diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebf0d3b..fd1199d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,17 +10,24 @@ on: permissions: contents: read +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + jobs: verify: name: Lint, TypeCheck & Tests runs-on: ubuntu-latest + timeout-minutes: 15 steps: - name: Checkout Repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false - name: Setup Deno 2.x - uses: denoland/setup-deno@v2 + uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2 with: deno-version: v2.x @@ -35,3 +42,29 @@ jobs: - name: Execute Unit & Integration Test Suite run: deno test --unstable-kv -A + + worker: + name: Cloudflare Worker (TypeCheck, Tests & Dry-Run) + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout Repository + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + + - name: Setup Node.js 22 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: "22" + cache: npm + + - name: Install Dependencies + run: npm ci + + - name: TypeCheck & Vitest + run: npm run check + + - name: Wrangler Dry-Run Bundle + run: npx wrangler deploy --dry-run diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a85b871..7fa78bc 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,23 +12,29 @@ permissions: contents: read security-events: write +concurrency: + group: codeql-${{ github.ref }} + cancel-in-progress: true + jobs: analyze: name: CodeQL AppSec Vulnerability Scan runs-on: ubuntu-latest - timeout-minutes: 360 + timeout-minutes: 60 steps: - name: Checkout Repository - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@aaf92c3279600a7c7217a1cd605774c6c791c6c3 # v3 with: languages: javascript-typescript queries: security-extended,security-and-quality - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@aaf92c3279600a7c7217a1cd605774c6c791c6c3 # v3 with: category: "/language:javascript-typescript" diff --git a/.gitignore b/.gitignore index 2320521..74d0935 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,10 @@ *.env.*.local # Fresh & Deno build artifacts +node_modules/ +.wrangler/ +.dev.vars +dist/ _fresh/ .deno/ deno.lock diff --git a/README.md b/README.md index 2c2b0b1..d8b8bf8 100644 --- a/README.md +++ b/README.md @@ -1,147 +1,152 @@ -# StatusZero 🦕⚡ +# StatusZero -> **The Zero-Config Status Page for Any GitHub Repository** An open-source, -> edge-native alternative to Vercel Status and Instatus. Built with **Deno -> Deploy**, **Deno KV**, **Fresh SSR**, and **Octokit**. +> **The Zero-Config Status Page for Any GitHub Repository** — An open-source, +> edge-native alternative to Vercel Status and Instatus. Powered by **Cloudflare +> Workers**, **Hono SSR**, **Cloudflare KV**, and **GitHub Actions**. -[![Status](https://img.shields.io/github/actions/workflow/status/glastor-dev/status/ci.yml?branch=master&label=CI%2FCD)](https://github.com/glastor-dev/status/actions) +[![Status](https://statuszero.pii-veilglastores.workers.dev/badge/glastor-dev/status.svg)](https://statuszero.pii-veilglastores.workers.dev/glastor-dev/status) +[![CI/CD](https://img.shields.io/github/actions/workflow/status/glastor-dev/status/ci.yml?branch=master&label=CI%2FCD)](https://github.com/glastor-dev/status/actions) [![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](LICENSE) -[![Built with Deno](https://img.shields.io/badge/Deno-2.x-black?logo=deno)](https://deno.land) -[![Fresh Framework](https://img.shields.io/badge/Fresh-1.7.3-yellow?logo=fresh)](https://fresh.deno.dev) +[![Cloudflare Workers](https://img.shields.io/badge/Cloudflare-Workers-F38020?logo=cloudflare&logoColor=white)](https://workers.cloudflare.com) +[![Hono](https://img.shields.io/badge/Hono-4.x-E36002?logo=hono&logoColor=white)](https://hono.dev) [![Repo](https://img.shields.io/badge/GitHub-glastor--dev%2Fstatus-181717?logo=github)](https://github.com/glastor-dev/status) --- -## ✨ Highlights +## Highlights - **Zero Configuration**: No signup, database setup, or third-party paid - accounts. Just type any GitHub repository (`owner/repo`) and get a live status - page instantly. -- **Dynamic Real-Time SVG Badges**: Crisp, vector status badges - (`/badge/:owner/:repo.svg`) that reflect real-time operational status - (Operational, Degraded, Major Outage) with automatic HTTP edge caching. -- **Global Deno KV Caching**: Cached snapshots in Deno KV eliminate GitHub API - rate-limiting while serving status metrics in sub-50ms across 35+ global edge - locations. -- **Deep GitHub Actions CI/CD Telemetry**: Automatically tracks recent workflow - runs, run durations, commit SHAs, authors, branches, and success rates. + accounts. Visit `/:owner/:repo` for any public GitHub repository and get a + live status page instantly. +- **Dynamic Real-Time SVG Badges**: Crisp vector status badges + (`/badge/:owner/:repo.svg?lang=en|es&label=...`) with XML escaping and edge + HTTP caching. +- **Cloudflare Edge & KV Caching**: Runs across 300+ global edge locations + (~35 KiB gzipped bundle, ~5 ms startup) with dynamic KV TTL, conditional + GitHub **ETag (`304 Not Modified`)** requests, and consolidated 90-day daily + history snapshots. +- **Deep GitHub Actions CI/CD Telemetry**: Tracks recent workflow runs, + durations, commit SHAs, authors, branches, and failure rates in parallel. - **Issue-Driven Incident Management**: Opening an issue labeled `incident`, - `outage`, `downtime`, or `bug` automatically flags system degradation with - real-time resolution timestamps. -- **90-Day Interactive Timeline**: Interactive daily uptime bars with hover - tooltips displaying daily uptime percentages and execution metrics. -- **Headless JSON REST API**: Query `/api/status/:owner/:repo` to power - Slack/Discord bots, widgets, or custom dashboards. -- **Automated CI Push Telemetry**: Optional 3-line step in your GitHub Actions - workflow pushes instant heartbeats via `POST /api/ping/:owner/:repo`. + `outage`, `downtime`, or `degradation` automatically updates system status and + the RSS 2.0 feed (`/rss/:owner/:repo.xml`). +- **Headless JSON REST API**: Query `/api/status/:owner/:repo` (with cooldown + protection on `?refresh=true`) to power bots, widgets, or dashboards. +- **Fail-Closed Push Telemetry & Webhooks**: Authenticated + `POST /api/ping/:owner/:repo` heartbeats (with latency & HTTP status integrated + into overall status) and HMAC-SHA256 verified `POST /api/webhook/github`. --- -## 🚀 Quick Start: Add to Your README +## Quick Start: Add to Your README -Simply paste this Markdown badge into your repository's `README.md`: +Paste this Markdown badge into your repository's `README.md`: ```markdown -[![Status](https://statuszero.deno.dev/badge/YOUR_OWNER/YOUR_REPO.svg)](https://statuszero.deno.dev/YOUR_OWNER/YOUR_REPO) +[![Status](https://statuszero.pii-veilglastores.workers.dev/badge/YOUR_OWNER/YOUR_REPO.svg)](https://statuszero.pii-veilglastores.workers.dev/YOUR_OWNER/YOUR_REPO) ``` -Whenever users or team members click the badge, they are directed to your -dedicated status page: `https://statuszero.deno.dev/YOUR_OWNER/YOUR_REPO` +Clicking the badge opens your dedicated status page: +`https://statuszero.pii-veilglastores.workers.dev/YOUR_OWNER/YOUR_REPO` --- -## ⚡ Optional: Push Instant Heartbeats via GitHub Actions +## Optional: Push Instant Heartbeats via GitHub Actions To record immediate status pings whenever your CI/CD pipeline finishes, add this -step to `.github/workflows/ci.yml`: +step to `.github/workflows/ci.yml` (configure `STATUSZERO_PING_SECRET` in your +repository secrets to match `PING_SECRET` in Cloudflare Workers): ```yaml -- name: 📡 Report Telemetry to StatusZero +- name: Report Telemetry to StatusZero if: always() + env: + STATUSZERO_PING_SECRET: ${{ secrets.STATUSZERO_PING_SECRET }} run: | - curl -s -X POST https://statuszero.deno.dev/api/ping/${{ github.repository }} \ + curl -fsS -X POST "https://statuszero.pii-veilglastores.workers.dev/api/ping/${{ github.repository }}" \ -H "Content-Type: application/json" \ + -H "Authorization: Bearer ${STATUSZERO_PING_SECRET}" \ -d '{"workflow":"${{ github.workflow }}","status":"${{ job.status }}","branch":"${{ github.ref_name }}","commit":"${{ github.sha }}"}' ``` --- -## 🛠 Tech Stack +## Tech Stack -- **Runtime**: [Deno 2.x](https://deno.com) -- **Framework**: [Fresh 1.7.3](https://fresh.deno.dev) (Islands architecture & - Server-Side Rendering) -- **Database & Cache**: [Deno KV](https://deno.com/kv) (Global ACID Key-Value - store on Deno Deploy) -- **API Client**: `@octokit/rest` (GitHub REST & Actions API) -- **Styling**: Modern Vanilla CSS Design System with dark mode, glassmorphism, - and responsive layouts -- **Deployment Target**: [Deno Deploy](https://deno.com/deploy) +- **Runtime & Hosting**: [Cloudflare Workers](https://workers.cloudflare.com) + + Workers Static Assets (`./public`) +- **Framework**: [Hono](https://hono.dev) (`hono/jsx` Server-Side Rendering) +- **Storage & Cache**: [Cloudflare KV](https://developers.cloudflare.com/kv/) + (`STATUS_KV` binding) +- **GitHub Integration**: Native Web `fetch` + conditional `If-None-Match` ETag + requests + Web Crypto API (`crypto.subtle`) +- **Testing**: [Vitest](https://vitest.dev) + TypeScript strict mode --- -## 💻 Local Development +## Local Development -### 1. Prerequisites - -Install Deno (version 2.0 or later): +### 1. Install dependencies ```bash -# Windows (PowerShell) -irm https://deno.land/install.ps1 | iex +npm install +``` + +### 2. Run the Worker locally -# macOS / Linux -curl -fsSL https://deno.land/install.sh | sh +```bash +npm run dev ``` -### 2. Run the Development Server +### 3. Type-check, test, and dry-run bundle ```bash -deno task start +npm run check +npx wrangler deploy --dry-run ``` -The server will start at `http://localhost:8000/`. +--- -### 3. Run Tests & Validation +## Deploy to Cloudflare Workers -```bash -# Run unit & integration test suite -deno test --unstable-kv -A +1. Authenticate with Cloudflare and create the KV namespace: -# Type-check and lint -deno task check +```bash +npx wrangler login +npx wrangler kv namespace create STATUS_KV ``` ---- +2. Put the generated KV namespace `id` into `wrangler.jsonc`. +3. Configure production secrets (fail-closed by default): -## 🌐 Deploy to Deno Deploy +```bash +npx wrangler secret put GITHUB_WEBHOOK_SECRET +npx wrangler secret put PING_SECRET +# Optional (recommended): fine-grained read-only token for 5,000 req/h +npx wrangler secret put GITHUB_TOKEN +``` -Deploy with 1-click or via GitHub integration on -[Deno Deploy Dashboard](https://dash.deno.com): +4. Deploy to the global edge: -1. Connect your repository. -2. Set entry point to `main.ts`. -3. _(Optional)_ Add `GITHUB_TOKEN` environment variable in project settings to - increase rate limit from 60 to 5,000 requests/hour. +```bash +npm run deploy +``` --- -## 📚 Documentación y Recursos +## Documentación y Recursos -- 👥 [CONTRIBUTORS.md](CONTRIBUTORS.md) — Gobernanza, equipo y guía de - patrocinio. -- 📜 [CHANGELOG.md](CHANGELOG.md) — Historial de versiones y notas de - lanzamiento. -- 🔖 [CITATION.cff](CITATION.cff) — Metadatos de citación académica y de - software. -- 🛡️ [SECURITY.md](.github/SECURITY.md) — Políticas de seguridad y reporte de +- [CONTRIBUTORS.md](CONTRIBUTORS.md) — Gobernanza, equipo y guía de patrocinio. +- [CHANGELOG.md](CHANGELOG.md) — Historial de versiones y notas de lanzamiento. +- [CITATION.cff](CITATION.cff) — Metadatos de citación académica y de software. +- [SECURITY.md](.github/SECURITY.md) — Políticas de seguridad y reporte de vulnerabilidades. -- 📄 [LICENSE](LICENSE) — Licencia de código abierto GNU Affero General Public +- [LICENSE](LICENSE) — Licencia de código abierto GNU Affero General Public License v3.0 (AGPL-3.0). --- -## 📄 Licencia +## Licencia Este proyecto está licenciado bajo los términos de la **GNU Affero General Public License v3.0 (AGPL-3.0)**. Consulta el archivo [LICENSE](LICENSE) para diff --git a/example.env b/example.env index db403d6..6c32ca8 100644 --- a/example.env +++ b/example.env @@ -19,6 +19,10 @@ # Si se define, solo las peticiones con 'Authorization: Bearer ' o 'x-statuszero-token' serán admitidas. # PING_SECRET=your_ping_secret_here -# GITHUB_WEBHOOK_SECRET (Opcional - AppSec) +# GITHUB_WEBHOOK_SECRET (Requerido en producción - fail-closed) # Clave secreta para verificar firmas HMAC-SHA256 (x-hub-signature-256) en /api/webhook/github. # GITHUB_WEBHOOK_SECRET=your_webhook_secret_here + +# Solo desarrollo local (NO activar en producción): +# ALLOW_UNAUTHENTICATED_PINGS=false +# ALLOW_UNAUTHENTICATED_WEBHOOKS=false diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..1b6fa00 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3257 @@ +{ + "name": "statuszero-worker", + "version": "2.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "statuszero-worker", + "version": "2.0.0", + "dependencies": { + "hono": "^4.7.0" + }, + "devDependencies": { + "@cloudflare/workers-types": "^4.20250214.0", + "typescript": "^5.7.3", + "vitest": "^3.0.5", + "wrangler": "^3.109.0" + } + }, + "node_modules/@cloudflare/kv-asset-handler": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.4.tgz", + "integrity": "sha512-YLPHc8yASwjNkmcDMQMY35yiWjoKAKnhUbPRszBRS0YgH+IXtsMp61j+yTcnCE3oO2DgP0U3iejLC8FTtKDC8Q==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "mime": "^3.0.0" + }, + "engines": { + "node": ">=16.13" + } + }, + "node_modules/@cloudflare/unenv-preset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.0.2.tgz", + "integrity": "sha512-nyzYnlZjjV5xT3LizahG1Iu6mnrCaxglJ04rZLpDwlDVDZ7v46lNsfxhV3A/xtfgQuSHmLnc6SVI+KwBpc3Lwg==", + "dev": true, + "license": "MIT OR Apache-2.0", + "peerDependencies": { + "unenv": "2.0.0-rc.14", + "workerd": "^1.20250124.0" + }, + "peerDependenciesMeta": { + "workerd": { + "optional": true + } + } + }, + "node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20250718.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250718.0.tgz", + "integrity": "sha512-FHf4t7zbVN8yyXgQ/r/GqLPaYZSGUVzeR7RnL28Mwj2djyw2ZergvytVc7fdGcczl6PQh+VKGfZCfUqpJlbi9g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20250718.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250718.0.tgz", + "integrity": "sha512-fUiyUJYyqqp4NqJ0YgGtp4WJh/II/YZsUnEb6vVy5Oeas8lUOxnN+ZOJ8N/6/5LQCVAtYCChRiIrBbfhTn5Z8Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20250718.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250718.0.tgz", + "integrity": "sha512-5+eb3rtJMiEwp08Kryqzzu8d1rUcK+gdE442auo5eniMpT170Dz0QxBrqkg2Z48SFUPYbj+6uknuA5tzdRSUSg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20250718.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250718.0.tgz", + "integrity": "sha512-Aa2M/DVBEBQDdATMbn217zCSFKE+ud/teS+fFS+OQqKABLn0azO2qq6ANAHYOIE6Q3Sq4CxDIQr8lGdaJHwUog==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20250718.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250718.0.tgz", + "integrity": "sha512-dY16RXKffmugnc67LTbyjdDHZn5NoTF1yHEf2fN4+OaOnoGSp3N1x77QubTDwqZ9zECWxgQfDLjddcH8dWeFhg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workers-types": { + "version": "4.20260702.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20260702.1.tgz", + "integrity": "sha512-mOhf5TUEB1m2vPrxtqoIGfz0fUC9xyxRDx5gWHy5s+OCo6dcV+g7wI1R7gYCMFohhqF/2y2xeKVwMwCJjfn/WA==", + "dev": true, + "license": "MIT OR Apache-2.0" + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild-plugins/node-globals-polyfill": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.2.3.tgz", + "integrity": "sha512-r3MIryXDeXDOZh7ih1l/yE9ZLORCd5e8vWg02azWRGj5SPTuoh69A2AIyn0Z31V/kHBfZ4HgWJ+OK3GTTwLmnw==", + "dev": true, + "license": "ISC", + "peerDependencies": { + "esbuild": "*" + } + }, + "node_modules/@esbuild-plugins/node-modules-polyfill": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.2.2.tgz", + "integrity": "sha512-LXV7QsWJxRuMYvKbiznh+U1ilIop3g2TeKRzUxOG5X3YITc8JyyTa90BmLwqqv0YnX4v32CSlG+vsziZp9dMvA==", + "dev": true, + "license": "ISC", + "dependencies": { + "escape-string-regexp": "^4.0.0", + "rollup-plugin-node-polyfills": "^0.2.1" + }, + "peerDependencies": { + "esbuild": "*" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz", + "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.68.8.tgz", + "integrity": "sha512-7l9FdeCGjhmMTVePgndK4t9u5tLR+VuTTMoyc0PscqZDdYjS07ZsQ0vQYsWsODu/ZZYPG7WVJwbUZ77n1hVT+w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.68.8.tgz", + "integrity": "sha512-kXkkIiJujBjArHwEToz99BQqIqibn4xdV6SjsoaxuZzvLUCVEzoHQ1Lp62m7xOhpLRpWpCtxL2ZUy/ADKuz9/g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-x64": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-x64/-/rollup-android-x64-4.68.8.tgz", + "integrity": "sha512-KYoBygnHs3zUOLR0z7SaqhMnUrSF9pbuTOJT/uHK3PrgCXdv/xaMubZD8jCpg6NTo46deasLgZRq38xFTyu8uw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.68.8.tgz", + "integrity": "sha512-YmBUNjgm5bsjOByO+H1TFbuGZe+ZnHcYtPXYj9+L1cwTu/BG8zjuUzO2PH9KwS85P0UH+WJDSb+mQ2hqjp5uBQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.68.8.tgz", + "integrity": "sha512-XMX5ybuOmkwiM13KJtsBxakZ69pyaR9thRYU2fMejhaB0VuzLMIkIc+9TBsu2rv34eEf6XaSMOaLOyEgHGWHTQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.68.8.tgz", + "integrity": "sha512-WuBXScWJDaqPJKwVrotUe1sM9DHWMN937C23RClt0MVHVt7A1rBy285ZfZTLccPEVMxmGJMt2jvdHMOI33lrKA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.68.8.tgz", + "integrity": "sha512-kegwGqP3rMenEMaKo8OzMBb5WvLW2h2jrQ3iKuYptTTF8C/yuxz+hinjBPrtYuIPLJDwxHc/hv2e4u5pmrqo9A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.68.8.tgz", + "integrity": "sha512-Qct0oLM1zGNbvqs1udQnuchg+Q9uHbkMcQqCfs3M7foNn7HvEkUypfFn9o5fklimUI5OF3A2nMknd4/vrEyeVg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.68.8.tgz", + "integrity": "sha512-xTH5vD+lW/5MU3kL/Op8RSSG/O9fxUQZuJcSBmmBeYem9uXYvCq6PDHx/oDSNeyLD/p4pGujG2PVI0R8MjAhSw==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.68.8.tgz", + "integrity": "sha512-lPPStmynSHvwWpSrAsuemPFB+EWFObXjwz44EK4Hph47U6SBAk1Kehq5MkI7i8EYVjrXddaAV7YkJH8mX8QSZQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.68.8.tgz", + "integrity": "sha512-kZkvIYAihM6l6M+giSUHayDDf/JL+TYR5bYWiAX7/jUFWvMkMmysA4GV2F0HOsXQNEyctW3x1xLjww1GqW7Q1w==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.68.8.tgz", + "integrity": "sha512-XZKLEIY977OJr6zUtK6nlQcLXme34c8HqVp3+WmKQxKVN6Nj+b9qE3ZHWIDHXznHJsGl2AsaMOgB0GL0fkZGUg==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.68.8.tgz", + "integrity": "sha512-+sN+Fj6F9suk8SkL6boIfXDmj9iJwSKPCTeCy8/pfTOHuzNX+duhTb9uyj6154oVK8Odl5zgL4DXRZzXjsRKcw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.68.8.tgz", + "integrity": "sha512-EBCu3uDFaGwSodUl+XR8yubvVFUkSo6QK9YAIOV1vljqntzTF2/mXLM6utgLaSGf/8oM+qEe8Ai0Jd4+tyMoIQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.68.8.tgz", + "integrity": "sha512-hRC0jWdsLBckCijx2wiUfk7zW1SqEW47yMsCNoDGmQfoqq0AjW+9UYZqxg3LTmG76PyHNdNGBSuspB3CqrhGIA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.68.8.tgz", + "integrity": "sha512-OZKrTRWyGnLITUTipbeXDdtb2dxQPyFk/Fbw9qER8pIvd2Ja9hHELkY0Fv5p9yYYkimqtzVhApKKXGv0cWGQGw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.68.8.tgz", + "integrity": "sha512-HmhSRSQ+dOeOntPfmYux4rCpOQLtsGbcGLQu4nm8ig3tuVqe/bKfDHorg36LKAqYq4X/nwFr79ImtaFHHsn4ug==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.68.8.tgz", + "integrity": "sha512-wk1Ci1hsMREaBELoKPSnzRAh1oUULI+8kfb2F5vVmTD2IcfR9AKMskCusizZhIAvojOtPZihPj4OdKy6ifZwhQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.68.8.tgz", + "integrity": "sha512-mDufoUJ6fnKZnCyjV3sGEDvXQQkM6j1UmINHheGX4Emau3TZWJzX3sCVmbzkNB+W2G84BiFQdDCcF09lv0i0VA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.68.8.tgz", + "integrity": "sha512-7EGVL9rYRYQZe3UC8JQzfBN9rxk484Rfs4u/yGWumTYKUdJt6tmdP+0Y3qHvAvzJCQ+JQM5rSqZbVyrJARlGpA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.68.8.tgz", + "integrity": "sha512-Umklz+QSGwKWQVlVrsMJrwFx1oNRYHgrxSGiZM8pJCMpzWnMDMinDhPILf0BvRXfA1QOArsDcs+AE7Jd6dQxvA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.68.8.tgz", + "integrity": "sha512-BlRp6uzQDK5rczAdaXQ8dlSIRFRlkDRBqpb8GGtv8iwZxQdOjoigdFU5t5dcxpnpU0caMoT9mH27MyAl4dWwKw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.68.8.tgz", + "integrity": "sha512-Sc8Mkf/fVfcV0hBJNDRIM82BjS4kJn2Of0jP8dgQ+TodquxtCZ/5D6FgSsY3uN5IBmNi8Zrb/OHd60IEYKaw+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.68.8.tgz", + "integrity": "sha512-XPTFXclN+I+Cfu3ONWDsw+uvgSZjTJa1B2u2EvtdKlSdgNU6mrOZdgeaMkvN+2T2KPTEXn6fnRY8IODlRg3/Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.68.8.tgz", + "integrity": "sha512-63dWiHgvpWcienfdr465lT3SIn4u3535vbDfaLKhSn0F2KJ06bbcUsewDGJZUPZCbJ67qESrPDhb85UnWdb5ew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.68.8.tgz", + "integrity": "sha512-/W1LBsMeQAdiCuH3Z2gkRspl3mlxL+butknhq4vXjmxO45vuT08BqhehxDoE4YS+m6s9lhpq6M9/PjTEAg8PYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "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.10", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitest/expect": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz", + "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz", + "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.7", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz", + "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz", + "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.7", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz", + "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.7", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz", + "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz", + "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.7", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/as-table": { + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz", + "integrity": "sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "printable-characters": "^1.0.42" + } + }, + "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/blake3-wasm": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", + "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", + "dev": true, + "license": "MIT" + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "optional": 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==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.2.tgz", + "integrity": "sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==", + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/defu": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", + "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==", + "dev": true, + "license": "MIT" + }, + "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", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "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==", + "dev": true, + "license": "MIT", + "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/exit-hook": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.1.tgz", + "integrity": "sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/exsolve": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.2.0.tgz", + "integrity": "sha512-h1pQPR9XoeSMdntRNCjyTznaume4UpfXrULBnlkZ2CUM/G5eSa+pBByGldO5uR8dxbPC+OuJXsPPNf+JZ81ADg==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "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/get-source": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/get-source/-/get-source-2.0.12.tgz", + "integrity": "sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==", + "dev": true, + "license": "Unlicense", + "dependencies": { + "data-uri-to-buffer": "^2.0.0", + "source-map": "^0.6.1" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/hono": { + "version": "4.13.19", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.19.tgz", + "integrity": "sha512-KmXvQAXwcAHV+muzbIwoJ23niEB5nMoDVr9WcRkU8mvjUECm/1+7v4Jgp7P7a+H6MLFrh+vXrGonGrGS+RQfkA==", + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", + "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "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/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/miniflare": { + "version": "3.20250718.3", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20250718.3.tgz", + "integrity": "sha512-JuPrDJhwLrNLEJiNLWO7ZzJrv/Vv9kZuwMYCfv0LskQDM6Eonw4OvywO3CH/wCGjgHzha/qyjUh8JQ068TjDgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "acorn": "8.14.0", + "acorn-walk": "8.3.2", + "exit-hook": "2.2.1", + "glob-to-regexp": "0.4.1", + "stoppable": "1.1.0", + "undici": "^5.28.5", + "workerd": "1.20250718.0", + "ws": "8.18.0", + "youch": "3.3.4", + "zod": "3.22.3" + }, + "bin": { + "miniflare": "bootstrap.js" + }, + "engines": { + "node": ">=16.13" + } + }, + "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==", + "dev": true, + "license": "MIT" + }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "dev": true, + "license": "MIT", + "bin": { + "mustache": "bin/mustache" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "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/ohash": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.12.tgz", + "integrity": "sha512-65S/5gk9YSsaRjcyf7Nfa6h/d3E8/1gslpXfI4W7Dxn/oap8IKRuNT5VXkLQ1YFKIEg4apRY4Pj6aiwFzrDdmw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", + "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.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/printable-characters": { + "version": "1.0.42", + "resolved": "https://registry.npmjs.org/printable-characters/-/printable-characters-1.0.42.tgz", + "integrity": "sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==", + "dev": true, + "license": "Unlicense" + }, + "node_modules/rollup": { + "version": "4.68.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.68.8.tgz", + "integrity": "sha512-IHx4DeeTGhoAPke6p1Wlg0JEQFyQoZQQjEe1iD+nhEERk7eoeHK9zyOpVJiGc54Z1MCgI96rN1tD7Ttub8XyPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.10" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.68.8", + "@rollup/rollup-android-arm64": "4.68.8", + "@rollup/rollup-android-x64": "4.68.8", + "@rollup/rollup-darwin-arm64": "4.68.8", + "@rollup/rollup-darwin-x64": "4.68.8", + "@rollup/rollup-freebsd-arm64": "4.68.8", + "@rollup/rollup-freebsd-x64": "4.68.8", + "@rollup/rollup-linux-arm-gnueabihf": "4.68.8", + "@rollup/rollup-linux-arm-musleabihf": "4.68.8", + "@rollup/rollup-linux-arm64-gnu": "4.68.8", + "@rollup/rollup-linux-arm64-musl": "4.68.8", + "@rollup/rollup-linux-loong64-gnu": "4.68.8", + "@rollup/rollup-linux-loong64-musl": "4.68.8", + "@rollup/rollup-linux-ppc64-gnu": "4.68.8", + "@rollup/rollup-linux-ppc64-musl": "4.68.8", + "@rollup/rollup-linux-riscv64-gnu": "4.68.8", + "@rollup/rollup-linux-riscv64-musl": "4.68.8", + "@rollup/rollup-linux-s390x-gnu": "4.68.8", + "@rollup/rollup-linux-x64-gnu": "4.68.8", + "@rollup/rollup-linux-x64-musl": "4.68.8", + "@rollup/rollup-openbsd-x64": "4.68.8", + "@rollup/rollup-openharmony-arm64": "4.68.8", + "@rollup/rollup-win32-arm64-msvc": "4.68.8", + "@rollup/rollup-win32-ia32-msvc": "4.68.8", + "@rollup/rollup-win32-x64-gnu": "4.68.8", + "@rollup/rollup-win32-x64-msvc": "4.68.8", + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-inject": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz", + "integrity": "sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==", + "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^0.6.1", + "magic-string": "^0.25.3", + "rollup-pluginutils": "^2.8.1" + } + }, + "node_modules/rollup-plugin-inject/node_modules/estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/rollup-plugin-inject/node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, + "node_modules/rollup-plugin-node-polyfills": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz", + "integrity": "sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==", + "dev": true, + "license": "MIT", + "dependencies": { + "rollup-plugin-inject": "^3.0.0" + } + }, + "node_modules/rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^0.6.1" + } + }, + "node_modules/rollup-pluginutils/node_modules/estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" + } + }, + "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/simple-swizzle": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", + "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz", + "integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "deprecated": "Please use @jridgewell/sourcemap-codec instead", + "dev": true, + "license": "MIT" + }, + "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/stacktracey": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/stacktracey/-/stacktracey-2.2.0.tgz", + "integrity": "sha512-ETyQEz+CzXiLjEbyJqpbp+/T79RQD/6wqFucRBIlVNZfYq2Ay7wbretD4cxpbymZlaPWx58aIhPEY1Cr8DlVvg==", + "dev": true, + "license": "Unlicense", + "dependencies": { + "as-table": "^1.0.36", + "get-source": "^2.0.12" + } + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/stoppable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", + "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4", + "npm": ">=6" + } + }, + "node_modules/strip-literal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", + "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "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": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "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/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz", + "integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ufo": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", + "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/unenv": { + "version": "2.0.0-rc.14", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.14.tgz", + "integrity": "sha512-od496pShMen7nOy5VmVJCnq8rptd45vh6Nx/r2iPbrba6pa6p+tS2ywuIHRZ/OBvSbQZB0kWvpO9XBNVFXHD3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "defu": "^6.1.4", + "exsolve": "^1.0.1", + "ohash": "^2.0.10", + "pathe": "^2.0.3", + "ufo": "^1.5.4" + } + }, + "node_modules/vite": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.8.tgz", + "integrity": "sha512-3tTi78MAKhVk9h+YZVXMQ8POmneJuE97QUPAWtJghHzhH7BAyiqQOC2KZh1DWOsu/USB2cRXhznPByaabvYXfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0 || ^0.28.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "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", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.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 + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "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/vite-node": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz", + "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.7", + "@vitest/mocker": "3.2.7", + "@vitest/pretty-format": "^3.2.7", + "@vitest/runner": "3.2.7", + "@vitest/snapshot": "3.2.7", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.7", + "@vitest/ui": "3.2.7", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "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/workerd": { + "version": "1.20250718.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250718.0.tgz", + "integrity": "sha512-kqkIJP/eOfDlUyBzU7joBg+tl8aB25gEAGqDap+nFWb+WHhnooxjGHgxPBy3ipw2hnShPFNOQt5lFRxbwALirg==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20250718.0", + "@cloudflare/workerd-darwin-arm64": "1.20250718.0", + "@cloudflare/workerd-linux-64": "1.20250718.0", + "@cloudflare/workerd-linux-arm64": "1.20250718.0", + "@cloudflare/workerd-windows-64": "1.20250718.0" + } + }, + "node_modules/wrangler": { + "version": "3.114.17", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.114.17.tgz", + "integrity": "sha512-tAvf7ly+tB+zwwrmjsCyJ2pJnnc7SZhbnNwXbH+OIdVas3zTSmjcZOjmLKcGGptssAA3RyTKhcF9BvKZzMUycA==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/kv-asset-handler": "0.3.4", + "@cloudflare/unenv-preset": "2.0.2", + "@esbuild-plugins/node-globals-polyfill": "0.2.3", + "@esbuild-plugins/node-modules-polyfill": "0.2.2", + "blake3-wasm": "2.1.5", + "esbuild": "0.17.19", + "miniflare": "3.20250718.3", + "path-to-regexp": "6.3.0", + "unenv": "2.0.0-rc.14", + "workerd": "1.20250718.0" + }, + "bin": { + "wrangler": "bin/wrangler.js", + "wrangler2": "bin/wrangler.js" + }, + "engines": { + "node": ">=16.17.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2", + "sharp": "^0.33.5" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^4.20250408.0" + }, + "peerDependenciesMeta": { + "@cloudflare/workers-types": { + "optional": true + } + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/wrangler/node_modules/esbuild": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", + "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" + } + }, + "node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/youch": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/youch/-/youch-3.3.4.tgz", + "integrity": "sha512-UeVBXie8cA35DS6+nBkls68xaBBXCye0CNznrhszZjTbRVnJKQuNsyLKBTTL4ln1o1rh2PKtv35twV7irj5SEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cookie": "^0.7.1", + "mustache": "^4.2.0", + "stacktracey": "^2.1.8" + } + }, + "node_modules/zod": { + "version": "3.22.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.3.tgz", + "integrity": "sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e3785e1 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "statuszero-worker", + "version": "2.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "wrangler dev", + "deploy": "wrangler deploy", + "typecheck": "tsc --noEmit", + "test": "vitest run", + "check": "npm run typecheck && npm run test", + "cf-typegen": "wrangler types" + }, + "dependencies": { + "hono": "^4.7.0" + }, + "devDependencies": { + "@cloudflare/workers-types": "^4.20250214.0", + "typescript": "^5.7.3", + "vitest": "^3.0.5", + "wrangler": "^3.109.0" + } +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..1cfaaa2 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..2651903 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/public/styles.css b/public/styles.css new file mode 100644 index 0000000..91ae25c --- /dev/null +++ b/public/styles.css @@ -0,0 +1,940 @@ +/* static/styles.css - StatusZero Design System */ + +:root { + --font-display: 'Outfit', sans-serif; + --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + --font-mono: 'JetBrains Mono', 'Fira Code', monospace; + + /* Color Palette */ + --bg-dark: #07090e; + --bg-primary: #0a0d14; + --bg-surface: #101522; + --bg-surface-elevated: #161d2f; + --bg-surface-hover: #1e273e; + --bg-glass: rgba(16, 21, 34, 0.72); + + --border-subtle: rgba(255, 255, 255, 0.08); + --border-medium: rgba(255, 255, 255, 0.14); + --border-bright: rgba(255, 255, 255, 0.28); + + --text-primary: #f8fafc; + --text-secondary: #94a3b8; + --text-muted: #64748b; + --text-dim: #475569; + + /* Status Colors */ + --status-operational: #10b981; + --status-operational-glow: rgba(16, 185, 129, 0.35); + --status-operational-bg: rgba(16, 185, 129, 0.12); + --status-operational-border: rgba(16, 185, 129, 0.3); + + --status-degraded: #f59e0b; + --status-degraded-glow: rgba(245, 158, 11, 0.35); + --status-degraded-bg: rgba(245, 158, 11, 0.12); + --status-degraded-border: rgba(245, 158, 11, 0.3); + + --status-outage: #ef4444; + --status-outage-glow: rgba(239, 68, 68, 0.35); + --status-outage-bg: rgba(239, 68, 68, 0.12); + --status-outage-border: rgba(239, 68, 68, 0.3); + + /* Brand Accents */ + --brand-cyan: #06b6d4; + --brand-emerald: #10b981; + --brand-indigo: #6366f1; + --brand-purple: #8b5cf6; + --brand-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #6366f1 100%); + --brand-glow: 0 0 32px rgba(16, 185, 129, 0.2); + + --radius-sm: 6px; + --radius-md: 10px; + --radius-lg: 16px; + --radius-xl: 24px; + --radius-full: 9999px; + + --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25); + --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35); + --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5); + --shadow-glow: 0 0 40px rgba(6, 182, 212, 0.15); +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html, +body { + background-color: var(--bg-dark); + color: var(--text-primary); + font-family: var(--font-body); + line-height: 1.5; + -webkit-font-smoothing: antialiased; + min-height: 100vh; +} + +body { + background-image: + radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.12), + transparent 70%), + radial-gradient(ellipse 60% 40% at 80% 80%, rgba(99, 102, 241, 0.08), + transparent 70%); + background-attachment: fixed; +} + +/* Links */ +a { + color: inherit; + text-decoration: none; +} + +/* App Wrapper */ +.site-wrapper { + display: flex; + flex-direction: column; + min-height: 100vh; +} + +.container { + width: 100%; + max-width: 1180px; + margin: 0 auto; + padding: 0 24px; +} + +/* Header & Navigation */ +.navbar { + position: sticky; + top: 0; + z-index: 100; + backdrop-filter: blur(16px); + -webkit-backdrop-filter: blur(16px); + background: var(--bg-glass); + border-bottom: 1px solid var(--border-subtle); + transition: border-color 0.2s ease; +} + +.navbar-inner { + display: flex; + align-items: center; + justify-content: space-between; + height: 68px; +} + +.logo-link { + display: flex; + align-items: center; + gap: 12px; + font-family: var(--font-display); + font-size: 1.25rem; + font-weight: 700; + letter-spacing: -0.02em; +} + +.logo-badge { + font-size: 0.68rem; + font-weight: 600; + text-transform: uppercase; + padding: 2px 7px; + border-radius: var(--radius-full); + background: rgba(16, 185, 129, 0.15); + color: var(--status-operational); + border: 1px solid var(--status-operational-border); + letter-spacing: 0.05em; +} + +.nav-links { + display: flex; + align-items: center; + gap: 20px; +} + +.nav-link { + color: var(--text-secondary); + font-size: 0.92rem; + font-weight: 500; + transition: color 0.15s ease; +} + +.nav-link:hover { + color: var(--text-primary); +} + +/* Buttons */ +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 9px 18px; + font-family: var(--font-body); + font-size: 0.9rem; + font-weight: 600; + border-radius: var(--radius-md); + border: 1px solid transparent; + cursor: pointer; + transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); + text-decoration: none; +} + +.btn-primary { + background: var(--brand-gradient); + color: #ffffff; + box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25); +} + +.btn-primary:hover { + transform: translateY(-1px); + box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); +} + +.btn-secondary { + background: var(--bg-surface-elevated); + color: var(--text-primary); + border-color: var(--border-subtle); +} + +.btn-secondary:hover { + background: var(--bg-surface-hover); + border-color: var(--border-medium); + transform: translateY(-1px); +} + +.btn-ghost { + background: transparent; + color: var(--text-secondary); + border-color: transparent; +} + +.btn-ghost:hover { + color: var(--text-primary); + background: var(--bg-surface); +} + +.btn-sm { + padding: 6px 12px; + font-size: 0.82rem; +} + +/* Hero Section */ +.hero { + padding: 80px 0 50px; + text-align: center; + position: relative; +} + +.hero-pill { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 5px 14px; + border-radius: var(--radius-full); + background: rgba(255, 255, 255, 0.04); + border: 1px solid var(--border-subtle); + font-size: 0.82rem; + color: var(--text-secondary); + margin-bottom: 24px; + backdrop-filter: blur(8px); +} + +.hero-pill-badge { + background: var(--status-operational); + color: #000; + font-size: 0.7rem; + font-weight: 700; + padding: 2px 6px; + border-radius: var(--radius-full); +} + +.hero-title { + font-family: var(--font-display); + font-size: clamp(2.5rem, 6vw, 4.25rem); + font-weight: 800; + line-height: 1.1; + letter-spacing: -0.035em; + margin-bottom: 20px; +} + +.gradient-text { + background: var(--brand-gradient); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} + +.hero-desc { + max-width: 660px; + margin: 0 auto 36px; + font-size: 1.15rem; + color: var(--text-secondary); + line-height: 1.6; +} + +/* Search Playground Island Card */ +.playground-card { + background: var(--bg-surface); + border: 1px solid var(--border-medium); + border-radius: var(--radius-xl); + padding: 32px; + max-width: 760px; + margin: 0 auto; + box-shadow: var(--shadow-lg), var(--shadow-glow); + position: relative; + backdrop-filter: blur(12px); +} + +.search-box { + display: flex; + gap: 12px; + position: relative; +} + +.search-input-wrapper { + position: relative; + flex: 1; +} + +.search-icon { + position: absolute; + left: 16px; + top: 50%; + transform: translateY(-50%); + color: var(--text-muted); +} + +.search-input { + width: 100%; + padding: 14px 16px 14px 44px; + background: var(--bg-surface-elevated); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-md); + color: var(--text-primary); + font-family: var(--font-body); + font-size: 1rem; + outline: none; + transition: all 0.2s ease; +} + +.search-input:focus { + border-color: var(--brand-cyan); + box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15); +} + +.search-input::placeholder { + color: var(--text-dim); +} + +.quick-chips { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8px; + margin-top: 16px; + font-size: 0.85rem; + color: var(--text-muted); +} + +.chip-btn { + background: var(--bg-surface-elevated); + color: var(--text-secondary); + border: 1px solid var(--border-subtle); + padding: 4px 10px; + border-radius: var(--radius-full); + font-size: 0.8rem; + font-family: var(--font-mono); + cursor: pointer; + transition: all 0.15s ease; +} + +.chip-btn:hover { + background: var(--bg-surface-hover); + color: var(--text-primary); + border-color: var(--border-bright); +} + +/* Badge Preview & Code Output */ +.preview-panel { + margin-top: 28px; + padding-top: 24px; + border-top: 1px solid var(--border-subtle); +} + +.preview-badge-row { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; + padding: 14px 18px; + background: var(--bg-surface-elevated); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-md); +} + +.code-tabs { + display: flex; + gap: 8px; + margin-bottom: 12px; +} + +.code-tab { + padding: 5px 12px; + border-radius: var(--radius-sm); + background: transparent; + color: var(--text-secondary); + font-size: 0.82rem; + font-weight: 500; + border: 1px solid transparent; + cursor: pointer; + transition: all 0.15s ease; +} + +.code-tab.active { + background: var(--bg-surface-elevated); + color: var(--text-primary); + border-color: var(--border-subtle); +} + +.code-block { + display: flex; + align-items: center; + justify-content: space-between; + background: #080b11; + border: 1px solid var(--border-subtle); + border-radius: var(--radius-md); + padding: 12px 16px; + font-family: var(--font-mono); + font-size: 0.82rem; + color: #38bdf8; + overflow-x: auto; +} + +.code-block pre { + margin: 0; + white-space: pre-wrap; + word-break: break-all; +} + +/* Status Page Layout */ +.status-header { + margin: 40px 0 24px; +} + +.repo-identity { + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: wrap; + gap: 16px; + margin-bottom: 24px; +} + +.repo-titles { + display: flex; + align-items: center; + gap: 14px; +} + +.repo-avatar { + width: 44px; + height: 44px; + border-radius: 10px; + border: 1px solid var(--border-subtle); +} + +.repo-name { + font-family: var(--font-display); + font-size: 1.75rem; + font-weight: 700; + color: var(--text-primary); +} + +.repo-desc { + color: var(--text-secondary); + font-size: 0.95rem; + margin-top: 4px; + max-width: 650px; +} + +/* Status Hero Banner */ +.status-banner { + display: flex; + align-items: center; + justify-content: space-between; + padding: 24px 32px; + border-radius: var(--radius-lg); + margin-bottom: 32px; + border: 1px solid; + transition: all 0.2s ease; + position: relative; + overflow: hidden; +} + +.status-banner.operational { + background: linear-gradient(90deg, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, + 129, 0.04) 100%); + border-color: var(--status-operational-border); + box-shadow: 0 4px 24px rgba(16, 185, 129, 0.12); +} + +.status-banner.degraded { + background: linear-gradient(90deg, rgba(245, 158, 11, 0.14) 0%, rgba(245, 158, + 11, 0.04) 100%); + border-color: var(--status-degraded-border); + box-shadow: 0 4px 24px rgba(245, 158, 11, 0.12); +} + +.status-banner.outage { + background: linear-gradient(90deg, rgba(239, 68, 68, 0.14) 0%, rgba(239, 68, + 68, 0.04) 100%); + border-color: var(--status-outage-border); + box-shadow: 0 4px 24px rgba(239, 68, 68, 0.12); +} + +.status-indicator { + display: flex; + align-items: center; + gap: 16px; +} + +.status-dot-pulse { + width: 18px; + height: 18px; + border-radius: var(--radius-full); + position: relative; +} + +.status-dot-pulse::after { + content: ''; + position: absolute; + inset: -4px; + border-radius: var(--radius-full); + animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite; +} + +.operational .status-dot-pulse { + background: var(--status-operational); +} +.operational .status-dot-pulse::after { + background: var(--status-operational-glow); +} + +.degraded .status-dot-pulse { + background: var(--status-degraded); +} +.degraded .status-dot-pulse::after { + background: var(--status-degraded-glow); +} + +.outage .status-dot-pulse { + background: var(--status-outage); +} +.outage .status-dot-pulse::after { + background: var(--status-outage-glow); +} + +@keyframes pulse-ring { + 0% { + transform: scale(0.95); + opacity: 0.8; + } + 50% { + transform: scale(1.6); + opacity: 0; + } + 100% { + transform: scale(0.95); + opacity: 0; + } +} + +.status-title { + font-family: var(--font-display); + font-size: 1.5rem; + font-weight: 700; + letter-spacing: -0.01em; +} + +.status-subtitle { + font-size: 0.88rem; + color: var(--text-secondary); + margin-top: 2px; +} + +/* Key Metrics Cards Grid */ +.metrics-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + gap: 16px; + margin-bottom: 32px; +} + +.metric-card { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 20px 24px; + display: flex; + flex-direction: column; + transition: all 0.2s ease; +} + +.metric-card:hover { + border-color: var(--border-medium); + transform: translateY(-2px); +} + +.metric-label { + font-size: 0.82rem; + font-weight: 500; + color: var(--text-muted); + text-transform: uppercase; + letter-spacing: 0.05em; + margin-bottom: 8px; +} + +.metric-value { + font-family: var(--font-display); + font-size: 1.85rem; + font-weight: 700; + color: var(--text-primary); + line-height: 1.2; +} + +.metric-sub { + font-size: 0.82rem; + color: var(--text-secondary); + margin-top: 6px; +} + +/* 90-Day Uptime Bars */ +.section-card { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 28px; + margin-bottom: 28px; +} + +.section-title-row { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 18px; +} + +.section-title { + font-family: var(--font-display); + font-size: 1.2rem; + font-weight: 700; +} + +.uptime-bars-wrapper { + margin-top: 12px; +} + +.uptime-bars { + display: flex; + gap: 3px; + height: 38px; + align-items: flex-end; + padding: 4px 0; +} + +.uptime-bar-col { + flex: 1; + height: 100%; + border-radius: 3px; + cursor: pointer; + transition: all 0.15s ease; + position: relative; +} + +.uptime-bar-col:hover { + transform: scaleY(1.15); + opacity: 1 !important; +} + +.bar-operational { + background-color: var(--status-operational); +} +.bar-degraded { + background-color: var(--status-degraded); +} +.bar-outage { + background-color: var(--status-outage); +} +.bar-none { + background-color: rgba(255, 255, 255, 0.08); +} + +.uptime-timeline-labels { + display: flex; + justify-content: space-between; + color: var(--text-muted); + font-size: 0.78rem; + margin-top: 8px; +} + +/* Workflow Runs Table / List */ +.runs-list { + display: flex; + flex-direction: column; + gap: 10px; +} + +.run-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 14px 18px; + background: var(--bg-surface-elevated); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-md); + transition: all 0.15s ease; +} + +.run-item:hover { + border-color: var(--border-medium); + background: var(--bg-surface-hover); +} + +.run-meta { + display: flex; + align-items: center; + gap: 14px; +} + +.run-status-icon { + width: 24px; + height: 24px; + display: flex; + align-items: center; + justify-content: center; + border-radius: var(--radius-full); +} + +.run-success { + color: var(--status-operational); + background: var(--status-operational-bg); +} + +.run-failure { + color: var(--status-outage); + background: var(--status-outage-bg); +} + +.run-details { + display: flex; + flex-direction: column; + gap: 3px; +} + +.run-name { + font-size: 0.94rem; + font-weight: 600; + color: var(--text-primary); +} + +.run-commit { + font-size: 0.82rem; + color: var(--text-secondary); + display: flex; + align-items: center; + gap: 8px; +} + +.commit-badge { + font-family: var(--font-mono); + font-size: 0.75rem; + background: rgba(255, 255, 255, 0.06); + padding: 1px 6px; + border-radius: var(--radius-sm); + color: #38bdf8; +} + +.run-time { + font-size: 0.82rem; + color: var(--text-muted); + text-align: right; +} + +/* Incidents Section */ +.incident-item { + padding: 16px; + border-radius: var(--radius-md); + background: var(--bg-surface-elevated); + border: 1px solid var(--border-subtle); + margin-bottom: 12px; +} + +.incident-title-row { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 8px; +} + +.incident-badge-pill { + font-size: 0.72rem; + font-weight: 600; + text-transform: uppercase; + padding: 2px 8px; + border-radius: var(--radius-full); +} + +/* Features Section on Landing */ +.features-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); + gap: 24px; + margin: 60px 0; +} + +.feature-box { + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 28px; + transition: all 0.2s ease; +} + +.feature-box:hover { + border-color: var(--border-medium); + transform: translateY(-2px); +} + +.feature-icon-wrapper { + width: 44px; + height: 44px; + border-radius: var(--radius-md); + background: var(--bg-surface-elevated); + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 18px; + border: 1px solid var(--border-subtle); +} + +.feature-title { + font-family: var(--font-display); + font-size: 1.25rem; + font-weight: 700; + margin-bottom: 10px; +} + +.feature-desc { + color: var(--text-secondary); + font-size: 0.92rem; + line-height: 1.6; +} + +/* Footer */ +.footer { + margin-top: auto; + border-top: 1px solid var(--border-subtle); + padding: 40px 0; + background: var(--bg-primary); + color: var(--text-muted); + font-size: 0.88rem; +} + +.footer-inner { + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: wrap; + gap: 20px; +} + +.footer-tech { + display: flex; + align-items: center; + gap: 16px; +} + +.footer-badge { + display: inline-flex; + align-items: center; + gap: 6px; + font-family: var(--font-mono); + font-size: 0.75rem; + background: var(--bg-surface-elevated); + padding: 4px 10px; + border-radius: var(--radius-full); + border: 1px solid var(--border-subtle); + color: var(--text-secondary); +} + +/* Responsive adjustments */ +@media (max-width: 768px) { + .hero-title { + font-size: 2.25rem; + } + .playground-card { + padding: 20px; + } + .search-box { + flex-direction: column; + } + .status-banner { + flex-direction: column; + align-items: flex-start; + gap: 16px; + } + .repo-identity { + flex-direction: column; + align-items: flex-start; + } +} + +/* Embed Widget Styles (?view=embed) */ +.embed-card { + background: var(--bg-surface); + border: 1px solid var(--border-medium); + border-radius: var(--radius-lg); + padding: 20px; + box-shadow: var(--shadow-md); + max-width: 680px; + margin: 0 auto; +} + +.embed-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 16px; + gap: 12px; +} + +.embed-title { + display: flex; + align-items: center; + gap: 8px; + font-family: var(--font-display); + font-size: 1.15rem; + font-weight: 700; +} + +.embed-footer { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 14px; + padding-top: 12px; + border-top: 1px solid var(--border-subtle); + font-size: 0.75rem; + color: var(--text-muted); +} + +.latency-badge { + display: inline-flex; + align-items: center; + gap: 4px; + font-family: var(--font-mono); + font-size: 0.78rem; + padding: 2px 8px; + border-radius: var(--radius-full); + background: rgba(16, 185, 129, 0.15); + color: var(--status-operational); + border: 1px solid var(--status-operational-border); +} diff --git a/routes/_middleware.ts b/routes/_middleware.ts index 9c1f2a8..c36525c 100644 --- a/routes/_middleware.ts +++ b/routes/_middleware.ts @@ -13,6 +13,10 @@ export async function handler( // Baseline Security Headers resp.headers.set("X-Content-Type-Options", "nosniff"); resp.headers.set("Referrer-Policy", "strict-origin-when-cross-origin"); + resp.headers.set( + "Strict-Transport-Security", + "max-age=31536000; includeSubDomains", + ); resp.headers.set( "Permissions-Policy", "camera=(), microphone=(), geolocation=()", @@ -21,7 +25,10 @@ export async function handler( // Badges need to be embeddable across any domain (GitHub README, docs, etc.) if (url.pathname.startsWith("/badge/")) { resp.headers.set("Access-Control-Allow-Origin", "*"); - resp.headers.set("X-Frame-Options", "ALLOWALL"); + resp.headers.set( + "Content-Security-Policy", + "default-src 'none'; style-src 'unsafe-inline'; frame-ancestors *", + ); } else { resp.headers.set("X-Frame-Options", "SAMEORIGIN"); resp.headers.set( diff --git a/routes/api/ping/[owner]/[repo].ts b/routes/api/ping/[owner]/[repo].ts index 4d90dc6..5f555c2 100644 --- a/routes/api/ping/[owner]/[repo].ts +++ b/routes/api/ping/[owner]/[repo].ts @@ -1,7 +1,7 @@ // routes/api/ping/[owner]/[repo].ts import { FreshContext } from "$fresh/server.ts"; import { - getKv, + consumeRateLimit, getRepoPingSecret, invalidateRepoCache, PingRecord, @@ -9,12 +9,14 @@ import { } from "../../../../services/kv.ts"; import { isValidGitHubIdentifier, + readBoundedBody, sanitizeText, timingSafeEqualString, verifyHmacSha256, } from "../../../../services/security.ts"; const RATE_LIMIT_MAX_PER_MINUTE = 30; +const MAX_PING_BODY_BYTES = 32 * 1024; // 32 KiB export const handler = async ( req: Request, @@ -47,8 +49,7 @@ export const handler = async ( ); } - // AppSec: Rate Limiting via Deno KV sliding minute - const kv = await getKv(); + // AppSec: Atomic Rate Limiting via Deno KV sliding minute const currentMinute = Math.floor(Date.now() / 60000); const rateLimitKey = [ "ratelimit_ping", @@ -56,10 +57,13 @@ export const handler = async ( repo.toLowerCase(), currentMinute, ]; - const rateLimitEntry = await kv.get(rateLimitKey); - const currentCount = rateLimitEntry.value || 0; + const rateLimit = await consumeRateLimit( + rateLimitKey, + RATE_LIMIT_MAX_PER_MINUTE, + 120 * 1000, + ); - if (currentCount >= RATE_LIMIT_MAX_PER_MINUTE) { + if (!rateLimit.allowed) { return new Response( JSON.stringify({ error: @@ -75,9 +79,14 @@ export const handler = async ( ); } - await kv.set(rateLimitKey, currentCount + 1, { expireIn: 120 * 1000 }); - - const rawBody = await req.text(); + const bodyResult = await readBoundedBody(req, MAX_PING_BODY_BYTES); + if (!bodyResult.ok) { + return new Response(JSON.stringify({ error: bodyResult.error }), { + status: 413, + headers: { "Content-Type": "application/json" }, + }); + } + const rawBody = bodyResult.text; let body: Record = {}; if (rawBody.trim()) { try { @@ -93,8 +102,22 @@ export const handler = async ( } } - // AppSec: Authentication check (HMAC-SHA256 or Bearer secret token) + // AppSec: Fail-closed authentication check (HMAC-SHA256 or Bearer secret token) const configuredSecret = await getRepoPingSecret(owner, repo); + const allowUnauthenticated = + Deno.env.get("ALLOW_UNAUTHENTICATED_PINGS") === "true"; + if (!configuredSecret && !allowUnauthenticated) { + return new Response( + JSON.stringify({ + error: + "Endpoint de pings protegido (fail-closed): configura PING_SECRET o un secreto por repositorio.", + }), + { + status: 503, + headers: { "Content-Type": "application/json" }, + }, + ); + } if (configuredSecret) { const authHeader = req.headers.get("Authorization") || ""; const tokenHeader = req.headers.get("x-statuszero-token") || ""; diff --git a/routes/api/status/[owner]/[repo].ts b/routes/api/status/[owner]/[repo].ts index 78386f4..76b968c 100644 --- a/routes/api/status/[owner]/[repo].ts +++ b/routes/api/status/[owner]/[repo].ts @@ -1,6 +1,7 @@ // routes/api/status/[owner]/[repo].ts import { FreshContext } from "$fresh/server.ts"; import { fetchRepoStatus } from "../../../../services/github.ts"; +import { canForceRefresh } from "../../../../services/kv.ts"; import { isValidGitHubIdentifier } from "../../../../services/security.ts"; export const handler = async ( @@ -10,7 +11,7 @@ export const handler = async ( const owner = ctx.params.owner; const repo = ctx.params.repo; const url = new URL(req.url); - const forceRefresh = url.searchParams.get("refresh") === "true"; + const requestedRefresh = url.searchParams.get("refresh") === "true"; // AppSec: Strict input validation if (!isValidGitHubIdentifier(owner) || !isValidGitHubIdentifier(repo)) { @@ -36,6 +37,9 @@ export const handler = async ( } try { + const forceRefresh = requestedRefresh + ? await canForceRefresh(owner, repo) + : false; const data = await fetchRepoStatus(owner, repo, forceRefresh); return new Response(JSON.stringify(data, null, 2), { status: 200, diff --git a/routes/api/webhook/github.ts b/routes/api/webhook/github.ts index bd5efff..89c5784 100644 --- a/routes/api/webhook/github.ts +++ b/routes/api/webhook/github.ts @@ -4,9 +4,12 @@ import { fetchRepoStatus } from "../../../services/github.ts"; import { invalidateRepoCache } from "../../../services/kv.ts"; import { isValidGitHubIdentifier, + readBoundedBody, verifyHmacSha256, } from "../../../services/security.ts"; +const MAX_WEBHOOK_BODY_BYTES = 256 * 1024; // 256 KiB + export const handler = async ( req: Request, _ctx: FreshContext, @@ -21,12 +24,35 @@ export const handler = async ( ); } + // AppSec: Fail-closed if GITHUB_WEBHOOK_SECRET is not configured + const webhookSecret = Deno.env.get("GITHUB_WEBHOOK_SECRET")?.trim(); + const allowUnauthenticated = + Deno.env.get("ALLOW_UNAUTHENTICATED_WEBHOOKS") === "true"; + if (!webhookSecret && !allowUnauthenticated) { + return new Response( + JSON.stringify({ + error: + "Webhook deshabilitado: configura GITHUB_WEBHOOK_SECRET en el entorno (fail-closed).", + }), + { + status: 503, + headers: { "Content-Type": "application/json" }, + }, + ); + } + const event = req.headers.get("x-github-event") || "unknown"; const signature = req.headers.get("x-hub-signature-256") || ""; - const rawBody = await req.text(); + const bodyResult = await readBoundedBody(req, MAX_WEBHOOK_BODY_BYTES); + if (!bodyResult.ok) { + return new Response(JSON.stringify({ error: bodyResult.error }), { + status: 413, + headers: { "Content-Type": "application/json" }, + }); + } + const rawBody = bodyResult.text; - // AppSec: Verify HMAC-SHA256 signature if GITHUB_WEBHOOK_SECRET is configured - const webhookSecret = Deno.env.get("GITHUB_WEBHOOK_SECRET"); + // AppSec: Verify HMAC-SHA256 signature if (webhookSecret) { if (!signature) { return new Response( diff --git a/services/github.ts b/services/github.ts index d9d8d11..055765d 100644 --- a/services/github.ts +++ b/services/github.ts @@ -1,18 +1,26 @@ // services/github.ts -// GitHub API integration using Octokit, calculating status, uptime, workflow metrics and incidents. +// GitHub API integration using Octokit with ETag conditional requests, singleflight deduplication, +// parallel edge fetching, persistent Deno KV 90-day history, and synthetic ping status integration. import { Octokit } from "@octokit/rest"; import { + DailyHistorySnapshot, getCachedRepoStatus, + getCacheTtlMs, getPings, + getRepoHistoryMap, HistoryDay, IncidentItem, + PingRecord, ReleaseInfo, RepoStatusData, saveRepoStatus, WorkflowRunItem, } from "./kv.ts"; +const inFlightRequests = new Map>(); +const RECENT_PING_WINDOW_MS = 24 * 60 * 60 * 1000; + function getOctokit(): Octokit { const token = Deno.env.get("GITHUB_TOKEN")?.trim(); return new Octokit({ @@ -21,9 +29,27 @@ function getOctokit(): Octokit { }); } -function generateHistoryDays( +function computePingLatencyMetrics(pings: PingRecord[]): { + averageLatencyMs?: number; + lastPingLatencyMs?: number; +} { + const pingsWithLatency = pings.filter( + (p) => typeof p.latencyMs === "number" && p.latencyMs > 0, + ); + const averageLatencyMs = pingsWithLatency.length > 0 + ? Math.round( + pingsWithLatency.reduce((acc, p) => acc + (p.latencyMs || 0), 0) / + pingsWithLatency.length, + ) + : undefined; + const lastPingLatencyMs = pingsWithLatency[0]?.latencyMs; + return { averageLatencyMs, lastPingLatencyMs }; +} + +export function generateHistoryDays( workflowRuns: WorkflowRunItem[], incidents: IncidentItem[], + kvHistory?: Map, ): HistoryDay[] { const days: HistoryDay[] = []; const now = new Date(); @@ -59,12 +85,17 @@ function generateHistoryDays( uptimePercent = 95.0; } else { status = "degraded"; - uptimePercent = 98.2; + uptimePercent = + Math.round(((totalRuns - failedRuns) / totalRuns) * 10000) / + 100; } - } else if (totalRuns === 0 && i > 30) { - // Older days with no specific CI runs default to operational if no incidents - status = "operational"; - uptimePercent = 100; + } else if (totalRuns === 0 && kvHistory?.has(dateStr)) { + // Hydrate real persisted daily history from Deno KV for older days beyond the last 20 runs + const snap = kvHistory.get(dateStr)!; + status = snap.status === "unknown" ? "operational" : snap.status; + uptimePercent = typeof snap.uptimePercent === "number" + ? snap.uptimePercent + : 100; } days.push({ @@ -80,6 +111,68 @@ function generateHistoryDays( return days; } +export function computeOverallStatus( + workflowRuns: WorkflowRunItem[], + incidents: IncidentItem[], + recentPings: PingRecord[], + nowMs = Date.now(), +): { status: RepoStatusData["status"]; statusMessage: string } { + const openIncidents = incidents.filter((i) => i.state === "open"); + const recentRuns = workflowRuns.slice(0, 10); + const failedRecent = recentRuns.filter((r) => r.conclusion === "failure"); + + if (openIncidents.length > 0) { + return { + status: "outage", + statusMessage: `Incidente activo: ${openIncidents[0].title}`, + }; + } + + // Factor in recent synthetic healthcheck pings (last 24h) + const latestPing = recentPings[0]; + if (latestPing) { + const pingAgeMs = nowMs - new Date(latestPing.timestamp).getTime(); + const isFreshPing = Number.isFinite(pingAgeMs) && + pingAgeMs <= RECENT_PING_WINDOW_MS; + const isPingFailure = latestPing.status === "failure" || + (typeof latestPing.httpStatus === "number" && + latestPing.httpStatus >= 500); + if (isFreshPing && isPingFailure) { + return { + status: "outage", + statusMessage: `Fallo en heartbeat sintético: ${ + latestPing.message || latestPing.workflow || "Healthcheck fallido" + }`, + }; + } + } + + if (failedRecent.length > 0) { + if (failedRecent.length > recentRuns.length / 2) { + return { + status: "outage", + statusMessage: "Fallos críticos en pipelines de CI/CD detectados", + }; + } + return { + status: "degraded", + statusMessage: "Degradación parcial en flujos de trabajo", + }; + } + + if (recentRuns.length === 0) { + return { + status: "operational", + statusMessage: "Operacional • Sin incidencias en CI/CD", + }; + } + + return { + status: "operational", + statusMessage: "Todos los sistemas y flujos operacionales", + }; +} + export async function fetchRepoStatus( owner: string, repo: string, @@ -87,38 +180,90 @@ export async function fetchRepoStatus( ): Promise { const normalizedOwner = owner.trim(); const normalizedRepo = repo.trim(); + const flightKey = + `${normalizedOwner.toLowerCase()}/${normalizedRepo.toLowerCase()}`; - // 1. Check Deno KV cache + // 1. Check Deno KV cache honoring dynamic TTL (1m with token, 5m without) if (!forceRefresh) { const cached = await getCachedRepoStatus(normalizedOwner, normalizedRepo); if (cached) { const age = Date.now() - (cached.cachedAt || 0); - if (age < 60 * 1000) { + if (age < getCacheTtlMs()) { return cached; } } } + // 2. Singleflight deduplication: coalesce concurrent requests for the same repo + const existingFlight = inFlightRequests.get(flightKey); + if (existingFlight) { + return await existingFlight; + } + + const task = fetchRepoStatusFromGitHub( + normalizedOwner, + normalizedRepo, + forceRefresh, + ).finally(() => { + inFlightRequests.delete(flightKey); + }); + + inFlightRequests.set(flightKey, task); + return await task; +} + +async function fetchRepoStatusFromGitHub( + normalizedOwner: string, + normalizedRepo: string, + forceRefresh: boolean, +): Promise { const octokit = getOctokit(); + const staleCached = await getCachedRepoStatus( + normalizedOwner, + normalizedRepo, + true, + ); try { - // 2. Fetch repository info - const { data: repoData } = await octokit.rest.repos.get({ + // 1. Fetch repository metadata with conditional ETag when available (304 costs 0 rate-limit) + const repoResp = await octokit.rest.repos.get({ owner: normalizedOwner, repo: normalizedRepo, + headers: !forceRefresh && staleCached?.etag + ? { "If-None-Match": staleCached.etag } + : undefined, }); + const repoData = repoResp.data; + const newEtag = typeof repoResp.headers?.etag === "string" + ? repoResp.headers.etag + : undefined; - // 3. Fetch workflow runs (actions) - let workflowRuns: WorkflowRunItem[] = []; - try { - const { data: runsData } = await octokit.rest.actions - .listWorkflowRunsForRepo({ + // 2. Fetch workflow runs, issues, latest release, pings, and persisted KV history in parallel + const [runsRes, issuesRes, releaseRes, pingsRes, historyRes] = await Promise + .allSettled([ + octokit.rest.actions.listWorkflowRunsForRepo({ owner: normalizedOwner, repo: normalizedRepo, per_page: 20, - }); + }), + octokit.rest.issues.listForRepo({ + owner: normalizedOwner, + repo: normalizedRepo, + state: "all", + per_page: 20, + sort: "updated", + }), + octokit.rest.repos.getLatestRelease({ + owner: normalizedOwner, + repo: normalizedRepo, + }), + getPings(normalizedOwner, normalizedRepo), + getRepoHistoryMap(normalizedOwner, normalizedRepo), + ]); - workflowRuns = (runsData.workflow_runs || []).map((run) => { + let workflowRuns: WorkflowRunItem[] = []; + if (runsRes.status === "fulfilled") { + workflowRuns = (runsRes.value.data.workflow_runs || []).map((run) => { const createdMs = new Date(run.created_at).getTime(); const updatedMs = new Date(run.updated_at).getTime(); const durationSeconds = Math.max( @@ -150,25 +295,12 @@ export async function fetchRepoStatus( durationSeconds, }; }); - } catch (_err) { - // Actions may be disabled or empty in some repos - workflowRuns = []; } - // 4. Fetch issues for incident tracking let incidents: IncidentItem[] = []; - try { - const { data: issuesData } = await octokit.rest.issues.listForRepo({ - owner: normalizedOwner, - repo: normalizedRepo, - state: "all", - per_page: 20, - sort: "updated", - }); - - // Filter issues labeled or titled as incident/outage/downtime/bug - incidents = issuesData - .filter((issue) => !issue.pull_request) // exclude PRs + if (issuesRes.status === "fulfilled") { + incidents = issuesRes.value.data + .filter((issue) => !issue.pull_request) .map((issue) => { const labelList = (issue.labels || []).map((l) => typeof l === "string" @@ -199,18 +331,11 @@ export async function fetchRepoStatus( }; }) .filter((i) => i.isIncident); - } catch (_err) { - incidents = []; } - // 5. Fetch latest release let latestRelease: ReleaseInfo | null = null; - try { - const { data: releaseData } = await octokit.rest.repos.getLatestRelease({ - owner: normalizedOwner, - repo: normalizedRepo, - }); - + if (releaseRes.status === "fulfilled") { + const releaseData = releaseRes.value.data; latestRelease = { tag: releaseData.tag_name, name: releaseData.name || releaseData.tag_name, @@ -218,39 +343,21 @@ export async function fetchRepoStatus( publishedAt: releaseData.published_at || releaseData.created_at, author: releaseData.author?.login || "Maintainer", }; - } catch (_err) { - latestRelease = null; } - // 6. Fetch any custom pings recorded in Deno KV - const recentPings = await getPings(normalizedOwner, normalizedRepo); - - // 7. Calculate Status & Uptime - const openIncidents = incidents.filter((i) => i.state === "open"); - const recentRuns = workflowRuns.slice(0, 10); - const failedRecent = recentRuns.filter((r) => r.conclusion === "failure"); - - let status: RepoStatusData["status"] = "operational"; - let statusMessage = "Todos los sistemas y flujos operacionales"; + const recentPings = pingsRes.status === "fulfilled" ? pingsRes.value : []; + const kvHistory = historyRes.status === "fulfilled" + ? historyRes.value + : undefined; - if (openIncidents.length > 0) { - status = "outage"; - statusMessage = `Incidente activo: ${openIncidents[0].title}`; - } else if (failedRecent.length > 0) { - if (failedRecent.length > recentRuns.length / 2) { - status = "outage"; - statusMessage = "Fallos críticos en pipelines de CI/CD detectados"; - } else { - status = "degraded"; - statusMessage = "Degradación parcial en flujos de trabajo"; - } - } else if (recentRuns.length === 0) { - status = "operational"; - statusMessage = "Operacional • Sin incidencias en CI/CD"; - } + // 3. Calculate overall status (including synthetic pings) & 90-day uptime history + const { status, statusMessage } = computeOverallStatus( + workflowRuns, + incidents, + recentPings, + ); - // Compute uptime percentage across the history days - const historyBars = generateHistoryDays(workflowRuns, incidents); + const historyBars = generateHistoryDays(workflowRuns, incidents, kvHistory); const totalUptimeSum = historyBars.reduce( (acc, curr) => acc + curr.uptimePercent, 0, @@ -258,17 +365,9 @@ export async function fetchRepoStatus( const uptimePercentage = Math.round((totalUptimeSum / historyBars.length) * 100) / 100; - // Compute latency metrics if pings contain latency reports - const pingsWithLatency = recentPings.filter( - (p) => typeof p.latencyMs === "number" && p.latencyMs > 0, + const { averageLatencyMs, lastPingLatencyMs } = computePingLatencyMetrics( + recentPings, ); - const averageLatencyMs = pingsWithLatency.length > 0 - ? Math.round( - pingsWithLatency.reduce((acc, p) => acc + (p.latencyMs || 0), 0) / - pingsWithLatency.length, - ) - : undefined; - const lastPingLatencyMs = pingsWithLatency[0]?.latencyMs; const result: RepoStatusData = { owner: repoData.owner.login, @@ -292,51 +391,62 @@ export async function fetchRepoStatus( recentPings, averageLatencyMs, lastPingLatencyMs, + etag: newEtag, }; - // Save to Deno KV await saveRepoStatus(result); - return result; } catch (error: unknown) { - // 1. Si hay datos cacheados en Deno KV (incluso antiguos), los usamos como fallback - const staleCached = await getCachedRepoStatus( - normalizedOwner, - normalizedRepo, - true, - ); - if (staleCached) { - staleCached.isRateLimited = true; - staleCached.recentPings = await getPings( - normalizedOwner, - normalizedRepo, - ); - const pingsWithLatency = staleCached.recentPings.filter( - (p) => typeof p.latencyMs === "number" && p.latencyMs > 0, - ); - staleCached.averageLatencyMs = pingsWithLatency.length > 0 - ? Math.round( - pingsWithLatency.reduce((acc, p) => acc + (p.latencyMs || 0), 0) / - pingsWithLatency.length, - ) - : undefined; - staleCached.lastPingLatencyMs = pingsWithLatency[0]?.latencyMs; - return staleCached; - } - const err = error as { status?: number; message?: string; response?: { headers?: Record }; }; + // Conditional ETag hit (304 Not Modified): refresh timestamp & pings at 0 rate-limit cost + if (err.status === 304 && staleCached) { + const recentPings = await getPings(normalizedOwner, normalizedRepo); + const { averageLatencyMs, lastPingLatencyMs } = computePingLatencyMetrics( + recentPings, + ); + const { status, statusMessage } = computeOverallStatus( + staleCached.workflowRuns, + staleCached.incidents, + recentPings, + ); + const refreshed: RepoStatusData = { + ...staleCached, + status, + statusMessage, + recentPings, + averageLatencyMs, + lastPingLatencyMs, + lastUpdated: new Date().toISOString(), + cachedAt: Date.now(), + isRateLimited: false, + }; + await saveRepoStatus(refreshed); + return refreshed; + } + + // Fallback to stale cache during rate limits or transient GitHub outages + if (staleCached && err.status !== 404) { + staleCached.isRateLimited = err.status === 403 || err.status === 429; + staleCached.recentPings = await getPings(normalizedOwner, normalizedRepo); + const { averageLatencyMs, lastPingLatencyMs } = computePingLatencyMetrics( + staleCached.recentPings, + ); + staleCached.averageLatencyMs = averageLatencyMs; + staleCached.lastPingLatencyMs = lastPingLatencyMs; + return staleCached; + } + if (err.status === 404) { throw new Error( - `El repositorio "${owner}/${repo}" no fue encontrado en GitHub.`, + `El repositorio "${normalizedOwner}/${normalizedRepo}" no fue encontrado en GitHub.`, ); } - // 2. Si es rate limit (403/429) y no hay caché, modo degradado de resiliencia if (err.status === 403 || err.status === 429) { const resetHeader = err.response?.headers?.["x-ratelimit-reset"]; const resetTimestamp = resetHeader @@ -348,16 +458,9 @@ export async function fetchRepoStatus( ); const recentPings = await getPings(normalizedOwner, normalizedRepo); - const pingsWithLatency = recentPings.filter( - (p) => typeof p.latencyMs === "number" && p.latencyMs > 0, + const { averageLatencyMs, lastPingLatencyMs } = computePingLatencyMetrics( + recentPings, ); - const averageLatencyMs = pingsWithLatency.length > 0 - ? Math.round( - pingsWithLatency.reduce((acc, p) => acc + (p.latencyMs || 0), 0) / - pingsWithLatency.length, - ) - : undefined; - const lastPingLatencyMs = pingsWithLatency[0]?.latencyMs; const fallbackData: RepoStatusData = { owner: normalizedOwner, @@ -387,13 +490,12 @@ export async function fetchRepoStatus( rateLimitResetMinutes: minutesUntilReset, }; - // Guardar en KV para evitar golpear la API de GitHub mientras dure el bloqueo await saveRepoStatus(fallbackData); return fallbackData; } throw new Error( - `Error al consultar el estado de "${owner}/${repo}": ${ + `Error al consultar el estado de "${normalizedOwner}/${normalizedRepo}": ${ err.message || "Error desconocido" }`, ); diff --git a/services/kv.ts b/services/kv.ts index 70e0edc..b00848a 100644 --- a/services/kv.ts +++ b/services/kv.ts @@ -87,6 +87,14 @@ export interface RepoStatusData { lastPingLatencyMs?: number; isRateLimited?: boolean; rateLimitResetMinutes?: number; + etag?: string; +} + +export interface DailyHistorySnapshot { + date: string; + status: "operational" | "degraded" | "outage" | "unknown"; + uptimePercent: number; + updatedAt: string; } let kvInstance: Deno.Kv | null = null; @@ -221,3 +229,72 @@ export async function invalidateRepoCache( const key = ["repo_status", owner.toLowerCase(), repo.toLowerCase()]; await kv.delete(key); } + +/** + * Retrieves persisted daily history snapshots for a repository (up to 90 days). + */ +export async function getRepoHistoryMap( + owner: string, + repo: string, +): Promise> { + const kv = await getKv(); + const prefix = ["repo_history", owner.toLowerCase(), repo.toLowerCase()]; + const map = new Map(); + const iter = kv.list({ prefix }); + for await (const entry of iter) { + if (entry.value?.date) { + map.set(entry.value.date, entry.value); + } + } + return map; +} + +/** + * Atomic CAS rate-limiter backed by Deno KV (prevents concurrent TOCTOU bypasses). + */ +export async function consumeRateLimit( + key: Deno.KvKey, + maxPerWindow: number, + expireInMs: number, +): Promise<{ allowed: boolean; count: number }> { + const kv = await getKv(); + for (let attempt = 0; attempt < 5; attempt++) { + const entry = await kv.get(key); + const current = entry.value ?? 0; + if (current >= maxPerWindow) { + return { allowed: false, count: current }; + } + const next = current + 1; + const res = await kv + .atomic() + .check(entry) + .set(key, next, { expireIn: expireInMs }) + .commit(); + if (res.ok) { + return { allowed: true, count: next }; + } + } + return { allowed: false, count: maxPerWindow }; +} + +/** + * Guards `?refresh=true` against cache-busting DoS with an atomic per-repo cooldown. + */ +export async function canForceRefresh( + owner: string, + repo: string, + cooldownMs = 30 * 1000, +): Promise { + const kv = await getKv(); + const key = ["refresh_cooldown", owner.toLowerCase(), repo.toLowerCase()]; + const entry = await kv.get(key); + if (entry.value && Date.now() - entry.value < cooldownMs) { + return false; + } + const res = await kv + .atomic() + .check(entry) + .set(key, Date.now(), { expireIn: cooldownMs }) + .commit(); + return res.ok; +} diff --git a/services/security.ts b/services/security.ts index 6b9aa13..2297610 100644 --- a/services/security.ts +++ b/services/security.ts @@ -120,3 +120,60 @@ export async function verifyHmacSha256( return false; } } + +/** + * Reads a Request body up to `maxBytes`, aborting early if Content-Length or streamed bytes + * exceed the limit (mitigates memory exhaustion / payload flooding). + */ +export async function readBoundedBody( + req: Request, + maxBytes: number, +): Promise<{ ok: true; text: string } | { ok: false; error: string }> { + const contentLength = req.headers.get("content-length"); + if (contentLength) { + const declared = Number(contentLength); + if (Number.isFinite(declared) && declared > maxBytes) { + return { + ok: false, + error: + `Cuerpo de la petición demasiado grande (máximo ${maxBytes} bytes).`, + }; + } + } + + if (!req.body) { + return { ok: true, text: "" }; + } + + const reader = req.body.getReader(); + const chunks: Uint8Array[] = []; + let total = 0; + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + if (!value) continue; + total += value.byteLength; + if (total > maxBytes) { + await reader.cancel(); + return { + ok: false, + error: + `Cuerpo de la petición demasiado grande (máximo ${maxBytes} bytes).`, + }; + } + chunks.push(value); + } + } finally { + reader.releaseLock(); + } + + const merged = new Uint8Array(total); + let offset = 0; + for (const chunk of chunks) { + merged.set(chunk, offset); + offset += chunk.byteLength; + } + return { ok: true, text: new TextDecoder().decode(merged) }; +} diff --git a/src/index.tsx b/src/index.tsx new file mode 100644 index 0000000..dc263f8 --- /dev/null +++ b/src/index.tsx @@ -0,0 +1,477 @@ +import { Hono } from "hono"; +import type { Env, PingRecord } from "./types"; +import { generateStatusBadge } from "./services/badge"; +import { fetchRepoStatus } from "./services/github"; +import { + canForceRefresh, + consumeRateLimit, + getRepoPingSecret, + invalidateRepoCache, + savePing, +} from "./services/kv"; +import { + escapeXml, + isValidGitHubIdentifier, + readBoundedBody, + sanitizeText, + timingSafeEqualString, + verifyHmacSha256, +} from "./services/security"; +import { HomePage } from "./views/home"; +import { StatusPage } from "./views/status"; + +const RATE_LIMIT_MAX_PER_MINUTE = 30; +const MAX_PING_BODY_BYTES = 32 * 1024; +const MAX_WEBHOOK_BODY_BYTES = 256 * 1024; + +const app = new Hono<{ Bindings: Env }>(); + +// Baseline AppSec security headers middleware +app.use("*", async (c, next) => { + await next(); + c.header("X-Content-Type-Options", "nosniff"); + c.header("Referrer-Policy", "strict-origin-when-cross-origin"); + c.header("Strict-Transport-Security", "max-age=31536000; includeSubDomains"); + c.header("Permissions-Policy", "camera=(), microphone=(), geolocation=()"); + + if (c.req.path.startsWith("/badge/")) { + c.header("Access-Control-Allow-Origin", "*"); + c.header( + "Content-Security-Policy", + "default-src 'none'; style-src 'unsafe-inline'; frame-ancestors *", + ); + } else { + c.header("X-Frame-Options", "SAMEORIGIN"); + c.header( + "Content-Security-Policy", + [ + "default-src 'self'", + "script-src 'self' 'unsafe-inline'", + "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com", + "font-src 'self' https://fonts.gstatic.com", + "img-src 'self' data: https://github.com https://avatars.githubusercontent.com", + "connect-src 'self' https://api.github.com", + "frame-ancestors 'self'", + ].join("; "), + ); + } +}); + +// Landing page +app.get("/", (c) => { + const origin = new URL(c.req.url).origin; + return c.html(); +}); + +// Health endpoint for observability +app.get("/health", (c) => { + return c.json({ ok: true, runtime: "cloudflare-workers" }); +}); + +// Dynamic SVG Status Badge +app.get("/badge/:owner/:repo", async (c) => { + const owner = c.req.param("owner"); + let repo = c.req.param("repo"); + if (repo.endsWith(".svg")) { + repo = repo.slice(0, -4); + } + const lang = c.req.query("lang") === "es" ? "es" : "en"; + const label = c.req.query("label"); + + if (!isValidGitHubIdentifier(owner) || !isValidGitHubIdentifier(repo)) { + return c.body(generateStatusBadge("unknown", lang, label), 400, { + "Content-Type": "image/svg+xml; charset=utf-8", + "Cache-Control": "no-store", + }); + } + + let status: "operational" | "degraded" | "outage" | "unknown" = "unknown"; + try { + const data = await fetchRepoStatus(c.env, owner, repo); + status = data.status; + } catch { + status = "unknown"; + } + + return c.body(generateStatusBadge(status, lang, label), 200, { + "Content-Type": "image/svg+xml; charset=utf-8", + "Cache-Control": + "public, max-age=60, s-maxage=120, stale-while-revalidate=300", + }); +}); + +// Headless JSON Status API +app.get("/api/status/:owner/:repo", async (c) => { + const owner = c.req.param("owner"); + const repo = c.req.param("repo"); + const requestedRefresh = c.req.query("refresh") === "true"; + + if (!isValidGitHubIdentifier(owner) || !isValidGitHubIdentifier(repo)) { + return c.json( + { + error: + "Identificador de repositorio o propietario de GitHub no válido.", + owner, + repo, + }, + 400, + { "Access-Control-Allow-Origin": "*" }, + ); + } + + try { + const forceRefresh = requestedRefresh + ? await canForceRefresh(c.env, owner, repo) + : false; + const data = await fetchRepoStatus(c.env, owner, repo, forceRefresh); + return c.json(data, 200, { + "Access-Control-Allow-Origin": "*", + "Cache-Control": "public, max-age=60, s-maxage=60", + }); + } catch (err: unknown) { + const message = + err instanceof Error ? err.message : "Error interno del servidor"; + const status = message.includes("no fue encontrado") ? 404 : 500; + return c.json({ error: message, owner, repo }, status, { + "Access-Control-Allow-Origin": "*", + }); + } +}); + +// Synthetic Ping Telemetry Endpoint (Fail-Closed + Bounded Body + Rate Limited) +app.post("/api/ping/:owner/:repo", async (c) => { + const owner = c.req.param("owner"); + const repo = c.req.param("repo"); + + if (!isValidGitHubIdentifier(owner) || !isValidGitHubIdentifier(repo)) { + return c.json( + { + error: + "Identificador de repositorio o propietario de GitHub no válido.", + }, + 400, + ); + } + + const currentMinute = Math.floor(Date.now() / 60000); + const bucketKey = `rl:ping:${owner.toLowerCase()}/${repo.toLowerCase()}:${currentMinute}`; + const rateLimit = await consumeRateLimit( + c.env, + bucketKey, + RATE_LIMIT_MAX_PER_MINUTE, + 120, + ); + if (!rateLimit.allowed) { + return c.json( + { + error: + "Límite de tasa excedido. Máximo 30 pings por minuto por repositorio.", + }, + 429, + { "Retry-After": "60" }, + ); + } + + const bodyResult = await readBoundedBody(c.req.raw, MAX_PING_BODY_BYTES); + if (!bodyResult.ok) { + return c.json({ error: bodyResult.error }, 413); + } + + let body: Record = {}; + if (bodyResult.text.trim()) { + try { + body = JSON.parse(bodyResult.text) as Record; + } catch { + return c.json({ error: "Cuerpo de la petición JSON inválido." }, 400); + } + } + + const configuredSecret = await getRepoPingSecret(c.env, owner, repo); + const allowUnauthenticated = c.env.ALLOW_UNAUTHENTICATED_PINGS === "true"; + if (!configuredSecret && !allowUnauthenticated) { + return c.json( + { + error: + "Endpoint de pings protegido (fail-closed): configura PING_SECRET en Wrangler secrets.", + }, + 503, + ); + } + + if (configuredSecret) { + const authHeader = c.req.header("Authorization") || ""; + const tokenHeader = c.req.header("x-statuszero-token") || ""; + const signatureHeader = c.req.header("x-statuszero-signature") || ""; + + let isAuthorized = false; + if (authHeader.startsWith("Bearer ")) { + isAuthorized = timingSafeEqualString( + authHeader.slice(7).trim(), + configuredSecret, + ); + } else if (tokenHeader) { + isAuthorized = timingSafeEqualString( + tokenHeader.trim(), + configuredSecret, + ); + } else if (signatureHeader) { + isAuthorized = await verifyHmacSha256( + configuredSecret, + bodyResult.text, + signatureHeader, + ); + } + + if (!isAuthorized) { + return c.json( + { + error: + "Autenticación requerida o firma no válida. Configura Authorization: Bearer o x-statuszero-signature.", + }, + 401, + ); + } + } + + const latencyRaw = + typeof body.latencyMs === "number" + ? body.latencyMs + : typeof body.latency === "number" + ? body.latency + : undefined; + const latencyMs = + typeof latencyRaw === "number" && !Number.isNaN(latencyRaw) + ? Math.max(0, Math.min(60000, Math.round(latencyRaw))) + : undefined; + + const httpStatus = + typeof body.httpStatus === "number" && + body.httpStatus >= 100 && + body.httpStatus <= 599 + ? body.httpStatus + : undefined; + + const endpoint = + typeof body.endpoint === "string" + ? sanitizeText(body.endpoint, 150) + : undefined; + + const ping: PingRecord = { + timestamp: new Date().toISOString(), + workflow: sanitizeText(String(body.workflow || "Manual Ping"), 80), + branch: sanitizeText(String(body.branch || "main"), 100), + commit: sanitizeText(String(body.commit || ""), 40), + status: body.status === "failure" ? "failure" : "success", + message: sanitizeText( + String(body.message || "Heartbeat ping recibido"), + 200, + ), + latencyMs, + endpoint, + httpStatus, + }; + + await savePing(c.env, owner, repo, ping); + await invalidateRepoCache(c.env, owner, repo); + + return c.json({ + ok: true, + message: "Heartbeat de telemetría registrado con éxito en Cloudflare KV.", + ping, + }); +}); + +// GitHub Webhook Endpoint (Fail-Closed + HMAC-SHA256 + ctx.waitUntil re-prime) +app.post("/api/webhook/github", async (c) => { + const webhookSecret = c.env.GITHUB_WEBHOOK_SECRET?.trim(); + const allowUnauthenticated = c.env.ALLOW_UNAUTHENTICATED_WEBHOOKS === "true"; + if (!webhookSecret && !allowUnauthenticated) { + return c.json( + { + error: + "Webhook deshabilitado: configura GITHUB_WEBHOOK_SECRET en Wrangler secrets (fail-closed).", + }, + 503, + ); + } + + const event = c.req.header("x-github-event") || "unknown"; + const signature = c.req.header("x-hub-signature-256") || ""; + const bodyResult = await readBoundedBody(c.req.raw, MAX_WEBHOOK_BODY_BYTES); + if (!bodyResult.ok) { + return c.json({ error: bodyResult.error }, 413); + } + + if (webhookSecret) { + if (!signature) { + return c.json( + { error: "Firma X-Hub-Signature-256 requerida pero no provista." }, + 401, + ); + } + const isValid = await verifyHmacSha256( + webhookSecret, + bodyResult.text, + signature, + ); + if (!isValid) { + return c.json({ error: "Firma X-Hub-Signature-256 inválida." }, 401); + } + } + + let payload: Record; + try { + payload = JSON.parse(bodyResult.text) as Record; + } catch { + return c.json({ error: "Cuerpo JSON no válido." }, 400); + } + + if (event === "ping") { + return c.json({ + ok: true, + message: "Webhook de GitHub registrado exitosamente en StatusZero.", + zen: payload.zen || "Keep it logically awesome.", + }); + } + + const repoObj = payload.repository as + | { name?: string; owner?: { login?: string } } + | undefined; + const owner = repoObj?.owner?.login || ""; + const repo = repoObj?.name || ""; + + if ( + owner && + repo && + isValidGitHubIdentifier(owner) && + isValidGitHubIdentifier(repo) + ) { + await invalidateRepoCache(c.env, owner, repo); + + if ( + event === "workflow_run" || + event === "issues" || + event === "release" + ) { + // Properly attach background re-prime to Worker lifecycle via waitUntil + try { + c.executionCtx.waitUntil( + fetchRepoStatus(c.env, owner, repo, true).catch(() => {}), + ); + } catch { + // In unit tests without ExecutionContext, skip background re-prime + } + } + + return c.json({ + ok: true, + event, + owner, + repo, + message: `Evento '${event}' procesado. Estado sincronizado en tiempo real.`, + }); + } + + return c.json({ + ok: true, + event, + message: "Evento recibido pero sin repositorio objetivo identificable.", + }); +}); + +// RSS 2.0 Feed +app.get("/rss/:owner/:repo", async (c) => { + const owner = c.req.param("owner"); + let repo = c.req.param("repo"); + if (repo.endsWith(".xml")) { + repo = repo.slice(0, -4); + } + + if (!isValidGitHubIdentifier(owner) || !isValidGitHubIdentifier(repo)) { + return c.body( + `ErrorIdentificador inválido`, + 400, + { "Content-Type": "application/rss+xml; charset=utf-8" }, + ); + } + + try { + const data = await fetchRepoStatus(c.env, owner, repo); + const nowRfc822 = new Date().toUTCString(); + const origin = c.env.SITE_URL?.trim() || new URL(c.req.url).origin; + const siteUrl = `${origin}/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`; + + const itemsXml = data.incidents + .map((incident) => { + const prefix = + incident.state === "open" ? "[INCIDENTE ACTIVO]" : "[RESUELTO]"; + const pubDate = new Date(incident.createdAt).toUTCString(); + const desc = incident.bodyPreview + ? escapeXml(incident.bodyPreview) + : `Incidente registrado en GitHub #${incident.number}.`; + return ` + ${prefix} #${incident.number}: ${escapeXml(incident.title)} + ${escapeXml(incident.htmlUrl)} + ${escapeXml(incident.htmlUrl)} + ${pubDate} + ${desc} + `; + }) + .join("\n"); + + const rssXml = ` + + + Estado e Incidentes — ${escapeXml(owner)}/${escapeXml(repo)} + ${siteUrl} + Feed RSS de disponibilidad e incidentes para ${escapeXml(owner)}/${escapeXml(repo)}. + es + ${nowRfc822} + + + Estado Actual: ${data.status.toUpperCase()} (${data.uptimePercentage}%) + ${siteUrl} + ${siteUrl}#${Date.now()} + ${nowRfc822} + ${escapeXml(data.statusMessage)} — ${data.lastUpdated} + +${itemsXml} + +`; + + return c.body(rssXml, 200, { + "Content-Type": "application/rss+xml; charset=utf-8", + "Cache-Control": "public, max-age=120, s-maxage=300", + }); + } catch (err: unknown) { + const message = + err instanceof Error ? err.message : "Error al obtener estado"; + return c.body( + `Error${escapeXml(message)}`, + 500, + { "Content-Type": "application/rss+xml; charset=utf-8" }, + ); + } +}); + +// Status Page SSR +app.get("/:owner/:repo", async (c) => { + const owner = c.req.param("owner"); + const repo = c.req.param("repo"); + + if (!isValidGitHubIdentifier(owner) || !isValidGitHubIdentifier(repo)) { + return c.text("Identificador de repositorio inválido.", 400); + } + + try { + const data = await fetchRepoStatus(c.env, owner, repo); + const origin = new URL(c.req.url).origin; + return c.html(); + } catch (err: unknown) { + const message = + err instanceof Error ? err.message : "Repositorio no encontrado"; + return c.text(message, message.includes("no fue encontrado") ? 404 : 500); + } +}); + +export default app; diff --git a/src/services/badge.ts b/src/services/badge.ts new file mode 100644 index 0000000..bcb4425 --- /dev/null +++ b/src/services/badge.ts @@ -0,0 +1,84 @@ +import { escapeXml, sanitizeText } from "./security"; + +interface BadgeOptions { + label?: string; + statusText: string; + color: string; + dotColor?: string; +} + +export function generateStatusBadge( + status: "operational" | "degraded" | "outage" | "unknown", + lang: "en" | "es" = "en", + customLabel?: string, +): string { + const label = customLabel + ? sanitizeText(customLabel, 32) + : lang === "es" + ? "estado" + : "status"; + + let statusText = lang === "es" ? "operacional" : "operational"; + let color = "#10b981"; + let dotColor = "#34d399"; + + if (status === "degraded") { + statusText = lang === "es" ? "degradado" : "degraded"; + color = "#f59e0b"; + dotColor = "#fbbf24"; + } else if (status === "outage") { + statusText = lang === "es" ? "interrupción" : "major outage"; + color = "#ef4444"; + dotColor = "#f87171"; + } else if (status === "unknown") { + statusText = lang === "es" ? "desconocido" : "unknown"; + color = "#64748b"; + dotColor = "#94a3b8"; + } + + return renderSvgBadge({ label, statusText, color, dotColor }); +} + +function renderSvgBadge(opts: BadgeOptions): string { + const rawLeft = opts.label || "status"; + const rawRight = opts.statusText; + + const charWidth = 6.8; + const leftWidth = Math.round(rawLeft.length * charWidth + 18); + const rightWidth = Math.round(rawRight.length * charWidth + 26); + const totalWidth = leftWidth + rightWidth; + const height = 20; + + const leftTextX = Math.round(leftWidth / 2); + const dotX = leftWidth + 10; + const rightTextX = + leftWidth + 16 + Math.round((rawRight.length * charWidth) / 2); + + const safeLeft = escapeXml(rawLeft); + const safeRight = escapeXml(rawRight); + const safeColor = escapeXml(opts.color); + const safeDotColor = escapeXml(opts.dotColor || "#fff"); + + return ` + ${safeLeft}: ${safeRight} + + + + + + + + + + + + + + ${safeLeft} + ${safeLeft} + + ${safeRight} + ${safeRight} + +`; +} diff --git a/src/services/github.ts b/src/services/github.ts new file mode 100644 index 0000000..60f4024 --- /dev/null +++ b/src/services/github.ts @@ -0,0 +1,519 @@ +// Native Web-Fetch GitHub API client for Cloudflare Workers: +// ETag conditional requests (304 = 0 rate-limit cost), Promise.allSettled parallelization, +// persisted 90-day KV history hydration, and synthetic ping status integration. + +import type { + DailyHistorySnapshot, + Env, + HistoryDay, + IncidentItem, + PingRecord, + ReleaseInfo, + RepoStatusData, + WorkflowRunItem, +} from "../types"; +import { + getCachedRepoStatus, + getCacheTtlMs, + getPings, + getRepoHistoryMap, + saveRepoStatus, +} from "./kv"; + +const GITHUB_API = "https://api.github.com"; +const RECENT_PING_WINDOW_MS = 24 * 60 * 60 * 1000; + +interface GitHubRepoResponse { + owner: { login: string }; + name: string; + full_name: string; + description: string | null; + stargazers_count: number; + open_issues_count: number; + default_branch: string; + archived: boolean; + html_url: string; +} + +interface GitHubWorkflowRunsResponse { + workflow_runs?: Array<{ + id: number; + name?: string; + status?: string; + conclusion: string | null; + head_sha?: string; + head_commit?: { message?: string; author?: { name?: string } }; + actor?: { login?: string; avatar_url?: string }; + head_branch?: string; + event?: string; + run_number: number; + html_url: string; + created_at: string; + updated_at: string; + }>; +} + +interface GitHubIssueResponse { + id: number; + number: number; + title: string; + html_url: string; + state: "open" | "closed"; + pull_request?: unknown; + labels?: Array; + created_at: string; + updated_at: string; + closed_at: string | null; + body?: string | null; +} + +interface GitHubReleaseResponse { + tag_name: string; + name?: string | null; + html_url: string; + published_at?: string | null; + created_at: string; + author?: { login?: string } | null; +} + +function buildGitHubHeaders(env: Env, etag?: string): HeadersInit { + const headers: Record = { + Accept: "application/vnd.github+json", + "User-Agent": "StatusZero-Worker/2.0", + "X-GitHub-Api-Version": "2022-11-28", + }; + const token = env.GITHUB_TOKEN?.trim(); + if (token) { + headers.Authorization = `Bearer ${token}`; + } + if (etag) { + headers["If-None-Match"] = etag; + } + return headers; +} + +function computePingLatencyMetrics(pings: PingRecord[]): { + averageLatencyMs?: number; + lastPingLatencyMs?: number; +} { + const pingsWithLatency = pings.filter( + (p) => typeof p.latencyMs === "number" && p.latencyMs > 0, + ); + const averageLatencyMs = + pingsWithLatency.length > 0 + ? Math.round( + pingsWithLatency.reduce((acc, p) => acc + (p.latencyMs || 0), 0) / + pingsWithLatency.length, + ) + : undefined; + const lastPingLatencyMs = pingsWithLatency[0]?.latencyMs; + return { averageLatencyMs, lastPingLatencyMs }; +} + +export function generateHistoryDays( + workflowRuns: WorkflowRunItem[], + incidents: IncidentItem[], + kvHistory?: Map, +): HistoryDay[] { + const days: HistoryDay[] = []; + const now = new Date(); + + for (let i = 89; i >= 0; i--) { + const d = new Date(now.getTime() - i * 24 * 60 * 60 * 1000); + const dateStr = d.toISOString().slice(0, 10); + + const dayRuns = workflowRuns.filter( + (r) => r.createdAt.slice(0, 10) === dateStr, + ); + const dayIncidents = incidents.filter((inc) => { + const created = inc.createdAt.slice(0, 10); + const closed = inc.closedAt ? inc.closedAt.slice(0, 10) : dateStr; + return dateStr >= created && dateStr <= closed; + }); + + const totalRuns = dayRuns.length; + const failedRuns = dayRuns.filter((r) => r.conclusion === "failure").length; + const incidentsCount = dayIncidents.length; + + let status: HistoryDay["status"] = "operational"; + let uptimePercent = 100; + + if (incidentsCount > 0) { + status = "outage"; + uptimePercent = 92.5; + } else if (failedRuns > 0) { + if (failedRuns === totalRuns && totalRuns > 0) { + status = "outage"; + uptimePercent = 95.0; + } else { + status = "degraded"; + uptimePercent = + Math.round(((totalRuns - failedRuns) / totalRuns) * 10000) / 100; + } + } else if (totalRuns === 0 && kvHistory?.has(dateStr)) { + const snap = kvHistory.get(dateStr)!; + status = snap.status === "unknown" ? "operational" : snap.status; + uptimePercent = + typeof snap.uptimePercent === "number" ? snap.uptimePercent : 100; + } + + days.push({ + date: dateStr, + status, + uptimePercent, + totalRuns, + failedRuns, + incidentsCount, + }); + } + + return days; +} + +export function computeOverallStatus( + workflowRuns: WorkflowRunItem[], + incidents: IncidentItem[], + recentPings: PingRecord[], + nowMs = Date.now(), +): { status: RepoStatusData["status"]; statusMessage: string } { + const openIncidents = incidents.filter((i) => i.state === "open"); + const recentRuns = workflowRuns.slice(0, 10); + const failedRecent = recentRuns.filter((r) => r.conclusion === "failure"); + + if (openIncidents.length > 0) { + return { + status: "outage", + statusMessage: `Incidente activo: ${openIncidents[0].title}`, + }; + } + + const latestPing = recentPings[0]; + if (latestPing) { + const pingAgeMs = nowMs - new Date(latestPing.timestamp).getTime(); + const isFreshPing = + Number.isFinite(pingAgeMs) && pingAgeMs <= RECENT_PING_WINDOW_MS; + const isPingFailure = + latestPing.status === "failure" || + (typeof latestPing.httpStatus === "number" && + latestPing.httpStatus >= 500); + if (isFreshPing && isPingFailure) { + return { + status: "outage", + statusMessage: `Fallo en heartbeat sintético: ${ + latestPing.message || latestPing.workflow || "Healthcheck fallido" + }`, + }; + } + } + + if (failedRecent.length > 0) { + if (failedRecent.length > recentRuns.length / 2) { + return { + status: "outage", + statusMessage: "Fallos críticos en pipelines de CI/CD detectados", + }; + } + return { + status: "degraded", + statusMessage: "Degradación parcial en flujos de trabajo", + }; + } + + if (recentRuns.length === 0) { + return { + status: "operational", + statusMessage: "Operacional • Sin incidencias en CI/CD", + }; + } + + return { + status: "operational", + statusMessage: "Todos los sistemas y flujos operacionales", + }; +} + +export async function fetchRepoStatus( + env: Env, + owner: string, + repo: string, + forceRefresh = false, +): Promise { + const normalizedOwner = owner.trim(); + const normalizedRepo = repo.trim(); + + if (!forceRefresh) { + const cached = await getCachedRepoStatus( + env, + normalizedOwner, + normalizedRepo, + ); + if (cached && Date.now() - (cached.cachedAt || 0) < getCacheTtlMs(env)) { + return cached; + } + } + + const staleCached = await getCachedRepoStatus( + env, + normalizedOwner, + normalizedRepo, + true, + ); + const encOwner = encodeURIComponent(normalizedOwner); + const encRepo = encodeURIComponent(normalizedRepo); + + const repoResp = await fetch(`${GITHUB_API}/repos/${encOwner}/${encRepo}`, { + headers: buildGitHubHeaders( + env, + !forceRefresh ? staleCached?.etag : undefined, + ), + }); + + // Conditional ETag hit (304 Not Modified): 0 GitHub rate-limit cost + if (repoResp.status === 304 && staleCached) { + const recentPings = await getPings(env, normalizedOwner, normalizedRepo); + const { averageLatencyMs, lastPingLatencyMs } = + computePingLatencyMetrics(recentPings); + const { status, statusMessage } = computeOverallStatus( + staleCached.workflowRuns, + staleCached.incidents, + recentPings, + ); + const refreshed: RepoStatusData = { + ...staleCached, + status, + statusMessage, + recentPings, + averageLatencyMs, + lastPingLatencyMs, + lastUpdated: new Date().toISOString(), + cachedAt: Date.now(), + isRateLimited: false, + }; + await saveRepoStatus(env, refreshed); + return refreshed; + } + + if (repoResp.status === 404) { + throw new Error( + `El repositorio "${normalizedOwner}/${normalizedRepo}" no fue encontrado en GitHub.`, + ); + } + + if (!repoResp.ok) { + if (staleCached) { + staleCached.isRateLimited = + repoResp.status === 403 || repoResp.status === 429; + staleCached.recentPings = await getPings( + env, + normalizedOwner, + normalizedRepo, + ); + const { averageLatencyMs, lastPingLatencyMs } = + computePingLatencyMetrics(staleCached.recentPings); + staleCached.averageLatencyMs = averageLatencyMs; + staleCached.lastPingLatencyMs = lastPingLatencyMs; + return staleCached; + } + + if (repoResp.status === 403 || repoResp.status === 429) { + const resetHeader = repoResp.headers.get("x-ratelimit-reset"); + const resetTimestamp = resetHeader + ? Number(resetHeader) + : Math.floor(Date.now() / 1000) + 1800; + const minutesUntilReset = Math.max( + 1, + Math.ceil((resetTimestamp * 1000 - Date.now()) / 60000), + ); + const recentPings = await getPings(env, normalizedOwner, normalizedRepo); + const { averageLatencyMs, lastPingLatencyMs } = + computePingLatencyMetrics(recentPings); + + const fallbackData: RepoStatusData = { + owner: normalizedOwner, + repo: normalizedRepo, + fullName: `${normalizedOwner}/${normalizedRepo}`, + description: + "Repositorio público en GitHub (esperando sincronización de cuota de API).", + stars: 0, + openIssuesCount: 0, + defaultBranch: "main", + isArchived: false, + htmlUrl: `https://github.com/${normalizedOwner}/${normalizedRepo}`, + status: "degraded", + statusMessage: `Límite de GitHub API alcanzado (60 pet/h). Restablecimiento en ~${minutesUntilReset} min.`, + uptimePercentage: 100, + lastUpdated: new Date().toISOString(), + cachedAt: Date.now(), + workflowRuns: [], + incidents: [], + latestRelease: null, + historyBars: generateHistoryDays([], []), + recentPings, + averageLatencyMs, + lastPingLatencyMs, + isRateLimited: true, + rateLimitResetMinutes: minutesUntilReset, + }; + await saveRepoStatus(env, fallbackData); + return fallbackData; + } + + throw new Error( + `Error al consultar el estado de "${normalizedOwner}/${normalizedRepo}": HTTP ${repoResp.status}`, + ); + } + + const repoData = (await repoResp.json()) as GitHubRepoResponse; + const newEtag = repoResp.headers.get("etag") ?? undefined; + const authHeaders = buildGitHubHeaders(env); + + const [runsRes, issuesRes, releaseRes, pingsRes, historyRes] = + await Promise.allSettled([ + fetch( + `${GITHUB_API}/repos/${encOwner}/${encRepo}/actions/runs?per_page=20`, + { headers: authHeaders }, + ).then((r) => + r.ok ? (r.json() as Promise) : null, + ), + fetch( + `${GITHUB_API}/repos/${encOwner}/${encRepo}/issues?state=all&per_page=20&sort=updated`, + { headers: authHeaders }, + ).then((r) => + r.ok ? (r.json() as Promise) : null, + ), + fetch(`${GITHUB_API}/repos/${encOwner}/${encRepo}/releases/latest`, { + headers: authHeaders, + }).then((r) => + r.ok ? (r.json() as Promise) : null, + ), + getPings(env, normalizedOwner, normalizedRepo), + getRepoHistoryMap(env, normalizedOwner, normalizedRepo), + ]); + + let workflowRuns: WorkflowRunItem[] = []; + if (runsRes.status === "fulfilled" && runsRes.value?.workflow_runs) { + workflowRuns = runsRes.value.workflow_runs.map((run) => { + const createdMs = new Date(run.created_at).getTime(); + const updatedMs = new Date(run.updated_at).getTime(); + const durationSeconds = Math.max( + 1, + Math.round((updatedMs - createdMs) / 1000), + ); + return { + id: run.id, + name: run.name || "Workflow", + status: run.status || "unknown", + conclusion: run.conclusion, + commitSha: run.head_sha ? run.head_sha.slice(0, 7) : "", + commitMessage: + run.head_commit?.message?.split("\n")[0] || "Commit update", + author: { + name: + run.head_commit?.author?.name || + run.actor?.login || + "Contributor", + avatarUrl: + run.actor?.avatar_url || "https://github.com/ghost.png", + }, + branch: run.head_branch || repoData.default_branch, + event: run.event || "push", + runNumber: run.run_number, + htmlUrl: run.html_url, + createdAt: run.created_at, + updatedAt: run.updated_at, + durationSeconds, + }; + }); + } + + let incidents: IncidentItem[] = []; + if (issuesRes.status === "fulfilled" && Array.isArray(issuesRes.value)) { + incidents = issuesRes.value + .filter((issue) => !issue.pull_request) + .map((issue) => { + const labelList = (issue.labels || []).map((l) => + typeof l === "string" + ? { name: l, color: "6b7280" } + : { name: l.name || "", color: l.color || "6b7280" }, + ); + const hasIncidentLabel = labelList.some((l) => + /incident|outage|downtime|down|degradation|broken/i.test(l.name), + ); + const hasIncidentTitle = + /\[incident\]|\[outage\]|service down|downtime/i.test(issue.title); + return { + id: issue.id, + number: issue.number, + title: issue.title, + htmlUrl: issue.html_url, + state: issue.state, + labels: labelList, + createdAt: issue.created_at, + updatedAt: issue.updated_at, + closedAt: issue.closed_at, + bodyPreview: (issue.body || "").slice(0, 200), + isIncident: hasIncidentLabel || hasIncidentTitle, + }; + }) + .filter((i) => i.isIncident); + } + + let latestRelease: ReleaseInfo | null = null; + if (releaseRes.status === "fulfilled" && releaseRes.value) { + const r = releaseRes.value; + latestRelease = { + tag: r.tag_name, + name: r.name || r.tag_name, + htmlUrl: r.html_url, + publishedAt: r.published_at || r.created_at, + author: r.author?.login || "Maintainer", + }; + } + + const recentPings = pingsRes.status === "fulfilled" ? pingsRes.value : []; + const kvHistory = + historyRes.status === "fulfilled" ? historyRes.value : undefined; + + const { status, statusMessage } = computeOverallStatus( + workflowRuns, + incidents, + recentPings, + ); + const historyBars = generateHistoryDays(workflowRuns, incidents, kvHistory); + const totalUptimeSum = historyBars.reduce( + (acc, curr) => acc + curr.uptimePercent, + 0, + ); + const uptimePercentage = + Math.round((totalUptimeSum / historyBars.length) * 100) / 100; + const { averageLatencyMs, lastPingLatencyMs } = + computePingLatencyMetrics(recentPings); + + const result: RepoStatusData = { + owner: repoData.owner.login, + repo: repoData.name, + fullName: repoData.full_name, + description: repoData.description || "Sin descripción proporcionada.", + stars: repoData.stargazers_count, + openIssuesCount: repoData.open_issues_count, + defaultBranch: repoData.default_branch, + isArchived: repoData.archived, + htmlUrl: repoData.html_url, + status, + statusMessage, + uptimePercentage, + lastUpdated: new Date().toISOString(), + cachedAt: Date.now(), + workflowRuns, + incidents, + latestRelease, + historyBars, + recentPings, + averageLatencyMs, + lastPingLatencyMs, + etag: newEtag, + }; + + await saveRepoStatus(env, result); + return result; +} diff --git a/src/services/kv.ts b/src/services/kv.ts new file mode 100644 index 0000000..dbbb7f1 --- /dev/null +++ b/src/services/kv.ts @@ -0,0 +1,196 @@ +// Cloudflare KV storage adapter for StatusZero: +// repo status cache, consolidated 90-day history (1 KV read/write), synthetic pings, +// per-repo secrets, rate-limiting, and refresh cooldown. + +import type { + DailyHistorySnapshot, + Env, + PingRecord, + RepoStatusData, +} from "../types"; + +const MAX_HISTORY_DAYS = 90; + +function statusKey(owner: string, repo: string): string { + return `status:${owner.toLowerCase()}/${repo.toLowerCase()}`; +} + +function historyKey(owner: string, repo: string): string { + return `history:${owner.toLowerCase()}/${repo.toLowerCase()}`; +} + +function pingsKey(owner: string, repo: string): string { + return `pings:${owner.toLowerCase()}/${repo.toLowerCase()}`; +} + +function secretKey(owner: string, repo: string): string { + return `secret:${owner.toLowerCase()}/${repo.toLowerCase()}`; +} + +function refreshCooldownKey(owner: string, repo: string): string { + return `refresh:${owner.toLowerCase()}/${repo.toLowerCase()}`; +} + +export function getCacheTtlMs(env: Env): number { + return env.GITHUB_TOKEN?.trim() ? 60 * 1000 : 5 * 60 * 1000; +} + +export async function getCachedRepoStatus( + env: Env, + owner: string, + repo: string, + allowStale = false, +): Promise { + const data = await env.STATUS_KV.get( + statusKey(owner, repo), + "json", + ); + if (!data) return null; + if (allowStale) return data; + + const age = Date.now() - (data.cachedAt || 0); + if (age > getCacheTtlMs(env)) { + return null; + } + return data; +} + +export async function saveRepoStatus( + env: Env, + data: RepoStatusData, +): Promise { + data.cachedAt = Date.now(); + await env.STATUS_KV.put( + statusKey(data.owner, data.repo), + JSON.stringify(data), + ); + + // Consolidate 90-day daily snapshots into a single KV value (1 read + 1 write instead of list()) + const today = new Date().toISOString().slice(0, 10); + const existing = + (await env.STATUS_KV.get>( + historyKey(data.owner, data.repo), + "json", + )) ?? {}; + + existing[today] = { + date: today, + status: data.status, + uptimePercent: data.uptimePercentage, + updatedAt: data.lastUpdated, + }; + + // Prune snapshots older than 90 days + const sortedDates = Object.keys(existing).sort(); + if (sortedDates.length > MAX_HISTORY_DAYS) { + const excess = sortedDates.slice(0, sortedDates.length - MAX_HISTORY_DAYS); + for (const oldDate of excess) { + delete existing[oldDate]; + } + } + + await env.STATUS_KV.put( + historyKey(data.owner, data.repo), + JSON.stringify(existing), + ); +} + +export async function getRepoHistoryMap( + env: Env, + owner: string, + repo: string, +): Promise> { + const raw = await env.STATUS_KV.get>( + historyKey(owner, repo), + "json", + ); + const map = new Map(); + if (raw) { + for (const [date, snap] of Object.entries(raw)) { + if (snap?.date) { + map.set(date, snap); + } + } + } + return map; +} + +export async function savePing( + env: Env, + owner: string, + repo: string, + ping: PingRecord, +): Promise { + const key = pingsKey(owner, repo); + const list = (await env.STATUS_KV.get(key, "json")) ?? []; + list.unshift(ping); + await env.STATUS_KV.put(key, JSON.stringify(list.slice(0, 50))); +} + +export async function getPings( + env: Env, + owner: string, + repo: string, +): Promise { + return ( + (await env.STATUS_KV.get(pingsKey(owner, repo), "json")) ?? [] + ); +} + +export async function getRepoPingSecret( + env: Env, + owner: string, + repo: string, +): Promise { + const perRepo = await env.STATUS_KV.get(secretKey(owner, repo), "text"); + if (perRepo?.trim()) { + return perRepo.trim(); + } + return env.PING_SECRET?.trim() || null; +} + +export async function invalidateRepoCache( + env: Env, + owner: string, + repo: string, +): Promise { + await env.STATUS_KV.delete(statusKey(owner, repo)); +} + +export async function consumeRateLimit( + env: Env, + bucketKey: string, + maxPerWindow: number, + ttlSeconds: number, +): Promise<{ allowed: boolean; count: number }> { + const currentRaw = await env.STATUS_KV.get(bucketKey, "text"); + const current = currentRaw ? Number(currentRaw) : 0; + if (Number.isFinite(current) && current >= maxPerWindow) { + return { allowed: false, count: current }; + } + const next = (Number.isFinite(current) ? current : 0) + 1; + await env.STATUS_KV.put(bucketKey, String(next), { + expirationTtl: Math.max(60, ttlSeconds), + }); + return { allowed: true, count: next }; +} + +export async function canForceRefresh( + env: Env, + owner: string, + repo: string, + cooldownSeconds = 60, +): Promise { + const key = refreshCooldownKey(owner, repo); + const lastRaw = await env.STATUS_KV.get(key, "text"); + if (lastRaw) { + const lastMs = Number(lastRaw); + if (Number.isFinite(lastMs) && Date.now() - lastMs < cooldownSeconds * 1000) { + return false; + } + } + await env.STATUS_KV.put(key, String(Date.now()), { + expirationTtl: Math.max(60, cooldownSeconds), + }); + return true; +} diff --git a/src/services/security.ts b/src/services/security.ts new file mode 100644 index 0000000..f0d98d8 --- /dev/null +++ b/src/services/security.ts @@ -0,0 +1,149 @@ +// Web-Standards AppSec utilities for Cloudflare Workers: +// identifier validation, XML escaping, text sanitization, timing-safe HMAC-SHA256, and bounded body reads. + +const GITHUB_IDENTIFIER_REGEX = /^[a-zA-Z0-9_.-]{1,100}$/; + +export function isValidGitHubIdentifier(val: string): boolean { + if (!val || typeof val !== "string") return false; + const trimmed = val.trim(); + if ( + trimmed === "." || + trimmed === ".." || + trimmed.includes("..") || + trimmed.includes("/") || + trimmed.includes("\\") || + trimmed.startsWith(".") || + trimmed.endsWith(".") + ) { + return false; + } + return GITHUB_IDENTIFIER_REGEX.test(trimmed); +} + +export function escapeXml(str: string): string { + if (!str || typeof str !== "string") return ""; + return str + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); +} + +export function sanitizeText(str: string, maxLength = 250): string { + if (!str || typeof str !== "string") return ""; + let clean = ""; + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + if (code >= 32 && code !== 127) { + clean += str[i]; + } + } + return clean.trim().slice(0, maxLength); +} + +export function timingSafeEqualString(a: string, b: string): boolean { + if (typeof a !== "string" || typeof b !== "string") return false; + const encoder = new TextEncoder(); + const bufA = encoder.encode(a); + const bufB = encoder.encode(b); + if (bufA.byteLength !== bufB.byteLength) { + return false; + } + let mismatch = 0; + for (let i = 0; i < bufA.byteLength; i++) { + mismatch |= bufA[i] ^ bufB[i]; + } + return mismatch === 0; +} + +export async function createHmacSha256( + secret: string, + data: string, +): Promise { + const encoder = new TextEncoder(); + const key = await crypto.subtle.importKey( + "raw", + encoder.encode(secret), + { name: "HMAC", hash: "SHA-256" }, + false, + ["sign"], + ); + const signature = await crypto.subtle.sign( + "HMAC", + key, + encoder.encode(data), + ); + return Array.from(new Uint8Array(signature)) + .map((b) => b.toString(16).padStart(2, "0")) + .join(""); +} + +export async function verifyHmacSha256( + secret: string, + data: string, + expectedHex: string, +): Promise { + if (!secret || !data || !expectedHex) return false; + try { + const cleanExpected = expectedHex.replace(/^sha256=/, "").trim(); + const computedHex = await createHmacSha256(secret, data); + return timingSafeEqualString( + computedHex.toLowerCase(), + cleanExpected.toLowerCase(), + ); + } catch { + return false; + } +} + +export async function readBoundedBody( + req: Request, + maxBytes: number, +): Promise<{ ok: true; text: string } | { ok: false; error: string }> { + const contentLength = req.headers.get("content-length"); + if (contentLength) { + const declared = Number(contentLength); + if (Number.isFinite(declared) && declared > maxBytes) { + return { + ok: false, + error: `Cuerpo de la petición demasiado grande (máximo ${maxBytes} bytes).`, + }; + } + } + + if (!req.body) { + return { ok: true, text: "" }; + } + + const reader = req.body.getReader(); + const chunks: Uint8Array[] = []; + let total = 0; + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + if (!value) continue; + total += value.byteLength; + if (total > maxBytes) { + await reader.cancel(); + return { + ok: false, + error: `Cuerpo de la petición demasiado grande (máximo ${maxBytes} bytes).`, + }; + } + chunks.push(value); + } + } finally { + reader.releaseLock(); + } + + const merged = new Uint8Array(total); + let offset = 0; + for (const chunk of chunks) { + merged.set(chunk, offset); + offset += chunk.byteLength; + } + return { ok: true, text: new TextDecoder().decode(merged) }; +} diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..b7d5add --- /dev/null +++ b/src/types.ts @@ -0,0 +1,105 @@ +export interface Env { + STATUS_KV: KVNamespace; + GITHUB_TOKEN?: string; + PING_SECRET?: string; + GITHUB_WEBHOOK_SECRET?: string; + ALLOW_UNAUTHENTICATED_PINGS?: string; + ALLOW_UNAUTHENTICATED_WEBHOOKS?: string; + SITE_URL?: string; +} + +export interface WorkflowRunItem { + id: number; + name: string; + status: string; + conclusion: string | null; + commitSha: string; + commitMessage: string; + author: { + name: string; + avatarUrl: string; + }; + branch: string; + event: string; + runNumber: number; + htmlUrl: string; + createdAt: string; + updatedAt: string; + durationSeconds: number; +} + +export interface IncidentItem { + id: number; + number: number; + title: string; + htmlUrl: string; + state: "open" | "closed"; + labels: { name: string; color: string }[]; + createdAt: string; + updatedAt: string; + closedAt: string | null; + bodyPreview: string; +} + +export interface ReleaseInfo { + tag: string; + name: string; + htmlUrl: string; + publishedAt: string; + author: string; +} + +export interface HistoryDay { + date: string; // YYYY-MM-DD + status: "operational" | "degraded" | "outage" | "none"; + uptimePercent: number; + totalRuns: number; + failedRuns: number; + incidentsCount: number; +} + +export interface DailyHistorySnapshot { + date: string; + status: "operational" | "degraded" | "outage" | "unknown"; + uptimePercent: number; + updatedAt: string; +} + +export interface PingRecord { + timestamp: string; + workflow?: string; + branch?: string; + commit?: string; + status?: "success" | "failure" | "in_progress"; + message?: string; + latencyMs?: number; + endpoint?: string; + httpStatus?: number; +} + +export interface RepoStatusData { + owner: string; + repo: string; + fullName: string; + description: string; + stars: number; + openIssuesCount: number; + defaultBranch: string; + isArchived: boolean; + htmlUrl: string; + status: "operational" | "degraded" | "outage" | "unknown"; + statusMessage: string; + uptimePercentage: number; + lastUpdated: string; + cachedAt: number; + workflowRuns: WorkflowRunItem[]; + incidents: IncidentItem[]; + latestRelease: ReleaseInfo | null; + historyBars: HistoryDay[]; + recentPings: PingRecord[]; + averageLatencyMs?: number; + lastPingLatencyMs?: number; + isRateLimited?: boolean; + rateLimitResetMinutes?: number; + etag?: string; +} diff --git a/src/views/home.tsx b/src/views/home.tsx new file mode 100644 index 0000000..e2186c4 --- /dev/null +++ b/src/views/home.tsx @@ -0,0 +1,49 @@ +import { Layout } from "./layout"; + +export function HomePage({ origin }: { origin: string }) { + return ( + +
+
Edge-Native • Cloudflare Workers + KV
+

+ Páginas de estado Zero-Config para cualquier repositorio + de GitHub +

+

+ Convierte tus GitHub Actions, releases, incidencias y pings sintéticos + en una status page en tiempo real, badge SVG y feed RSS. Sin registro. +

+ + + + + +
+
Badge instantáneo para tu README
+
+            {`[![Status](${origin}/badge/OWNER/REPO.svg)](${origin}/OWNER/REPO)`}
+          
+
+
+