Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
Initial commit - OpenWA v0.1.0
rmyndharisc5bd4b5fecb3
diff --git a/.dockerignore b/.dockerignorenew file mode 100644index 000000000..2f12f7bc2--- /dev/null+++ b/.dockerignore@@ -0,0 +1,41 @@+# Dependencies+node_modules/++# Build output+dist/++# Test coverage+coverage/++# Environment files+.env+.env.local+.env.*.local++# Data files (sessions, media, database)+data/++# IDE+.idea/+.vscode/+*.swp+*.swo++# OS+.DS_Store+Thumbs.db++# Logs+logs/+*.log+npm-debug.log*++# Temporary files+tmp/+temp/++# Docker+.docker/++# Debug+.pnpm-debug.log*diff --git a/.env.example b/.env.examplenew file mode 100644index 000000000..dd481681e--- /dev/null+++ b/.env.example@@ -0,0 +1,119 @@+# =============================================================================+# OpenWA - Environment Configuration+# =============================================================================+# Copy this file to .env and customize as needed.+# This is the Single Source of Truth for all configuration.++# =============================================================================+# CORE SETTINGS+# =============================================================================+NODE_ENV=production+API_PORT=2785+LOG_LEVEL=info # error | warn | info | debug++# Domain Configuration+DOMAIN=localhost+DASHBOARD_PORT=2886++# Public URLs (for startup banner and external access)+# BASE_URL=https://api.yourdomain.com+# DASHBOARD_URL=https://dashboard.yourdomain.com++# CORS Configuration (comma-separated origins, or * for all)+CORS_ORIGINS=*++# SSL/TLS (enable for production with real domain)+# TRAEFIK_ACME_STORAGE=/letsencrypt/acme.json++# =============================================================================+# COMPONENTS (enable/disable container profiles)+# =============================================================================+DASHBOARD_ENABLED=true # Enable dashboard container+PROXY_ENABLED=true # Enable Traefik proxy container++# =============================================================================+# ENGINE CONFIGURATION+# =============================================================================+# Which WhatsApp engine to use (plugin-based)+# Options: whatsapp-web.js, baileys (future)+ENGINE_TYPE=whatsapp-web.js++# Engine-specific settings+SESSION_DATA_PATH=./data/sessions+PUPPETEER_HEADLESS=true+PUPPETEER_ARGS=--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-gpu++# =============================================================================+# DATABASE+# =============================================================================+# Options: sqlite, postgres+DATABASE_TYPE=sqlite+POSTGRES_BUILTIN=false # Use built-in PostgreSQL container?++# PostgreSQL settings (ignored for sqlite, auto-configured if POSTGRES_BUILTIN=true)+DATABASE_HOST=localhost+DATABASE_PORT=5432+DATABASE_NAME=openwa+DATABASE_USERNAME=openwa+DATABASE_PASSWORD=your-secure-password+DATABASE_SYNCHRONIZE=false # WARNING: Set false in production!+DATABASE_LOGGING=false++# =============================================================================+# REDIS / QUEUE (Phase 2)+# =============================================================================+REDIS_ENABLED=false # Enable Redis for queue and caching+REDIS_BUILTIN=false # Use built-in Redis container?++# Redis settings (auto-configured if REDIS_BUILTIN=true)+REDIS_HOST=localhost+REDIS_PORT=6379+# REDIS_PASSWORD=++# =============================================================================+# STORAGE+# =============================================================================+# Options: local, s3+STORAGE_TYPE=local+MINIO_BUILTIN=false # Use built-in MinIO container?++# Local storage path (if STORAGE_TYPE=local)+STORAGE_LOCAL_PATH=./data/media++# S3/MinIO settings (if STORAGE_TYPE=s3, auto-configured if MINIO_BUILTIN=true)+S3_ENDPOINT=http://localhost:9000+S3_BUCKET=openwa+S3_REGION=us-east-1+S3_ACCESS_KEY=minioadmin+S3_SECRET_KEY=minioadmin++# =============================================================================+# WEBHOOK+# =============================================================================+WEBHOOK_TIMEOUT=10000 # Timeout in milliseconds+WEBHOOK_MAX_RETRIES=3 # Number of retry attempts+WEBHOOK_RETRY_DELAY=5000 # Delay between retries in ms++# =============================================================================+# RATE LIMITING+# =============================================================================+RATE_LIMIT_TTL=60 # Time window in seconds+RATE_LIMIT_MAX=100 # Max requests per window++# =============================================================================+# PLUGINS+# =============================================================================+PLUGINS_ENABLED=true # Enable plugin system+PLUGINS_DIR=./data/plugins # Plugin directory++# =============================================================================+# SECURITY+# =============================================================================+# Master API key (leave empty to disable, or set to secure value)+API_MASTER_KEY=++# =============================================================================+# DEVELOPER SETTINGS+# =============================================================================+ENABLE_SWAGGER=true # Enable API documentation at /api/docsdiff --git a/.env.minimal b/.env.minimalnew file mode 100644index 000000000..a536ed94b--- /dev/null+++ b/.env.minimal@@ -0,0 +1,43 @@+# ===========================================+# OpenWA - Environment Configuration (Minimal)+# ===========================================+# This is a minimal configuration for development+# and single-session personal bots using SQLite.++# Server+PORT=2785+NODE_ENV=development++# Database (SQLite - no external service required)+DATABASE_TYPE=sqlite+DATABASE_NAME=./data/openwa.sqlite+DATABASE_SYNCHRONIZE=true+DATABASE_LOGGING=false++# WhatsApp Engine+ENGINE_TYPE=whatsapp-web.js+SESSION_DATA_PATH=./data/sessions+PUPPETEER_HEADLESS=true+PUPPETEER_ARGS=--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage++# Webhook+WEBHOOK_TIMEOUT=10000+WEBHOOK_MAX_RETRIES=3+WEBHOOK_RETRY_DELAY=5000++# Storage (Local filesystem)+STORAGE_TYPE=local+STORAGE_LOCAL_PATH=./data/media++# Redis & Queue (disabled for minimal setup)+REDIS_ENABLED=false+REDIS_BUILTIN=false+QUEUE_ENABLED=false+CACHE_ENABLED=false++# Built-in Docker services (all disabled for minimal setup)+POSTGRES_BUILTIN=false+MINIO_BUILTIN=false++# API Security (optional for development)+# API_MASTER_KEY=your-master-api-key-herediff --git a/.github/pull_request_template.md b/.github/pull_request_template.mdnew file mode 100644index 000000000..d13be4fa8--- /dev/null+++ b/.github/pull_request_template.md@@ -0,0 +1,19 @@+## Description+Brief description of changes++## Type of Change+- [ ] Bug fix+- [ ] New feature+- [ ] Breaking change+- [ ] Documentation update++## Checklist+- [ ] Tests added/updated+- [ ] Documentation updated+- [ ] Lint passes+- [ ] Self-reviewed++## Screenshots (if applicable)++## Related Issues+Closes #diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlnew file mode 100644index 000000000..cb8f7721d--- /dev/null+++ b/.github/workflows/ci.yml@@ -0,0 +1,121 @@+name: CI++on:+ push:+ branches: [main, develop]+ pull_request:+ branches: [main, develop]++env:+ NODE_VERSION: '20'++jobs:+ lint:+ name: Lint+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4++ - name: Setup Node.js+ uses: actions/setup-node@v4+ with:+ node-version: ${{ env.NODE_VERSION }}+ cache: 'npm'++ - name: Install dependencies+ run: npm ci++ - name: Run ESLint+ run: npm run lint++ - name: Check formatting+ run: npm run format -- --check++ test:+ name: Test+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4++ - name: Setup Node.js+ uses: actions/setup-node@v4+ with:+ node-version: ${{ env.NODE_VERSION }}+ cache: 'npm'++ - name: Install dependencies+ run: npm ci++ - name: Run unit tests+ run: npm test -- --coverage++ - name: Upload coverage+ uses: codecov/codecov-action@v4+ if: always()+ with:+ files: ./coverage/lcov.info+ fail_ci_if_error: false++ build:+ name: Build+ runs-on: ubuntu-latest+ needs: [lint, test]+ steps:+ - uses: actions/checkout@v4++ - name: Setup Node.js+ uses: actions/setup-node@v4+ with:+ node-version: ${{ env.NODE_VERSION }}+ cache: 'npm'++ - name: Install dependencies+ run: npm ci++ - name: Build project+ run: npm run build++ - name: Upload build artifacts+ uses: actions/upload-artifact@v4+ with:+ name: dist+ path: dist/+ retention-days: 7++ docker:+ name: Docker Build+ runs-on: ubuntu-latest+ needs: [build]+ if: github.event_name == 'push'+ steps:+ - uses: actions/checkout@v4++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Login to GitHub Container Registry+ uses: docker/login-action@v3+ with:+ registry: ghcr.io+ username: ${{ github.actor }}+ password: ${{ secrets.GITHUB_TOKEN }}++ - name: Extract metadata+ id: meta+ uses: docker/metadata-action@v5+ with:+ images: ghcr.io/${{ github.repository }}+ tags: |+ type=ref,event=branch+ type=sha,prefix=+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}++ - name: Build and push+ uses: docker/build-push-action@v5+ with:+ context: .+ push: true+ tags: ${{ steps.meta.outputs.tags }}+ labels: ${{ steps.meta.outputs.labels }}+ cache-from: type=gha+ cache-to: type=gha,mode=maxdiff --git a/.gitignore b/.gitignorenew file mode 100644index 000000000..b2a47b301--- /dev/null+++ b/.gitignore@@ -0,0 +1,73 @@+# Dependencies+node_modules/+.pnp+.pnp.js++# Build output+dist/+build/+.next/+out/++# Testing+coverage/++# Environment+.env+.env.local+.env.development.local+.env.test.local+.env.production.local++# Logs+npm-debug.log*+yarn-debug.log*+yarn-error.log*+logs/+*.log++# OS files+.DS_Store+.DS_Store?+._*+.Spotlight-V100+.Trashes+ehthumbs.db+Thumbs.db++# IDE+.idea/+.vscode/+*.swp+*.swo+*.sublime-workspace+*.sublime-project++# Data and storage+data/+media/+uploads/+.wwebjs_auth/+.wwebjs_cache/++# Database+*.db+*.sqlite+*.sqlite3++# Docker+.docker/++# Misc+*.bak+*.tmp+*.temp++# Git worktrees+.worktrees/++# AI Agents+.agent/+.claude/+CLAUDE.md+_docs/diff --git a/.prettierrc b/.prettierrcnew file mode 100644index 000000000..1a3466e92--- /dev/null+++ b/.prettierrc@@ -0,0 +1,11 @@+{+ "singleQuote": true,+ "trailingComma": "all",+ "printWidth": 120,+ "tabWidth": 2,+ "useTabs": false,+ "semi": true,+ "bracketSpacing": true,+ "arrowParens": "avoid",+ "endOfLine": "auto"+}\ No newline at end of filediff --git a/CHANGELOG.md b/CHANGELOG.mdnew file mode 100644index 000000000..94f5c64a4--- /dev/null+++ b/CHANGELOG.md@@ -0,0 +1,82 @@+# Changelog++All notable changes to this project will be documented in this file.++The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).++## [Unreleased]++### Fixed++- **[P1] Idempotency Key**: Made `generateIdempotencyKey` deterministic by removing `Date.now()`. Keys are now content-based for proper deduplication+- **[P2] Webhook Processor**: Added `lastTriggeredAt` update and `webhook:delivered`/`webhook:error` hooks after queue delivery+- **[P2] Hook Semantics**: Added `webhook:queued` event for queue mode; `webhook:after` now only fires in direct mode+- **[P2] QueueModule DI**: Added `TypeOrmModule.forFeature([Webhook])` and `HooksModule` imports for proper dependency injection+- **[P3] Message Processor**: Changed placeholder to throw error so BullMQ correctly marks job as failed++### Added++- New hook events: `webhook:queued` (after queue add) and `webhook:delivered` (after actual delivery)++## [0.1.0] - 2026-02-05++### 🎉 Initial Release++OpenWA v0.1.0 is the first stable release featuring a complete WhatsApp API Gateway with all core functionality.++### Core Features++- **REST API** for WhatsApp operations+- **Multi-session** support with concurrent session handling+- **Web Dashboard** for visual management+- **WebSocket** real-time events via Socket.IO+- **API Key Authentication** with role-based permissions+- **Webhook System** with HMAC signatures and queue-based retries++### Messaging++- Send/receive text, image, video, audio, document messages+- Message reactions and replies+- Bulk messaging with rate limiting+- Location and contact sharing+- Sticker support++### Advanced Features++- **Groups API** - Full CRUD operations+- **Channels/Newsletter** support+- **Labels Management**+- **Catalog API** for product management+- **Status/Stories** support+- **Proxy per Session** configuration+- **Plugin System** for extensibility++### Infrastructure++- SQLite (development) and PostgreSQL (production) support+- Redis queue for webhook delivery (optional)+- S3/MinIO storage for media (optional)+- Docker + Docker Compose deployment+- Traefik reverse proxy integration+- Health check endpoints+- Zero-config onboarding with auto-generated API key++### Security++- API key authentication with SHA-256 hashing+- Rate limiting (configurable)+- CIDR IP whitelisting+- CORS configuration+- Helmet security headers+- Audit logging for all operations++### Dashboard++- Session management with QR code display+- Webhook configuration and testing+- API key management+- Message tester for debugging+- Infrastructure status monitoring+- Audit logs viewer+- Plugin managementdiff --git a/Dockerfile b/Dockerfilenew file mode 100644index 000000000..367cbdcba--- /dev/null+++ b/Dockerfile@@ -0,0 +1,89 @@+# OpenWA - Dockerfile+# Multi-stage build for production-ready image++# ===== Stage 1: Builder =====+FROM node:20-slim AS builder++WORKDIR /app++# Install build dependencies+RUN apt-get update && apt-get install -y \+ python3 \+ make \+ g++ \+ && rm -rf /var/lib/apt/lists/*++# Copy package files+COPY package*.json ./++# Install all dependencies (including devDependencies for build)+RUN npm ci++# Copy source code+COPY . .++# Build the application+RUN npm run build++# ===== Stage 2: Production =====+FROM node:20-slim AS production++# Install Chrome/Chromium and required dependencies+RUN apt-get update && apt-get install -y \+ chromium \+ fonts-liberation \+ libappindicator3-1 \+ libasound2 \+ libatk-bridge2.0-0 \+ libatk1.0-0 \+ libcups2 \+ libdbus-1-3 \+ libdrm2 \+ libgbm1 \+ libgtk-3-0 \+ libnspr4 \+ libnss3 \+ libx11-xcb1 \+ libxcomposite1 \+ libxdamage1 \+ libxrandr2 \+ xdg-utils \+ dumb-init \+ && rm -rf /var/lib/apt/lists/*++# Set Chrome executable path for Puppeteer+ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium+ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true++# Create app user for security+RUN groupadd -r openwa && useradd -r -g openwa openwa++WORKDIR /app++# Copy package files+COPY package*.json ./++# Install production dependencies only+RUN npm ci --omit=dev && npm cache clean --force++# Copy built application from builder stage+COPY --from=builder /app/dist ./dist++# Create data directories with proper permissions+RUN mkdir -p ./data/sessions ./data/media && \+ chown -R openwa:openwa /app++# Note: Running as root to allow Docker socket access for orchestration+# For production with stricter security, consider using a Docker socket proxy+# USER openwa++# Expose port+EXPOSE 2785++# Health check+HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \+ CMD node -e "require('http').get('http://localhost:2785/api/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"++# Start with dumb-init to handle signals properly+ENTRYPOINT ["dumb-init", "--"]+CMD ["node", "dist/main"]diff --git a/LICENSE b/LICENSEnew file mode 100644index 000000000..f28272ec3--- /dev/null+++ b/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 Yudhi Armyndharis and OpenWA Contributors++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/README.md b/README.mdnew file mode 100644index 000000000..055ca2054--- /dev/null+++ b/README.md@@ -0,0 +1,319 @@+<p align="center">+ <img src="docs/logo/openwa_logo.webp" alt="OpenWA Logo" width="200"/>+</p>++<h1 align="center">OpenWA</h1>+<p align="center">+ <strong>Open Source WhatsApp API Gateway</strong>+</p>++<p align="center">+ <a href="#-features">Features</a> •+ <a href="#-quick-start">Quick Start</a> •+ <a href="#-documentation">Docs</a> •+ <a href="#-api-examples">API</a> •+ <a href="#-contributing">Contributing</a>+</p>++<p align="center">+ <img src="https://img.shields.io/badge/version-0.1.0-blue.svg" alt="Version"/>+ <img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"/>+ <img src="https://img.shields.io/badge/node-20_LTS-brightgreen.svg" alt="Node"/>+ <img src="https://img.shields.io/badge/NestJS-11.x-red.svg" alt="NestJS"/>+ <img src="https://img.shields.io/badge/docker-ready-blue.svg" alt="Docker"/>+ <img src="https://img.shields.io/badge/TypeScript-5.x-3178C6.svg" alt="TypeScript"/>+</p>++---++## ✨ Why OpenWA?++**OpenWA** is a free, open-source WhatsApp API Gateway designed for developers who need full control over their messaging infrastructure—without vendor lock-in or hidden paywalls.++Built on a **pluggable architecture**, OpenWA lets you swap database engines (SQLite/PostgreSQL), storage backends (Local/S3), and cache layers (Memory/Redis) without changing a single line of application code.++| | |+| ----------------------------- | ------------------------------------------------------------ |+| 🔓 **100% Open Source** | No licensing fees, no feature locks, full source code access |+| 🏗️ **Pluggable Architecture** | Swap adapters for database, storage, and cache via config |+| 🖥️ **Full Dashboard** | Modern React UI for session, webhook, and API key management |+| � **Multi-Session Ready** | Run multiple WhatsApp sessions concurrently on one instance |+| � **Docker Native** | Production-ready with zero configuration |+| � **n8n Integration** | Community nodes for workflow automation |++---++## 🎯 Features++### Core Features++| Feature | Status | Description |+| ------------- | ------ | ------------------------------------ |+| REST API | ✅ | Full WhatsApp API via HTTP endpoints |+| Multi-Session | ✅ | Manage multiple WhatsApp accounts |+| Webhooks | ✅ | Real-time events with HMAC signature |+| Web Dashboard | ✅ | Visual management interface |+| API Key Auth | ✅ | Secure API authentication |+| Swagger Docs | ✅ | Interactive API documentation |++### Messaging++| Feature | Status | Description |+| ----------------- | ------ | -------------------------------- |+| Text Messages | ✅ | Send/receive text messages |+| Media Messages | ✅ | Images, videos, documents, audio |+| Message Reactions | ✅ | React to messages with emoji |+| Bulk Messaging | ✅ | Send to multiple recipients |+| Message Status | ✅ | Track delivery and read receipts |++### Advanced++| Feature | Status | Description |+| ------------------- | ------ | ---------------------------------- |+| Groups API | ✅ | Create, manage, and message groups |+| Channels/Newsletter | ✅ | WhatsApp Channels support |+| Labels Management | ✅ | Organize chats with labels |+| Proxy Support | ✅ | Per-session proxy configuration |+| Rate Limiting | ✅ | Configurable request limits |+| CIDR Whitelisting | ✅ | IP-based access control |+| Audit Logging | ✅ | Track all API operations |++### Infrastructure++| Feature | Status | Description |+| ---------------- | ------ | ------------------------------ |+| SQLite | ✅ | Zero-config embedded database |+| PostgreSQL | ✅ | Production-grade database |+| Redis Cache | ✅ | Optional performance caching |+| S3/MinIO Storage | ✅ | Scalable media storage |+| Docker | ✅ | One-command deployment |+| Health Checks | ✅ | Kubernetes-ready probes |+| Data Migration | ✅ | Export/import between backends |++---++## 🚀 Quick Start++### Option A: Docker (Recommended)++```bash+# Clone and start+git clone https://github.com/rmyndharis/OpenWA.git+cd OpenWA+docker compose -f docker-compose.dev.yml up -d++# Access+# Dashboard: http://localhost:2886+# API: http://localhost:2785/api+# Swagger: http://localhost:2785/api/docs+```++### Option B: Local Development++```bash+# Clone repository+git clone https://github.com/rmyndharis/OpenWA.git+cd OpenWA++# Install dependencies (includes dashboard)+npm install++# Start API + Dashboard (config is auto-generated on first run)+npm run dev++# Access+# Dashboard: http://localhost:2886+# API: http://localhost:2785/api+# Swagger: http://localhost:2785/api/docs+```++---++## 🏭 Production Deployment++For production, use the main `docker-compose.yml` with optional services:++```bash+# Basic production (SQLite, local storage)+docker compose up -d++# With PostgreSQL database+docker compose --profile postgres up -d++# Full stack (PostgreSQL, Redis, Dashboard, Traefik)+docker compose --profile full up -d+```++| Profile | Services |+| ---------------- | --------------------- |+| `postgres` | PostgreSQL database |+| `redis` | Redis cache |+| `minio` | S3-compatible storage |+| `with-dashboard` | Web dashboard |+| `with-proxy` | Traefik reverse proxy |+| `full` | All services above |++> **Development vs Production**+>+> - Development (`docker-compose.dev.yml`): SQLite, local storage, both API & Dashboard included+> - Production (`docker-compose.yml`): Configurable database, profiles for optional services++## 🔌 Ports++| Service | Port | Description |+| --------- | --------------- | ------------------------ |+| API | `2785` | REST API endpoints |+| Dashboard | `2886` | Web management interface |+| Swagger | `2785/api/docs` | Interactive API docs |++---++## 📡 API Examples++### Create a Session++```bash+curl -X POST http://localhost:2785/api/sessions \+ -H "Content-Type: application/json" \+ -H "X-API-Key: YOUR_API_KEY" \+ -d '{"name": "my-bot"}'+```++### Start Session & Get QR Code++```bash+# Start the session+curl -X POST http://localhost:2785/api/sessions/{sessionId}/start \+ -H "X-API-Key: YOUR_API_KEY"++# Get QR code (scan with WhatsApp)+curl http://localhost:2785/api/sessions/{sessionId}/qr \+ -H "X-API-Key: YOUR_API_KEY"+```++### Send a Message++```bash+curl -X POST http://localhost:2785/api/sessions/{sessionId}/messages/send-text \+ -H "Content-Type: application/json" \+ -H "X-API-Key: YOUR_API_KEY" \+ -d '{+ "chatId": "[email protected]",+ "text": "Hello from OpenWA!"+ }'+```++### Setup Webhook++```bash+curl -X POST http://localhost:2785/api/sessions/{sessionId}/webhooks \+ -H "Content-Type: application/json" \+ -H "X-API-Key: YOUR_API_KEY" \+ -d '{+ "url": "https://your-server.com/webhook",+ "events": ["message.received", "session.status"],+ "secret": "your-hmac-secret"+ }'+```++---++## 🛠 Tech Stack++| Layer | Technology |+| ------------- | ----------------------- |+| **Runtime** | Node.js 20 LTS |+| **Framework** | NestJS 11.x |+| **Language** | TypeScript 5.x |+| **WA Engine** | whatsapp-web.js |+| **Database** | SQLite / PostgreSQL |+| **Cache** | Redis (optional) |+| **Storage** | Local / S3 / MinIO |+| **ORM** | TypeORM |+| **Container** | Docker + Docker Compose |++---++## 📁 Project Structure++```+openwa/+├── src/+│ ├── main.ts # Application entry point+│ ├── app.module.ts # Root module+│ ├── config/ # Configuration+│ ├── common/ # Shared utilities+│ │ ├── cache/ # Redis caching+│ │ └── storage/ # File storage (Local/S3)+│ ├── core/ # Core systems+│ │ ├── hooks/ # Plugin hooks+│ │ └── plugins/ # Plugin system+│ ├── engine/ # WhatsApp engine abstraction+│ └── modules/+│ ├── session/ # Session management+│ ├── message/ # Message handling+│ ├── webhook/ # Webhook management+│ ├── group/ # Groups API+│ ├── contact/ # Contacts API+│ ├── auth/ # API key authentication+│ ├── infra/ # Infrastructure management+│ └── health/ # Health checks+├── dashboard/ # React web dashboard+├── docs/ # Documentation+├── docker-compose.yml+├── Dockerfile+└── package.json+```++---++## 📚 Documentation++Comprehensive documentation is available in the `docs/` folder:++| Document | Description |+| ------------------------------------------------------- | ---------------------------- |+| [Project Overview](./docs/01-project-overview.md) | Introduction and goals |+| [Requirements](./docs/02-requirements-specification.md) | Feature specifications |+| [Architecture](./docs/03-system-architecture.md) | System design |+| [Security](./docs/04-security-design.md) | Security implementation |+| [Database](./docs/05-database-design.md) | Data models and migrations |+| [API Spec](./docs/06-api-specification.md) | Complete API reference |+| [Development](./docs/08-development-guidelines.md) | Coding standards |+| [Migration Guide](./docs/14-migration-guide.md) | Database & storage migration |++---++## 🤝 Contributing++We welcome contributions! Here's how to get started:++1. **Fork** the repository+2. **Create** your feature branch (`git checkout -b feature/amazing-feature`)+3. **Commit** your changes (`git commit -m 'Add amazing feature'`)+4. **Push** to the branch (`git push origin feature/amazing-feature`)+5. **Open** a Pull Request++Please read our [Development Guidelines](./docs/08-development-guidelines.md) for coding standards and best practices.++---++## 📄 License++This project is licensed under the **MIT License** – free for personal and commercial use.++See [LICENSE](./LICENSE) for details.++---++<div align="center">++**OpenWA** – Free, Open Source WhatsApp API Gateway++[📖 Documentation](./docs/README.md) · [🔌 API Docs](http://localhost:2785/api/docs) · [🐛 Report Bug](https://github.com/rmyndharis/OpenWA/issues) · [💡 Request Feature](https://github.com/rmyndharis/OpenWA/issues)++<br/>++<sub>Made with ❤️ by <a href="https://github.com/rmyndharis">Yudhi Armyndharis</a> and the OpenWA Community</sub>++</div>diff --git a/dashboard/.gitignore b/dashboard/.gitignorenew file mode 100644index 000000000..a547bf36d--- /dev/null+++ b/dashboard/.gitignore@@ -0,0 +1,24 @@+# Logs+logs+*.log+npm-debug.log*+yarn-debug.log*+yarn-error.log*+pnpm-debug.log*+lerna-debug.log*++node_modules+dist+dist-ssr+*.local++# Editor directories and files+.vscode/*+!.vscode/extensions.json+.idea+.DS_Store+*.suo+*.ntvs*+*.njsproj+*.sln+*.sw?diff --git a/dashboard/Dockerfile b/dashboard/Dockerfilenew file mode 100644index 000000000..37486f2e0--- /dev/null+++ b/dashboard/Dockerfile@@ -0,0 +1,28 @@+FROM node:20-alpine AS builder++WORKDIR /app++# Copy package files+COPY package*.json ./++# Install dependencies+RUN npm ci++# Copy source code+COPY . .++# Build the app+RUN npm run build++# Production stage with nginx+FROM nginx:alpine++# Copy built files+COPY --from=builder /app/dist /usr/share/nginx/html++# Copy nginx config+COPY nginx.conf /etc/nginx/conf.d/default.conf++EXPOSE 80++CMD ["nginx", "-g", "daemon off;"]diff --git a/dashboard/Dockerfile.traefik b/dashboard/Dockerfile.traefiknew file mode 100644index 000000000..d51ea424f--- /dev/null+++ b/dashboard/Dockerfile.traefik@@ -0,0 +1,30 @@+# Dashboard with lightweight static file server for Traefik+FROM node:20-alpine AS builder++WORKDIR /app++COPY package*.json ./+RUN npm ci++COPY . .+RUN npm run build++# ===== Production: Lightweight static server =====+FROM nginx:alpine++# Copy built static files+COPY --from=builder /app/dist /usr/share/nginx/html++# Simple nginx config for SPA (Traefik handles routing)+RUN echo 'server { \+ listen 80; \+ server_name localhost; \+ root /usr/share/nginx/html; \+ index index.html; \+ location / { \+ try_files $uri $uri/ /index.html; \+ } \+}' > /etc/nginx/conf.d/default.conf++EXPOSE 80+CMD ["nginx", "-g", "daemon off;"]diff --git a/dashboard/README.md b/dashboard/README.mdnew file mode 100644index 000000000..f029b0d00--- /dev/null+++ b/dashboard/README.md@@ -0,0 +1,89 @@+# OpenWA Dashboard++<p align="center">+ <img src="../docs/logo/openwa_logo.webp" alt="OpenWA Logo" width="120"/>+</p>++Modern web dashboard for managing OpenWA WhatsApp API Gateway sessions, webhooks, and infrastructure.++## ✨ Features++- **Session Management** - Create, monitor, and control WhatsApp sessions+- **QR Code Authentication** - Real-time QR code display for device pairing+- **Webhook Configuration** - Configure and test webhook endpoints+- **API Key Management** - Generate and manage API keys+- **Infrastructure Monitoring** - View system health and storage status+- **Real-time Updates** - Live session status via WebSocket++## 🛠️ Tech Stack++| Technology | Purpose |+| ---------------- | ----------------------- |+| React 19 | UI Framework |+| TypeScript | Type Safety |+| Vite 7 | Build Tool |+| React Router 7 | Client-side Routing |+| TanStack Query | Server State Management |+| TanStack Table | Data Tables |+| Socket.IO Client | Real-time Communication |+| Lucide React | Icons |++## 🚀 Getting Started++### Prerequisites++- Node.js 20++- npm or yarn++### Development++```bash+# Install dependencies+npm install++# Start development server+npm run dev+```++Dashboard will be available at `http://localhost:2886`++### Production Build++```bash+# Build for production+npm run build++# Preview production build+npm run preview+```++## 📁 Project Structure++```+dashboard/+├── src/+│ ├── components/ # Reusable UI components+│ ├── pages/ # Page components+│ ├── hooks/ # Custom React hooks+│ ├── services/ # API service layer+│ ├── types/ # TypeScript definitions+│ ├── utils/ # Utility functions+│ ├── App.tsx # Root component+│ ├── App.css # Global styles+│ └── main.tsx # Entry point+├── public/ # Static assets+├── index.html # HTML template+└── vite.config.ts # Vite configuration+```++## 🔗 API Connection++The dashboard connects to the OpenWA API backend. Configure the API URL in environment variables:++```bash+VITE_API_URL=http://localhost:2785+```++## 📄 License++MIT License - Part of the [OpenWA](https://github.com/rmyndharis/OpenWA) project.diff --git a/dashboard/eslint.config.js b/dashboard/eslint.config.jsnew file mode 100644index 000000000..5e6b472f5--- /dev/null+++ b/dashboard/eslint.config.js@@ -0,0 +1,23 @@+import js from '@eslint/js'+import globals from 'globals'+import reactHooks from 'eslint-plugin-react-hooks'+import reactRefresh from 'eslint-plugin-react-refresh'+import tseslint from 'typescript-eslint'+import { defineConfig, globalIgnores } from 'eslint/config'++export default defineConfig([+ globalIgnores(['dist']),+ {+ files: ['**/*.{ts,tsx}'],+ extends: [+ js.configs.recommended,+ tseslint.configs.recommended,+ reactHooks.configs.flat.recommended,+ reactRefresh.configs.vite,+ ],+ languageOptions: {+ ecmaVersion: 2020,+ globals: globals.browser,+ },+ },+])diff --git a/dashboard/index.html b/dashboard/index.htmlnew file mode 100644index 000000000..da91bd428--- /dev/null+++ b/dashboard/index.html@@ -0,0 +1,13 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>OpenWA</title>+ </head>+ <body>+ <div id="root"></div>+ <script type="module" src="/src/main.tsx"></script>+ </body>+</html>diff --git a/dashboard/nginx.conf b/dashboard/nginx.confnew file mode 100644index 000000000..090581205--- /dev/null+++ b/dashboard/nginx.conf@@ -0,0 +1,35 @@+server {+ listen 80;+ server_name localhost;+ root /usr/share/nginx/html;+ index index.html;++ # Gzip compression+ gzip on;+ gzip_types text/plain text/css application/json application/javascript text/xml application/xml;++ # SPA routing - serve index.html for all routes+ location / {+ try_files $uri $uri/ /index.html;+ }++ # Proxy API requests to backend+ location /api/ {+ proxy_pass http://openwa:2785;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection 'upgrade';+ proxy_set_header Host $host;+ proxy_cache_bypass $http_upgrade;+ }++ # WebSocket proxy+ location /socket.io/ {+ proxy_pass http://openwa:2785;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection 'upgrade';+ proxy_set_header Host $host;+ proxy_cache_bypass $http_upgrade;+ }+}diff --git a/dashboard/package-lock.json b/dashboard/package-lock.jsonnew file mode 100644index 000000000..150b38ad7--- /dev/null+++ b/dashboard/package-lock.json@@ -0,0 +1,3483 @@+{+ "name": "dashboard",+ "version": "0.0.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "dashboard",+ "version": "0.0.0",+ "dependencies": {+ "@tanstack/react-query": "^5.90.20",+ "@tanstack/react-table": "^8.21.3",+ "lucide-react": "^0.563.0",+ "react": "^19.2.0",+ "react-dom": "^19.2.0",+ "react-router-dom": "^7.13.0",+ "socket.io-client": "^4.8.3"+ },+ "devDependencies": {+ "@eslint/js": "^9.39.1",+ "@types/node": "^24.10.1",+ "@types/react": "^19.2.5",+ "@types/react-dom": "^19.2.3",+ "@vitejs/plugin-react": "^5.1.1",+ "eslint": "^9.39.1",+ "eslint-plugin-react-hooks": "^7.0.1",+ "eslint-plugin-react-refresh": "^0.4.24",+ "globals": "^16.5.0",+ "typescript": "~5.9.3",+ "typescript-eslint": "^8.46.4",+ "vite": "^7.2.4"+ }+ },+ "node_modules/@babel/code-frame": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",+ "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-validator-identifier": "^7.28.5",+ "js-tokens": "^4.0.0",+ "picocolors": "^1.1.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/compat-data": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz",+ "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/core": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",+ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@babel/code-frame": "^7.29.0",+ "@babel/generator": "^7.29.0",+ "@babel/helper-compilation-targets": "^7.28.6",+ "@babel/helper-module-transforms": "^7.28.6",+ "@babel/helpers": "^7.28.6",+ "@babel/parser": "^7.29.0",+ "@babel/template": "^7.28.6",+ "@babel/traverse": "^7.29.0",+ "@babel/types": "^7.29.0",+ "@jridgewell/remapping": "^2.3.5",+ "convert-source-map": "^2.0.0",+ "debug": "^4.1.0",+ "gensync": "^1.0.0-beta.2",+ "json5": "^2.2.3",+ "semver": "^6.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/babel"+ }+ },+ "node_modules/@babel/generator": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.0.tgz",+ "integrity": "sha512-vSH118/wwM/pLR38g/Sgk05sNtro6TlTJKuiMXDaZqPUfjTFcudpCOt00IhOfj+1BFAX+UFAlzCU+6WXr3GLFQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.29.0",+ "@babel/types": "^7.29.0",+ "@jridgewell/gen-mapping": "^0.3.12",+ "@jridgewell/trace-mapping": "^0.3.28",+ "jsesc": "^3.0.2"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-compilation-targets": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz",+ "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/compat-data": "^7.28.6",+ "@babel/helper-validator-option": "^7.27.1",+ "browserslist": "^4.24.0",+ "lru-cache": "^5.1.1",+ "semver": "^6.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-globals": {+ "version": "7.28.0",+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",+ "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-module-imports": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz",+ "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/traverse": "^7.28.6",+ "@babel/types": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-module-transforms": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz",+ "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-module-imports": "^7.28.6",+ "@babel/helper-validator-identifier": "^7.28.5",+ "@babel/traverse": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0"+ }+ },+ "node_modules/@babel/helper-plugin-utils": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz",+ "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-string-parser": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",+ "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-validator-identifier": {+ "version": "7.28.5",+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",+ "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-validator-option": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",+ "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helpers": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz",+ "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/template": "^7.28.6",+ "@babel/types": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/parser": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz",+ "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.29.0"+ },+ "bin": {+ "parser": "bin/babel-parser.js"+ },+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@babel/plugin-transform-react-jsx-self": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz",+ "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.27.1"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-transform-react-jsx-source": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz",+ "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.27.1"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/template": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz",+ "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.28.6",+ "@babel/parser": "^7.28.6",+ "@babel/types": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/traverse": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz",+ "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.29.0",+ "@babel/generator": "^7.29.0",+ "@babel/helper-globals": "^7.28.0",+ "@babel/parser": "^7.29.0",+ "@babel/template": "^7.28.6",+ "@babel/types": "^7.29.0",+ "debug": "^4.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/types": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",+ "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-string-parser": "^7.27.1",+ "@babel/helper-validator-identifier": "^7.28.5"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz",+ "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz",+ "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz",+ "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz",+ "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz",+ "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz",+ "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz",+ "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz",+ "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz",+ "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz",+ "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz",+ "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz",+ "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz",+ "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz",+ "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz",+ "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz",+ "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz",+ "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-arm64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz",+ "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz",+ "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-arm64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz",+ "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz",+ "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openharmony-arm64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz",+ "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz",+ "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz",+ "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz",+ "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz",+ "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@eslint-community/eslint-utils": {+ "version": "4.9.1",+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",+ "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "eslint-visitor-keys": "^3.4.3"+ },+ "engines": {+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ },+ "peerDependencies": {+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"+ }+ },+ "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {+ "version": "3.4.3",+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/@eslint-community/regexpp": {+ "version": "4.12.2",+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",+ "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"+ }+ },+ "node_modules/@eslint/config-array": {+ "version": "0.21.1",+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz",+ "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@eslint/object-schema": "^2.1.7",+ "debug": "^4.3.1",+ "minimatch": "^3.1.2"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@eslint/config-helpers": {+ "version": "0.4.2",+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@eslint/core": "^0.17.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@eslint/core": {+ "version": "0.17.0",+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@types/json-schema": "^7.0.15"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@eslint/eslintrc": {+ "version": "3.3.3",+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz",+ "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ajv": "^6.12.4",+ "debug": "^4.3.2",+ "espree": "^10.0.1",+ "globals": "^14.0.0",+ "ignore": "^5.2.0",+ "import-fresh": "^3.2.1",+ "js-yaml": "^4.1.1",+ "minimatch": "^3.1.2",+ "strip-json-comments": "^3.1.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/@eslint/eslintrc/node_modules/globals": {+ "version": "14.0.0",+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/@eslint/js": {+ "version": "9.39.2",+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz",+ "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://eslint.org/donate"+ }+ },+ "node_modules/@eslint/object-schema": {+ "version": "2.1.7",+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@eslint/plugin-kit": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@eslint/core": "^0.17.0",+ "levn": "^0.4.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@humanfs/core": {+ "version": "0.19.1",+ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",+ "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=18.18.0"+ }+ },+ "node_modules/@humanfs/node": {+ "version": "0.16.7",+ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz",+ "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@humanfs/core": "^0.19.1",+ "@humanwhocodes/retry": "^0.4.0"+ },+ "engines": {+ "node": ">=18.18.0"+ }+ },+ "node_modules/@humanwhocodes/module-importer": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=12.22"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/nzakas"+ }+ },+ "node_modules/@humanwhocodes/retry": {+ "version": "0.4.3",+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",+ "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=18.18"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/nzakas"+ }+ },+ "node_modules/@jridgewell/gen-mapping": {+ "version": "0.3.13",+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.0",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/remapping": {+ "version": "2.3.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/gen-mapping": "^0.3.5",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.5.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.31",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.1.0",+ "@jridgewell/sourcemap-codec": "^1.4.14"+ }+ },+ "node_modules/@rolldown/pluginutils": {+ "version": "1.0.0-rc.2",+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.2.tgz",+ "integrity": "sha512-izyXV/v+cHiRfozX62W9htOAvwMo4/bXKDrQ+vom1L1qRuexPock/7VZDAhnpHCLNejd3NJ6hiab+tO0D44Rgw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@rollup/rollup-android-arm-eabi": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz",+ "integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@rollup/rollup-android-arm64": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz",+ "integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@rollup/rollup-darwin-arm64": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz",+ "integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@rollup/rollup-darwin-x64": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz",+ "integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@rollup/rollup-freebsd-arm64": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz",+ "integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@rollup/rollup-freebsd-x64": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz",+ "integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz",+ "integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz",+ "integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm64-gnu": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz",+ "integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm64-musl": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz",+ "integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-loong64-gnu": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz",+ "integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-loong64-musl": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz",+ "integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz",+ "integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-ppc64-musl": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz",+ "integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz",+ "integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-riscv64-musl": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz",+ "integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-s390x-gnu": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz",+ "integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-x64-gnu": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz",+ "integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-x64-musl": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz",+ "integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-openbsd-x64": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz",+ "integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ]+ },+ "node_modules/@rollup/rollup-openharmony-arm64": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz",+ "integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ]+ },+ "node_modules/@rollup/rollup-win32-arm64-msvc": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz",+ "integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-ia32-msvc": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz",+ "integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-x64-gnu": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz",+ "integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-x64-msvc": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz",+ "integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@socket.io/component-emitter": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz",+ "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==",+ "license": "MIT"+ },+ "node_modules/@tanstack/query-core": {+ "version": "5.90.20",+ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.20.tgz",+ "integrity": "sha512-OMD2HLpNouXEfZJWcKeVKUgQ5n+n3A2JFmBaScpNDUqSrQSjiveC7dKMe53uJUg1nDG16ttFPz2xfilz6i2uVg==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/tannerlinsley"+ }+ },+ "node_modules/@tanstack/react-query": {+ "version": "5.90.20",+ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.20.tgz",+ "integrity": "sha512-vXBxa+qeyveVO7OA0jX1z+DeyCA4JKnThKv411jd5SORpBKgkcVnYKCiBgECvADvniBX7tobwBmg01qq9JmMJw==",+ "license": "MIT",+ "dependencies": {+ "@tanstack/query-core": "5.90.20"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/tannerlinsley"+ },+ "peerDependencies": {+ "react": "^18 || ^19"+ }+ },+ "node_modules/@tanstack/react-table": {+ "version": "8.21.3",+ "resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.21.3.tgz",+ "integrity": "sha512-5nNMTSETP4ykGegmVkhjcS8tTLW6Vl4axfEGQN3v0zdHYbK4UfoqfPChclTrJ4EoK9QynqAu9oUf8VEmrpZ5Ww==",+ "license": "MIT",+ "dependencies": {+ "@tanstack/table-core": "8.21.3"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/tannerlinsley"+ },+ "peerDependencies": {+ "react": ">=16.8",+ "react-dom": ">=16.8"+ }+ },+ "node_modules/@tanstack/table-core": {+ "version": "8.21.3",+ "resolved": "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.21.3.tgz",+ "integrity": "sha512-ldZXEhOBb8Is7xLs01fR3YEc3DERiz5silj8tnGkFZytt1abEvl/GhUmCE0PMLaMPTa3Jk4HbKmRlHmu+gCftg==",+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/tannerlinsley"+ }+ },+ "node_modules/@types/babel__core": {+ "version": "7.20.5",+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",+ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.20.7",+ "@babel/types": "^7.20.7",+ "@types/babel__generator": "*",+ "@types/babel__template": "*",+ "@types/babel__traverse": "*"+ }+ },+ "node_modules/@types/babel__generator": {+ "version": "7.27.0",+ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz",+ "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.0.0"+ }+ },+ "node_modules/@types/babel__template": {+ "version": "7.4.4",+ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",+ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.1.0",+ "@babel/types": "^7.0.0"+ }+ },+ "node_modules/@types/babel__traverse": {+ "version": "7.28.0",+ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz",+ "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.28.2"+ }+ },+ "node_modules/@types/estree": {+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/json-schema": {+ "version": "7.0.15",+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",+ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/node": {+ "version": "24.10.9",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.9.tgz",+ "integrity": "sha512-ne4A0IpG3+2ETuREInjPNhUGis1SFjv1d5asp8MzEAGtOZeTeHVDOYqOgqfhvseqg/iXty2hjBf1zAOb7RNiNw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "undici-types": "~7.16.0"+ }+ },+ "node_modules/@types/react": {+ "version": "19.2.10",+ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.10.tgz",+ "integrity": "sha512-WPigyYuGhgZ/cTPRXB2EwUw+XvsRA3GqHlsP4qteqrnnjDrApbS7MxcGr/hke5iUoeB7E/gQtrs9I37zAJ0Vjw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "csstype": "^3.2.2"+ }+ },+ "node_modules/@types/react-dom": {+ "version": "19.2.3",+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz",+ "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",+ "dev": true,+ "license": "MIT",+ "peerDependencies": {+ "@types/react": "^19.2.0"+ }+ },+ "node_modules/@typescript-eslint/eslint-plugin": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.54.0.tgz",+ "integrity": "sha512-hAAP5io/7csFStuOmR782YmTthKBJ9ND3WVL60hcOjvtGFb+HJxH4O5huAcmcZ9v9G8P+JETiZ/G1B8MALnWZQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@eslint-community/regexpp": "^4.12.2",+ "@typescript-eslint/scope-manager": "8.54.0",+ "@typescript-eslint/type-utils": "8.54.0",+ "@typescript-eslint/utils": "8.54.0",+ "@typescript-eslint/visitor-keys": "8.54.0",+ "ignore": "^7.0.5",+ "natural-compare": "^1.4.0",+ "ts-api-utils": "^2.4.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "@typescript-eslint/parser": "^8.54.0",+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {+ "version": "7.0.5",+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",+ "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/@typescript-eslint/parser": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.54.0.tgz",+ "integrity": "sha512-BtE0k6cjwjLZoZixN0t5AKP0kSzlGu7FctRXYuPAm//aaiZhmfq1JwdYpYr1brzEspYyFeF+8XF5j2VK6oalrA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@typescript-eslint/scope-manager": "8.54.0",+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/typescript-estree": "8.54.0",+ "@typescript-eslint/visitor-keys": "8.54.0",+ "debug": "^4.4.3"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/project-service": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.54.0.tgz",+ "integrity": "sha512-YPf+rvJ1s7MyiWM4uTRhE4DvBXrEV+d8oC3P9Y2eT7S+HBS0clybdMIPnhiATi9vZOYDc7OQ1L/i6ga6NFYK/g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/tsconfig-utils": "^8.54.0",+ "@typescript-eslint/types": "^8.54.0",+ "debug": "^4.4.3"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/scope-manager": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.54.0.tgz",+ "integrity": "sha512-27rYVQku26j/PbHYcVfRPonmOlVI6gihHtXFbTdB5sb6qA0wdAQAbyXFVarQ5t4HRojIz64IV90YtsjQSSGlQg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/visitor-keys": "8.54.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@typescript-eslint/tsconfig-utils": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.54.0.tgz",+ "integrity": "sha512-dRgOyT2hPk/JwxNMZDsIXDgyl9axdJI3ogZ2XWhBPsnZUv+hPesa5iuhdYt2gzwA9t8RE5ytOJ6xB0moV0Ujvw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/type-utils": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.54.0.tgz",+ "integrity": "sha512-hiLguxJWHjjwL6xMBwD903ciAwd7DmK30Y9Axs/etOkftC3ZNN9K44IuRD/EB08amu+Zw6W37x9RecLkOo3pMA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/typescript-estree": "8.54.0",+ "@typescript-eslint/utils": "8.54.0",+ "debug": "^4.4.3",+ "ts-api-utils": "^2.4.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/types": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.54.0.tgz",+ "integrity": "sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.54.0.tgz",+ "integrity": "sha512-BUwcskRaPvTk6fzVWgDPdUndLjB87KYDrN5EYGetnktoeAvPtO4ONHlAZDnj5VFnUANg0Sjm7j4usBlnoVMHwA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/project-service": "8.54.0",+ "@typescript-eslint/tsconfig-utils": "8.54.0",+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/visitor-keys": "8.54.0",+ "debug": "^4.4.3",+ "minimatch": "^9.0.5",+ "semver": "^7.7.3",+ "tinyglobby": "^0.2.15",+ "ts-api-utils": "^2.4.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {+ "version": "9.0.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {+ "version": "7.7.3",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",+ "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/@typescript-eslint/utils": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.54.0.tgz",+ "integrity": "sha512-9Cnda8GS57AQakvRyG0PTejJNlA2xhvyNtEVIMlDWOOeEyBkYWhGPnfrIAnqxLMTSTo6q8g12XVjjev5l1NvMA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@eslint-community/eslint-utils": "^4.9.1",+ "@typescript-eslint/scope-manager": "8.54.0",+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/typescript-estree": "8.54.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/visitor-keys": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.54.0.tgz",+ "integrity": "sha512-VFlhGSl4opC0bprJiItPQ1RfUhGDIBokcPwaFH4yiBCaNPeld/9VeXbiPO1cLyorQi1G1vL+ecBk1x8o1axORA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.54.0",+ "eslint-visitor-keys": "^4.2.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@vitejs/plugin-react": {+ "version": "5.1.3",+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.3.tgz",+ "integrity": "sha512-NVUnA6gQCl8jfoYqKqQU5Clv0aPw14KkZYCsX6T9Lfu9slI0LOU10OTwFHS/WmptsMMpshNd/1tuWsHQ2Uk+cg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/core": "^7.29.0",+ "@babel/plugin-transform-react-jsx-self": "^7.27.1",+ "@babel/plugin-transform-react-jsx-source": "^7.27.1",+ "@rolldown/pluginutils": "1.0.0-rc.2",+ "@types/babel__core": "^7.20.5",+ "react-refresh": "^0.18.0"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "peerDependencies": {+ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"+ }+ },+ "node_modules/acorn": {+ "version": "8.15.0",+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",+ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "bin": {+ "acorn": "bin/acorn"+ },+ "engines": {+ "node": ">=0.4.0"+ }+ },+ "node_modules/acorn-jsx": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",+ "dev": true,+ "license": "MIT",+ "peerDependencies": {+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"+ }+ },+ "node_modules/ajv": {+ "version": "6.12.6",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-deep-equal": "^3.1.1",+ "fast-json-stable-stringify": "^2.0.0",+ "json-schema-traverse": "^0.4.1",+ "uri-js": "^4.2.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/ansi-styles": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "color-convert": "^2.0.1"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/argparse": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",+ "dev": true,+ "license": "Python-2.0"+ },+ "node_modules/balanced-match": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/baseline-browser-mapping": {+ "version": "2.9.19",+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz",+ "integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "baseline-browser-mapping": "dist/cli.js"+ }+ },+ "node_modules/brace-expansion": {+ "version": "1.1.12",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0",+ "concat-map": "0.0.1"+ }+ },+ "node_modules/browserslist": {+ "version": "4.28.1",+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",+ "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/browserslist"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "baseline-browser-mapping": "^2.9.0",+ "caniuse-lite": "^1.0.30001759",+ "electron-to-chromium": "^1.5.263",+ "node-releases": "^2.0.27",+ "update-browserslist-db": "^1.2.0"+ },+ "bin": {+ "browserslist": "cli.js"+ },+ "engines": {+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"+ }+ },+ "node_modules/callsites": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/caniuse-lite": {+ "version": "1.0.30001767",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001767.tgz",+ "integrity": "sha512-34+zUAMhSH+r+9eKmYG+k2Rpt8XttfE4yXAjoZvkAPs15xcYQhyBYdalJ65BzivAvGRMViEjy6oKr/S91loekQ==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "CC-BY-4.0"+ },+ "node_modules/chalk": {+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.1.0",+ "supports-color": "^7.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/chalk?sponsor=1"+ }+ },+ "node_modules/color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "color-name": "~1.1.4"+ },+ "engines": {+ "node": ">=7.0.0"+ }+ },+ "node_modules/color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/concat-map": {+ "version": "0.0.1",+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/convert-source-map": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/cookie": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/cross-spawn": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.1.0",+ "shebang-command": "^2.0.0",+ "which": "^2.0.1"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/csstype": {+ "version": "3.2.3",+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",+ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/debug": {+ "version": "4.4.3",+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",+ "license": "MIT",+ "dependencies": {+ "ms": "^2.1.3"+ },+ "engines": {+ "node": ">=6.0"+ },+ "peerDependenciesMeta": {+ "supports-color": {+ "optional": true+ }+ }+ },+ "node_modules/deep-is": {+ "version": "0.1.4",+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/electron-to-chromium": {+ "version": "1.5.283",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.283.tgz",+ "integrity": "sha512-3vifjt1HgrGW/h76UEeny+adYApveS9dH2h3p57JYzBSXJIKUJAvtmIytDKjcSCt9xHfrNCFJ7gts6vkhuq++w==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/engine.io-client": {+ "version": "6.6.4",+ "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.4.tgz",+ "integrity": "sha512-+kjUJnZGwzewFDw951CDWcwj35vMNf2fcj7xQWOctq1F2i1jkDdVvdFG9kM/BEChymCH36KgjnW0NsL58JYRxw==",+ "license": "MIT",+ "dependencies": {+ "@socket.io/component-emitter": "~3.1.0",+ "debug": "~4.4.1",+ "engine.io-parser": "~5.2.1",+ "ws": "~8.18.3",+ "xmlhttprequest-ssl": "~2.1.1"+ }+ },+ "node_modules/engine.io-parser": {+ "version": "5.2.3",+ "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz",+ "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==",+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/esbuild": {+ "version": "0.27.2",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz",+ "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.27.2",+ "@esbuild/android-arm": "0.27.2",+ "@esbuild/android-arm64": "0.27.2",+ "@esbuild/android-x64": "0.27.2",+ "@esbuild/darwin-arm64": "0.27.2",+ "@esbuild/darwin-x64": "0.27.2",+ "@esbuild/freebsd-arm64": "0.27.2",+ "@esbuild/freebsd-x64": "0.27.2",+ "@esbuild/linux-arm": "0.27.2",+ "@esbuild/linux-arm64": "0.27.2",+ "@esbuild/linux-ia32": "0.27.2",+ "@esbuild/linux-loong64": "0.27.2",+ "@esbuild/linux-mips64el": "0.27.2",+ "@esbuild/linux-ppc64": "0.27.2",+ "@esbuild/linux-riscv64": "0.27.2",+ "@esbuild/linux-s390x": "0.27.2",+ "@esbuild/linux-x64": "0.27.2",+ "@esbuild/netbsd-arm64": "0.27.2",+ "@esbuild/netbsd-x64": "0.27.2",+ "@esbuild/openbsd-arm64": "0.27.2",+ "@esbuild/openbsd-x64": "0.27.2",+ "@esbuild/openharmony-arm64": "0.27.2",+ "@esbuild/sunos-x64": "0.27.2",+ "@esbuild/win32-arm64": "0.27.2",+ "@esbuild/win32-ia32": "0.27.2",+ "@esbuild/win32-x64": "0.27.2"+ }+ },+ "node_modules/escalade": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/escape-string-regexp": {+ "version": "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/eslint": {+ "version": "9.39.2",+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz",+ "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@eslint-community/eslint-utils": "^4.8.0",+ "@eslint-community/regexpp": "^4.12.1",+ "@eslint/config-array": "^0.21.1",+ "@eslint/config-helpers": "^0.4.2",+ "@eslint/core": "^0.17.0",+ "@eslint/eslintrc": "^3.3.1",+ "@eslint/js": "9.39.2",+ "@eslint/plugin-kit": "^0.4.1",+ "@humanfs/node": "^0.16.6",+ "@humanwhocodes/module-importer": "^1.0.1",+ "@humanwhocodes/retry": "^0.4.2",+ "@types/estree": "^1.0.6",+ "ajv": "^6.12.4",+ "chalk": "^4.0.0",+ "cross-spawn": "^7.0.6",+ "debug": "^4.3.2",+ "escape-string-regexp": "^4.0.0",+ "eslint-scope": "^8.4.0",+ "eslint-visitor-keys": "^4.2.1",+ "espree": "^10.4.0",+ "esquery": "^1.5.0",+ "esutils": "^2.0.2",+ "fast-deep-equal": "^3.1.3",+ "file-entry-cache": "^8.0.0",+ "find-up": "^5.0.0",+ "glob-parent": "^6.0.2",+ "ignore": "^5.2.0",+ "imurmurhash": "^0.1.4",+ "is-glob": "^4.0.0",+ "json-stable-stringify-without-jsonify": "^1.0.1",+ "lodash.merge": "^4.6.2",+ "minimatch": "^3.1.2",+ "natural-compare": "^1.4.0",+ "optionator": "^0.9.3"+ },+ "bin": {+ "eslint": "bin/eslint.js"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://eslint.org/donate"+ },+ "peerDependencies": {+ "jiti": "*"+ },+ "peerDependenciesMeta": {+ "jiti": {+ "optional": true+ }+ }+ },+ "node_modules/eslint-plugin-react-hooks": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz",+ "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/core": "^7.24.4",+ "@babel/parser": "^7.24.4",+ "hermes-parser": "^0.25.1",+ "zod": "^3.25.0 || ^4.0.0",+ "zod-validation-error": "^3.5.0 || ^4.0.0"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0"+ }+ },+ "node_modules/eslint-plugin-react-refresh": {+ "version": "0.4.26",+ "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.26.tgz",+ "integrity": "sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ==",+ "dev": true,+ "license": "MIT",+ "peerDependencies": {+ "eslint": ">=8.40"+ }+ },+ "node_modules/eslint-scope": {+ "version": "8.4.0",+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",+ "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "esrecurse": "^4.3.0",+ "estraverse": "^5.2.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/eslint-visitor-keys": {+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/espree": {+ "version": "10.4.0",+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "acorn": "^8.15.0",+ "acorn-jsx": "^5.3.2",+ "eslint-visitor-keys": "^4.2.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/esquery": {+ "version": "1.7.0",+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",+ "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "estraverse": "^5.1.0"+ },+ "engines": {+ "node": ">=0.10"+ }+ },+ "node_modules/esrecurse": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "estraverse": "^5.2.0"+ },+ "engines": {+ "node": ">=4.0"+ }+ },+ "node_modules/estraverse": {+ "version": "5.3.0",+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",+ "dev": true,+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=4.0"+ }+ },+ "node_modules/esutils": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",+ "dev": true,+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/fast-deep-equal": {+ "version": "3.1.3",+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/fast-json-stable-stringify": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/fast-levenshtein": {+ "version": "2.0.6",+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",+ "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/file-entry-cache": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",+ "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "flat-cache": "^4.0.0"+ },+ "engines": {+ "node": ">=16.0.0"+ }+ },+ "node_modules/find-up": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "locate-path": "^6.0.0",+ "path-exists": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/flat-cache": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",+ "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "flatted": "^3.2.9",+ "keyv": "^4.5.4"+ },+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/flatted": {+ "version": "3.3.3",+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",+ "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",+ "dev": true,+ "license": "ISC"+ },+ "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/gensync": {+ "version": "1.0.0-beta.2",+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/glob-parent": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "is-glob": "^4.0.3"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/globals": {+ "version": "16.5.0",+ "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz",+ "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/has-flag": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/hermes-estree": {+ "version": "0.25.1",+ "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz",+ "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/hermes-parser": {+ "version": "0.25.1",+ "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz",+ "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "hermes-estree": "0.25.1"+ }+ },+ "node_modules/ignore": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",+ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/import-fresh": {+ "version": "3.3.1",+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "parent-module": "^1.0.0",+ "resolve-from": "^4.0.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/imurmurhash": {+ "version": "0.1.4",+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.8.19"+ }+ },+ "node_modules/is-extglob": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/is-glob": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "is-extglob": "^2.1.1"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/isexe": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/js-tokens": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/js-yaml": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",+ "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "argparse": "^2.0.1"+ },+ "bin": {+ "js-yaml": "bin/js-yaml.js"+ }+ },+ "node_modules/jsesc": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "jsesc": "bin/jsesc"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/json-buffer": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/json-schema-traverse": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/json-stable-stringify-without-jsonify": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/json5": {+ "version": "2.2.3",+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "json5": "lib/cli.js"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/keyv": {+ "version": "4.5.4",+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",+ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "json-buffer": "3.0.1"+ }+ },+ "node_modules/levn": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "prelude-ls": "^1.2.1",+ "type-check": "~0.4.0"+ },+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "node_modules/locate-path": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-locate": "^5.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/lodash.merge": {+ "version": "4.6.2",+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/lru-cache": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "yallist": "^3.0.2"+ }+ },+ "node_modules/lucide-react": {+ "version": "0.563.0",+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.563.0.tgz",+ "integrity": "sha512-8dXPB2GI4dI8jV4MgUDGBeLdGk8ekfqVZ0BdLcrRzocGgG75ltNEmWS+gE7uokKF/0oSUuczNDT+g9hFJ23FkA==",+ "license": "ISC",+ "peerDependencies": {+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"+ }+ },+ "node_modules/minimatch": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^1.1.7"+ },+ "engines": {+ "node": "*"+ }+ },+ "node_modules/ms": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",+ "license": "MIT"+ },+ "node_modules/nanoid": {+ "version": "3.3.11",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",+ "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",+ "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/natural-compare": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/node-releases": {+ "version": "2.0.27",+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",+ "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/optionator": {+ "version": "0.9.4",+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",+ "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "deep-is": "^0.1.3",+ "fast-levenshtein": "^2.0.6",+ "levn": "^0.4.1",+ "prelude-ls": "^1.2.1",+ "type-check": "^0.4.0",+ "word-wrap": "^1.2.5"+ },+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "node_modules/p-limit": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "yocto-queue": "^0.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-locate": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-limit": "^3.0.2"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/parent-module": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "callsites": "^3.0.0"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/path-exists": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/path-key": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "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.3",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.6",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",+ "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",+ "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.11",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.1"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/prelude-ls": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "node_modules/punycode": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/react": {+ "version": "19.2.4",+ "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz",+ "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/react-dom": {+ "version": "19.2.4",+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",+ "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "scheduler": "^0.27.0"+ },+ "peerDependencies": {+ "react": "^19.2.4"+ }+ },+ "node_modules/react-refresh": {+ "version": "0.18.0",+ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz",+ "integrity": "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/react-router": {+ "version": "7.13.0",+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.0.tgz",+ "integrity": "sha512-PZgus8ETambRT17BUm/LL8lX3Of+oiLaPuVTRH3l1eLvSPpKO3AvhAEb5N7ihAFZQrYDqkvvWfFh9p0z9VsjLw==",+ "license": "MIT",+ "dependencies": {+ "cookie": "^1.0.1",+ "set-cookie-parser": "^2.6.0"+ },+ "engines": {+ "node": ">=20.0.0"+ },+ "peerDependencies": {+ "react": ">=18",+ "react-dom": ">=18"+ },+ "peerDependenciesMeta": {+ "react-dom": {+ "optional": true+ }+ }+ },+ "node_modules/react-router-dom": {+ "version": "7.13.0",+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.13.0.tgz",+ "integrity": "sha512-5CO/l5Yahi2SKC6rGZ+HDEjpjkGaG/ncEP7eWFTvFxbHP8yeeI0PxTDjimtpXYlR3b3i9/WIL4VJttPrESIf2g==",+ "license": "MIT",+ "dependencies": {+ "react-router": "7.13.0"+ },+ "engines": {+ "node": ">=20.0.0"+ },+ "peerDependencies": {+ "react": ">=18",+ "react-dom": ">=18"+ }+ },+ "node_modules/resolve-from": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/rollup": {+ "version": "4.57.1",+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz",+ "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/estree": "1.0.8"+ },+ "bin": {+ "rollup": "dist/bin/rollup"+ },+ "engines": {+ "node": ">=18.0.0",+ "npm": ">=8.0.0"+ },+ "optionalDependencies": {+ "@rollup/rollup-android-arm-eabi": "4.57.1",+ "@rollup/rollup-android-arm64": "4.57.1",+ "@rollup/rollup-darwin-arm64": "4.57.1",+ "@rollup/rollup-darwin-x64": "4.57.1",+ "@rollup/rollup-freebsd-arm64": "4.57.1",+ "@rollup/rollup-freebsd-x64": "4.57.1",+ "@rollup/rollup-linux-arm-gnueabihf": "4.57.1",+ "@rollup/rollup-linux-arm-musleabihf": "4.57.1",+ "@rollup/rollup-linux-arm64-gnu": "4.57.1",+ "@rollup/rollup-linux-arm64-musl": "4.57.1",+ "@rollup/rollup-linux-loong64-gnu": "4.57.1",+ "@rollup/rollup-linux-loong64-musl": "4.57.1",+ "@rollup/rollup-linux-ppc64-gnu": "4.57.1",+ "@rollup/rollup-linux-ppc64-musl": "4.57.1",+ "@rollup/rollup-linux-riscv64-gnu": "4.57.1",+ "@rollup/rollup-linux-riscv64-musl": "4.57.1",+ "@rollup/rollup-linux-s390x-gnu": "4.57.1",+ "@rollup/rollup-linux-x64-gnu": "4.57.1",+ "@rollup/rollup-linux-x64-musl": "4.57.1",+ "@rollup/rollup-openbsd-x64": "4.57.1",+ "@rollup/rollup-openharmony-arm64": "4.57.1",+ "@rollup/rollup-win32-arm64-msvc": "4.57.1",+ "@rollup/rollup-win32-ia32-msvc": "4.57.1",+ "@rollup/rollup-win32-x64-gnu": "4.57.1",+ "@rollup/rollup-win32-x64-msvc": "4.57.1",+ "fsevents": "~2.3.2"+ }+ },+ "node_modules/scheduler": {+ "version": "0.27.0",+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",+ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",+ "license": "MIT"+ },+ "node_modules/semver": {+ "version": "6.3.1",+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ }+ },+ "node_modules/set-cookie-parser": {+ "version": "2.7.2",+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",+ "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",+ "license": "MIT"+ },+ "node_modules/shebang-command": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "shebang-regex": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/shebang-regex": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/socket.io-client": {+ "version": "4.8.3",+ "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.3.tgz",+ "integrity": "sha512-uP0bpjWrjQmUt5DTHq9RuoCBdFJF10cdX9X+a368j/Ft0wmaVgxlrjvK3kjvgCODOMMOz9lcaRzxmso0bTWZ/g==",+ "license": "MIT",+ "dependencies": {+ "@socket.io/component-emitter": "~3.1.0",+ "debug": "~4.4.1",+ "engine.io-client": "~6.6.1",+ "socket.io-parser": "~4.2.4"+ },+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/socket.io-parser": {+ "version": "4.2.5",+ "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.5.tgz",+ "integrity": "sha512-bPMmpy/5WWKHea5Y/jYAP6k74A+hvmRCQaJuJB6I/ML5JZq/KfNieUVo/3Mh7SAqn7TyFdIo6wqYHInG1MU1bQ==",+ "license": "MIT",+ "dependencies": {+ "@socket.io/component-emitter": "~3.1.0",+ "debug": "~4.4.1"+ },+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/source-map-js": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/strip-json-comments": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/supports-color": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "has-flag": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.15",+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",+ "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.3"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/ts-api-utils": {+ "version": "2.4.0",+ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz",+ "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18.12"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4"+ }+ },+ "node_modules/type-check": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "prelude-ls": "^1.2.1"+ },+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "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",+ "peer": true,+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/typescript-eslint": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.54.0.tgz",+ "integrity": "sha512-CKsJ+g53QpsNPqbzUsfKVgd3Lny4yKZ1pP4qN3jdMOg/sisIDLGyDMezycquXLE5JsEU0wp3dGNdzig0/fmSVQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/eslint-plugin": "8.54.0",+ "@typescript-eslint/parser": "8.54.0",+ "@typescript-eslint/typescript-estree": "8.54.0",+ "@typescript-eslint/utils": "8.54.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/undici-types": {+ "version": "7.16.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",+ "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/update-browserslist-db": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",+ "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/browserslist"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "escalade": "^3.2.0",+ "picocolors": "^1.1.1"+ },+ "bin": {+ "update-browserslist-db": "cli.js"+ },+ "peerDependencies": {+ "browserslist": ">= 4.21.0"+ }+ },+ "node_modules/uri-js": {+ "version": "4.4.1",+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "punycode": "^2.1.0"+ }+ },+ "node_modules/vite": {+ "version": "7.3.1",+ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz",+ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "esbuild": "^0.27.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/which": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "isexe": "^2.0.0"+ },+ "bin": {+ "node-which": "bin/node-which"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/word-wrap": {+ "version": "1.2.5",+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",+ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/ws": {+ "version": "8.18.3",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",+ "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",+ "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/xmlhttprequest-ssl": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.1.2.tgz",+ "integrity": "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==",+ "engines": {+ "node": ">=0.4.0"+ }+ },+ "node_modules/yallist": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/yocto-queue": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/zod": {+ "version": "4.3.6",+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",+ "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "funding": {+ "url": "https://github.com/sponsors/colinhacks"+ }+ },+ "node_modules/zod-validation-error": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz",+ "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18.0.0"+ },+ "peerDependencies": {+ "zod": "^3.25.0 || ^4.0.0"+ }+ }+ }+}diff --git a/dashboard/package.json b/dashboard/package.jsonnew file mode 100644index 000000000..6b703cd0a--- /dev/null+++ b/dashboard/package.json@@ -0,0 +1,35 @@+{+ "name": "dashboard",+ "private": true,+ "version": "0.1.0",+ "type": "module",+ "scripts": {+ "dev": "vite",+ "build": "tsc -b && vite build",+ "lint": "eslint .",+ "preview": "vite preview"+ },+ "dependencies": {+ "@tanstack/react-query": "^5.90.20",+ "@tanstack/react-table": "^8.21.3",+ "lucide-react": "^0.563.0",+ "react": "^19.2.0",+ "react-dom": "^19.2.0",+ "react-router-dom": "^7.13.0",+ "socket.io-client": "^4.8.3"+ },+ "devDependencies": {+ "@eslint/js": "^9.39.1",+ "@types/node": "^24.10.1",+ "@types/react": "^19.2.5",+ "@types/react-dom": "^19.2.3",+ "@vitejs/plugin-react": "^5.1.1",+ "eslint": "^9.39.1",+ "eslint-plugin-react-hooks": "^7.0.1",+ "eslint-plugin-react-refresh": "^0.4.24",+ "globals": "^16.5.0",+ "typescript": "~5.9.3",+ "typescript-eslint": "^8.46.4",+ "vite": "^7.2.4"+ }+}\ No newline at end of filediff --git a/dashboard/public/favicon.svg b/dashboard/public/favicon.svgnew file mode 100644index 000000000..408772705--- /dev/null+++ b/dashboard/public/favicon.svg@@ -0,0 +1,278 @@+<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 1024 1022">+<g transform="translate(0,1022) scale(0.1,-0.1)"+fill="#4ade80" stroke="none">+<path d="M4765 10140 c-77 -4 -171 -13 -210 -19 -38 -6 -92 -11 -118 -11 -65+0 -390 -62 -512 -97 -27 -8 -75 -21 -105 -28 -152 -37 -311 -84 -325 -96 -5+-5 -17 -9 -27 -9 -9 0 -37 -9 -60 -19 -24 -10 -70 -29 -103 -41 -61 -22 -128+-51 -178 -76 -16 -8 -34 -14 -40 -14 -21 0 -473 -232 -502 -258 -6 -5 -15 -11+-20 -13 -29 -12 -253 -154 -282 -179 -7 -5 -17 -10 -22 -10 -6 0 -14 -6 -18+-13 -4 -6 -33 -28 -63 -48 -30 -20 -102 -74 -160 -120 -114 -91 -111 -88 -185+-155 -27 -25 -70 -62 -95 -82 -45 -37 -309 -299 -365 -362 -16 -19 -54 -64+-84 -100 -29 -36 -56 -67 -60 -70 -17 -13 -131 -160 -131 -169 0 -5 -6 -14+-13 -18 -12 -7 -73 -88 -102 -135 -5 -9 -25 -37 -42 -62 -18 -26 -33 -49 -33+-52 0 -5 -52 -87 -61 -94 -3 -3 -8 -12 -12 -20 -4 -8 -18 -33 -32 -55 -14 -22+-32 -55 -41 -74 -8 -18 -27 -52 -42 -75 -14 -22 -49 -86 -77 -141 -29 -55 -57+-109 -62 -120 -20 -36 -152 -354 -183 -440 -12 -33 -26 -71 -32 -85 -34 -84+-99 -309 -133 -460 -7 -30 -20 -84 -28 -120 -29 -117 -50 -224 -57 -285 -4+-33 -15 -112 -23 -175 -24 -167 -47 -494 -47 -648 0 -114 7 -229 34 -548 2+-29 11 -92 20 -140 8 -49 19 -118 25 -154 27 -180 155 -679 202 -785 5 -11 24+-58 43 -105 18 -47 46 -114 61 -150 15 -36 36 -87 47 -115 11 -27 28 -68 38+-90 59 -133 66 -185 36 -299 -13 -50 -28 -102 -34 -116 -16 -40 -62 -188 -62+-201 0 -6 -6 -25 -14 -42 -19 -46 -96 -282 -96 -298 -1 -8 -9 -32 -20 -54 -11+-22 -19 -49 -20 -61 0 -11 -4 -24 -9 -30 -5 -5 -19 -43 -31 -84 -11 -41 -27+-95 -35 -120 -7 -25 -22 -74 -33 -110 -22 -72 -36 -112 -64 -182 -10 -26 -18+-55 -18 -66 0 -11 -7 -37 -16 -57 -58 -139 -57 -449 2 -583 110 -252 223 -388+399 -482 33 -17 64 -36 70 -41 5 -5 16 -9 25 -9 8 0 28 -7 44 -15 16 -9 46+-20 65 -24 20 -5 63 -16 96 -25 40 -11 101 -16 186 -16 108 0 142 4 240 30 63+16 134 35 159 41 76 20 183 50 225 64 22 7 76 23 120 35 44 12 103 30 130 40+28 10 88 28 135 40 47 12 108 30 135 40 28 9 73 23 100 30 28 7 73 19 100 27+28 8 79 23 115 33 36 10 79 22 95 28 75 26 165 51 227 62 78 14 182 1 245 -31+20 -10 44 -19 53 -19 9 0 25 -7 37 -15 11 -8 56 -26 99 -40 44 -14 93 -32 111+-40 17 -8 35 -15 40 -15 6 0 24 -7 41 -15 17 -9 52 -22 79 -29 26 -8 107 -32+178 -55 120 -38 204 -59 435 -111 152 -33 251 -51 334 -60 44 -5 140 -16 211+-24 180 -21 741 -21 920 0 72 8 173 19 225 24 53 5 109 14 125 20 16 6 63 15+104 20 42 6 99 16 126 24 28 8 95 24 150 36 55 13 117 29 138 36 20 8 46 14+56 14 10 0 40 9 67 19 27 11 94 33 149 51 55 17 104 36 110 41 5 5 19 9 32 9+13 0 31 4 41 10 27 16 134 60 144 60 15 0 277 127 503 244 53 27 108 60 141+83 11 9 47 30 79 47 38 21 213 135 231 151 6 6 22 17 34 25 36 24 94 68 111+85 9 8 21 15 27 15 5 0 12 4 14 8 2 4 30 28 63 54 57 43 72 56 155 132 19 17+55 48 80 68 50 40 179 167 310 304 105 111 126 135 265 309 119 150 167 215+248 339 6 10 21 31 33 45 19 24 99 156 138 226 9 17 28 48 41 70 14 22 37 65+52 95 16 30 30 57 33 60 11 10 140 288 140 301 0 6 6 23 14 37 8 15 27 59 41+97 32 86 47 125 74 192 12 28 21 58 21 66 0 8 9 36 19 63 10 27 27 78 36 114+10 36 26 92 36 125 10 33 27 103 38 155 11 52 28 129 37 170 9 41 20 102 24+135 4 33 14 105 23 160 57 355 57 1015 0 1345 -8 47 -19 119 -24 160 -5 41+-14 86 -19 100 -5 14 -13 52 -18 85 -5 33 -17 92 -27 130 -9 39 -26 106 -37+150 -45 176 -108 372 -149 463 -10 23 -19 48 -19 55 -1 6 -9 30 -20 52 -11 22+-20 47 -20 55 0 8 -7 24 -15 34 -8 11 -15 26 -15 33 0 8 -29 75 -65 148 -36+74 -65 139 -65 144 0 5 -3 11 -7 13 -5 2 -20 28 -36 58 -31 64 -29 60 -143+250 -81 135 -148 242 -167 265 -10 12 -92 128 -143 203 -21 30 -43 56 -51 59+-7 3 -13 11 -13 19 0 7 -6 17 -12 21 -7 4 -42 44 -78 88 -104 128 -303 333+-478 494 -106 96 -351 294 -432 348 -30 20 -57 39 -60 42 -3 3 -12 11 -21 16+-9 6 -36 23 -60 40 -56 38 -69 46 -110 69 -19 10 -36 22 -39 25 -5 6 -27 19+-80 48 -14 8 -45 27 -70 43 -25 16 -88 51 -140 78 -52 26 -104 53 -115 60 -22+12 -184 87 -230 106 -16 7 -51 23 -76 35 -25 11 -52 21 -60 21 -8 0 -22 7 -31+14 -10 7 -57 25 -105 41 -49 15 -97 31 -108 36 -30 13 -160 54 -245 77 -318+86 -550 130 -816 157 -188 19 -719 27 -929 15z m922 -240 c256 -35 497 -79+628 -115 204 -57 305 -88 377 -116 26 -11 53 -19 60 -19 8 0 33 -9 56 -20 22+-11 45 -20 51 -20 17 0 259 -109 395 -177 139 -70 156 -79 231 -124 28 -16 62+-34 78 -40 15 -6 27 -15 27 -20 0 -5 5 -9 10 -9 6 0 37 -17 68 -38 133 -89+290 -199 337 -234 28 -21 61 -46 73 -55 13 -10 31 -25 40 -33 10 -9 55 -47+102 -85 127 -105 321 -291 429 -412 219 -243 276 -314 398 -493 21 -30 41 -56+45 -58 5 -2 8 -7 8 -12 0 -4 26 -48 58 -96 33 -49 72 -111 88 -137 16 -27 39+-65 51 -85 46 -76 263 -523 263 -542 0 -5 9 -24 20 -42 11 -18 20 -39 20 -46+0 -8 6 -28 14 -45 8 -18 24 -63 36 -102 13 -38 31 -89 41 -113 11 -23 19 -51+19 -61 0 -10 7 -35 15 -56 9 -20 20 -55 25 -78 5 -23 21 -85 35 -137 60 -217+106 -512 131 -828 25 -313 11 -709 -33 -997 -9 -55 -19 -125 -24 -155 -4 -30+-17 -95 -28 -145 -11 -49 -27 -124 -36 -165 -19 -91 -37 -154 -82 -285 -19+-55 -38 -113 -43 -130 -12 -41 -84 -241 -105 -290 -14 -34 -116 -248 -159+-335 -14 -27 -34 -67 -48 -90 -4 -8 -14 -26 -21 -40 -7 -14 -36 -65 -65 -113+-28 -48 -52 -92 -52 -97 0 -6 -4 -10 -8 -10 -5 0 -19 -19 -33 -41 -13 -23 -31+-51 -39 -64 -8 -12 -42 -62 -74 -111 -32 -49 -63 -90 -67 -92 -5 -2 -9 -10 -9+-17 0 -8 -6 -18 -13 -22 -7 -4 -39 -42 -69 -84 -31 -42 -67 -87 -81 -100 -13+-13 -46 -51 -73 -84 -112 -137 -307 -332 -479 -480 -44 -38 -87 -76 -95 -84+-8 -8 -51 -41 -95 -74 -44 -32 -81 -63 -83 -68 -2 -5 -8 -9 -14 -9 -11 0 -91+-60 -96 -72 -2 -5 -10 -8 -17 -8 -8 0 -18 -6 -22 -12 -10 -16 -69 -58 -81 -58+-5 0 -16 -7 -23 -16 -7 -9 -22 -20 -34 -25 -11 -5 -40 -23 -65 -39 -25 -16+-58 -36 -75 -44 -16 -8 -57 -30 -90 -49 -190 -108 -308 -169 -390 -202 -38+-16 -74 -32 -80 -37 -5 -4 -15 -8 -23 -8 -14 0 -57 -18 -145 -61 -22 -11 -43+-19 -48 -19 -5 0 -48 -15 -97 -33 -110 -42 -189 -67 -422 -131 -133 -36 -374+-81 -595 -111 -359 -49 -963 -37 -1295 26 -30 6 -91 17 -135 24 -128 22 -365+80 -398 97 -10 5 -39 13 -65 18 -44 8 -159 43 -192 59 -8 4 -49 18 -90 31 -41+12 -100 34 -130 47 -30 14 -68 31 -85 38 -16 7 -48 21 -70 30 -122 53 -195 67+-350 67 -127 0 -160 -3 -214 -21 -35 -11 -71 -21 -80 -21 -9 0 -43 -9 -76 -20+-33 -10 -91 -28 -130 -40 -38 -11 -99 -29 -135 -39 -36 -11 -92 -27 -125 -36+-33 -9 -83 -25 -110 -36 -28 -10 -58 -19 -66 -19 -9 0 -34 -7 -55 -16 -37 -16+-81 -29 -204 -59 -50 -13 -166 -45 -280 -79 -25 -7 -79 -23 -121 -34 -41 -12+-88 -26 -103 -32 -15 -5 -82 -10 -149 -10 -103 0 -134 4 -202 26 -129 41 -219+96 -315 193 -80 81 -107 122 -153 231 -56 134 -51 332 13 495 4 11 24 74 45+140 21 66 53 167 73 225 19 58 39 121 43 140 8 35 44 147 59 185 5 11 18 54+31 95 12 41 28 89 35 105 7 17 18 53 24 80 6 27 15 54 20 60 4 5 11 28 15 50+4 22 16 58 25 80 10 22 23 60 30 85 6 25 18 70 26 100 46 165 46 249 1 406+-12 44 -28 82 -92 219 -27 58 -57 130 -65 155 -5 14 -18 50 -30 80 -30 78 -80+227 -80 241 0 6 -6 25 -14 42 -13 29 -32 94 -73 247 -15 59 -34 160 -53 280+-6 41 -18 109 -26 150 -68 356 -71 923 -7 1320 8 52 19 124 24 160 11 85 33+188 70 335 17 66 34 136 39 155 4 19 13 49 19 65 6 17 38 113 72 215 33 102+69 205 81 230 11 25 26 59 33 75 8 17 34 74 59 128 25 54 46 100 46 102 0 11+107 216 146 282 10 17 35 57 54 89 19 32 42 71 51 86 9 15 22 35 29 43 7 8 20+28 29 44 38 67 100 158 161 236 36 46 75 96 87 112 12 15 30 37 40 48 10 11+43 49 73 85 95 112 111 130 271 290 85 86 196 189 245 230 49 41 94 80 99 86+10 11 75 60 201 152 166 122 224 162 232 162 5 0 17 9 27 20 10 11 23 20 29+20 6 0 43 21 81 45 39 25 88 54 110 65 22 11 58 31 80 44 22 14 78 44 125 66+97 48 107 53 135 67 37 19 110 51 165 73 30 12 69 28 85 35 17 6 46 19 65 27+19 8 76 27 125 42 50 16 112 37 139 47 27 11 55 19 64 19 8 0 40 9 71 19 203+69 703 158 971 172 244 13 731 2 897 -21z"/>+<path d="M4880 9440 c-144 -10 -352 -30 -370 -35 -8 -3 -60 -11 -115 -20 -169+-26 -258 -43 -304 -59 -24 -9 -51 -16 -60 -16 -17 0 -121 -30 -206 -60 -27+-10 -86 -28 -130 -40 -44 -12 -84 -26 -90 -30 -5 -4 -34 -15 -62 -24 -29 -10+-53 -22 -53 -27 0 -5 -9 -9 -20 -9 -11 0 -41 -10 -67 -21 -45 -20 -56 -25+-100 -48 -10 -5 -74 -36 -143 -70 -141 -69 -180 -91 -357 -200 -48 -30 -109+-70 -135 -90 -26 -20 -71 -52 -99 -71 -28 -19 -58 -42 -68 -50 -9 -9 -34 -28+-56 -43 -22 -14 -58 -43 -80 -63 -22 -19 -65 -56 -95 -82 -120 -101 -420 -412+-501 -517 -13 -16 -26 -32 -29 -35 -32 -29 -260 -352 -260 -369 0 -5 -4 -11+-9 -13 -11 -4 -45 -60 -67 -110 -9 -21 -20 -38 -25 -38 -5 0 -9 -9 -9 -20 0+-11 -4 -20 -9 -20 -5 0 -54 -91 -109 -202 -124 -251 -163 -342 -213 -503 -12+-38 -25 -77 -29 -85 -4 -9 -11 -31 -14 -50 -4 -19 -16 -57 -26 -85 -17 -47+-35 -114 -76 -275 -9 -36 -20 -99 -25 -140 -5 -41 -14 -88 -19 -105 -5 -16+-14 -73 -20 -125 -6 -52 -15 -126 -20 -165 -5 -38 -10 -229 -10 -424 -1 -367+2 -413 51 -706 30 -181 95 -453 129 -539 5 -11 27 -79 50 -149 38 -119 50+-152 85 -232 46 -103 75 -175 75 -184 0 -6 5 -11 10 -11 6 0 10 -6 10 -12 0+-7 6 -25 14 -39 7 -14 26 -66 42 -115 28 -86 28 -95 29 -304 l0 -215 -58 -180+c-32 -99 -68 -209 -79 -245 -21 -67 -42 -129 -72 -215 -10 -27 -22 -63 -26+-80 -25 -91 -72 -246 -85 -285 -9 -25 -28 -81 -42 -125 -14 -44 -33 -102 -43+-130 -65 -184 -90 -275 -90 -328 0 -72 29 -134 78 -167 33 -22 50 -25 144 -28+91 -3 113 -1 153 17 26 12 57 21 68 21 11 0 45 9 76 19 31 11 90 29 131 41 41+11 104 29 140 40 36 10 92 26 125 35 33 9 80 24 105 33 25 8 61 19 80 23 19 4+55 14 80 22 25 8 79 24 120 36 133 38 203 59 320 95 243 74 271 79 452 78 91+0 181 -4 200 -10 18 -5 68 -18 111 -27 42 -10 80 -21 83 -26 3 -5 12 -9 20 -9+15 0 64 -20 149 -60 73 -34 134 -60 143 -60 4 0 27 -9 50 -20 22 -11 46 -20+52 -20 6 0 59 -15 118 -34 283 -89 553 -156 632 -156 19 0 73 -7 120 -15 155+-26 569 -39 836 -26 131 6 273 18 314 26 41 8 93 14 115 14 37 1 95 12 305 62+160 38 440 122 493 150 22 10 45 19 53 19 8 0 31 9 51 20 21 11 43 20 50 20 6+0 51 18 100 41 48 22 102 46 118 54 44 19 155 75 195 98 19 11 46 27 60 34 14+8 39 23 55 33 17 11 44 26 60 35 17 8 50 28 75 45 25 16 52 33 60 37 8 3 17 9+20 13 3 3 39 28 80 55 76 50 298 221 336 259 11 12 47 44 79 71 104 89 216+198 303 295 46 52 99 111 116 130 42 46 163 202 207 265 19 28 36 52 39 55 3+3 10 12 15 21 6 10 25 38 43 63 17 26 32 51 32 56 0 4 4 10 8 12 9 4 102 143+102 152 0 4 26 53 58 109 57 99 73 131 126 250 14 31 37 81 50 110 32 72 86+214 86 227 0 5 4 18 9 28 5 9 19 49 30 87 95 326 100 421 22 493 -46 42 -60+48 -146 56 -79 8 -138 30 -173 65 -41 41 -102 177 -152 341 -13 41 -29 95 -37+120 -8 25 -20 71 -27 103 l-13 58 32 13 c17 8 43 17 56 21 41 12 119 48 119+55 0 4 12 12 26 19 48 22 194 142 226 187 17 24 34 44 38 44 4 0 17 24 31 53+13 28 26 54 30 57 3 3 14 28 23 55 10 28 21 57 26 66 12 23 38 173 45 259 3+41 1 109 -4 150 -25 186 -32 228 -45 270 -7 25 -19 65 -27 90 -7 25 -16 49+-21 54 -4 6 -8 19 -8 30 0 30 -94 295 -147 416 -66 149 -106 231 -163 335 -18+33 -48 88 -66 122 -19 34 -44 77 -56 96 -13 19 -39 60 -58 92 -19 32 -42 65+-50 74 -18 20 -100 140 -100 146 0 6 -159 206 -175 220 -6 6 -31 35 -55 65+-57 71 -325 339 -415 415 -38 32 -76 65 -84 73 -52 51 -427 317 -521 369 -52+29 -83 46 -167 95 -120 68 -360 177 -548 248 -33 13 -69 26 -80 30 -37 14+-189 59 -330 98 -184 51 -425 94 -630 113 -338 30 -499 34 -725 19z m575 -230+c132 -11 260 -25 285 -30 25 -5 74 -14 110 -19 178 -27 536 -122 648 -172 23+-10 48 -19 55 -19 6 -1 30 -9 52 -20 22 -11 45 -19 50 -20 6 0 30 -10 55 -21+25 -12 59 -28 75 -35 106 -45 304 -147 395 -203 19 -11 49 -28 67 -36 17 -8+34 -19 38 -24 3 -5 29 -24 58 -41 45 -27 72 -45 171 -112 14 -10 177 -137 237+-186 101 -81 332 -308 434 -427 107 -124 119 -137 135 -155 15 -17 26 -32 61+-87 12 -18 25 -33 30 -33 5 0 9 -5 9 -12 0 -6 8 -21 19 -32 43 -48 227 -334+254 -396 4 -8 18 -33 32 -55 40 -65 155 -302 155 -318 0 -9 4 -18 9 -21 5 -3+12 -18 15 -32 4 -14 15 -45 25 -68 22 -51 42 -104 110 -296 7 -19 17 -55 23+-80 6 -25 14 -50 19 -55 4 -6 13 -40 19 -75 5 -36 15 -83 20 -105 5 -22 12+-80 16 -130 5 -86 -2 -142 -34 -268 -13 -49 -71 -163 -94 -184 -10 -9 -18 -20+-18 -24 0 -14 -111 -116 -150 -138 -78 -44 -154 -81 -166 -81 -7 0 -15 15 -18+33 -2 17 -14 88 -25 157 -12 69 -21 135 -21 146 0 12 -9 68 -20 125 -10 57+-29 158 -40 224 -36 199 -57 250 -122 291 -28 18 -52 24 -95 24 -109 0 -171+-61 -267 -265 -16 -33 -33 -68 -38 -78 -13 -27 -87 -234 -98 -276 -5 -20 -24+-81 -43 -136 -19 -55 -39 -120 -46 -145 -7 -25 -19 -70 -28 -100 -8 -30 -21+-80 -28 -110 -25 -109 -47 -196 -61 -245 -7 -27 -25 -99 -38 -160 -75 -338+-83 -430 -44 -472 18 -19 32 -23 78 -23 42 0 61 5 72 18 15 18 52 154 63 232+4 25 10 59 15 75 5 17 14 62 19 100 11 80 39 200 54 232 8 18 12 20 21 9 14+-17 210 -172 234 -185 23 -12 132 -101 233 -190 126 -110 230 -203 253 -227+36 -36 124 -93 168 -110 65 -24 140 -44 166 -44 13 0 33 -5 44 -11 17 -9 19+-17 14 -50 -11 -69 -76 -265 -136 -414 -40 -97 -48 -116 -75 -180 -19 -46+-115 -235 -141 -280 -13 -22 -28 -49 -34 -60 -5 -11 -21 -38 -35 -60 -13 -22+-32 -53 -41 -69 -9 -16 -20 -34 -25 -40 -5 -6 -38 -55 -74 -109 -70 -106 -172+-243 -228 -308 -117 -136 -170 -192 -287 -309 -147 -147 -226 -220 -240 -220+-5 0 -13 -6 -17 -14 -4 -8 -39 -38 -78 -67 -38 -29 -75 -58 -81 -64 -6 -5 -20+-16 -30 -23 -11 -7 -41 -28 -69 -48 -61 -44 -244 -164 -250 -164 -2 0 -21 -12+-42 -26 -21 -14 -103 -57 -183 -95 -80 -38 -153 -74 -162 -79 -35 -20 -54 -29+-136 -64 -46 -20 -88 -36 -93 -36 -5 0 -28 -9 -52 -19 -99 -45 -439 -149 -542+-166 -22 -4 -78 -15 -125 -25 -258 -56 -378 -70 -690 -77 -245 -5 -522 12+-666 41 -38 8 -125 24 -194 36 -115 20 -179 36 -316 75 -28 8 -57 15 -66 15+-8 0 -33 9 -56 20 -22 11 -48 20 -58 20 -9 0 -30 7 -47 15 -31 14 -83 33 -162+60 -39 13 -86 31 -197 76 -102 41 -184 68 -273 91 -79 20 -114 23 -290 23+-156 0 -218 -4 -280 -18 -44 -10 -100 -22 -125 -28 -39 -8 -92 -23 -290 -83+-25 -7 -79 -24 -120 -36 -41 -12 -100 -30 -130 -40 -30 -10 -90 -27 -132 -39+-184 -50 -236 -64 -278 -77 -25 -7 -79 -23 -120 -34 -41 -12 -103 -30 -136+-41 -34 -10 -68 -19 -75 -19 -8 0 -27 -7 -43 -15 -16 -8 -47 -18 -69 -22 l-40+-6 7 39 c7 36 26 100 66 219 42 122 90 275 90 285 0 5 8 29 19 53 10 23 28 78+41 122 12 44 30 103 39 130 10 28 35 104 56 170 21 66 46 144 57 173 10 29 18+60 18 70 0 9 9 39 19 67 62 162 88 394 66 588 -8 62 -20 132 -28 157 -8 25+-18 62 -22 84 -6 35 -14 58 -50 141 -8 17 -25 59 -40 95 -15 36 -32 79 -39 95+-48 110 -96 235 -96 246 0 5 -9 28 -19 52 -19 43 -91 291 -91 316 0 7 -8 43+-19 79 -32 113 -60 274 -86 487 -23 187 -20 616 5 829 31 258 95 577 158 781+19 63 24 75 71 192 12 28 21 57 21 62 0 6 8 30 19 54 10 23 26 62 35 87 25 64+47 112 101 220 69 137 89 175 98 178 4 2 7 11 7 20 0 10 9 28 20 42 11 14 20+28 20 32 0 6 21 40 61 98 23 35 115 175 125 192 6 10 18 26 27 36 10 10 17 24+17 30 0 7 4 12 9 12 4 0 27 27 51 61 41 59 65 88 113 139 13 14 44 49 68 79+79 98 435 441 457 441 4 0 15 8 24 18 24 26 69 62 111 90 20 13 37 29 37 33 0+5 4 9 9 9 8 0 118 70 146 92 18 15 86 58 91 58 3 0 13 8 24 18 10 9 40 28 66+42 27 14 84 45 129 70 70 40 244 127 300 150 127 53 175 74 202 86 17 8 38 14+47 14 8 0 35 9 58 19 92 40 342 111 533 150 210 42 286 54 475 71 261 23 399+23 685 0z m2880 -3287 c3 -27 13 -82 22 -123 9 -41 22 -124 29 -185 18 -152+33 -247 51 -334 9 -40 16 -90 17 -109 l1 -36 -80 -18 c-44 -9 -105 -17 -135+-18 -30 -1 -95 -7 -144 -14 -106 -15 -109 -12 -79 78 11 34 31 97 43 141 12+44 31 102 41 129 11 27 19 55 19 62 0 8 4 22 10 32 5 9 24 60 40 112 60 185+125 327 152 329 4 1 10 -20 13 -46z m173 -1008 c7 -14 15 -45 18 -68 3 -23 13+-60 21 -82 8 -22 21 -66 28 -98 11 -53 10 -56 -5 -42 -9 8 -20 15 -25 15 -4 0+-13 6 -19 14 -6 8 -60 53 -121 100 -176 136 -178 138 -163 147 7 5 40 9 73 10+33 0 80 6 105 13 66 20 76 18 88 -9z"/>+<path d="M1945 6207 c-85 -33 -207 -141 -268 -237 -65 -102 -65 -102 -90 -155+-102 -216 -136 -368 -144 -637 -7 -252 5 -357 70 -586 9 -29 35 -88 59 -130+43 -76 143 -192 166 -192 7 0 12 -4 12 -9 0 -5 16 -15 35 -22 19 -7 35 -16 35+-19 0 -20 95 -35 220 -35 l135 1 80 39 c60 29 96 55 145 106 91 95 120 133+136 182 4 9 10 17 15 17 5 0 9 9 9 20 0 11 5 20 10 20 6 0 10 6 10 13 0 6 9+30 19 52 24 49 44 103 65 175 19 63 66 325 66 368 0 16 6 34 13 39 15 13 148+56 153 50 8 -8 23 -154 24 -225 0 -53 -5 -84 -20 -114 -11 -23 -20 -46 -20+-51 0 -5 -6 -23 -14 -40 -36 -78 -65 -161 -118 -332 -12 -38 -30 -94 -40 -123+-10 -29 -18 -63 -18 -76 0 -13 -6 -46 -14 -72 -29 -101 -48 -196 -56 -281 -5+-49 -14 -126 -21 -173 -13 -96 -7 -314 11 -370 21 -67 54 -125 82 -148 57 -48+169 -61 233 -28 31 16 75 58 75 73 0 6 5 13 11 15 5 2 14 19 19 38 5 19 16 60+24 90 22 83 54 281 67 415 6 66 13 335 15 598 2 263 6 488 10 500 29 94 161+255 245 297 74 38 140 7 185 -88 26 -54 28 -64 28 -202 0 -108 -5 -162 -18+-210 -39 -138 -104 -240 -181 -281 -18 -10 -63 -23 -99 -30 -104 -18 -142 -72+-117 -166 9 -34 18 -44 51 -57 167 -67 524 -9 735 119 67 40 66 40 89 9 20+-28 65 -74 101 -103 9 -7 48 -24 87 -37 126 -43 255 -27 387 48 62 36 181 144+212 194 11 19 25 34 30 34 5 0 9 -51 9 -112 1 -130 6 -142 72 -159 39 -11 51+-10 81 4 38 18 43 31 67 182 27 165 102 448 141 528 11 22 19 43 19 49 0 11+89 191 99 198 3 3 11 14 17 25 14 26 74 67 92 63 29 -6 54 -54 59 -114 3 -35+-4 -133 -17 -239 -16 -123 -23 -237 -24 -360 -1 -170 0 -183 23 -228 42 -87+104 -128 201 -135 124 -9 234 79 335 270 33 64 34 64 68 -35 42 -118 123 -216+195 -236 161 -45 260 35 332 269 13 41 31 100 41 130 9 30 27 98 38 150 11 52+31 140 43 195 l22 100 18 -90 c9 -49 17 -108 18 -130 0 -22 5 -60 11 -85 6+-25 16 -76 24 -115 23 -119 41 -177 79 -258 68 -142 144 -190 280 -173 47 6+62 14 100 49 77 74 192 358 241 602 9 44 25 119 36 167 10 48 19 97 19 110 0+13 9 79 20 148 48 306 67 793 34 862 -24 52 -90 73 -147 47 -44 -20 -48 -37+-53 -287 -2 -130 -9 -273 -14 -317 -5 -44 -14 -125 -20 -180 -13 -124 -36+-272 -60 -390 -11 -49 -24 -112 -29 -140 -24 -116 -42 -189 -56 -216 -8 -15+-15 -34 -15 -40 0 -24 -52 -144 -77 -177 -24 -31 -26 -32 -43 -17 -19 17 -52+108 -70 189 -5 22 -16 68 -24 101 -31 126 -46 201 -46 228 0 16 -9 88 -19 160+-19 127 -46 339 -61 478 -14 135 -97 202 -190 154 -37 -19 -70 -82 -70 -132 0+-21 -9 -83 -19 -138 -11 -55 -29 -156 -41 -225 -11 -69 -27 -156 -35 -195 -8+-38 -17 -90 -21 -115 -3 -25 -15 -76 -26 -115 -11 -38 -26 -95 -35 -125 -38+-137 -79 -236 -108 -260 -27 -22 -45 10 -98 175 -20 61 -46 150 -58 200 -21+85 -21 91 -6 135 9 25 19 65 23 90 3 25 14 79 24 120 10 41 21 98 24 125 4 28+11 79 16 115 54 366 48 624 -17 745 -57 105 -228 135 -312 54 -88 -83 -124+-268 -102 -519 26 -307 46 -461 78 -610 27 -123 28 -199 3 -272 -25 -71 -44+-116 -71 -170 -11 -20 -19 -44 -19 -52 0 -9 -4 -16 -9 -16 -5 0 -16 -15 -24+-32 -18 -39 -74 -98 -92 -98 -25 0 -46 40 -55 100 -6 43 -4 103 6 194 43 389+43 560 1 644 -24 47 -68 102 -82 102 -4 0 -18 9 -32 20 -21 16 -41 20 -100 20+-62 0 -82 -4 -121 -27 -50 -28 -101 -76 -143 -133 -26 -36 -119 -218 -119+-235 0 -6 -7 -19 -15 -29 -13 -17 -14 0 -8 141 l6 160 -33 31 c-36 35 -66 40+-108 18 -56 -29 -59 -39 -67 -211 -9 -210 -39 -342 -102 -454 -14 -25 -31 -55+-37 -66 -27 -49 -89 -135 -122 -169 -50 -52 -103 -83 -173 -102 -53 -15 -66+-16 -103 -4 -44 14 -118 80 -118 104 0 8 17 26 38 42 20 15 96 86 168 158 100+101 140 149 173 209 81 146 103 298 60 409 -23 61 -39 82 -94 123 -36 27 -49+30 -128 34 -108 4 -180 -19 -250 -81 -44 -37 -137 -164 -137 -185 0 -5 -9 -28+-20 -51 -11 -22 -20 -47 -20 -54 0 -7 -10 -42 -22 -78 -19 -57 -22 -90 -23+-258 l-2 -193 -34 -22 c-19 -12 -43 -28 -54 -34 -31 -20 -138 -70 -162 -77+-13 -3 -33 -9 -45 -12 l-21 -6 23 38 c119 198 169 412 141 609 -28 199 -104+319 -239 381 -69 31 -186 33 -247 4 -22 -11 -44 -19 -49 -20 -9 0 -96 -70+-140 -113 -34 -33 -35 -32 -60 64 -31 116 -103 155 -203 110 -26 -12 -67 -31+-91 -42 -24 -11 -47 -17 -51 -14 -5 2 -11 46 -14 97 -3 51 -15 133 -27 181+-21 87 -77 225 -102 251 -7 7 -20 24 -28 36 -20 30 -119 105 -150 115 -14 4+-31 12 -38 18 -8 6 -53 13 -100 15 -71 3 -97 0 -139 -17 l-52 -20 -6 29 c-13+59 -73 83 -140 57z m4197 -268 c11 -69 10 -282 -2 -414 -7 -66 -13 -121 -15+-123 -8 -8 -35 280 -35 368 0 89 21 221 34 217 6 -2 14 -24 18 -48z m-3807 -5+c89 -37 150 -174 176 -395 15 -131 12 -144 -39 -135 -156 25 -265 95 -328 211+-24 44 -28 62 -28 140 0 78 3 96 23 128 44 71 108 88 196 51z m-420 -26 c-4+-13 -10 -71 -12 -131 -5 -123 8 -181 64 -283 91 -167 260 -272 462 -288 40 -4+77 -8 80 -11 11 -6 -14 -180 -39 -270 -41 -154 -59 -200 -122 -314 -39 -69+-70 -107 -145 -171 -34 -29 -112 -53 -173 -54 -56 -1 -74 4 -129 34 -53 29+-72 46 -107 100 -52 80 -67 118 -99 234 -52 195 -55 533 -5 706 10 36 22 82+26 103 3 20 10 40 15 43 5 3 9 15 9 27 0 12 9 36 20 52 11 17 20 38 20 48 0 9+3 17 8 17 4 0 14 15 21 32 23 51 91 147 105 148 4 0 5 -10 1 -22z m2540 -642+c28 -23 30 -28 28 -89 -1 -47 -9 -79 -26 -114 -38 -74 -143 -208 -211 -268+l-61 -55 -8 28 c-19 65 35 296 92 392 39 65 109 130 140 130 9 0 29 -11 46+-24z m-1534 -1326 c-5 -102 -17 -225 -26 -275 -19 -107 -56 -229 -69 -230 -40+-1 -40 375 -1 575 26 130 57 262 79 337 l21 72 3 -147 c1 -81 -2 -230 -7 -332z"/>+</g>+</svg>diff --git a/dashboard/public/openwa_logo.webp b/dashboard/public/openwa_logo.webpnew file mode 100644index 000000000..2fcab7f78Binary files /dev/null and b/dashboard/public/openwa_logo.webp differdiff --git a/dashboard/public/vite.svg b/dashboard/public/vite.svgnew file mode 100644index 000000000..e7b8dfb1b--- /dev/null+++ b/dashboard/public/vite.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>\ No newline at end of filediff --git a/dashboard/src/App.css b/dashboard/src/App.cssnew file mode 100644index 000000000..01b41cc92--- /dev/null+++ b/dashboard/src/App.css@@ -0,0 +1,94 @@+@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');++:root {+ --primary: #25d366;+ --primary-hover: #1da851;+ --bg-light: #f8fafc;+ --bg-white: #ffffff;+ --bg-card: #ffffff;+ --text-primary: #0f172a; /* Slate 900 */+ --text-secondary: #475569; /* Slate 600 */+ --text-muted: #94a3b8; /* Slate 400 */+ --border: #e2e8f0; /* Slate 200 */+ --error: #ef4444;+ --success: #22c55e;+ --warning: #f59e0b;+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);+ --radius: 10px;+}++/* Dark Mode */+[data-theme='dark'] {+ --bg-light: #0f172a; /* Slate 900 */+ --bg-white: #1e293b; /* Slate 800 */+ --bg-card: #1e293b;+ --text-primary: #f1f5f9; /* Slate 100 */+ --text-secondary: #cbd5e1; /* Slate 300 */+ --text-muted: #64748b; /* Slate 500 */+ --border: #334155; /* Slate 700 */+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);+}++/* System preference dark mode */+@media (prefers-color-scheme: dark) {+ :root:not([data-theme='light']) {+ --bg-light: #0f172a;+ --bg-white: #1e293b;+ --bg-card: #1e293b;+ --text-primary: #f1f5f9;+ --text-secondary: #cbd5e1;+ --text-muted: #64748b;+ --border: #334155;+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);+ }+}++* {+ box-sizing: border-box;+}++body {+ margin: 0;+ font-family:+ 'Plus Jakarta Sans',+ -apple-system,+ BlinkMacSystemFont,+ 'Segoe UI',+ Roboto,+ Helvetica,+ Arial,+ sans-serif;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;+ background: var(--bg-light);+ color: var(--text-primary);+ line-height: 1.6;+}++button {+ font-family: inherit;+}++input,+select,+textarea {+ font-family: inherit;+ background: var(--bg-white);+ color: var(--text-primary);+ border-color: var(--border);+}++a {+ color: var(--primary);+ text-decoration: none;+}++a:hover {+ text-decoration: underline;+}diff --git a/dashboard/src/App.tsx b/dashboard/src/App.tsxnew file mode 100644index 000000000..20dd2b500--- /dev/null+++ b/dashboard/src/App.tsx@@ -0,0 +1,105 @@+import { useState, useEffect } from 'react';+import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';+import { Layout } from './components/Layout';+import { Login } from './pages/Login';+import { Dashboard } from './pages/Dashboard';+import { Sessions } from './pages/Sessions';+import { Webhooks } from './pages/Webhooks';+import { Logs } from './pages/Logs';+import { ApiKeys } from './pages/ApiKeys';+import { MessageTester } from './pages/MessageTester';+import { Infrastructure } from './pages/Infrastructure';+import Plugins from './pages/Plugins';+import { ToastProvider } from './components/Toast';+import { RoleProvider, useRole, type UserRole } from './hooks/useRole';+import './App.css';++function AppContent() {+ // Initialize from localStorage to avoid setState in effect+ const savedKey = localStorage.getItem('openwa_api_key');+ const [isAuthenticated, setIsAuthenticated] = useState(!!savedKey);+ const [, setApiKey] = useState(savedKey || '');+ const { setRole, role } = useRole();++ const handleLogin = async (key: string) => {+ setApiKey(key);+ localStorage.setItem('openwa_api_key', key);++ // Fetch the role from API+ try {+ const response = await fetch('/api/auth/validate', {+ method: 'POST',+ headers: { 'X-API-Key': key },+ });+ if (response.ok) {+ const data = await response.json();+ setRole(data.role as UserRole);+ }+ } catch {+ // Default to viewer if we can't fetch role+ setRole('viewer');+ }++ setIsAuthenticated(true);+ };++ const handleLogout = () => {+ setApiKey('');+ setIsAuthenticated(false);+ setRole(null);+ localStorage.removeItem('openwa_api_key');+ };++ // Re-validate and get role on mount if already authenticated+ useEffect(() => {+ if (!savedKey) return;++ fetch('/api/auth/validate', {+ method: 'POST',+ headers: { 'X-API-Key': savedKey },+ })+ .then(res => res.json())+ .then(data => {+ if (data.valid && data.role) {+ setRole(data.role as UserRole);+ }+ })+ .catch(() => {+ // Keep existing role from localStorage if validation fails+ });+ }, [savedKey, setRole]);++ if (!isAuthenticated) {+ return <Login onLogin={handleLogin} />;+ }++ return (+ <ToastProvider>+ <BrowserRouter>+ <Routes>+ <Route path="/" element={<Layout onLogout={handleLogout} userRole={role} />}>+ <Route index element={<Dashboard />} />+ <Route path="sessions" element={<Sessions />} />+ <Route path="webhooks" element={<Webhooks />} />+ {role === 'admin' && <Route path="api-keys" element={<ApiKeys />} />}+ <Route path="logs" element={<Logs />} />+ <Route path="message-tester" element={<MessageTester />} />+ <Route path="infrastructure" element={<Infrastructure />} />+ {role === 'admin' && <Route path="plugins" element={<Plugins />} />}+ <Route path="*" element={<Navigate to="/" replace />} />+ </Route>+ </Routes>+ </BrowserRouter>+ </ToastProvider>+ );+}++function App() {+ return (+ <RoleProvider>+ <AppContent />+ </RoleProvider>+ );+}++export default App;diff --git a/dashboard/src/assets/icons/folder.svg b/dashboard/src/assets/icons/folder.svgnew file mode 100644index 000000000..aaf539ee8--- /dev/null+++ b/dashboard/src/assets/icons/folder.svg@@ -0,0 +1,6 @@+<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->+<svg fill="#000000" width="800px" height="800px" viewBox="0 0 36 36" version="1.1" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">+ <title>storage-outline-badged</title>+ <path class="clr-i-outline--badged clr-i-outline-path-1--badged" d="M7,7.76V9.85a43.53,43.53,0,0,0,11,1.27,54.82,54.82,0,0,0,6.2-.36,7.5,7.5,0,0,1-1.13-1.88c-1.5.15-3.2.24-5.07.24A37.6,37.6,0,0,1,7,7.76Z"></path><path class="clr-i-outline--badged clr-i-outline-path-2--badged" d="M31,13.43v.82c-.33.86-5.06,2.45-13,2.45A37.45,37.45,0,0,1,7,15.34v2.08A43.33,43.33,0,0,0,18,18.7c4,0,9.93-.48,13-2v5.17c-.33.86-5.06,2.45-13,2.45A37.45,37.45,0,0,1,7,22.92V25a43.33,43.33,0,0,0,11,1.28c4,0,9.93-.48,13-2v5.1c-.35.86-5.08,2.45-13,2.45S5.3,30.2,5,29.37V6.82C5.3,6,10,4.36,18,4.36c1.7,0,3.25.08,4.64.2a7.44,7.44,0,0,1,.67-1.94c-1.88-.18-3.75-.26-5.31-.26-5.57,0-15,.93-15,4.43V29.37c0,3.49,9.43,4.43,15,4.43s15-.93,15-4.43V12.87A7.45,7.45,0,0,1,31,13.43Z"></path><circle class="clr-i-outline--badged clr-i-outline-path-3--badged clr-i-badge" cx="30" cy="6" r="5"></circle>+ <rect x="0" y="0" width="36" height="36" fill-opacity="0"/>+</svg>\ No newline at end of filediff --git a/dashboard/src/assets/icons/postgresql.svg b/dashboard/src/assets/icons/postgresql.svgnew file mode 100644index 000000000..d1eefea11--- /dev/null+++ b/dashboard/src/assets/icons/postgresql.svg@@ -0,0 +1,16 @@+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>+<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->+<svg width="800px" height="800px" viewBox="-4 0 264 264" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">+ <g>+ <path d="M255.007926,158.085617 C253.473109,153.437413 249.452194,150.199279 244.251788,149.42182 C241.799982,149.055852 238.991667,149.211935 235.668988,149.897164 C229.877358,151.092028 225.580342,151.546679 222.44449,151.635363 C234.280794,131.650217 243.905921,108.859714 249.446873,87.4065589 C258.406282,52.7182633 253.61855,36.9154365 248.023797,29.7669469 C233.217182,10.8477783 211.614448,0.683454965 185.55152,0.371879908 C171.649478,0.202198614 159.443658,2.94725173 153.077358,4.92075751 C147.149155,3.87547344 140.774577,3.29134411 134.08606,3.18315012 C121.550337,2.9833164 110.473164,5.71595381 101.008259,11.332582 C95.7670577,9.56127483 87.3580785,7.06335335 77.6460416,5.46882217 C54.8035104,1.71868822 36.3939769,4.64110855 22.9282587,14.153903 C6.62230023,25.6721293 -0.937090069,45.6838799 0.461154734,73.6339954 C0.904572748,82.5082679 5.86908083,109.507695 13.6850624,135.114199 C18.1771824,149.831538 22.9672794,162.053912 27.9223279,171.443732 C34.9490254,184.758688 42.4676212,192.600092 50.9085266,195.415501 C55.6400924,196.992296 64.2358984,198.09552 73.2774873,190.566873 C74.4232794,191.953885 75.9515935,193.33321 77.9812656,194.613801 C80.5578199,196.239076 83.7090439,197.566965 86.8555381,198.353885 C98.1969885,201.189395 108.820102,200.479926 117.882975,196.506309 C117.93855,198.117986 117.981709,199.658125 118.018365,200.987788 C118.07867,203.145164 118.137792,205.259972 118.217016,207.237617 C118.753848,220.612286 119.663741,231.011326 122.359723,238.286928 C122.507529,238.687778 122.706771,239.29733 122.917247,239.943538 C124.261691,244.062005 126.511298,250.955677 132.232573,256.355326 C138.158411,261.947714 145.325229,263.663446 151.888998,263.662855 C155.180933,263.662855 158.322106,263.231261 161.076619,262.640628 C170.897441,260.536462 182.050291,257.329663 190.118134,245.84218 C197.745515,234.981986 201.453672,218.625182 202.124711,192.851363 C202.211621,192.122975 202.292028,191.427104 202.369478,190.763751 C202.421506,190.316194 202.474716,189.858587 202.528517,189.402162 L204.325838,189.560018 L204.788767,189.591353 C214.791095,190.047187 227.021155,187.925875 234.532065,184.437062 C240.467363,181.68255 259.485857,171.642383 255.007926,158.085617" fill="#000000">+ </path>+ <path d="M237.905589,160.722476 C208.165838,166.857016 206.121386,156.78788 206.121386,156.78788 C237.521885,110.194697 250.64824,51.0516028 239.320388,36.5766651 C208.417109,-2.90823095 154.921977,15.7655797 154.029229,16.2503834 L153.741894,16.3018199 C147.866309,15.0821247 141.290716,14.3555104 133.900416,14.2349007 C120.443566,14.0143741 110.236083,17.7627344 102.490457,23.636545 C102.490457,23.636545 7.06039723,-15.6768961 11.4987159,73.0806097 C12.4429007,91.9631224 38.5625866,215.954032 69.7171363,178.502947 C81.1041109,164.808425 92.1061986,153.229303 92.1061986,153.229303 C97.5708822,156.859418 104.112776,158.711132 110.970975,158.046005 L111.503667,157.593718 C111.338125,159.294079 111.413801,160.957192 111.717099,162.925968 C103.691233,171.893062 106.049626,173.467492 90.0055797,176.770069 C73.7711594,180.115806 83.308194,186.072388 89.5349654,187.629081 C97.0837136,189.516859 114.54788,192.190965 126.34812,175.672166 L125.877506,177.556988 C129.022226,180.075603 131.230448,193.940397 130.860342,206.508637 C130.490236,219.077469 130.243104,227.706383 132.720924,234.446337 C135.198744,241.186291 137.668286,256.351187 158.759612,251.831871 C176.383409,248.055132 185.516046,238.268009 186.786587,221.94254 C187.688203,210.336222 189.728517,212.051954 189.857404,201.675381 L191.493912,196.762901 C193.381099,181.029838 191.793663,175.95418 202.651492,178.314938 L205.290125,178.546697 C213.2817,178.9103 223.741044,177.261376 229.879723,174.408129 C243.098309,168.273589 250.93794,158.031224 237.904406,160.722476 L237.905589,160.722476" fill="#336791">+ </path>+ <path d="M108.076342,81.5250624 C105.396915,81.152 102.969349,81.4972748 101.741376,82.426679 C101.050236,82.9499122 100.836804,83.5559169 100.779455,83.973321 C100.625145,85.0783187 101.399649,86.2997875 101.874993,86.9300323 C103.220619,88.7137552 105.18703,89.9399538 107.133339,90.2101432 C107.415353,90.249164 107.695594,90.2680831 107.974651,90.2680831 C111.220471,90.2680831 114.170679,87.7411917 114.430818,85.8758799 C114.755991,83.5399538 111.36473,81.9826697 108.076342,81.5250624" fill="#FFFFFF">+ </path>+ <path d="M196.860453,81.5989654 L196.859861,81.5989654 C196.604453,79.7679446 193.345626,79.2458938 190.253524,79.6757136 C187.166152,80.1061247 184.171603,81.4996397 184.421691,83.3347991 C184.622707,84.7620139 187.19867,87.198448 190.249386,87.1978568 C190.506568,87.1978568 190.766707,87.1807113 191.028619,87.1440554 C193.064794,86.8620416 194.558818,85.5690346 195.268286,84.8235012 C196.349635,83.688351 196.974559,82.4219492 196.860453,81.5989654" fill="#FFFFFF">+ </path>+ <path d="M247.802088,160.025423 C246.66812,156.596323 243.018494,155.492508 236.954309,156.745312 C218.949173,160.461155 212.501284,157.886965 210.38352,156.327908 C224.378975,135.007187 235.89188,109.236323 242.102688,85.1906513 C245.04521,73.8007206 246.670485,63.2231316 246.802919,54.601903 C246.949543,45.1375889 245.338457,38.1842032 242.014005,33.9362587 C228.611547,16.8108637 208.942115,7.62501617 185.131751,7.37256351 C168.763122,7.18869284 154.93321,11.3781062 152.252009,12.5558245 C146.60582,11.1516674 140.450587,10.2896628 133.750245,10.1796952 C121.461654,9.98104388 110.840314,12.9229746 102.045857,18.9191686 C98.2259584,17.4978661 88.3536998,14.10897 76.2814965,12.1644342 C55.4089238,8.80332564 38.8233164,11.3497275 26.9870115,19.7350577 C12.8638522,29.740933 6.34383372,47.626642 7.60727945,72.8943741 C8.03236952,81.3961755 12.8756767,107.547788 20.5202032,132.593219 C30.5822448,165.556915 41.5192979,184.218309 53.0280647,188.056536 C54.374873,188.505866 55.9286097,188.820397 57.6407945,188.820397 C61.8390762,188.820397 66.9856813,186.927889 72.3409885,180.490051 C81.2359538,169.788896 89.5408776,160.821801 92.6022356,157.563566 C97.1262818,159.992314 102.09552,161.347991 107.179455,161.483972 C107.188323,161.616998 107.201921,161.750023 107.213746,161.882457 C106.193885,163.092102 105.357303,164.152166 104.644286,165.05733 C101.122365,169.528166 100.389247,170.458753 89.0519353,172.793497 C85.8273995,173.458624 77.2611547,175.224018 77.1364065,181.227898 C76.9998337,187.787529 87.2605266,190.542633 88.4299677,190.834697 C92.5040924,191.854559 96.4286374,192.357691 100.171677,192.357691 C109.275344,192.357099 117.285838,189.365506 123.688203,183.576831 C123.490734,206.962697 124.466254,230.006836 127.273977,237.028212 C129.573247,242.775501 135.191649,256.822984 152.93842,256.821801 C155.54158,256.821801 158.408425,256.519095 161.561423,255.843326 C180.082106,251.872074 188.124527,243.686577 191.236139,225.640055 C192.901025,215.995418 195.758411,192.963695 197.101672,180.610069 C199.937774,181.49454 203.589173,181.899529 207.536185,181.898938 C215.768388,181.898938 225.266993,180.150097 231.224166,177.384942 C237.91564,174.277469 249.991982,166.650679 247.802088,160.025423 L247.802088,160.025423 Z M203.696185,76.5445912 C203.634697,80.1918522 203.132748,83.5027067 202.600647,86.9590023 C202.028342,90.6760277 201.435935,94.5189838 201.286947,99.1843326 C201.139732,103.724342 201.706716,108.444674 202.255372,113.008924 C203.363326,122.228471 204.500249,131.720573 200.098587,141.086744 C199.41454,139.871778 198.754143,138.546254 198.14873,137.078245 C197.601848,135.752129 196.414079,133.621949 194.769885,130.673515 C188.370476,119.197857 173.385312,92.3243603 181.056443,81.3583372 C183.340933,78.0935982 189.139658,74.7384018 203.696185,76.5445912 L203.696185,76.5445912 Z M186.052286,14.7581339 C207.386014,15.2293395 224.261321,23.2102725 236.209958,38.4780416 C245.373931,50.1890069 235.282919,103.476028 206.069949,149.446651 C205.781432,149.080092 205.487594,148.709986 205.183704,148.33042 C205.062503,148.178476 204.938938,148.024166 204.814189,147.868083 C212.362938,135.400942 210.886651,123.066236 209.572952,112.129774 C209.033164,107.641792 208.523529,103.402716 208.653007,99.4214134 C208.787215,95.2000739 209.34533,91.5811917 209.884527,88.0811455 C210.548471,83.7675751 211.223058,79.3050162 211.036822,74.0437136 C211.17576,73.4921016 211.231926,72.8399815 211.159206,72.0660693 C210.683861,67.0205635 204.924157,51.9224758 193.18363,38.2551501 C186.762346,30.7808961 177.396767,22.4156674 164.609774,16.7736166 C170.109931,15.6337367 177.631483,14.5707159 186.052286,14.7581339 L186.052286,14.7581339 Z M66.6741062,175.777995 C60.7742818,182.871501 56.6995658,181.512277 55.3598522,181.065903 C46.6292471,178.153533 36.499806,159.702023 27.568776,130.441755 C19.8408868,105.123769 15.3245266,79.6650716 14.9674273,72.5260416 C13.8387806,49.9483788 19.3117413,34.2129515 31.2349561,25.7572656 C50.6389284,11.9965266 82.5413764,20.2328684 95.3602956,24.4104573 C95.1758337,24.591963 94.9842771,24.7622356 94.8015889,24.9466975 C73.7664296,46.1911501 74.2654226,82.4875751 74.3168591,84.7058476 C74.3150855,85.56194 74.3866236,86.7739492 74.485358,88.4412009 C74.8471871,94.5455889 75.5205912,105.907732 73.7214965,118.775132 C72.0489238,130.732046 75.7346143,142.435326 83.8320185,150.883917 C84.6703741,151.758337 85.5453857,152.579547 86.4493672,153.352277 C82.8446744,157.212379 75.0115473,165.74788 66.6741062,175.777995 L66.6741062,175.777995 Z M89.1530346,145.78461 C82.6265127,138.975483 79.6627067,129.503483 81.020157,119.795584 C82.920351,106.202753 82.2185681,94.3646744 81.8419584,88.0048776 C81.7893395,87.1150855 81.7426328,86.335261 81.7148453,85.7197968 C84.7880277,82.9954365 99.0288406,75.3645081 109.184296,77.6915658 C113.819492,78.7534042 116.642587,81.9087667 117.816758,87.3373857 C123.893358,115.440037 118.621413,127.153367 114.385293,136.565654 C113.512055,138.504868 112.687298,140.337663 111.982559,142.234309 L111.436859,143.699954 C110.054577,147.406337 108.768665,150.851991 107.971695,154.124416 C101.034273,154.103132 94.2848591,151.139917 89.1530346,145.78461 L89.1530346,145.78461 Z M90.2178291,183.685025 C88.1922956,183.178938 86.3701432,182.299788 85.3012102,181.570808 C86.1939584,181.150448 87.7831686,180.579326 90.5388637,180.011751 C103.876286,177.265515 105.93552,175.328074 110.433552,169.61685 C111.465238,168.30788 112.634088,166.823316 114.252859,165.015353 C114.25345,165.014171 114.254042,165.01358 114.254633,165.012988 C116.666236,162.31346 117.768868,162.771067 119.768979,163.600554 C121.390115,164.271594 122.968684,166.303039 123.608979,168.539048 C123.911686,169.594975 124.252231,171.599815 123.138956,173.158873 C113.742633,186.31479 100.051067,186.1457 90.2178291,183.685025 L90.2178291,183.685025 Z M160.016554,248.637487 C143.700545,252.133395 137.923695,243.80837 134.116804,234.291436 C131.659677,228.146845 130.452397,200.440314 131.309081,169.84388 C131.320314,169.436527 131.262374,169.043363 131.150042,168.673848 C131.05249,167.96024 130.902319,167.238356 130.694208,166.511741 C129.419529,162.059824 126.315012,158.335704 122.5903,156.792018 C121.110467,156.178919 118.393792,155.05382 115.129644,155.888628 C115.826106,153.0206 117.033386,149.782467 118.341764,146.275326 L118.891012,144.79963 C119.509432,143.136517 120.284527,141.413691 121.105145,139.590356 C125.538143,129.741746 131.609423,116.25297 125.020231,85.7795104 C122.551871,74.3659307 114.310208,68.7924619 101.815871,70.0866513 C94.3250624,70.861746 87.472776,73.8840831 84.0549099,75.6169607 C83.3200185,75.9894319 82.6477968,76.3488961 82.0199169,76.6994919 C82.9735612,65.1990023 86.578254,43.707418 100.060527,30.1098568 C108.54873,21.548933 119.854115,17.3210901 133.628453,17.5487113 C160.768591,17.9933118 178.172453,31.9213672 187.994457,43.5276859 C196.457829,53.5294226 201.040998,63.6038799 202.870245,69.0372286 C189.115418,67.6389838 179.76048,70.3544758 175.017681,77.1340416 C164.700822,91.8815335 180.662097,120.506236 188.333229,134.262836 C189.739751,136.784406 190.954125,138.963067 191.336055,139.888924 C193.833977,145.943058 197.067972,149.984665 199.429321,152.935464 C200.152979,153.839446 200.855353,154.716231 201.389229,155.481866 C197.223464,156.683233 189.740342,159.457848 190.422023,173.328554 C189.872185,180.289035 185.960647,212.874938 183.974134,224.387843 C181.351464,239.597672 175.754346,245.263372 160.016554,248.637487 L160.016554,248.637487 Z M228.120831,170.700564 C223.861062,172.678208 216.732083,174.161589 209.959612,174.479667 C202.479446,174.830263 198.671963,173.641903 197.776259,172.91115 C197.355307,164.267455 200.573339,163.364065 203.978199,162.408055 C204.513256,162.257293 205.035307,162.111261 205.53903,161.935076 C205.852379,162.189894 206.195289,162.442938 206.570716,162.690661 C212.582873,166.658956 223.306494,167.087002 238.444785,163.962383 C238.50036,163.950559 238.555935,163.939917 238.610919,163.928684 C236.569423,165.837746 233.075289,168.400111 228.120831,170.700564 L228.120831,170.700564 Z" fill="#FFFFFF">+ </path>+ </g>+</svg>\ No newline at end of filediff --git a/dashboard/src/assets/icons/s3.svg b/dashboard/src/assets/icons/s3.svgnew file mode 100644index 000000000..61a20e114--- /dev/null+++ b/dashboard/src/assets/icons/s3.svg@@ -0,0 +1,20 @@+<?xml version="1.0" encoding="iso-8859-1"?>+<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">+<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"+ width="800px" height="800px" viewBox="0 0 165.255 165.255"+ xml:space="preserve">+<g>+ <g>+ <path d="M153.829,64.762c-2.879-8.854-11.098-15.292-20.893-15.292c-0.114,0-0.217,0.027-0.328,0.033+ c-1.574-16.815-15.573-30.027-32.797-30.027c-9.693,0-18.334,4.246-24.396,10.886c-3.822-3.166-8.662-5.144-14.003-5.144+ c-11.99,0-21.707,9.582-22.024,21.494c-2.102-0.793-4.361-1.283-6.743-1.283c-10.563,0-19.119,8.563-19.119,19.125+ C6.052,64.554,0,70.611,0,78.081c0,7.469,6.052,13.527,13.527,13.527c3.021,0,135.838,0,138.201,0+ c7.475,0,13.527-6.058,13.527-13.527C165.26,71.317,160.297,65.771,153.829,64.762z"/>+ <polygon points="73.361,79.15 31.834,103.12 29.637,99.322 22.778,111.224 36.513,111.224 34.316,107.421 75.843,83.459+ 51.877,124.97 48.078,122.775 48.078,136.521 59.973,129.647 56.179,127.46 80.153,85.936 80.153,133.878 75.757,133.878+ 82.635,145.779 89.512,133.878 85.113,133.878 85.113,85.957 109.09,127.46 105.294,129.66 117.19,136.521 117.19,122.787+ 113.391,124.981 89.429,83.476 130.936,107.432 128.745,111.23 142.479,111.23 135.614,99.328 133.42,103.131 91.886,79.15 "/>+ </g>+</g>+</svg>\ No newline at end of filediff --git a/dashboard/src/assets/icons/sqlite.svg b/dashboard/src/assets/icons/sqlite.svgnew file mode 100644index 000000000..378298ffb--- /dev/null+++ b/dashboard/src/assets/icons/sqlite.svg@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->+<svg width="800px" height="800px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient id="a" x1="-118.318" y1="45.638" x2="-116.751" y2="45.638" gradientTransform="matrix(0, 11.486, 11.486, 0, -510.889, 1363.307)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#97d9f6"/><stop offset="0.92" stop-color="#0f80cc"/><stop offset="1" stop-color="#0f80cc"/></linearGradient></defs><title>file_type_sqlite</title><path d="M23.192,3.242H5.623A2.147,2.147,0,0,0,3.482,5.383V24.759A2.147,2.147,0,0,0,5.623,26.9H17.195C17.063,21.142,19.03,9.968,23.192,3.242Z" style="fill:#0f80cc"/><path d="M22.554,3.867H5.623A1.518,1.518,0,0,0,4.107,5.383V23.345a42.01,42.01,0,0,1,13.569-2.684A123.555,123.555,0,0,1,22.554,3.867Z" style="fill:url(#a)"/><path d="M27.29,2.608c-1.2-1.073-2.66-.642-4.1.634-.213.19-.426.4-.638.625A25.4,25.4,0,0,0,17.1,15a10.178,10.178,0,0,1,.634,1.822c.036.14.069.272.1.384.062.265.1.437.1.437s-.022-.083-.113-.346l-.059-.17c-.01-.027-.023-.059-.038-.094-.16-.373-.6-1.16-.8-1.5-.167.493-.315.954-.438,1.371a12.131,12.131,0,0,1,.908,2.8s-.03-.115-.171-.515a19.037,19.037,0,0,0-.9-1.708,4.037,4.037,0,0,0-.264,1.724,6.009,6.009,0,0,1,.493,1.383c.334,1.283.566,2.846.566,2.846s.008.1.02.263a26.145,26.145,0,0,0,.065,3.205,11.362,11.362,0,0,0,.584,3.1l.18-.1a13.859,13.859,0,0,1-.478-4.628,35.269,35.269,0,0,1,1.938-9.688c2.01-5.308,4.8-9.568,7.35-11.6-2.326,2.1-5.474,8.9-6.417,11.418a45.656,45.656,0,0,0-2.254,8A6.211,6.211,0,0,1,21.39,20s1.233-1.521,2.674-3.693a26.206,26.206,0,0,0-2.755.733c-.7.294-.889.394-.889.394a23.939,23.939,0,0,1,4.215-2.007c2.676-4.215,5.592-10.2,2.656-12.824" style="fill:#003b57"/></svg>\ No newline at end of filediff --git a/dashboard/src/assets/react.svg b/dashboard/src/assets/react.svgnew file mode 100644index 000000000..6c87de9bb--- /dev/null+++ b/dashboard/src/assets/react.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>\ No newline at end of filediff --git a/dashboard/src/components/Layout.css b/dashboard/src/components/Layout.cssnew file mode 100644index 000000000..6ef68d0e6--- /dev/null+++ b/dashboard/src/components/Layout.css@@ -0,0 +1,338 @@+.layout {+ display: flex;+ min-height: 100vh;+}++/* ==================== Sidebar ==================== */+.sidebar {+ width: 260px;+ background: var(--bg-white);+ border-right: 1px solid var(--border);+ display: flex;+ flex-direction: column;+ position: fixed;+ height: 100vh;+ z-index: 100;+ transition:+ width 0.3s ease,+ transform 0.3s ease;+}++.sidebar.collapsed {+ width: 72px;+}++.sidebar-header {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ padding: 1.5rem;+ border-bottom: 1px solid var(--border);+ min-height: 72px;+}++.sidebar.collapsed .sidebar-header {+ justify-content: center;+ padding: 1.5rem 1rem;+}++.sidebar-logo {+ width: 28px;+ height: 28px;+ object-fit: contain;+ flex-shrink: 0;+}++.mobile-brand .sidebar-logo {+ width: 24px;+ height: 24px;+}++.sidebar-brand {+ display: flex;+ flex-direction: column;+ overflow: hidden;+ white-space: nowrap;+}++.brand-name {+ font-size: 1.125rem;+ font-weight: 800;+ color: var(--text-primary);+ letter-spacing: -0.01em;+}++.brand-subtitle {+ font-size: 0.7rem;+ font-weight: 500;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ color: var(--text-muted);+}++/* Collapse Toggle Button - Circular design at edge */+.collapse-toggle {+ position: absolute;+ right: -14px;+ top: 36px;+ width: 28px;+ height: 28px;+ border-radius: 50%;+ background: var(--bg-white);+ border: 1px solid var(--border);+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);+ display: flex;+ align-items: center;+ justify-content: center;+ cursor: pointer;+ color: var(--text-secondary);+ transition: all 0.2s;+ z-index: 101;+ padding: 0;+}++.collapse-toggle:hover {+ background: var(--primary);+ border-color: var(--primary);+ color: white;+ box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);+}++.collapse-toggle svg {+ width: 16px;+ height: 16px;+}++.sidebar.collapsed .collapse-toggle {+ right: -14px;+}++.sidebar-nav {+ flex: 1;+ padding: 1rem 0.75rem;+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+ overflow-y: auto;+}++.sidebar.collapsed .sidebar-nav {+ padding: 1rem 0.5rem;+}++.nav-item {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ padding: 0.7rem 1rem;+ color: var(--text-secondary);+ text-decoration: none;+ border-radius: var(--radius);+ font-size: 0.875rem;+ font-weight: 500;+ transition: all 0.2s;+ white-space: nowrap;+ overflow: hidden;+}++.sidebar.collapsed .nav-item {+ justify-content: center;+ padding: 0.7rem;+}++.nav-item:hover {+ background: var(--bg-light);+ color: var(--text-primary);+ text-decoration: none;+}++.nav-item.active {+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+}++.nav-item.active svg {+ color: var(--primary);+}++.sidebar-footer {+ padding: 0.75rem;+ display: flex;+ flex-direction: column;+ gap: 0.5rem;+ border-top: 1px solid var(--border);+}++.sidebar.collapsed .sidebar-footer {+ padding: 0.75rem 0.5rem;+}++.theme-toggle-btn {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ padding: 0.6rem 0.9rem;+ color: var(--text-secondary);+ background: none;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ font-size: 0.875rem;+ font-weight: 500;+ cursor: pointer;+ transition: all 0.2s;+ white-space: nowrap;+ overflow: hidden;+}++.sidebar.collapsed .theme-toggle-btn,+.sidebar.collapsed .logout-btn {+ justify-content: center;+ padding: 0.6rem;+}++.theme-toggle-btn:hover {+ background: var(--bg-light);+ color: var(--text-primary);+}++.logout-btn {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ padding: 0.6rem 0.9rem;+ color: var(--text-secondary);+ background: none;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ font-size: 0.875rem;+ font-weight: 500;+ cursor: pointer;+ transition: all 0.2s;+ white-space: nowrap;+ overflow: hidden;+}++.logout-btn:hover {+ background: #fee2e2;+ border-color: #fecaca;+ color: #dc2626;+}++/* ==================== Main Content ==================== */+.main-content {+ flex: 1;+ margin-left: 260px;+ width: calc(100% - 260px);+ background: var(--bg-light);+ min-height: 100vh;+ overflow-x: hidden;+ transition:+ margin-left 0.3s ease,+ width 0.3s ease;+}++.main-content.expanded {+ margin-left: 72px;+ width: calc(100% - 72px);+}++/* ==================== Mobile Styles ==================== */+.mobile-header {+ display: none;+}++.sidebar-overlay {+ display: none;+}++@media (max-width: 767px) {+ .mobile-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ position: fixed;+ top: 0;+ left: 0;+ right: 0;+ height: 56px;+ padding: 0 1rem;+ background: var(--bg-white);+ border-bottom: 1px solid var(--border);+ z-index: 90;+ }++ .mobile-menu-btn {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 40px;+ height: 40px;+ background: transparent !important;+ border: none;+ color: var(--text-primary);+ cursor: pointer;+ border-radius: var(--radius);+ transition: background 0.2s;+ padding: 0;+ }++ .mobile-menu-btn svg {+ color: var(--text-primary);+ stroke: var(--text-primary);+ }++ .mobile-menu-btn:hover {+ background: var(--bg-light) !important;+ }++ .mobile-brand {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ }++ .mobile-brand .brand-name {+ font-size: 1rem;+ }++ .sidebar.mobile {+ transform: translateX(-100%);+ width: 280px;+ box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);+ }++ .sidebar.mobile.open {+ transform: translateX(0);+ }++ .sidebar-overlay {+ display: block;+ position: fixed;+ inset: 0;+ background: rgba(0, 0, 0, 0.5);+ z-index: 95;+ animation: fadeIn 0.2s ease;+ }++ @keyframes fadeIn {+ from {+ opacity: 0;+ }+ to {+ opacity: 1;+ }+ }++ .main-content.mobile {+ margin-left: 0;+ width: 100%;+ padding-top: 56px;+ height: 100vh;+ overflow-y: auto;+ -webkit-overflow-scrolling: touch;+ }++ .collapse-toggle {+ display: none;+ }+}diff --git a/dashboard/src/components/Layout.tsx b/dashboard/src/components/Layout.tsxnew file mode 100644index 000000000..96ed2d197--- /dev/null+++ b/dashboard/src/components/Layout.tsx@@ -0,0 +1,164 @@+import { useState, useEffect } from 'react';+import { NavLink, Outlet } from 'react-router-dom';+import {+ LayoutDashboard,+ Smartphone,+ Webhook,+ Key,+ FileText,+ LogOut,+ Send,+ Server,+ Puzzle,+ Sun,+ Moon,+ Monitor,+ Menu,+ X,+ ChevronLeft,+ ChevronRight,+} from 'lucide-react';+import { useTheme } from '../hooks/useTheme';+import { type UserRole } from '../hooks/useRole';+import './Layout.css';++interface LayoutProps {+ onLogout: () => void;+ userRole: UserRole | null;+}++const allNavItems = [+ { to: '/', icon: LayoutDashboard, label: 'Dashboard', adminOnly: false },+ { to: '/sessions', icon: Smartphone, label: 'Sessions', adminOnly: false },+ { to: '/webhooks', icon: Webhook, label: 'Webhooks', adminOnly: false },+ { to: '/api-keys', icon: Key, label: 'API Keys', adminOnly: true },+ { to: '/message-tester', icon: Send, label: 'Message Tester', adminOnly: false },+ { to: '/infrastructure', icon: Server, label: 'Infrastructure', adminOnly: false },+ { to: '/plugins', icon: Puzzle, label: 'Plugins', adminOnly: true },+ { to: '/logs', icon: FileText, label: 'Logs', adminOnly: false },+];++const themeIcons = { light: Sun, dark: Moon, system: Monitor };+const themeLabels = { light: 'Light', dark: 'Dark', system: 'System' };++export function Layout({ onLogout, userRole }: LayoutProps) {+ const { theme, toggleTheme } = useTheme();+ const ThemeIcon = themeIcons[theme];++ // Filter navigation items based on user role+ const navItems = allNavItems.filter(item => !item.adminOnly || userRole === 'admin');++ // Sidebar state - collapsed on desktop, hidden on mobile+ const [isCollapsed, setIsCollapsed] = useState(false);+ const [isMobileOpen, setIsMobileOpen] = useState(false);+ const [isMobile, setIsMobile] = useState(window.innerWidth < 768);++ // Handle window resize+ useEffect(() => {+ const handleResize = () => {+ const mobile = window.innerWidth < 768;+ setIsMobile(mobile);+ if (!mobile) {+ setIsMobileOpen(false);+ }+ };+ window.addEventListener('resize', handleResize);+ return () => window.removeEventListener('resize', handleResize);+ }, []);++ // Close mobile sidebar when nav item is clicked+ const handleNavClick = () => {+ if (isMobile) {+ setIsMobileOpen(false);+ }+ };++ // Handle body scroll lock when mobile menu is open+ useEffect(() => {+ if (isMobileOpen) {+ document.body.style.overflow = 'hidden';+ } else {+ document.body.style.overflow = '';+ }+ return () => {+ document.body.style.overflow = '';+ };+ }, [isMobileOpen]);++ const toggleCollapse = () => setIsCollapsed(!isCollapsed);+ const toggleMobile = () => setIsMobileOpen(!isMobileOpen);++ return (+ <div className="layout">+ {/* Mobile Header */}+ {isMobile && (+ <header className="mobile-header">+ <button className="mobile-menu-btn" onClick={toggleMobile}>+ {isMobileOpen ? <X size={24} /> : <Menu size={24} />}+ </button>+ <div className="mobile-brand">+ <img src="/openwa_logo.webp" alt="OpenWA" className="sidebar-logo" />+ <span className="brand-name">OpenWA</span>+ </div>+ <div style={{ width: 40 }} /> {/* Spacer for centering */}+ </header>+ )}++ {/* Overlay for mobile */}+ {isMobile && isMobileOpen && <div className="sidebar-overlay" onClick={() => setIsMobileOpen(false)} />}++ {/* Sidebar */}+ <aside+ className={`sidebar ${isCollapsed ? 'collapsed' : ''} ${isMobile ? 'mobile' : ''} ${isMobileOpen ? 'open' : ''}`}+ >+ <div className="sidebar-header">+ <img src="/openwa_logo.webp" alt="OpenWA" className="sidebar-logo" />+ {!isCollapsed && (+ <div className="sidebar-brand">+ <span className="brand-name">OpenWA</span>+ <span className="brand-subtitle">WhatsApp API</span>+ </div>+ )}+ </div>++ {/* Collapse toggle button - positioned at edge */}+ {!isMobile && (+ <button className="collapse-toggle" onClick={toggleCollapse} title={isCollapsed ? 'Expand' : 'Collapse'}>+ {isCollapsed ? <ChevronRight size={16} /> : <ChevronLeft size={16} />}+ </button>+ )}++ <nav className="sidebar-nav">+ {navItems.map(({ to, icon: Icon, label }) => (+ <NavLink+ key={to}+ to={to}+ className={({ isActive }) => `nav-item ${isActive ? 'active' : ''}`}+ end={to === '/'}+ onClick={handleNavClick}+ title={isCollapsed ? label : undefined}+ >+ <Icon size={20} />+ {!isCollapsed && <span>{label}</span>}+ </NavLink>+ ))}+ </nav>++ <div className="sidebar-footer">+ <button className="theme-toggle-btn" onClick={toggleTheme} title={`Theme: ${themeLabels[theme]}`}>+ <ThemeIcon size={18} />+ {!isCollapsed && <span>{themeLabels[theme]}</span>}+ </button>+ <button className="logout-btn" onClick={onLogout} title={isCollapsed ? 'Logout' : undefined}>+ <LogOut size={20} />+ {!isCollapsed && <span>Logout</span>}+ </button>+ </div>+ </aside>++ <main className={`main-content ${isCollapsed ? 'expanded' : ''} ${isMobile ? 'mobile' : ''}`}>+ <Outlet />+ </main>+ </div>+ );+}diff --git a/dashboard/src/components/PageHeader.css b/dashboard/src/components/PageHeader.cssnew file mode 100644index 000000000..a3f91a2e2--- /dev/null+++ b/dashboard/src/components/PageHeader.css@@ -0,0 +1,83 @@+/* =============================================+ PageHeader Component - Shared Styles+ Consistent header styling for all pages+ ============================================= */++.page-header {+ margin-bottom: 1.5rem;+ width: 100%;+}++.page-header__top {+ display: flex;+ justify-content: space-between;+ align-items: center;+ gap: 1rem;+}++.page-header__title-group {+ display: flex;+ align-items: center;+ gap: 0.75rem;+}++.page-header__title-group h1 {+ margin: 0;+ /* h1 styles inherited from global */+}++.page-header__badge {+ display: inline-flex;+}++.page-header__actions {+ display: flex;+ align-items: center;+ gap: 0.75rem;+}++.page-header__subtitle {+ margin: 0;+ margin-top: 0.5rem; /* Consistent 8px gap from title row */+ font-size: 0.9375rem;+ color: var(--text-muted);+ line-height: 1.5;+}++/* Mobile Responsive */+@media (max-width: 768px) {+ .page-header__top {+ flex-wrap: wrap;+ gap: 0.75rem;+ }++ .page-header__title-group h1 {+ font-size: 1.5rem;+ }++ .page-header__actions {+ flex-shrink: 0;+ }++ .page-header__subtitle {+ font-size: 0.875rem;+ }+}++@media (max-width: 480px) {+ .page-header__top {+ flex-direction: column;+ align-items: flex-start;+ }++ .page-header__actions {+ width: 100%;+ }++ .page-header__actions > button,+ .page-header__actions > .btn-primary,+ .page-header__actions > .btn-secondary {+ width: 100%;+ justify-content: center;+ }+}diff --git a/dashboard/src/components/PageHeader.tsx b/dashboard/src/components/PageHeader.tsxnew file mode 100644index 000000000..a4384c5ac--- /dev/null+++ b/dashboard/src/components/PageHeader.tsx@@ -0,0 +1,40 @@+import type { ReactNode } from 'react';+import './PageHeader.css';++interface PageHeaderProps {+ title: string;+ subtitle?: string;+ badge?: ReactNode;+ actions?: ReactNode;+}++/**+ * Shared page header component for consistent styling across all pages.+ *+ * @example+ * // Simple usage+ * <PageHeader title="Settings" subtitle="Configure application preferences" />+ *+ * @example+ * // With badge and actions+ * <PageHeader+ * title="Dashboard"+ * badge={<StatusBadge status="connected" />}+ * subtitle="Overview of your WhatsApp sessions"+ * actions={<button>Create New</button>}+ * />+ */+export function PageHeader({ title, subtitle, badge, actions }: PageHeaderProps) {+ return (+ <header className="page-header">+ <div className="page-header__top">+ <div className="page-header__title-group">+ <h1>{title}</h1>+ {badge && <span className="page-header__badge">{badge}</span>}+ </div>+ {actions && <div className="page-header__actions">{actions}</div>}+ </div>+ {subtitle && <p className="page-header__subtitle">{subtitle}</p>}+ </header>+ );+}diff --git a/dashboard/src/components/Skeleton.css b/dashboard/src/components/Skeleton.cssnew file mode 100644index 000000000..2f7c8bbe9--- /dev/null+++ b/dashboard/src/components/Skeleton.css@@ -0,0 +1,37 @@+.skeleton {+ background: linear-gradient(90deg, var(--border) 25%, rgba(0, 0, 0, 0.05) 50%, var(--border) 75%);+ background-size: 200% 100%;+ animation: shimmer 1.5s infinite;+ border-radius: 6px;+}++.skeleton-text {+ border-radius: 4px;+}++.skeleton-circle {+ border-radius: 50%;+}++.skeleton-card {+ pointer-events: none;+}++.skeleton-row td {+ padding: 1rem 0.75rem;+}++@keyframes shimmer {+ 0% {+ background-position: 200% 0;+ }+ 100% {+ background-position: -200% 0;+ }+}++/* Dark mode adjustments */+[data-theme='dark'] .skeleton {+ background: linear-gradient(90deg, var(--border) 25%, rgba(255, 255, 255, 0.05) 50%, var(--border) 75%);+ background-size: 200% 100%;+}diff --git a/dashboard/src/components/Skeleton.tsx b/dashboard/src/components/Skeleton.tsxnew file mode 100644index 000000000..c85a4893a--- /dev/null+++ b/dashboard/src/components/Skeleton.tsx@@ -0,0 +1,53 @@+import './Skeleton.css';++interface SkeletonProps {+ width?: string | number;+ height?: string | number;+ variant?: 'text' | 'rect' | 'circle';+ className?: string;+}++export function Skeleton({ width = '100%', height = '1rem', variant = 'rect', className = '' }: SkeletonProps) {+ const style = {+ width: typeof width === 'number' ? `${width}px` : width,+ height: typeof height === 'number' ? `${height}px` : height,+ };++ return <div className={`skeleton skeleton-${variant} ${className}`} style={style} aria-hidden="true" />;+}++export function SessionCardSkeleton() {+ return (+ <div className="session-card skeleton-card">+ <div className="session-header">+ <Skeleton width={120} height={20} />+ <Skeleton width={80} height={24} variant="rect" />+ </div>+ <div className="session-details">+ <Skeleton width="60%" height={14} />+ <Skeleton width="40%" height={14} />+ </div>+ <div className="session-meta">+ <Skeleton width={100} height={12} />+ <Skeleton width={80} height={12} />+ </div>+ <div className="session-actions">+ <Skeleton width={60} height={32} variant="rect" />+ <Skeleton width={60} height={32} variant="rect" />+ <Skeleton width={60} height={32} variant="rect" />+ </div>+ </div>+ );+}++export function TableRowSkeleton({ columns = 5 }: { columns?: number }) {+ return (+ <tr className="skeleton-row">+ {Array.from({ length: columns }).map((_, i) => (+ <td key={i}>+ <Skeleton width={`${60 + Math.random() * 40}%`} height={16} />+ </td>+ ))}+ </tr>+ );+}diff --git a/dashboard/src/components/Toast.css b/dashboard/src/components/Toast.cssnew file mode 100644index 000000000..766412bb1--- /dev/null+++ b/dashboard/src/components/Toast.css@@ -0,0 +1,111 @@+.toast-container {+ position: fixed;+ bottom: 1.5rem;+ right: 1.5rem;+ z-index: 9999;+ display: flex;+ flex-direction: column;+ gap: 0.75rem;+ max-width: 400px;+}++.toast {+ display: flex;+ align-items: flex-start;+ gap: 0.75rem;+ padding: 1rem 1.25rem;+ background: white;+ border-radius: 12px;+ box-shadow:+ 0 10px 40px rgba(0, 0, 0, 0.12),+ 0 4px 12px rgba(0, 0, 0, 0.08);+ border-left: 4px solid;+ animation: slideIn 0.3s ease-out;+}++@keyframes slideIn {+ from {+ transform: translateX(100%);+ opacity: 0;+ }+ to {+ transform: translateX(0);+ opacity: 1;+ }+}++.toast-success {+ border-color: #22c55e;+}++.toast-success .toast-icon {+ color: #22c55e;+}++.toast-error {+ border-color: #ef4444;+}++.toast-error .toast-icon {+ color: #ef4444;+}++.toast-warning {+ border-color: #f59e0b;+}++.toast-warning .toast-icon {+ color: #f59e0b;+}++.toast-info {+ border-color: #3b82f6;+}++.toast-info .toast-icon {+ color: #3b82f6;+}++.toast-icon {+ flex-shrink: 0;+ margin-top: 2px;+}++.toast-content {+ flex: 1;+ min-width: 0;+}++.toast-title {+ font-weight: 600;+ font-size: 0.9375rem;+ color: #1e293b;+ line-height: 1.4;+}++.toast-message {+ font-size: 0.8125rem;+ color: #64748b;+ margin-top: 0.25rem;+ line-height: 1.5;+}++.toast-close {+ flex-shrink: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ width: 24px;+ height: 24px;+ border-radius: 6px;+ border: none;+ background: transparent;+ color: #94a3b8;+ cursor: pointer;+ transition: all 0.15s ease;+}++.toast-close:hover {+ background: #f1f5f9;+ color: #475569;+}diff --git a/dashboard/src/components/Toast.tsx b/dashboard/src/components/Toast.tsxnew file mode 100644index 000000000..d41df26e3--- /dev/null+++ b/dashboard/src/components/Toast.tsx@@ -0,0 +1,129 @@+import { createContext, useContext, useState, useCallback, type ReactNode } from 'react';+import { CheckCircle, XCircle, AlertCircle, Info, X } from 'lucide-react';+import './Toast.css';++type ToastType = 'success' | 'error' | 'warning' | 'info';++interface Toast {+ id: string;+ type: ToastType;+ title: string;+ message?: string;+ duration?: number;+}++interface ToastContextValue {+ toasts: Toast[];+ addToast: (toast: Omit<Toast, 'id'>) => void;+ removeToast: (id: string) => void;+ success: (title: string, message?: string) => void;+ error: (title: string, message?: string) => void;+ warning: (title: string, message?: string) => void;+ info: (title: string, message?: string) => void;+}++const ToastContext = createContext<ToastContextValue | null>(null);++export function useToast() {+ const context = useContext(ToastContext);+ if (!context) {+ throw new Error('useToast must be used within a ToastProvider');+ }+ return context;+}++interface ToastProviderProps {+ children: ReactNode;+}++export function ToastProvider({ children }: ToastProviderProps) {+ const [toasts, setToasts] = useState<Toast[]>([]);++ const removeToast = useCallback((id: string) => {+ setToasts(prev => prev.filter(t => t.id !== id));+ }, []);++ const addToast = useCallback(+ (toast: Omit<Toast, 'id'>) => {+ const id = crypto.randomUUID();+ const newToast = { ...toast, id };+ setToasts(prev => [...prev, newToast]);++ // Auto-remove after duration+ const duration = toast.duration ?? 4000;+ if (duration > 0) {+ setTimeout(() => removeToast(id), duration);+ }+ },+ [removeToast],+ );++ const success = useCallback(+ (title: string, message?: string) => {+ addToast({ type: 'success', title, message });+ },+ [addToast],+ );++ const error = useCallback(+ (title: string, message?: string) => {+ addToast({ type: 'error', title, message, duration: 6000 });+ },+ [addToast],+ );++ const warning = useCallback(+ (title: string, message?: string) => {+ addToast({ type: 'warning', title, message });+ },+ [addToast],+ );++ const info = useCallback(+ (title: string, message?: string) => {+ addToast({ type: 'info', title, message });+ },+ [addToast],+ );++ return (+ <ToastContext.Provider value={{ toasts, addToast, removeToast, success, error, warning, info }}>+ {children}+ <ToastContainer toasts={toasts} removeToast={removeToast} />+ </ToastContext.Provider>+ );+}++const icons = {+ success: CheckCircle,+ error: XCircle,+ warning: AlertCircle,+ info: Info,+};++interface ToastContainerProps {+ toasts: Toast[];+ removeToast: (id: string) => void;+}++function ToastContainer({ toasts, removeToast }: ToastContainerProps) {+ return (+ <div className="toast-container">+ {toasts.map(toast => {+ const Icon = icons[toast.type];+ return (+ <div key={toast.id} className={`toast toast-${toast.type}`}>+ <Icon className="toast-icon" size={20} />+ <div className="toast-content">+ <div className="toast-title">{toast.title}</div>+ {toast.message && <div className="toast-message">{toast.message}</div>}+ </div>+ <button className="toast-close" onClick={() => removeToast(toast.id)}>+ <X size={16} />+ </button>+ </div>+ );+ })}+ </div>+ );+}diff --git a/dashboard/src/hooks/useDocumentTitle.ts b/dashboard/src/hooks/useDocumentTitle.tsnew file mode 100644index 000000000..1c5242039--- /dev/null+++ b/dashboard/src/hooks/useDocumentTitle.ts@@ -0,0 +1,16 @@+import { useEffect } from 'react';++/**+ * Custom hook to set document title dynamically.+ * Automatically appends " | OpenWA" suffix.+ */+export function useDocumentTitle(title: string) {+ useEffect(() => {+ const previousTitle = document.title;+ document.title = `${title} | OpenWA`;++ return () => {+ document.title = previousTitle;+ };+ }, [title]);+}diff --git a/dashboard/src/hooks/useRole.tsx b/dashboard/src/hooks/useRole.tsxnew file mode 100644index 000000000..ad8fe341a--- /dev/null+++ b/dashboard/src/hooks/useRole.tsx@@ -0,0 +1,41 @@+import { createContext, useContext, useState, useCallback, type ReactNode } from 'react';+import type { UserRole, RoleContextType } from '../types/role';++export type { UserRole, RoleContextType } from '../types/role';++const RoleContext = createContext<RoleContextType | undefined>(undefined);++export function RoleProvider({ children }: { children: ReactNode }) {+ const [role, setRoleState] = useState<UserRole | null>(() => {+ const saved = localStorage.getItem('openwa_user_role');+ return (saved as UserRole) || null;+ });++ const setRole = useCallback((newRole: UserRole | null) => {+ setRoleState(newRole);+ if (newRole) {+ localStorage.setItem('openwa_user_role', newRole);+ } else {+ localStorage.removeItem('openwa_user_role');+ }+ }, []);++ const value: RoleContextType = {+ role,+ setRole,+ isAdmin: role === 'admin',+ isOperator: role === 'operator',+ isViewer: role === 'viewer',+ canWrite: role === 'admin' || role === 'operator',+ };++ return <RoleContext.Provider value={value}>{children}</RoleContext.Provider>;+}++export function useRole(): RoleContextType {+ const context = useContext(RoleContext);+ if (context === undefined) {+ throw new Error('useRole must be used within a RoleProvider');+ }+ return context;+}diff --git a/dashboard/src/hooks/useTheme.ts b/dashboard/src/hooks/useTheme.tsnew file mode 100644index 000000000..1d537dcfc--- /dev/null+++ b/dashboard/src/hooks/useTheme.ts@@ -0,0 +1,46 @@+import { useState, useEffect, useCallback } from 'react';++type Theme = 'light' | 'dark' | 'system';++const THEME_KEY = 'openwa_theme';++export function useTheme() {+ const [theme, setThemeState] = useState<Theme>(() => {+ const saved = localStorage.getItem(THEME_KEY) as Theme | null;+ return saved || 'system';+ });++ const applyTheme = useCallback((newTheme: Theme) => {+ const root = document.documentElement;++ if (newTheme === 'system') {+ // Remove data-theme to let CSS media query handle it+ root.removeAttribute('data-theme');+ } else {+ root.setAttribute('data-theme', newTheme);+ }+ }, []);++ useEffect(() => {+ applyTheme(theme);+ localStorage.setItem(THEME_KEY, theme);+ }, [theme, applyTheme]);++ const setTheme = useCallback((newTheme: Theme) => {+ setThemeState(newTheme);+ }, []);++ const toggleTheme = useCallback(() => {+ setThemeState(prev => {+ if (prev === 'light') return 'dark';+ if (prev === 'dark') return 'system';+ return 'light';+ });+ }, []);++ // Get the resolved theme (what's actually displayed)+ const resolvedTheme =+ theme === 'system' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme;++ return { theme, setTheme, toggleTheme, resolvedTheme };+}diff --git a/dashboard/src/hooks/useWebSocket.ts b/dashboard/src/hooks/useWebSocket.tsnew file mode 100644index 000000000..e6ca3346e--- /dev/null+++ b/dashboard/src/hooks/useWebSocket.ts@@ -0,0 +1,115 @@+import { useEffect, useRef, useCallback, useState } from 'react';+import { io, Socket } from 'socket.io-client';++interface SessionStatusEvent {+ sessionId: string;+ status: string;+ timestamp: string;+}++interface QRCodeEvent {+ sessionId: string;+ qrCode: string;+ timestamp: string;+}++interface MessageEvent {+ sessionId: string;+ message: Record<string, unknown>;+ timestamp: string;+}++interface WebSocketEvents {+ onSessionStatus?: (event: SessionStatusEvent) => void;+ onQRCode?: (event: QRCodeEvent) => void;+ onMessage?: (event: MessageEvent) => void;+}++// Use current origin for WebSocket (goes through nginx proxy in Docker)+// Falls back to env var or localhost for development+const SOCKET_URL = import.meta.env.VITE_WS_URL || window.location.origin;++export function useWebSocket(events: WebSocketEvents = {}) {+ const socketRef = useRef<Socket | null>(null);+ const [isConnected, setIsConnected] = useState(false);++ const connect = useCallback(() => {+ if (socketRef.current?.connected) return;++ // Get API key from localStorage (same as api.ts)+ const apiKey = localStorage.getItem('openwa_api_key');++ if (!apiKey) {+ console.warn('[WebSocket] No API key found, skipping connection');+ return;+ }++ socketRef.current = io(`${SOCKET_URL}/events`, {+ autoConnect: true,+ reconnection: true,+ reconnectionAttempts: 5,+ reconnectionDelay: 1000,+ auth: {+ apiKey,+ },+ extraHeaders: {+ 'X-API-Key': apiKey,+ },+ query: {+ apiKey,+ },+ });++ socketRef.current.on('connect', () => {+ console.log('[WebSocket] Connected');+ setIsConnected(true);+ });++ socketRef.current.on('disconnect', () => {+ console.log('[WebSocket] Disconnected');+ setIsConnected(false);+ });++ socketRef.current.on('connect_error', error => {+ console.warn('[WebSocket] Connection error:', error.message);+ });+ }, []);++ useEffect(() => {+ connect();++ return () => {+ if (socketRef.current) {+ socketRef.current.disconnect();+ socketRef.current = null;+ }+ };+ }, [connect]);++ // Register event handlers+ useEffect(() => {+ if (!socketRef.current) return;++ const socket = socketRef.current;++ if (events.onSessionStatus) {+ socket.on('session:status', events.onSessionStatus);+ }++ if (events.onQRCode) {+ socket.on('session:qr', events.onQRCode);+ }++ if (events.onMessage) {+ socket.on('session:message', events.onMessage);+ }++ return () => {+ socket.off('session:status');+ socket.off('session:qr');+ socket.off('session:message');+ };+ }, [events.onSessionStatus, events.onQRCode, events.onMessage]);++ return { isConnected };+}diff --git a/dashboard/src/index.css b/dashboard/src/index.cssnew file mode 100644index 000000000..aedb09bc0--- /dev/null+++ b/dashboard/src/index.css@@ -0,0 +1,300 @@+:root {+ font-family: 'Plus Jakarta Sans', system-ui, Avenir, Helvetica, Arial, sans-serif;+ line-height: 1.6;+ font-weight: 400;++ color-scheme: light dark;+ color: var(--text-primary);+ background-color: var(--bg-light);++ font-synthesis: none;+ text-rendering: optimizeLegibility;+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;+}++a {+ font-weight: 500;+ color: #646cff;+ text-decoration: inherit;+}+a:hover {+ color: #535bf2;+}++body {+ margin: 0;+ min-width: 320px;+ min-height: 100vh;+}++h1 {+ font-size: 1.875rem;+ font-weight: 700;+ color: var(--text-primary);+ margin: 0;+ letter-spacing: -0.025em;+}++h2 {+ font-size: 0.8125rem;+ font-weight: 600;+ color: var(--text-secondary);+ text-transform: uppercase;+ letter-spacing: 0.05em;+ margin: 0;+}++h3 {+ font-size: 1rem;+ font-weight: 600;+ color: var(--text-primary);+ margin: 0;+}++button {+ border-radius: 8px;+ border: 1px solid transparent;+ padding: 0.6em 1.2em;+ font-size: 1em;+ font-weight: 500;+ font-family: inherit;+ background-color: #1a1a1a;+ cursor: pointer;+ transition: border-color 0.25s;+}+button:hover {+ border-color: #646cff;+}+button:focus,+button:focus-visible {+ outline: 4px auto -webkit-focus-ring-color;+}++@media (prefers-color-scheme: light) {+ :root {+ color: #213547;+ background-color: #ffffff;+ }+ a:hover {+ color: #747bff;+ }+ button {+ background-color: #f9f9f9;+ }+}++/* Global select/dropdown styling */+select {+ appearance: none;+ -webkit-appearance: none;+ -moz-appearance: none;+ width: 100%;+ padding: 0.75rem 2.5rem 0.75rem 1rem;+ font-size: 0.9375rem;+ font-family: inherit;+ color: var(--text-primary);+ background-color: var(--bg-white, #fff);+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");+ background-repeat: no-repeat;+ background-position: right 0.75rem center;+ background-size: 16px;+ border: 1px solid var(--border, #e2e8f0);+ border-radius: 8px;+ cursor: pointer;+ transition: all 0.2s;+}++select:hover {+ border-color: var(--primary, #25d366);+}++select:focus {+ outline: none;+ border-color: var(--primary, #25d366);+ box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);+}++select:disabled {+ background-color: var(--bg-light, #f8fafc);+ color: var(--text-muted, #94a3b8);+ cursor: not-allowed;+}++/* ============================================+ GLOBAL MODAL STYLES+ ============================================ */++/* Modal Overlay */+.modal-overlay {+ position: fixed;+ inset: 0;+ background: rgba(0, 0, 0, 0.5);+ backdrop-filter: blur(4px);+ display: flex;+ align-items: center;+ justify-content: center;+ z-index: 1000;+ animation: fadeIn 0.2s ease;+}++@keyframes fadeIn {+ from {+ opacity: 0;+ }+ to {+ opacity: 1;+ }+}++/* Modal Card */+.modal {+ background: var(--bg-white, #fff);+ border-radius: 16px;+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);+ width: 90%;+ max-width: 480px;+ animation: slideUp 0.3s ease;+ overflow: hidden;+}++@keyframes slideUp {+ from {+ opacity: 0;+ transform: translateY(20px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }+}++.modal-header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: 1.5rem 1.5rem 1rem;+ border-bottom: 1px solid var(--border, #e2e8f0);+}++.modal-header h2 {+ font-size: 1.25rem;+ font-weight: 700;+ color: var(--text-primary, #1e293b);+ margin: 0;+ text-transform: none;+ letter-spacing: normal;+}++.modal-body {+ padding: 1.5rem;+}++.modal-body label {+ display: block;+ font-size: 0.875rem;+ font-weight: 600;+ color: var(--text-secondary, #64748b);+ margin-bottom: 0.5rem;+}++.modal-body input {+ width: 100%;+ padding: 0.875rem 1rem;+ border: 1px solid var(--border, #e2e8f0);+ border-radius: 8px;+ font-size: 0.9375rem;+ background: var(--bg-light, #f8fafc);+ transition: all 0.2s;+ box-sizing: border-box;+}++.modal-body input:focus {+ outline: none;+ border-color: var(--primary, #25d366);+ background: var(--bg-white, #fff);+ box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);+}++.modal-footer {+ display: flex;+ justify-content: flex-end;+ gap: 0.75rem;+ padding: 1rem 1.5rem 1.5rem;+}++/* Icon Button (modal close X) */+.btn-icon {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 36px;+ height: 36px;+ background: var(--bg-light, #f8fafc);+ border: 1px solid var(--border, #e2e8f0);+ border-radius: 8px;+ cursor: pointer;+ color: var(--text-secondary, #64748b);+ transition: all 0.2s;+ flex-shrink: 0;+ padding: 0;+}++.btn-icon svg {+ width: 20px;+ height: 20px;+ stroke: var(--text-secondary, #64748b);+}++.btn-icon:hover {+ background: #fee2e2;+ border-color: #fecaca;+ color: #dc2626;+}++.btn-icon:hover svg {+ stroke: #dc2626;+}++/* Secondary Button */+.btn-secondary {+ padding: 0.75rem 1.25rem;+ background: var(--bg-light, #f8fafc);+ color: var(--text-secondary, #64748b);+ border: 1px solid var(--border, #e2e8f0);+ border-radius: 8px;+ font-size: 0.9375rem;+ font-weight: 600;+ cursor: pointer;+ transition: all 0.2s;+}++.btn-secondary:hover {+ background: var(--bg-white, #fff);+ border-color: var(--text-muted, #94a3b8);+ color: var(--text-primary, #1e293b);+}++/* Spin Animation */+@keyframes spin {+ from {+ transform: rotate(0deg);+ }+ to {+ transform: rotate(360deg);+ }+}++.animate-spin {+ animation: spin 1s linear infinite;+}++/* Code element styling */+code {+ background: var(--bg-light, #f1f5f9);+ padding: 0.125rem 0.375rem;+ border-radius: 4px;+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;+ font-size: 0.875em;+ color: var(--text-primary, #1e293b);+}diff --git a/dashboard/src/main.tsx b/dashboard/src/main.tsxnew file mode 100644index 000000000..bef5202a3--- /dev/null+++ b/dashboard/src/main.tsx@@ -0,0 +1,10 @@+import { StrictMode } from 'react'+import { createRoot } from 'react-dom/client'+import './index.css'+import App from './App.tsx'++createRoot(document.getElementById('root')!).render(+ <StrictMode>+ <App />+ </StrictMode>,+)diff --git a/dashboard/src/pages/ApiKeys.css b/dashboard/src/pages/ApiKeys.cssnew file mode 100644index 000000000..c2522a5fc--- /dev/null+++ b/dashboard/src/pages/ApiKeys.css@@ -0,0 +1,454 @@+.api-keys-page {+ padding: 2rem;+ width: 100%;+ box-sizing: border-box;+}++.page-header {+ margin-bottom: 2rem;+}++.header-content {+ display: flex;+ justify-content: space-between;+ align-items: center;+}++/* H1 inherited from global */++.btn-primary {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.75rem 1.25rem;+ background: var(--primary);+ color: white;+ border: none;+ border-radius: var(--radius);+ font-size: 0.9375rem;+ font-weight: 600;+ cursor: pointer;+ transition: background 0.2s;+}++.btn-primary:hover {+ background: var(--primary-hover);+}++.api-keys-content {+ display: flex;+ flex-direction: column;+ gap: 1.5rem;+}++.keys-table-container {+ background: var(--bg-white);+ border-radius: 12px;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+ width: 100%;+ overflow-x: auto;+}++.keys-table {+ width: 100%;+ font-size: 0.875rem;+ border-collapse: collapse;+}++/* Table header and row styling */+.keys-table thead tr.table-row.header th {+ background: var(--bg-light);+ font-size: 0.7rem;+ font-weight: 700;+ color: var(--text-secondary);+ text-transform: uppercase;+ letter-spacing: 0.05em;+ border-bottom: 1px solid var(--border);+ padding: 1.125rem 1.5rem;+ text-align: left;+}++.keys-table tbody tr.table-row td {+ padding: 1.125rem 1.5rem;+ border-bottom: 1px solid var(--border);+ vertical-align: middle;+}++.keys-table tbody tr.table-row:last-child td {+ border-bottom: none;+}++.keys-table tbody tr.table-row:hover {+ background: rgba(37, 211, 102, 0.05);+}++.keys-table tbody tr.table-row:nth-child(even) {+ background: rgba(0, 0, 0, 0.02);+}++.keys-table tbody tr.table-row:nth-child(even):hover {+ background: rgba(37, 211, 102, 0.05);+}++.name-cell {+ font-weight: 500;+ color: var(--text-primary);+ white-space: nowrap;+}++.key-cell {+ display: flex;+ align-items: center;+ gap: 0.5rem;+}++.key-cell code {+ font-size: 0.8125rem;+ color: var(--text-secondary);+ background: var(--bg-light);+ padding: 0.375rem 0.625rem;+ border-radius: 4px;+ font-family: monospace;+ white-space: nowrap;+}++.icon-btn-sm {+ padding: 0.25rem;+ background: transparent;+ border: none;+ color: var(--text-muted);+ cursor: pointer;+ transition: color 0.2s;+ flex-shrink: 0;+}++.icon-btn-sm:hover {+ color: var(--text-primary);+}++.permissions-cell {+ display: flex;+ flex-wrap: wrap;+ gap: 0.25rem;+}++.permission-badge {+ font-size: 0.6875rem;+ padding: 0.25rem 0.5rem;+ background: #e0f2fe;+ color: #0369a1;+ border-radius: 4px;+ font-weight: 500;+ white-space: nowrap;+}++.permission-badge:first-child:last-child {+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+}++.rate-limit {+ font-family: monospace;+ font-size: 0.8125rem;+ color: var(--text-secondary);+ white-space: nowrap;+}++.actions-cell {+ display: flex;+ gap: 0.25rem;+ justify-content: flex-end;+}++.icon-btn {+ padding: 0.5rem;+ background: transparent;+ border: 1px solid var(--border);+ border-radius: 6px;+ cursor: pointer;+ color: var(--text-secondary);+ transition: all 0.2s;+ flex-shrink: 0;+}++.icon-btn:hover {+ background: var(--bg-light);+ color: var(--text-primary);+}++.icon-btn.danger:hover {+ background: #fee2e2;+ border-color: #fecaca;+ color: #dc2626;+}++.permissions-reference {+ background: var(--bg-white);+ border-radius: 12px;+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+}++.permissions-reference h3 {+ /* Inherits from H3 */+ margin-bottom: 1rem;+}++.permissions-list {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));+ gap: 0.75rem;+}++.perm-item {+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+ padding: 0.75rem;+ background: var(--bg-light);+ border-radius: var(--radius);+}++.perm-item code {+ font-size: 0.8125rem;+ color: var(--primary);+ background: rgba(37, 211, 102, 0.1);+ padding: 0.25rem 0.5rem;+ border-radius: 4px;+ width: fit-content;+}++.perm-item span {+ font-size: 0.75rem;+ color: var(--text-secondary);+}++/* Empty Table State */+.empty-table-state {+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ padding: 4rem 2rem;+ text-align: center;+ color: var(--text-muted);+}++.empty-table-state svg {+ margin-bottom: 1rem;+ opacity: 0.4;+ color: var(--text-muted);+}++.empty-table-state h3 {+ font-size: 1.125rem;+ font-weight: 600;+ color: var(--text-secondary);+ margin: 0 0 0.5rem;+}++.empty-table-state p {+ margin: 0;+ font-size: 0.875rem;+ max-width: 300px;+}++/* Confirmation Modal Styles */+.confirm-modal {+ max-width: 400px;+}++.confirm-icon-wrapper {+ display: flex;+ justify-content: center;+ margin-bottom: 1rem;+}++.confirm-warning-icon {+ color: #f59e0b;+}++.confirm-message {+ text-align: center;+ color: var(--text-secondary);+ font-size: 0.9375rem;+ line-height: 1.6;+ margin: 0;+}++.confirm-message strong {+ color: var(--text-primary);+}++.btn-danger {+ padding: 0.75rem 1.25rem;+ background: #dc2626;+ color: white;+ border: none;+ border-radius: 8px;+ font-size: 0.9375rem;+ font-weight: 600;+ cursor: pointer;+ transition: background 0.2s;+}++.btn-danger:hover {+ background: #b91c1c;+}++/* Mobile Responsive */+@media (max-width: 768px) {+ .api-keys-page {+ padding: 1rem;+ }++ /* Header adjustments for mobile */+ .api-keys-page .header-content {+ flex-direction: column;+ align-items: stretch;+ gap: 1rem;+ }++ .api-keys-page .btn-primary {+ width: 100%;+ justify-content: center;+ }++ .keys-table-container {+ overflow-x: visible;+ border: none;+ background: transparent;+ box-shadow: none;+ }++ /* Switch to card layout on mobile */+ .keys-table {+ display: block;+ }++ .keys-table thead {+ display: none;+ }++ .keys-table tbody {+ display: flex;+ flex-direction: column;+ gap: 1rem;+ }++ .keys-table tbody tr.table-row {+ display: flex;+ flex-direction: column;+ gap: 0.75rem;+ padding: 1rem;+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: 12px;+ box-shadow: var(--shadow-sm);+ }++ .keys-table tbody tr.table-row:hover,+ .keys-table tbody tr.table-row:nth-child(even),+ .keys-table tbody tr.table-row:nth-child(even):hover {+ background: var(--bg-white);+ }++ .keys-table tbody tr.table-row td {+ padding: 0;+ border-bottom: none;+ display: block;+ }++ /* Name cell - prominent at top */+ .keys-table tbody tr.table-row td:first-child {+ order: 1;+ }++ .keys-table tbody tr.table-row td:first-child .name-cell {+ font-size: 1.125rem;+ font-weight: 600;+ display: block;+ color: var(--text-primary);+ }++ /* Key cell */+ .keys-table tbody tr.table-row td:nth-child(2) {+ order: 2;+ }++ .keys-table tbody tr.table-row td:nth-child(2) .key-cell {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ flex-wrap: wrap;+ }++ .keys-table tbody tr.table-row td:nth-child(2) .key-cell code {+ font-size: 0.75rem;+ word-break: break-all;+ white-space: normal;+ }++ /* Role & Status - wrapper for badges */+ .keys-table tbody tr.table-row td:nth-child(3),+ .keys-table tbody tr.table-row td:nth-child(4) {+ display: inline-block;+ order: 3;+ }++ .keys-table tbody tr.table-row td:nth-child(3) {+ margin-right: 0.5rem;+ }++ /* Status badges styling */+ .status-badge {+ font-size: 0.6875rem;+ padding: 0.25rem 0.5rem;+ border-radius: 9999px;+ font-weight: 600;+ }++ .status-badge.active {+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+ }++ .status-badge.inactive {+ background: #fee2e2;+ color: #dc2626;+ }++ /* Actions cell - bottom with separator */+ .keys-table tbody tr.table-row td:last-child {+ order: 5;+ margin-top: 0.5rem;+ padding-top: 0.75rem;+ border-top: 1px solid var(--border);+ }++ .keys-table tbody tr.table-row td:last-child .actions-cell {+ justify-content: flex-start;+ gap: 0.5rem;+ }++ /* Permissions reference mobile */+ .permissions-reference {+ padding: 1rem;+ }++ .permissions-reference h3 {+ font-size: 0.9375rem;+ }+}++@media (max-width: 480px) {+ .permissions-list {+ grid-template-columns: 1fr;+ }++ .api-keys-page {+ padding: 0.75rem;+ }+}diff --git a/dashboard/src/pages/ApiKeys.tsx b/dashboard/src/pages/ApiKeys.tsxnew file mode 100644index 000000000..b1b08878c--- /dev/null+++ b/dashboard/src/pages/ApiKeys.tsx@@ -0,0 +1,408 @@+import { useState, useEffect, useMemo } from 'react';+import {+ useReactTable,+ getCoreRowModel,+ flexRender,+ createColumnHelper,+ type VisibilityState,+} from '@tanstack/react-table';+import { Plus, Copy, RefreshCw, Trash2, Eye, EyeOff, Loader2, X, Check, KeyRound, AlertTriangle } from 'lucide-react';+import { apiKeyApi, type ApiKey } from '../services/api';+import { useDocumentTitle } from '../hooks/useDocumentTitle';+import { PageHeader } from '../components/PageHeader';+import './ApiKeys.css';++const permissionsReference = [+ { name: 'admin', description: 'Full access to all resources' },+ { name: 'operator', description: 'Session & message management' },+ { name: 'viewer', description: 'Read-only access' },+];++// Hook to track window size+function useWindowSize() {+ const [width, setWidth] = useState(window.innerWidth);++ useEffect(() => {+ const handleResize = () => setWidth(window.innerWidth);+ window.addEventListener('resize', handleResize);+ return () => window.removeEventListener('resize', handleResize);+ }, []);++ return width;+}++const columnHelper = createColumnHelper<ApiKey>();++export function ApiKeys() {+ useDocumentTitle('API Keys');+ const [apiKeys, setApiKeys] = useState<ApiKey[]>([]);+ const [loading, setLoading] = useState(true);+ const [visibleKeys, setVisibleKeys] = useState<Set<string>>(new Set());+ const [showModal, setShowModal] = useState(false);+ const [newKey, setNewKey] = useState({ name: '', role: 'operator' });+ const [createdKey, setCreatedKey] = useState<string | null>(null);+ const [copied, setCopied] = useState<string | null>(null);+ const [confirmAction, setConfirmAction] = useState<{ type: 'delete' | 'revoke'; id: string; name: string } | null>(+ null,+ );++ const windowWidth = useWindowSize();+ const isMobile = windowWidth < 768;+ const isSmall = windowWidth < 640;++ // Column visibility based on screen size+ const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({});++ useEffect(() => {+ setColumnVisibility({+ key: !isSmall, // Hide key column on very small screens+ lastUsed: !isMobile, // Hide last used on mobile+ });+ }, [isMobile, isSmall]);++ useEffect(() => {+ fetchKeys();+ }, []);++ const fetchKeys = async () => {+ try {+ setLoading(true);+ const data = await apiKeyApi.list();+ setApiKeys(data);+ } catch {+ // Handle error+ } finally {+ setLoading(false);+ }+ };++ const handleCreate = async () => {+ if (!newKey.name) return;+ try {+ const created = await apiKeyApi.create({ name: newKey.name, role: newKey.role });+ setApiKeys([...apiKeys, created]);+ setCreatedKey(created.apiKey || null);+ setNewKey({ name: '', role: 'operator' });+ } catch (err) {+ console.error('Failed to create:', err);+ }+ };++ const handleRevoke = async (id: string) => {+ try {+ await apiKeyApi.revoke(id);+ setApiKeys(apiKeys.map(k => (k.id === id ? { ...k, isActive: false } : k)));+ } catch (err) {+ console.error('Failed to revoke:', err);+ }+ };++ const handleDelete = async (id: string) => {+ try {+ await apiKeyApi.delete(id);+ setApiKeys(apiKeys.filter(k => k.id !== id));+ } catch (err) {+ console.error('Failed to delete:', err);+ }+ };++ const confirmAndExecute = () => {+ if (!confirmAction) return;+ if (confirmAction.type === 'delete') {+ handleDelete(confirmAction.id);+ } else {+ handleRevoke(confirmAction.id);+ }+ setConfirmAction(null);+ };++ const toggleKeyVisibility = (id: string) => {+ setVisibleKeys(prev => {+ const next = new Set(prev);+ if (next.has(id)) next.delete(id);+ else next.add(id);+ return next;+ });+ };++ const copyToClipboard = (text: string, id: string) => {+ navigator.clipboard.writeText(text);+ setCopied(id);+ setTimeout(() => setCopied(null), 2000);+ };++ // Define columns using TanStack Table+ const columns = useMemo(+ () => [+ columnHelper.accessor('name', {+ header: 'Name',+ cell: info => <span className="name-cell">{info.getValue()}</span>,+ }),+ columnHelper.accessor('keyPrefix', {+ id: 'key',+ header: 'Key',+ cell: info => {+ const apiKey = info.row.original;+ return (+ <span className="key-cell">+ <code>{visibleKeys.has(apiKey.id) ? apiKey.keyPrefix + '...' : apiKey.keyPrefix + '****'}</code>+ <button className="icon-btn-sm" onClick={() => toggleKeyVisibility(apiKey.id)}>+ {visibleKeys.has(apiKey.id) ? <EyeOff size={14} /> : <Eye size={14} />}+ </button>+ </span>+ );+ },+ }),+ columnHelper.accessor('role', {+ header: 'Role',+ cell: info => <span className="permission-badge">{info.getValue()}</span>,+ }),+ columnHelper.accessor('isActive', {+ header: 'Status',+ cell: info => (+ <span className={`status-badge ${info.getValue() ? 'active' : 'inactive'}`}>+ {info.getValue() ? 'Active' : 'Revoked'}+ </span>+ ),+ }),+ columnHelper.accessor('lastUsedAt', {+ id: 'lastUsed',+ header: 'Last Used',+ cell: info => (+ <span className="last-used">+ {info.getValue() ? new Date(info.getValue()!).toLocaleDateString() : 'Never'}+ </span>+ ),+ }),+ columnHelper.display({+ id: 'actions',+ header: 'Actions',+ cell: info => {+ const apiKey = info.row.original;+ return (+ <span className="actions-cell">+ <button className="icon-btn" onClick={() => copyToClipboard(apiKey.keyPrefix, apiKey.id)} title="Copy">+ {copied === apiKey.id ? <Check size={16} /> : <Copy size={16} />}+ </button>+ {apiKey.isActive && (+ <button+ className="icon-btn"+ onClick={() => setConfirmAction({ type: 'revoke', id: apiKey.id, name: apiKey.name })}+ title="Revoke"+ >+ <RefreshCw size={16} />+ </button>+ )}+ <button+ className="icon-btn danger"+ onClick={() => setConfirmAction({ type: 'delete', id: apiKey.id, name: apiKey.name })}+ title="Delete"+ >+ <Trash2 size={16} />+ </button>+ </span>+ );+ },+ }),+ ],+ [visibleKeys, copied],+ );++ const table = useReactTable({+ data: apiKeys,+ columns,+ state: {+ columnVisibility,+ },+ onColumnVisibilityChange: setColumnVisibility,+ getCoreRowModel: getCoreRowModel(),+ });++ if (loading) {+ return (+ <div+ className="api-keys-page"+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '400px' }}+ >+ <Loader2 className="animate-spin" size={32} />+ </div>+ );+ }++ return (+ <div className="api-keys-page">+ <PageHeader+ title="API Keys"+ subtitle="Manage API keys for authentication and access control"+ actions={+ <button className="btn-primary" onClick={() => setShowModal(true)}>+ <Plus size={18} />+ Create API Key+ </button>+ }+ />++ {showModal && (+ <div+ className="modal-overlay"+ onClick={() => {+ setShowModal(false);+ setCreatedKey(null);+ }}+ >+ <div className="modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>{createdKey ? 'API Key Created' : 'Create API Key'}</h2>+ <button+ className="btn-icon"+ onClick={() => {+ setShowModal(false);+ setCreatedKey(null);+ }}+ >+ <X size={20} />+ </button>+ </div>+ <div className="modal-body">+ {createdKey ? (+ <div>+ <p style={{ marginBottom: '1rem', color: 'var(--text-muted)' }}>+ Copy this key now. You won't be able to see it again.+ </p>+ <div style={{ display: 'flex', gap: '0.5rem', alignItems: 'center' }}>+ <code+ style={{+ flex: 1,+ padding: '0.75rem',+ background: 'var(--bg-secondary)',+ borderRadius: '6px',+ wordBreak: 'break-all',+ }}+ >+ {createdKey}+ </code>+ <button className="btn-primary" onClick={() => copyToClipboard(createdKey, 'modal')}>+ {copied === 'modal' ? <Check size={16} /> : <Copy size={16} />}+ </button>+ </div>+ </div>+ ) : (+ <>+ <label>Name</label>+ <input+ type="text"+ placeholder="e.g., Production Key"+ value={newKey.name}+ onChange={e => setNewKey({ ...newKey, name: e.target.value })}+ />+ <label>Role</label>+ <select value={newKey.role} onChange={e => setNewKey({ ...newKey, role: e.target.value })}>+ <option value="admin">Admin</option>+ <option value="operator">Operator</option>+ <option value="viewer">Viewer</option>+ </select>+ </>+ )}+ </div>+ {!createdKey && (+ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setShowModal(false)}>+ Cancel+ </button>+ <button className="btn-primary" onClick={handleCreate}>+ Create+ </button>+ </div>+ )}+ </div>+ </div>+ )}++ <div className="api-keys-content">+ <div className="keys-table-container">+ {apiKeys.length === 0 ? (+ <div className="empty-table-state">+ <KeyRound size={48} strokeWidth={1} />+ <h3>No API keys created</h3>+ <p>Create an API key to authenticate your requests</p>+ </div>+ ) : (+ <table className="keys-table">+ <thead>+ {table.getHeaderGroups().map(headerGroup => (+ <tr key={headerGroup.id} className="table-row header">+ {headerGroup.headers.map(header => (+ <th key={header.id}>+ {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}+ </th>+ ))}+ </tr>+ ))}+ </thead>+ <tbody>+ {table.getRowModel().rows.map(row => (+ <tr key={row.id} className="table-row">+ {row.getVisibleCells().map(cell => (+ <td key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</td>+ ))}+ </tr>+ ))}+ </tbody>+ </table>+ )}+ </div>++ <div className="permissions-reference">+ <h3>Roles Reference</h3>+ <div className="permissions-list">+ {permissionsReference.map(perm => (+ <div key={perm.name} className="perm-item">+ <code>{perm.name}</code>+ <span>{perm.description}</span>+ </div>+ ))}+ </div>+ </div>+ </div>++ {/* Confirmation Modal */}+ {confirmAction && (+ <div className="modal-overlay" onClick={() => setConfirmAction(null)}>+ <div className="modal confirm-modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>{confirmAction.type === 'delete' ? 'Delete API Key' : 'Revoke API Key'}</h2>+ <button className="btn-icon" onClick={() => setConfirmAction(null)}>+ <X size={20} />+ </button>+ </div>+ <div className="modal-body">+ <div className="confirm-icon-wrapper">+ <AlertTriangle size={48} className="confirm-warning-icon" />+ </div>+ <p className="confirm-message">+ {confirmAction.type === 'delete' ? (+ <>+ Are you sure you want to permanently delete <strong>{confirmAction.name}</strong>? This action+ cannot be undone.+ </>+ ) : (+ <>+ Are you sure you want to revoke <strong>{confirmAction.name}</strong>? It will no longer work.+ </>+ )}+ </p>+ </div>+ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setConfirmAction(null)}>+ Cancel+ </button>+ <button className={`btn-danger`} onClick={confirmAndExecute}>+ {confirmAction.type === 'delete' ? 'Delete' : 'Revoke'}+ </button>+ </div>+ </div>+ </div>+ )}+ </div>+ );+}diff --git a/dashboard/src/pages/Dashboard.css b/dashboard/src/pages/Dashboard.cssnew file mode 100644index 000000000..5e2e07a0a--- /dev/null+++ b/dashboard/src/pages/Dashboard.css@@ -0,0 +1,301 @@+.dashboard {+ padding: 2rem;+ width: 100%;+ box-sizing: border-box;+}++.page-header {+ margin-bottom: 2rem;+}++.header-title {+ display: flex;+ align-items: center;+ gap: 1rem;+}++/* H1 inherited from global */++.status-badge {+ padding: 0.375rem 0.75rem;+ border-radius: 9999px;+ font-size: 0.6875rem;+ font-weight: 700;+ text-transform: uppercase;+ letter-spacing: 0.025em;+}++.status-badge.connected {+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+}++.stats-grid {+ display: grid;+ grid-template-columns: repeat(4, 1fr);+ gap: 1.5rem;+ margin-bottom: 2rem;+ width: 100%;+}++.stat-card {+ position: relative;+ background: var(--bg-white);+ border-radius: 12px;+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+ min-width: 0;+ overflow: hidden;+ transition:+ transform 0.2s ease,+ box-shadow 0.2s ease;+}++.stat-card:hover {+ transform: translateY(-2px);+ box-shadow: var(--shadow-md);+}++.stat-header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ margin-bottom: 0.75rem;+}++.stat-icon {+ color: var(--text-muted);+ position: relative;+ z-index: 2;+}++.stat-watermark {+ position: absolute;+ right: -10px;+ bottom: -15px;+ width: 96px;+ height: 96px;+ opacity: 0.04;+ color: var(--text-primary);+ transform: rotate(-15deg);+ pointer-events: none;+ z-index: 1;+}++.stat-label {+ font-size: 0.75rem;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ color: var(--text-secondary);+ position: relative;+ z-index: 2;+}++.stat-value {+ font-size: 2rem;+ font-weight: 700;+ color: var(--text-primary);+ position: relative;+ z-index: 2;+}++.stat-trend {+ display: flex;+ align-items: center;+ gap: 0.25rem;+ font-size: 0.75rem;+ font-weight: 500;+ margin-top: 0.5rem;+ position: relative;+ z-index: 2;+}++.stat-trend.up {+ color: var(--primary);+}++.stat-trend.down {+ color: #ef4444;+}++.sessions-section {+ background: var(--bg-white);+ border-radius: 12px;+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+ width: 100%;+ box-sizing: border-box;+}++.section-header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ margin-bottom: 1.5rem;+}++/* H2 inherited from global */++.section-subtitle {+ font-size: 0.875rem;+ color: var(--text-muted);+}++.sessions-table {+ display: flex;+ flex-direction: column;+ width: 100%;+ font-size: 0.875rem;+}++.sessions-table .table-header,+.sessions-table .table-row {+ display: grid;+ grid-template-columns: 140px 200px 140px 1fr 180px;+ gap: 1rem;+ padding: 1rem 1.5rem;+ align-items: center;+}++.sessions-table .table-header {+ background: var(--bg-light);+ border-radius: var(--radius) var(--radius) 0 0;+ font-size: 0.7rem;+ font-weight: 700;+ color: var(--text-secondary);+ text-transform: uppercase;+ letter-spacing: 0.05em;+ border-bottom: 1px solid var(--border);+}++.sessions-table .table-row {+ border-bottom: 1px solid var(--border);+}++.sessions-table .table-row:last-child {+ border-bottom: none;+}++.session-info-cell {+ display: flex;+ flex-direction: column;+ gap: 0.125rem;+ min-width: 0;+}++.session-id {+ font-family: 'JetBrains Mono', monospace;+ font-size: 0.8125rem;+ color: var(--text-primary);+ white-space: nowrap;+}++.session-name {+ font-size: 0.75rem;+ color: var(--text-muted);+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ max-width: 140px;+}++.phone {+ color: var(--text-primary);+ font-size: 0.8125rem;+ white-space: nowrap;+}++.status-pill {+ display: inline-block;+ padding: 0.25rem 0.75rem;+ border-radius: 9999px;+ font-size: 0.75rem;+ font-weight: 500;+ width: fit-content;+}++.status-pill.ready {+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+}++.status-pill.connecting {+ background: #fef3c7;+ color: #d97706;+}++.status-pill.disconnected {+ background: #f3f4f6;+ color: var(--text-muted);+}++.last-active {+ color: var(--text-secondary);+ font-size: 0.875rem;+}++.actions {+ display: flex;+ gap: 0.5rem;+ justify-content: flex-end;+}++.btn-sm {+ padding: 0.375rem 0.75rem;+ font-size: 0.75rem;+ font-weight: 500;+ border-radius: 6px;+ cursor: pointer;+ transition: all 0.2s;+ background: var(--bg-light);+ border: 1px solid var(--border);+ color: var(--text-secondary);+}++.btn-sm:hover {+ background: var(--bg-white);+ border-color: var(--text-muted);+}++.btn-sm.danger {+ color: #dc2626;+ border-color: #fecaca;+ background: #fef2f2;+}++.btn-sm.danger:hover {+ background: #fee2e2;+}++@media (max-width: 1200px) {+ .stats-grid {+ grid-template-columns: repeat(2, 1fr);+ }+}++@media (max-width: 768px) {+ .dashboard {+ padding: 1rem;+ }++ .stats-grid {+ grid-template-columns: 1fr;+ gap: 1rem;+ }++ .table-header,+ .table-row {+ grid-template-columns: 1fr 1fr 1fr;+ font-size: 0.8125rem;+ }++ .table-header span:nth-child(4),+ .table-header span:nth-child(5),+ .table-row > *:nth-child(4),+ .table-row > *:nth-child(5) {+ display: none;+ }+}diff --git a/dashboard/src/pages/Dashboard.tsx b/dashboard/src/pages/Dashboard.tsxnew file mode 100644index 000000000..1fe8c3baa--- /dev/null+++ b/dashboard/src/pages/Dashboard.tsx@@ -0,0 +1,184 @@+import { useState, useEffect } from 'react';+import { useNavigate } from 'react-router-dom';+import { MessageSquare, Send, Webhook, Activity, ArrowUpRight, ArrowDownRight, Loader2 } from 'lucide-react';+import { sessionApi, webhookApi, type Session, type SessionStats } from '../services/api';+import { useDocumentTitle } from '../hooks/useDocumentTitle';+import { PageHeader } from '../components/PageHeader';+import './Dashboard.css';++export function Dashboard() {+ useDocumentTitle('Dashboard');+ const navigate = useNavigate();+ const [sessions, setSessions] = useState<Session[]>([]);+ const [stats, setStats] = useState<SessionStats | null>(null);+ const [webhookCount, setWebhookCount] = useState(0);+ const [loading, setLoading] = useState(true);+ const [error, setError] = useState<string | null>(null);++ useEffect(() => {+ async function fetchData() {+ try {+ setLoading(true);+ const [sessionsData, statsData, webhooksData] = await Promise.all([+ sessionApi.list(),+ sessionApi.getStats(),+ webhookApi.listAll().catch(() => []),+ ]);+ setSessions(sessionsData);+ setStats(statsData);+ setWebhookCount(webhooksData.length);+ } catch (err) {+ setError(err instanceof Error ? err.message : 'Failed to load data');+ } finally {+ setLoading(false);+ }+ }+ fetchData();+ }, []);++ const handleDisconnect = async (id: string) => {+ try {+ await sessionApi.stop(id);+ setSessions(sessions.map(s => (s.id === id ? { ...s, status: 'disconnected' } : s)));+ } catch (err) {+ console.error('Failed to disconnect:', err);+ }+ };++ const statsCards = [+ {+ label: 'Active Sessions',+ value: stats?.active ?? 0,+ icon: MessageSquare,+ trend: `+${stats?.ready ?? 0}`,+ trendUp: true,+ },+ { label: 'Messages Today', value: '—', icon: Send, trend: '0', trendUp: null },+ { label: 'Webhooks Configured', value: webhookCount, icon: Webhook, trend: '0', trendUp: null },+ { label: 'API Calls (24h)', value: '—', icon: Activity, trend: '0', trendUp: null },+ ];++ const formatLastActive = (date?: string) => {+ if (!date) return 'Never';+ const diff = Date.now() - new Date(date).getTime();+ if (diff < 60000) return 'Just now';+ if (diff < 3600000) return `${Math.floor(diff / 60000)} min ago`;+ if (diff < 86400000) return `${Math.floor(diff / 3600000)} hours ago`;+ return new Date(date).toLocaleDateString();+ };++ const formatStatus = (status: string) => {+ const statusMap: Record<string, string> = {+ created: 'New',+ idle: 'Idle',+ initializing: 'Starting...',+ connecting: 'Connecting...',+ qr_ready: 'Scan QR',+ ready: 'Connected',+ disconnected: 'Disconnected',+ };+ return statusMap[status] || status;+ };++ if (loading) {+ return (+ <div+ className="dashboard"+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '400px' }}+ >+ <Loader2 className="animate-spin" size={32} />+ </div>+ );+ }++ if (error) {+ return (+ <div className="dashboard" style={{ padding: '2rem' }}>+ <div style={{ background: '#FEE2E2', padding: '1rem', borderRadius: '8px', color: '#DC2626' }}>+ Error: {error}+ </div>+ </div>+ );+ }++ return (+ <div className="dashboard">+ <PageHeader+ title="Dashboard"+ subtitle="Overview of your WhatsApp sessions and activity"+ badge={+ <span className={`status-badge ${stats && stats.ready > 0 ? 'connected' : 'disconnected'}`}>+ {stats && stats.ready > 0 ? 'Connected' : 'Disconnected'}+ </span>+ }+ />++ <div className="stats-grid">+ {statsCards.map(({ label, value, icon: Icon, trend, trendUp }) => (+ <div key={label} className="stat-card">+ <Icon className="stat-watermark" />+ <div className="stat-header">+ <span className="stat-label">{label}</span>+ <Icon size={20} className="stat-icon" />+ </div>+ <div className="stat-value">{typeof value === 'number' ? value.toLocaleString() : value}</div>+ {trend !== '0' && (+ <div className={`stat-trend ${trendUp ? 'up' : 'down'}`}>+ {trendUp ? <ArrowUpRight size={14} /> : <ArrowDownRight size={14} />}+ {trend}+ </div>+ )}+ </div>+ ))}+ </div>++ <section className="sessions-section">+ <div className="section-header">+ <h2>Sessions Overview</h2>+ <span className="section-subtitle">+ Showing {sessions.length} of {stats?.total ?? 0} sessions+ </span>+ </div>++ <div className="sessions-table">+ <div className="table-header">+ <span>Session ID</span>+ <span>Phone Number</span>+ <span>Status</span>+ <span>Last Active</span>+ <span>Actions</span>+ </div>+ {sessions.length === 0 ? (+ <div className="table-row" style={{ justifyContent: 'center', color: 'var(--text-muted)' }}>+ No sessions found. Create one to get started.+ </div>+ ) : (+ sessions.map(session => (+ <div key={session.id} className="table-row">+ <div className="session-info-cell">+ <span className="session-id">{session.id.substring(0, 12)}</span>+ <span className="session-name" title={session.name}>+ {session.name}+ </span>+ </div>+ <span className="phone">{session.phone || '—'}</span>+ <span className={`status-pill ${session.status}`}>{formatStatus(session.status)}</span>+ <span className="last-active">{formatLastActive(session.lastActive)}</span>+ <div className="actions">+ <button className="btn-sm" onClick={() => navigate('/sessions')}>+ View+ </button>+ {['ready', 'initializing', 'connecting', 'qr_ready'].includes(session.status) && (+ <button className="btn-sm danger" onClick={() => handleDisconnect(session.id)}>+ Disconnect+ </button>+ )}+ </div>+ </div>+ ))+ )}+ </div>+ </section>+ </div>+ );+}diff --git a/dashboard/src/pages/Infrastructure.css b/dashboard/src/pages/Infrastructure.cssnew file mode 100644index 000000000..ea079ecf4--- /dev/null+++ b/dashboard/src/pages/Infrastructure.css@@ -0,0 +1,569 @@+.infrastructure-page {+ padding: 2rem;+ width: 100%;+ box-sizing: border-box;+}++.page-header {+ margin-bottom: 2rem;+}++/* H1 inherited from global */++.page-subtitle {+ margin: 0;+ font-size: 0.9375rem;+ color: var(--text-secondary);+}++.infra-sections {+ display: grid;+ grid-template-columns: repeat(2, 1fr);+ gap: 1.5rem;+ width: 100%;+}++.infra-card {+ background: var(--bg-white);+ border-radius: 12px;+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+ width: 100%;+ box-sizing: border-box;+}++.infra-card.full-width {+ grid-column: 1 / -1;+}++.card-header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ margin-bottom: 1.5rem;+ padding-bottom: 1rem;+ border-bottom: 1px solid var(--border);+}++.header-left {+ display: flex;+ align-items: center;+ gap: 0.75rem;+}++.header-left svg {+ color: var(--primary);+}++.card-header h2 {+ margin: 0;+}++.status-indicator {+ display: flex;+ align-items: center;+ gap: 0.375rem;+ font-size: 0.8125rem;+ font-weight: 500;+ padding: 0.375rem 0.75rem;+ border-radius: 9999px;+}++.status-indicator.connected {+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+}++.status-indicator.disconnected {+ background: #fee2e2;+ color: #dc2626;+}++.status-indicator.sqlite {+ background: #e0f2fe;+ color: #0369a1;+}++.warning-badge {+ font-size: 0.75rem;+ padding: 0.375rem 0.75rem;+ background: #fef3c7;+ color: #d97706;+ border-radius: 6px;+}++/* Radio Group */+.radio-group {+ display: grid;+ grid-template-columns: repeat(2, 1fr);+ gap: 1rem;+ margin-bottom: 1.5rem;+}++.radio-option {+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+ padding: 1rem;+ border: 2px solid var(--border);+ border-radius: var(--radius);+ cursor: pointer;+ transition: all 0.2s;+}++.radio-option:hover {+ border-color: var(--text-muted);+}++.radio-option.selected {+ border-color: var(--primary);+ background: rgba(37, 211, 102, 0.05);+}++.radio-option input {+ display: none;+}++.radio-option span {+ font-weight: 600;+ color: var(--text-primary);+}++.radio-option small {+ font-size: 0.75rem;+ color: var(--text-secondary);+}++/* Watermark Icon */+.radio-option {+ position: relative;+ overflow: hidden;+}++.watermark-icon {+ position: absolute;+ right: -15px;+ bottom: -15px;+ width: 100px;+ height: 100px;+ opacity: 0.15;+ transform: rotate(-15deg);+ pointer-events: none;+ transition: all 0.3s ease;+}++.radio-option:hover .watermark-icon {+ opacity: 0.25;+ transform: rotate(-12deg) scale(1.05);+}++.radio-option.selected .watermark-icon {+ opacity: 0.3;+ transform: rotate(-12deg) scale(1.1);+}++/* Form Styles */+.config-form {+ display: flex;+ flex-direction: column;+ gap: 1rem;+}++.form-row {+ display: grid;+ grid-template-columns: repeat(2, 1fr);+ gap: 1rem;+}++.form-row .form-group.small {+ max-width: 120px;+}++.form-group {+ display: flex;+ flex-direction: column;+ gap: 0.5rem;+}++.form-group label {+ font-size: 0.7rem;+ font-weight: 700;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ color: var(--text-secondary);+}++.form-group input,+.form-group select {+ padding: 0.75rem 1rem;+ font-size: 0.9375rem;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ background: var(--bg-white);+ transition: border-color 0.2s;+}++.form-group input:focus,+.form-group select:focus {+ outline: none;+ border-color: var(--primary);+}++/* Toggle */+.toggle-row {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: 0.75rem 0;+}++.toggle-info {+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+}++.toggle-info span {+ font-size: 0.9375rem;+ font-weight: 500;+ color: var(--text-primary);+}++.toggle-info small {+ font-size: 0.75rem;+ font-weight: 400;+ color: #64748b; /* Slate 500 */+ opacity: 0.85;+}++.toggle-switch {+ position: relative;+ width: 48px;+ height: 26px;+ cursor: pointer;+}++.toggle-switch input {+ opacity: 0;+ width: 0;+ height: 0;+}++.toggle-slider {+ position: absolute;+ top: 0;+ left: 0;+ right: 0;+ bottom: 0;+ background: #e5e7eb;+ border-radius: 26px;+ transition: all 0.2s;+}++.toggle-slider::before {+ content: '';+ position: absolute;+ width: 20px;+ height: 20px;+ left: 3px;+ bottom: 3px;+ background: white;+ border-radius: 50%;+ transition: all 0.2s;+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);+}++.toggle-switch input:checked + .toggle-slider {+ background: var(--primary);+}++.toggle-switch input:checked + .toggle-slider::before {+ transform: translateX(22px);+}++/* Migrations Section */+.migrations-section {+ margin-top: 1.5rem;+ padding-top: 1.5rem;+ border-top: 1px solid var(--border);+}++.migrations-section h3 {+ margin: 0 0 1rem;+ font-size: 0.9375rem;+ font-weight: 600;+ color: var(--text-primary);+}++.migrations-list {+ background: var(--bg-light);+ border-radius: var(--radius);+ padding: 0.5rem;+ margin-bottom: 1rem;+}++.migration-item {+ display: grid;+ grid-template-columns: 24px 1fr auto;+ gap: 0.75rem;+ padding: 0.625rem 0.75rem;+ align-items: center;+}++.migration-status {+ font-size: 0.875rem;+}++.migration-item.completed .migration-status {+ color: var(--primary);+}++.migration-item.pending .migration-status {+ color: var(--text-muted);+}++.migration-name {+ font-size: 0.875rem;+ color: var(--text-primary);+}++.migration-date {+ font-size: 0.75rem;+ color: var(--text-muted);+}++.migration-actions {+ display: flex;+ gap: 0.75rem;+}++/* Queue Stats */+.queue-stats {+ margin-top: 1.5rem;+ padding-top: 1.5rem;+ border-top: 1px solid var(--border);+}++.queue-stats h3 {+ margin: 0 0 1rem;+ font-size: 0.9375rem;+ font-weight: 600;+ color: var(--text-primary);+}++.stats-row {+ display: grid;+ grid-template-columns: repeat(2, 1fr);+ gap: 1rem;+ margin-bottom: 1rem;+}++.queue-stat-card {+ background: var(--bg-light);+ padding: 1rem;+ border-radius: var(--radius);+}++.queue-stat-card h4 {+ margin: 0 0 0.75rem;+ font-size: 0.8125rem;+ font-weight: 600;+ color: var(--text-secondary);+}++.stat-values {+ display: flex;+ gap: 1.5rem;+}++.stat-item {+ display: flex;+ flex-direction: column;+ gap: 0.125rem;+}++.stat-item .value {+ font-size: 1.25rem;+ font-weight: 700;+}++.stat-item .label {+ font-size: 0.6875rem;+ text-transform: uppercase;+ letter-spacing: 0.05em;+}++.stat-item.pending .value {+ color: #d97706;+}+.stat-item.pending .label {+ color: #d97706;+}+.stat-item.completed .value {+ color: var(--primary);+}+.stat-item.completed .label {+ color: var(--primary);+}+.stat-item.failed .value {+ color: #dc2626;+}+.stat-item.failed .label {+ color: #dc2626;+}++.queue-actions {+ display: flex;+ gap: 0.75rem;+}++/* Buttons */+.btn-primary {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.625rem 1rem;+ background: var(--primary);+ color: white;+ border: none;+ border-radius: var(--radius);+ font-size: 0.875rem;+ font-weight: 600;+ cursor: pointer;+ transition: background 0.2s;+}++.btn-primary:hover {+ background: var(--primary-hover);+}++.btn-primary.large {+ padding: 0.875rem 1.5rem;+ font-size: 1rem;+}++.btn-outline {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.625rem 1rem;+ background: transparent;+ color: var(--text-primary);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ font-size: 0.875rem;+ font-weight: 500;+ cursor: pointer;+ transition: all 0.2s;+}++.btn-outline:hover {+ background: var(--bg-light);+}++.btn-danger-outline {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.625rem 1rem;+ background: transparent;+ color: #dc2626;+ border: 1px solid #dc2626;+ border-radius: var(--radius);+ font-size: 0.875rem;+ font-weight: 500;+ cursor: pointer;+ transition: all 0.2s;+}++.btn-danger-outline:hover {+ background: #fee2e2;+}++/* Footer */+.page-footer {+ margin-top: 2rem;+ padding-top: 1.5rem;+ border-top: 1px solid var(--border);+ display: flex;+ justify-content: flex-end;+}++/* Responsive */+@media (max-width: 900px) {+ .infra-sections {+ grid-template-columns: 1fr;+ }++ .infrastructure-page {+ padding: 1rem;+ }++ .radio-group {+ grid-template-columns: 1fr;+ }++ .form-row {+ grid-template-columns: 1fr;+ }++ .stats-row {+ grid-template-columns: 1fr;+ }++ /* Card header mobile layout */+ .card-header {+ flex-wrap: wrap;+ gap: 0.75rem;+ }++ .header-left {+ flex: 1;+ min-width: 0;+ }++ .header-left h2 {+ font-size: 0.9375rem;+ line-height: 1.3;+ }++ /* Status badge mobile - prevent shrinking */+ .status-indicator {+ flex-shrink: 0;+ white-space: nowrap;+ font-size: 0.75rem;+ padding: 0.25rem 0.625rem;+ }++ /* Warning badge mobile */+ .warning-badge {+ flex-shrink: 0;+ white-space: nowrap;+ font-size: 0.6875rem;+ padding: 0.25rem 0.5rem;+ }++ /* Toggle row mobile - prevent switch from being cut off */+ .toggle-row {+ gap: 1rem;+ }++ .toggle-info {+ flex: 1;+ min-width: 0;+ }++ .toggle-switch {+ flex-shrink: 0;+ }++ /* Queue actions stack on mobile */+ .queue-actions {+ flex-direction: column;+ }++ .queue-actions button {+ justify-content: center;+ }+}diff --git a/dashboard/src/pages/Infrastructure.tsx b/dashboard/src/pages/Infrastructure.tsxnew file mode 100644index 000000000..aeadd4318--- /dev/null+++ b/dashboard/src/pages/Infrastructure.tsx@@ -0,0 +1,1090 @@+import { useState, useEffect } from 'react';+import {+ Database,+ Server,+ HardDrive,+ Save,+ ExternalLink,+ Loader2,+ CheckCircle,+ Trash2,+ Globe,+ Webhook,+ Gauge,+} from 'lucide-react';+import { infraApi } from '../services/api';+import { useDocumentTitle } from '../hooks/useDocumentTitle';+import { PageHeader } from '../components/PageHeader';+import './Infrastructure.css';++// Watermark icons+import sqliteIcon from '../assets/icons/sqlite.svg';+import postgresIcon from '../assets/icons/postgresql.svg';+import folderIcon from '../assets/icons/folder.svg';+import s3Icon from '../assets/icons/s3.svg';++interface DatabaseConfig {+ type: 'sqlite' | 'postgres';+ builtIn: boolean;+ host: string;+ port: string;+ username: string;+ password: string;+ database: string;+ poolSize: number;+ sslEnabled: boolean;+}++interface RedisConfig {+ builtIn: boolean;+ host: string;+ port: string;+ password: string;+ connected: boolean;+}++interface StorageConfig {+ type: 'local' | 's3';+ builtIn: boolean;+ localPath: string;+ s3Bucket: string;+ s3Region: string;+ s3AccessKey: string;+ s3SecretKey: string;+ s3Endpoint: string;+}++interface QueueStats {+ pending: number;+ completed: number;+ failed: number;+}++interface ServerConfig {+ port: string;+ nodeEnv: 'production' | 'development';+ domain: string;+ dashboardPort: string;+ baseUrl: string;+ dashboardUrl: string;+ corsOrigins: string;+}++interface WebhookConfig {+ timeout: number;+ maxRetries: number;+ retryDelay: number;+}++interface RateLimitConfig {+ ttl: number;+ max: number;+}++export function Infrastructure() {+ useDocumentTitle('Infrastructure');+ const [loading, setLoading] = useState(true);+ const [saving, setSaving] = useState(false);+ const [showRestartModal, setShowRestartModal] = useState(false);+ const [restartCountdown, setRestartCountdown] = useState(0);+ const [restartStatus, setRestartStatus] = useState<'idle' | 'restarting' | 'waiting' | 'success' | 'error'>('idle');++ const [dbConfig, setDbConfig] = useState<DatabaseConfig>({+ type: 'sqlite',+ builtIn: false,+ host: 'localhost',+ port: '5432',+ username: 'postgres',+ password: '',+ database: 'openwa',+ poolSize: 10,+ sslEnabled: false,+ });++ const [redisConfig, setRedisConfig] = useState<RedisConfig>({+ builtIn: false,+ host: 'localhost',+ port: '6379',+ password: '',+ connected: false,+ });++ const [storageConfig, setStorageConfig] = useState<StorageConfig>({+ type: 'local',+ builtIn: false,+ localPath: './data/media',+ s3Bucket: '',+ s3Region: 'ap-southeast-1',+ s3AccessKey: '',+ s3SecretKey: '',+ s3Endpoint: '',+ });++ const [queueStats, setQueueStats] = useState({+ messages: { pending: 0, completed: 0, failed: 0 } as QueueStats,+ webhooks: { pending: 0, completed: 0, failed: 0 } as QueueStats,+ });++ const [redisEnabled, setRedisEnabled] = useState(false);+ const [queueEnabled, setQueueEnabled] = useState(false);+ const [pendingProfiles, setPendingProfiles] = useState<string[]>([]);+ const [previousProfiles, setPreviousProfiles] = useState<string[]>([]); // Track previously enabled for removal++ const [serverConfig, setServerConfig] = useState<ServerConfig>({+ port: '2785',+ nodeEnv: 'development',+ domain: 'localhost',+ dashboardPort: '2886',+ baseUrl: '',+ dashboardUrl: '',+ corsOrigins: '*',+ });++ const [webhookConfig, setWebhookConfig] = useState<WebhookConfig>({+ timeout: 10000,+ maxRetries: 3,+ retryDelay: 5000,+ });++ const [rateLimitConfig, setRateLimitConfig] = useState<RateLimitConfig>({+ ttl: 60,+ max: 100,+ });++ // Fetch infrastructure status from API+ useEffect(() => {+ const fetchInfraStatus = async () => {+ try {+ const status = await infraApi.getStatus();++ // Update configs with real data+ setDbConfig(prev => ({+ ...prev,+ type: (status.database.type as 'sqlite' | 'postgres') || 'sqlite',+ host: status.database.host || 'localhost',+ }));++ setRedisConfig(prev => ({+ ...prev,+ host: status.redis.host,+ port: String(status.redis.port),+ connected: status.redis.connected,+ }));++ setStorageConfig(prev => ({+ ...prev,+ type: status.storage.type,+ localPath: status.storage.path || './uploads',+ }));++ setQueueEnabled(status.queue.enabled);+ setQueueStats({+ messages: status.queue.messages,+ webhooks: status.queue.webhooks,+ });+ } catch (err) {+ console.error('Failed to fetch infra status:', err);+ } finally {+ setLoading(false);+ }+ };++ fetchInfraStatus();+ }, []);++ // Show loading state+ if (loading) {+ return (+ <div+ className="infrastructure-page"+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '400px' }}+ >+ <Loader2 className="animate-spin" size={32} />+ </div>+ );+ }++ const updateDbConfig = (key: keyof DatabaseConfig, value: string | number | boolean) => {+ setDbConfig(prev => ({ ...prev, [key]: value }));+ };++ const updateRedisConfig = (key: keyof RedisConfig, value: string | boolean) => {+ setRedisConfig(prev => ({ ...prev, [key]: value }));+ };++ const updateStorageConfig = (key: keyof StorageConfig, value: string | boolean) => {+ setStorageConfig(prev => ({ ...prev, [key]: value }));+ };++ const updateServerConfig = (key: keyof ServerConfig, value: string) => {+ setServerConfig(prev => ({ ...prev, [key]: value }));+ };++ const updateWebhookConfig = (key: keyof WebhookConfig, value: number) => {+ setWebhookConfig(prev => ({ ...prev, [key]: value }));+ };++ const updateRateLimitConfig = (key: keyof RateLimitConfig, value: number) => {+ setRateLimitConfig(prev => ({ ...prev, [key]: value }));+ };++ // Save and restart handlers+ const handleSaveConfig = async () => {+ setSaving(true);+ try {+ const payload = {+ database: {+ type: dbConfig.type,+ builtIn: dbConfig.builtIn,+ host: dbConfig.host,+ port: dbConfig.port,+ username: dbConfig.username,+ password: dbConfig.password,+ database: dbConfig.database,+ poolSize: dbConfig.poolSize,+ sslEnabled: dbConfig.sslEnabled,+ },+ redis: {+ enabled: redisEnabled,+ builtIn: redisConfig.builtIn,+ host: redisConfig.host,+ port: redisConfig.port,+ password: redisConfig.password,+ },+ queue: {+ enabled: queueEnabled,+ },+ storage: {+ type: storageConfig.type,+ builtIn: storageConfig.builtIn,+ localPath: storageConfig.localPath,+ s3Bucket: storageConfig.s3Bucket,+ s3Region: storageConfig.s3Region,+ s3AccessKey: storageConfig.s3AccessKey,+ s3SecretKey: storageConfig.s3SecretKey,+ s3Endpoint: storageConfig.s3Endpoint,+ },+ server: {+ port: serverConfig.port,+ nodeEnv: serverConfig.nodeEnv,+ domain: serverConfig.domain,+ dashboardPort: serverConfig.dashboardPort,+ baseUrl: serverConfig.baseUrl,+ dashboardUrl: serverConfig.dashboardUrl,+ corsOrigins: serverConfig.corsOrigins,+ },+ webhook: {+ timeout: webhookConfig.timeout,+ maxRetries: webhookConfig.maxRetries,+ retryDelay: webhookConfig.retryDelay,+ },+ rateLimit: {+ ttl: rateLimitConfig.ttl,+ max: rateLimitConfig.max,+ },+ };++ const result = await infraApi.saveConfig(payload);+ if (result.saved) {+ // Store current profiles as previous before updating to new ones+ setPreviousProfiles(pendingProfiles);+ setPendingProfiles(result.profiles || []);+ setShowRestartModal(true);+ } else {+ alert('Failed to save configuration: ' + result.message);+ }+ } catch (err) {+ alert('Failed to save configuration: ' + (err instanceof Error ? err.message : 'Unknown error'));+ } finally {+ setSaving(false);+ }+ };++ const handleRestart = async () => {+ setRestartStatus('restarting');+ setRestartCountdown(30); // Default, will be updated after API call++ // Compute profiles to remove (were enabled before, now disabled)+ const profilesToRemove = previousProfiles.filter(p => !pendingProfiles.includes(p));++ let countdownTime = 30; // Default fallback+ try {+ const response = await infraApi.restart(pendingProfiles, profilesToRemove);+ // Use server-provided estimated time if available+ if (response.estimatedTime) {+ countdownTime = response.estimatedTime;+ setRestartCountdown(countdownTime);+ }+ } catch {+ // Expected - server is shutting down, use default countdown+ }++ // Start countdown (visual feedback only)+ setRestartStatus('waiting');++ // Store interval ID to allow early termination when health check succeeds+ let intervalRef: ReturnType<typeof setInterval> | null = null;++ const stopCountdown = () => {+ if (intervalRef) {+ clearInterval(intervalRef);+ intervalRef = null;+ }+ };++ intervalRef = setInterval(() => {+ setRestartCountdown(prev => {+ if (prev <= 1) {+ stopCountdown();+ return 0;+ }+ return prev - 1;+ });+ }, 1000);++ // Start health polling IMMEDIATELY - this is more accurate than countdown+ // Server will respond as soon as it's ready, stopping countdown early+ checkServerHealth(stopCountdown);+ };++ const checkServerHealth = async (stopCountdown?: () => void) => {+ let attempts = 0;+ const maxAttempts = 60; // Allow up to 60 attempts (60 seconds)++ const check = async () => {+ try {+ await infraApi.healthCheck();+ // Server is back! Stop countdown and show success+ stopCountdown?.();+ setRestartCountdown(0);+ setRestartStatus('success');+ // Reload page after 2 seconds+ setTimeout(() => {+ window.location.reload();+ }, 2000);+ } catch {+ attempts++;+ if (attempts < maxAttempts) {+ setTimeout(check, 1000);+ } else {+ setRestartStatus('error');+ }+ }+ };++ // Start checking immediately with a small delay for server to begin shutdown+ setTimeout(check, 3000);+ };++ return (+ <div className="infrastructure-page">+ <PageHeader title="Infrastructure" subtitle="Configure server, database, cache, storage, and engine settings" />++ <div className="infra-sections">+ {/* Server Configuration Section */}+ <section className="infra-card">+ <div className="card-header">+ <div className="header-left">+ <Globe size={20} />+ <h2>Server Configuration</h2>+ </div>+ <span className={`status-indicator ${serverConfig.nodeEnv === 'production' ? 'connected' : 'sqlite'}`}>+ ● {serverConfig.nodeEnv === 'production' ? 'Production' : 'Development'}+ </span>+ </div>++ <div className="config-form">+ <div className="form-row">+ <div className="form-group">+ <label>Environment</label>+ <select+ value={serverConfig.nodeEnv}+ onChange={e => updateServerConfig('nodeEnv', e.target.value as 'production' | 'development')}+ >+ <option value="production">Production</option>+ <option value="development">Development</option>+ </select>+ </div>+ <div className="form-group">+ <label>Domain</label>+ <input+ type="text"+ value={serverConfig.domain}+ onChange={e => updateServerConfig('domain', e.target.value)}+ placeholder="localhost"+ />+ </div>+ </div>+ <div className="form-row">+ <div className="form-group small">+ <label>API Port</label>+ <input+ type="text"+ value={serverConfig.port}+ onChange={e => updateServerConfig('port', e.target.value)}+ />+ </div>+ <div className="form-group small">+ <label>Dashboard Port</label>+ <input+ type="text"+ value={serverConfig.dashboardPort}+ onChange={e => updateServerConfig('dashboardPort', e.target.value)}+ />+ </div>+ <div className="form-group">+ <label>CORS Origins</label>+ <input+ type="text"+ value={serverConfig.corsOrigins}+ onChange={e => updateServerConfig('corsOrigins', e.target.value)}+ placeholder="* or comma-separated origins"+ />+ </div>+ </div>+ <div className="form-row">+ <div className="form-group">+ <label>Public API URL (optional)</label>+ <input+ type="text"+ value={serverConfig.baseUrl}+ onChange={e => updateServerConfig('baseUrl', e.target.value)}+ placeholder="https://api.yourdomain.com"+ />+ </div>+ <div className="form-group">+ <label>Public Dashboard URL (optional)</label>+ <input+ type="text"+ value={serverConfig.dashboardUrl}+ onChange={e => updateServerConfig('dashboardUrl', e.target.value)}+ placeholder="https://dashboard.yourdomain.com"+ />+ </div>+ </div>+ </div>+ </section>++ {/* Webhook & Rate Limiting Section */}+ <section className="infra-card">+ <div className="card-header">+ <div className="header-left">+ <Webhook size={20} />+ <h2>Webhook & Rate Limiting</h2>+ </div>+ </div>++ <div className="config-form">+ <h3 style={{ margin: '0 0 1rem', fontSize: '0.9375rem', color: '#475569', fontWeight: 600 }}>+ <Webhook size={16} style={{ marginRight: '0.5rem', verticalAlign: 'middle' }} />+ Webhook Settings+ </h3>+ <div className="form-row">+ <div className="form-group">+ <label>Timeout (ms)</label>+ <input+ type="number"+ value={webhookConfig.timeout}+ onChange={e => updateWebhookConfig('timeout', parseInt(e.target.value) || 10000)}+ />+ </div>+ <div className="form-group small">+ <label>Max Retries</label>+ <input+ type="number"+ min="0"+ max="10"+ value={webhookConfig.maxRetries}+ onChange={e => updateWebhookConfig('maxRetries', parseInt(e.target.value) || 3)}+ />+ </div>+ <div className="form-group">+ <label>Retry Delay (ms)</label>+ <input+ type="number"+ value={webhookConfig.retryDelay}+ onChange={e => updateWebhookConfig('retryDelay', parseInt(e.target.value) || 5000)}+ />+ </div>+ </div>++ <div style={{ borderTop: '1px solid var(--border)', margin: '1.5rem 0', paddingTop: '1.5rem' }}>+ <h3 style={{ margin: '0 0 1rem', fontSize: '0.9375rem', color: '#475569', fontWeight: 600 }}>+ <Gauge size={16} style={{ marginRight: '0.5rem', verticalAlign: 'middle' }} />+ Rate Limiting+ </h3>+ <div className="form-row">+ <div className="form-group">+ <label>Time Window (seconds)</label>+ <input+ type="number"+ value={rateLimitConfig.ttl}+ onChange={e => updateRateLimitConfig('ttl', parseInt(e.target.value) || 60)}+ />+ </div>+ <div className="form-group">+ <label>Max Requests per Window</label>+ <input+ type="number"+ value={rateLimitConfig.max}+ onChange={e => updateRateLimitConfig('max', parseInt(e.target.value) || 100)}+ />+ </div>+ </div>+ </div>+ </div>+ </section>++ {/* Database Section */}+ <section className="infra-card">+ <div className="card-header">+ <div className="header-left">+ <Database size={20} />+ <h2>Database Configuration</h2>+ </div>+ <span className={`status-indicator ${dbConfig.type === 'postgres' ? 'connected' : 'sqlite'}`}>+ ● {dbConfig.type === 'postgres' ? 'PostgreSQL' : 'SQLite'}+ </span>+ </div>++ <div className="radio-group">+ <label className={`radio-option ${dbConfig.type === 'sqlite' ? 'selected' : ''}`}>+ <input+ type="radio"+ name="dbType"+ checked={dbConfig.type === 'sqlite'}+ onChange={() => updateDbConfig('type', 'sqlite')}+ />+ <img src={sqliteIcon} alt="" className="watermark-icon" />+ <span>SQLite</span>+ <small>Local file-based database</small>+ </label>+ <label className={`radio-option ${dbConfig.type === 'postgres' ? 'selected' : ''}`}>+ <input+ type="radio"+ name="dbType"+ checked={dbConfig.type === 'postgres'}+ onChange={() => updateDbConfig('type', 'postgres')}+ />+ <img src={postgresIcon} alt="" className="watermark-icon" />+ <span>PostgreSQL</span>+ <small>Production-ready database</small>+ </label>+ </div>++ {dbConfig.type === 'postgres' && (+ <>+ <div className="toggle-row" style={{ marginTop: '1rem', marginBottom: '1rem' }}>+ <div className="toggle-info">+ <span>Use Built-in PostgreSQL Container</span>+ <small>OpenWA will manage a PostgreSQL container for you</small>+ </div>+ <label className="toggle-switch">+ <input+ type="checkbox"+ checked={dbConfig.builtIn}+ onChange={e => updateDbConfig('builtIn', e.target.checked)}+ />+ <span className="toggle-slider"></span>+ </label>+ </div>++ {!dbConfig.builtIn && (+ <div className="config-form">+ <div className="form-row">+ <div className="form-group">+ <label>Host</label>+ <input type="text" value={dbConfig.host} onChange={e => updateDbConfig('host', e.target.value)} />+ </div>+ <div className="form-group small">+ <label>Port</label>+ <input type="text" value={dbConfig.port} onChange={e => updateDbConfig('port', e.target.value)} />+ </div>+ </div>+ <div className="form-row">+ <div className="form-group">+ <label>Username</label>+ <input+ type="text"+ value={dbConfig.username}+ onChange={e => updateDbConfig('username', e.target.value)}+ />+ </div>+ <div className="form-group">+ <label>Password</label>+ <input+ type="password"+ value={dbConfig.password}+ onChange={e => updateDbConfig('password', e.target.value)}+ />+ </div>+ </div>+ <div className="form-row">+ <div className="form-group">+ <label>Database Name</label>+ <input+ type="text"+ value={dbConfig.database}+ onChange={e => updateDbConfig('database', e.target.value)}+ />+ </div>+ <div className="form-group small">+ <label>Pool Size</label>+ <input+ type="number"+ min="1"+ max="50"+ value={dbConfig.poolSize}+ onChange={e => updateDbConfig('poolSize', parseInt(e.target.value))}+ />+ </div>+ </div>+ <div className="toggle-row">+ <div className="toggle-info">+ <span>SSL Connection</span>+ <small>Enable TLS/SSL for secure database connections</small>+ </div>+ <label className="toggle-switch">+ <input+ type="checkbox"+ checked={dbConfig.sslEnabled}+ onChange={e => updateDbConfig('sslEnabled', e.target.checked)}+ />+ <span className="toggle-slider"></span>+ </label>+ </div>+ </div>+ )}+ </>+ )}++ <div+ className="empty-state-card"+ style={{+ padding: '2.5rem',+ textAlign: 'center',+ background: '#F8FAFC',+ borderRadius: '12px',+ border: '1px dashed #E2E8F0',+ marginTop: '1rem',+ }}+ >+ <Database size={32} style={{ color: '#22C55E', marginBottom: '1rem', opacity: 0.7 }} />+ <p style={{ margin: 0, color: '#475569', fontSize: '0.9375rem', fontWeight: 500 }}>Database Migrations</p>+ <p+ style={{+ margin: '0.75rem 0 0',+ color: '#22C55E',+ fontSize: '0.875rem',+ fontWeight: 500,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ gap: '0.375rem',+ }}+ >+ <CheckCircle size={16} />+ Schema is auto-synchronized with TypeORM+ </p>+ <p style={{ margin: '0.5rem 0 0', color: '#64748B', fontSize: '0.8125rem', lineHeight: 1.5 }}>+ Migrations are managed automatically. Use CLI for manual migrations.+ </p>+ </div>+ </section>++ {/* Redis Section */}+ <section className="infra-card">+ <div className="card-header">+ <div className="header-left">+ <Server size={20} />+ <h2>Redis</h2>+ </div>+ <span+ className={`status-indicator ${redisEnabled && redisConfig.connected ? 'connected' : 'disconnected'}`}+ >+ ● {redisEnabled ? (redisConfig.connected ? 'Connected' : 'Disconnected') : 'Disabled'}+ </span>+ </div>++ <div+ className="toggle-row"+ style={{+ borderBottom: redisEnabled ? '1px solid var(--border)' : 'none',+ marginBottom: redisEnabled ? '1.5rem' : 0,+ paddingBottom: redisEnabled ? '1.25rem' : 0,+ }}+ >+ <div className="toggle-info">+ <span>Enable Redis</span>+ <small>Required for caching, session storage, and BullMQ queues</small>+ </div>+ <label className="toggle-switch">+ <input+ type="checkbox"+ checked={redisEnabled}+ onChange={e => {+ setRedisEnabled(e.target.checked);+ if (!e.target.checked) setQueueEnabled(false);+ }}+ />+ <span className="toggle-slider"></span>+ </label>+ </div>++ {redisEnabled ? (+ <>+ <div className="toggle-row" style={{ marginBottom: '1rem' }}>+ <div className="toggle-info">+ <span>Use Built-in Redis Container</span>+ <small>OpenWA will manage a Redis container for you</small>+ </div>+ <label className="toggle-switch">+ <input+ type="checkbox"+ checked={redisConfig.builtIn}+ onChange={e => updateRedisConfig('builtIn', e.target.checked)}+ />+ <span className="toggle-slider"></span>+ </label>+ </div>++ {!redisConfig.builtIn && (+ <div className="config-form">+ <div className="form-row">+ <div className="form-group">+ <label>Host</label>+ <input+ type="text"+ value={redisConfig.host}+ onChange={e => updateRedisConfig('host', e.target.value)}+ />+ </div>+ <div className="form-group small">+ <label>Port</label>+ <input+ type="text"+ value={redisConfig.port}+ onChange={e => updateRedisConfig('port', e.target.value)}+ />+ </div>+ <div className="form-group">+ <label>Password</label>+ <input+ type="password"+ value={redisConfig.password}+ onChange={e => updateRedisConfig('password', e.target.value)}+ placeholder="(optional)"+ />+ </div>+ </div>+ </div>+ )}++ {/* BullMQ Queue Toggle */}+ <div+ className="toggle-row"+ style={{ borderTop: '1px solid var(--border)', paddingTop: '1.25rem', marginTop: '0.5rem' }}+ >+ <div className="toggle-info">+ <span>Enable BullMQ Queue System</span>+ <small>Use message queues for reliable message and webhook delivery</small>+ </div>+ <label className="toggle-switch">+ <input type="checkbox" checked={queueEnabled} onChange={e => setQueueEnabled(e.target.checked)} />+ <span className="toggle-slider"></span>+ </label>+ </div>++ {queueEnabled && (+ <div className="queue-stats">+ <h3>Queue Statistics</h3>+ <div className="stats-row">+ <div className="queue-stat-card">+ <h4>Message Queue</h4>+ <div className="stat-values">+ <div className="stat-item pending">+ <span className="value">{queueStats.messages.pending}</span>+ <span className="label">Pending</span>+ </div>+ <div className="stat-item completed">+ <span className="value">{queueStats.messages.completed.toLocaleString()}</span>+ <span className="label">Completed</span>+ </div>+ <div className="stat-item failed">+ <span className="value">{queueStats.messages.failed}</span>+ <span className="label">Failed</span>+ </div>+ </div>+ </div>+ <div className="queue-stat-card">+ <h4>Webhook Queue</h4>+ <div className="stat-values">+ <div className="stat-item pending">+ <span className="value">{queueStats.webhooks.pending}</span>+ <span className="label">Pending</span>+ </div>+ <div className="stat-item completed">+ <span className="value">{queueStats.webhooks.completed.toLocaleString()}</span>+ <span className="label">Completed</span>+ </div>+ <div className="stat-item failed">+ <span className="value">{queueStats.webhooks.failed}</span>+ <span className="label">Failed</span>+ </div>+ </div>+ </div>+ </div>+ <div className="queue-actions">+ <button className="btn-danger-outline">+ <Trash2 size={16} />+ Clear Failed Jobs+ </button>+ <button+ className="btn-outline"+ onClick={() => window.open('http://localhost:2785/api/admin/queues', '_blank')}+ >+ <ExternalLink size={16} />+ View Bull MQ Dashboard+ </button>+ </div>+ </div>+ )}+ </>+ ) : (+ <div+ className="empty-state-card"+ style={{+ padding: '2.5rem',+ textAlign: 'center',+ background: '#F8FAFC',+ borderRadius: '12px',+ border: '1px dashed #E2E8F0',+ marginTop: '1rem',+ }}+ >+ <Server size={32} style={{ color: '#94A3B8', marginBottom: '1rem', opacity: 0.5 }} />+ <p style={{ margin: 0, color: '#475569', fontSize: '0.9375rem', fontWeight: 500 }}>Redis is Disabled</p>+ <p style={{ margin: '0.5rem 0 0', color: '#64748B', fontSize: '0.8125rem', lineHeight: 1.5 }}>+ Enable Redis for caching, session storage, <br />+ and BullMQ message queues.+ </p>+ </div>+ )}+ </section>++ {/* Storage Section */}+ <section className="infra-card">+ <div className="card-header">+ <div className="header-left">+ <HardDrive size={20} />+ <h2>Storage Configuration</h2>+ </div>+ </div>++ <div className="radio-group">+ <label className={`radio-option ${storageConfig.type === 'local' ? 'selected' : ''}`}>+ <input+ type="radio"+ name="storageType"+ checked={storageConfig.type === 'local'}+ onChange={() => updateStorageConfig('type', 'local')}+ />+ <img src={folderIcon} alt="" className="watermark-icon" />+ <span>Local Filesystem</span>+ <small>Store media files locally</small>+ </label>+ <label className={`radio-option ${storageConfig.type === 's3' ? 'selected' : ''}`}>+ <input+ type="radio"+ name="storageType"+ checked={storageConfig.type === 's3'}+ onChange={() => updateStorageConfig('type', 's3')}+ />+ <img src={s3Icon} alt="" className="watermark-icon" />+ <span>Amazon S3</span>+ <small>Cloud storage (S3 compatible)</small>+ </label>+ </div>++ <div className="config-form">+ {storageConfig.type === 'local' && (+ <div className="form-group">+ <label>Storage Path</label>+ <input+ type="text"+ value={storageConfig.localPath}+ onChange={e => updateStorageConfig('localPath', e.target.value)}+ />+ </div>+ )}++ {storageConfig.type === 's3' && (+ <>+ <div className="toggle-row" style={{ marginTop: '1rem', marginBottom: '1rem' }}>+ <div className="toggle-info">+ <span>Use Built-in MinIO Container</span>+ <small>OpenWA will manage a MinIO (S3-compatible) container for you</small>+ </div>+ <label className="toggle-switch">+ <input+ type="checkbox"+ checked={storageConfig.builtIn}+ onChange={e => updateStorageConfig('builtIn', e.target.checked)}+ />+ <span className="toggle-slider"></span>+ </label>+ </div>++ {!storageConfig.builtIn && (+ <>+ <div className="form-row">+ <div className="form-group">+ <label>Bucket Name</label>+ <input+ type="text"+ value={storageConfig.s3Bucket}+ onChange={e => updateStorageConfig('s3Bucket', e.target.value)}+ />+ </div>+ <div className="form-group">+ <label>Region</label>+ <input+ type="text"+ value={storageConfig.s3Region}+ onChange={e => updateStorageConfig('s3Region', e.target.value)}+ />+ </div>+ </div>+ <div className="form-row">+ <div className="form-group">+ <label>Access Key</label>+ <input+ type="text"+ value={storageConfig.s3AccessKey}+ onChange={e => updateStorageConfig('s3AccessKey', e.target.value)}+ />+ </div>+ <div className="form-group">+ <label>Secret Key</label>+ <input+ type="password"+ value={storageConfig.s3SecretKey}+ onChange={e => updateStorageConfig('s3SecretKey', e.target.value)}+ />+ </div>+ </div>+ <div className="form-group">+ <label>Custom Endpoint (optional)</label>+ <input+ type="text"+ value={storageConfig.s3Endpoint}+ onChange={e => updateStorageConfig('s3Endpoint', e.target.value)}+ placeholder="For MinIO or other S3-compatible services"+ />+ </div>+ </>+ )}+ </>+ )}+ </div>+ </section>+ </div>++ {/* Restart Modal */}+ {showRestartModal && (+ <div className="modal-overlay">+ <div className="modal" style={{ maxWidth: '500px', textAlign: 'center' }}>+ <div className="modal-header" style={{ justifyContent: 'center', borderBottom: 'none' }}>+ <h2>+ {restartStatus === 'idle' && '⚙️ Configuration Saved'}+ {restartStatus === 'restarting' && '🔄 Restarting Server...'}+ {restartStatus === 'waiting' && '⏳ Please Wait...'}+ {restartStatus === 'success' && '✅ Server Ready'}+ {restartStatus === 'error' && '❌ Restart Failed'}+ </h2>+ </div>+ <div className="modal-body" style={{ padding: '2rem' }}>+ {restartStatus === 'idle' && (+ <>+ <p style={{ fontSize: '1rem', color: '#475569', marginBottom: '1.5rem' }}>+ Configuration has been saved to <code>.env.generated</code>.<br />A server restart is required to+ apply the changes.+ </p>+ <div style={{ display: 'flex', gap: '1rem', justifyContent: 'center' }}>+ <button className="btn-secondary" onClick={() => setShowRestartModal(false)}>+ Restart Later+ </button>+ <button className="btn-primary" onClick={handleRestart}>+ Restart Now+ </button>+ </div>+ </>+ )}++ {(restartStatus === 'restarting' || restartStatus === 'waiting') && (+ <>+ <div style={{ marginBottom: '1.5rem' }}>+ <Loader2 className="animate-spin" size={48} style={{ color: '#22C55E', marginBottom: '1rem' }} />+ <p style={{ fontSize: '1.125rem', color: '#1E293B', fontWeight: 500 }}>+ {restartCountdown > 0 ? `Server restarting... ${restartCountdown}s` : 'Checking server status...'}+ </p>+ </div>+ <div+ style={{+ width: '100%',+ height: '8px',+ background: '#E2E8F0',+ borderRadius: '4px',+ overflow: 'hidden',+ }}+ >+ <div+ style={{+ width: restartCountdown > 0 ? `${((30 - restartCountdown) / 30) * 100}%` : '100%',+ height: '100%',+ background: 'linear-gradient(90deg, #22C55E, #10B981)',+ transition: 'width 1s linear',+ }}+ />+ </div>+ <p style={{ marginTop: '1rem', fontSize: '0.875rem', color: '#64748B' }}>+ Please do not close this window+ </p>+ </>+ )}++ {restartStatus === 'success' && (+ <>+ <CheckCircle size={48} style={{ color: '#22C55E', marginBottom: '1rem' }} />+ <p style={{ fontSize: '1rem', color: '#475569' }}>+ Server is back online! The page will reload automatically.+ </p>+ </>+ )}++ {restartStatus === 'error' && (+ <>+ <p style={{ fontSize: '1rem', color: '#DC2626', marginBottom: '1rem' }}>+ Server did not respond after 30 seconds.+ <br />+ Please check the Docker logs and restart manually.+ </p>+ <button className="btn-primary" onClick={() => window.location.reload()}>+ Reload Page+ </button>+ </>+ )}+ </div>+ </div>+ </div>+ )}++ <footer className="page-footer">+ <button className="btn-primary large" onClick={handleSaveConfig} disabled={saving}>+ {saving ? <Loader2 className="animate-spin" size={20} /> : <Save size={20} />}+ {saving ? 'Saving...' : 'Save Configuration'}+ </button>+ </footer>+ </div>+ );+}diff --git a/dashboard/src/pages/Login.css b/dashboard/src/pages/Login.cssnew file mode 100644index 000000000..92f31e968--- /dev/null+++ b/dashboard/src/pages/Login.css@@ -0,0 +1,191 @@+.login-container {+ min-height: 100vh;+ width: 100%;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ background: var(--bg-light);+ padding: 2rem;+ position: fixed;+ top: 0;+ left: 0;+ right: 0;+ bottom: 0;+}++.login-card {+ background: var(--bg-white);+ border-radius: 12px;+ box-shadow: var(--shadow-lg);+ padding: 3rem;+ width: 100%;+ max-width: 420px;+ text-align: center;+}++.login-logo {+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 0.5rem;+ margin-bottom: 1.5rem;+}++.logo-icon {+ width: 127px;+ height: 127px;+ object-fit: contain;+}++.version-info {+ font-size: 0.75rem;+ color: var(--text-muted);+ font-weight: 500;+}++.login-title {+ font-size: 1.75rem;+ font-weight: 600;+ color: var(--text-primary);+ margin: 0 0 0.5rem;+}++.login-subtitle {+ color: var(--text-secondary);+ margin: 0 0 2rem;+}++.login-form {+ text-align: left;+}++.input-group {+ margin-bottom: 1.5rem;+}++.input-group label {+ display: block;+ font-size: 0.875rem;+ font-weight: 500;+ color: var(--text-primary);+ margin-bottom: 0.5rem;+}++.input-wrapper {+ position: relative;+}++.input-wrapper input {+ width: 100%;+ padding: 0.75rem 3rem 0.75rem 1rem;+ font-size: 1rem;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ background: var(--bg-white);+ transition:+ border-color 0.2s,+ box-shadow 0.2s;+}++.input-wrapper input:focus {+ outline: none;+ border-color: var(--primary);+ box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);+}++.input-wrapper input.error {+ border-color: var(--error);+}++.toggle-visibility {+ position: absolute;+ right: 0.75rem;+ top: 50%;+ transform: translateY(-50%);+ background: none;+ border: none;+ color: var(--text-muted);+ cursor: pointer;+ padding: 0.25rem;+}++.toggle-visibility:hover {+ color: var(--text-secondary);+}++.error-message {+ display: block;+ color: var(--error);+ font-size: 0.875rem;+ margin-top: 0.5rem;+}++.connect-btn {+ width: 100%;+ padding: 0.875rem 1.5rem;+ font-size: 1rem;+ font-weight: 600;+ color: white;+ background: var(--primary);+ border: none;+ border-radius: var(--radius);+ cursor: pointer;+ transition: background 0.2s;+}++.connect-btn:hover:not(:disabled) {+ background: var(--primary-hover);+}++.connect-btn:disabled {+ opacity: 0.7;+ cursor: not-allowed;+}++.login-help {+ margin-top: 1.5rem;+ font-size: 0.875rem;+ color: var(--text-secondary);+}++.login-help a {+ color: var(--primary);+ text-decoration: none;+ font-weight: 500;+}++.login-help a:hover {+ text-decoration: underline;+}++.login-footer {+ margin-top: 2rem;+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 0.75rem;+ font-size: 0.75rem;+ color: var(--text-muted);+ text-align: center;+}++.login-footer .github-link {+ color: var(--text-muted);+ transition: color 0.2s;+}++.login-footer .github-link:hover {+ color: var(--primary);+}++.login-footer a {+ color: var(--text-muted);+ font-size: 0.75rem;+ text-decoration: none;+}++.login-footer a:hover {+ color: var(--text-secondary);+}diff --git a/dashboard/src/pages/Login.tsx b/dashboard/src/pages/Login.tsxnew file mode 100644index 000000000..7a070ae2f--- /dev/null+++ b/dashboard/src/pages/Login.tsx@@ -0,0 +1,105 @@+import { useState } from 'react';+import { Eye, EyeOff, Github } from 'lucide-react';+import './Login.css';++interface LoginProps {+ onLogin: (apiKey: string) => void;+}++export function Login({ onLogin }: LoginProps) {+ const [apiKey, setApiKey] = useState('');+ const [showKey, setShowKey] = useState(false);+ const [isLoading, setIsLoading] = useState(false);+ const [error, setError] = useState('');++ const handleSubmit = async (e: React.FormEvent) => {+ e.preventDefault();+ if (!apiKey.trim()) {+ setError('API key is required');+ return;+ }+ setIsLoading(true);+ setError('');++ try {+ // Validate API key with backend+ const response = await fetch('/api/auth/validate', {+ method: 'POST',+ headers: {+ 'Content-Type': 'application/json',+ 'X-API-Key': apiKey,+ },+ });++ if (response.ok) {+ onLogin(apiKey);+ } else {+ const errorData = await response.json().catch(() => ({}));+ setError(errorData.message || 'Invalid API key');+ }+ } catch {+ setError('Unable to connect to server. Please try again.');+ } finally {+ setIsLoading(false);+ }+ };++ return (+ <div className="login-container">+ <div className="login-card">+ <div className="login-logo">+ <img src="/openwa_logo.webp" alt="OpenWA" className="logo-icon" />+ <span className="version-info">+ v{__APP_VERSION__} · {new Date(__BUILD_TIME__).toLocaleDateString()}+ </span>+ </div>+ <form onSubmit={handleSubmit} className="login-form">+ <div className="input-group">+ <label htmlFor="apiKey">API Key</label>+ <div className="input-wrapper">+ <input+ id="apiKey"+ type={showKey ? 'text' : 'password'}+ value={apiKey}+ onChange={e => setApiKey(e.target.value)}+ placeholder="Enter your API key"+ className={error ? 'error' : ''}+ />+ <button type="button" className="toggle-visibility" onClick={() => setShowKey(!showKey)}>+ {showKey ? <EyeOff size={20} /> : <Eye size={20} />}+ </button>+ </div>+ {error && <span className="error-message">{error}</span>}+ </div>++ <button type="submit" className="connect-btn" disabled={isLoading}>+ {isLoading ? 'Connecting...' : 'Connect'}+ </button>+ </form>++ <p className="login-help">+ Need help?{' '}+ <a+ href="https://github.com/rmyndharis/OpenWA/blob/main/docs/01-project-overview.md"+ target="_blank"+ rel="noopener noreferrer"+ >+ View Documentation+ </a>+ </p>+ </div>++ <footer className="login-footer">+ <span>Made with ❤️ by Yudhi Armyndharis and the OpenWA Community</span>+ <a+ href="https://github.com/rmyndharis/OpenWA"+ target="_blank"+ rel="noopener noreferrer"+ className="github-link"+ >+ <Github size={18} />+ </a>+ </footer>+ </div>+ );+}diff --git a/dashboard/src/pages/Logs.css b/dashboard/src/pages/Logs.cssnew file mode 100644index 000000000..7a4ea255a--- /dev/null+++ b/dashboard/src/pages/Logs.css@@ -0,0 +1,383 @@+.logs-page {+ padding: 2rem;+ width: 100%;+ box-sizing: border-box;+}++.page-header {+ margin-bottom: 1.5rem;+}++.header-content {+ display: flex;+ justify-content: space-between;+ align-items: center;+}++/* H1 inherited from global */++.btn-secondary {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.75rem 1.25rem;+ background: var(--bg-white);+ color: var(--text-primary);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ font-size: 0.9375rem;+ font-weight: 500;+ cursor: pointer;+ transition: all 0.2s;+}++.btn-secondary:hover {+ background: var(--bg-light);+}++.filters-bar {+ display: flex;+ gap: 1rem;+ margin-bottom: 1.5rem;+}++.search-input {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ flex: 1;+ max-width: 400px;+ padding: 0.75rem 1rem;+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: var(--radius);+}++.search-input svg {+ color: var(--text-muted);+}++.search-input input {+ flex: 1;+ border: none;+ background: none;+ font-size: 0.9375rem;+ color: var(--text-primary);+}++.search-input input:focus {+ outline: none;+}++.filter-group {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0 1rem;+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: var(--radius);+}++.filter-group svg {+ color: var(--text-muted);+}++.filter-group select {+ padding: 0.75rem 0;+ border: none;+ background: none;+ font-size: 0.9375rem;+ color: var(--text-primary);+ cursor: pointer;+}++.filter-group select:focus {+ outline: none;+}++.logs-table-container {+ background: var(--bg-white);+ border-radius: 12px;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+ overflow-x: auto;+}++.logs-table {+ display: flex;+ flex-direction: column;+ width: 100%;+ font-size: 0.875rem;+}++/* Unified row styling - same class for header and data */+.logs-table .table-row {+ display: grid;+ grid-template-columns: 180px 200px 150px 150px 150px 1fr 120px;+ gap: 1rem;+ padding: 1rem 1.5rem;+ align-items: center;+ border-bottom: 1px solid var(--border);+}++.logs-table .table-row:last-child {+ border-bottom: none;+}++.logs-table .table-row.header {+ background: var(--bg-light);+ font-size: 0.7rem;+ font-weight: 700;+ color: var(--text-secondary);+ text-transform: uppercase;+ letter-spacing: 0.05em;+ border-bottom: 1px solid var(--border);+}++.logs-table .table-row:not(.header):hover {+ background: rgba(37, 211, 102, 0.05);+}++.timestamp {+ font-family: monospace;+ font-size: 0.8125rem;+ color: var(--text-muted);+ white-space: nowrap;+}++.action {+ font-weight: 600;+ color: var(--text-primary);+ font-size: 0.8125rem;+ white-space: nowrap;+}++.api-key {+ font-family: monospace;+ font-size: 0.8125rem;+ white-space: nowrap;+}++.ip {+ font-family: monospace;+ font-size: 0.8125rem;+ white-space: nowrap;+}++.details {+ font-size: 0.875rem;+ color: var(--text-secondary);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}++.severity-badge {+ display: inline-block;+ padding: 0.25rem 0.625rem;+ border-radius: 6px;+ font-size: 0.6875rem;+ font-weight: 700;+ text-transform: uppercase;+ letter-spacing: 0.025em;+ white-space: nowrap;+}++.logs-table .table-row > span:last-child {+ justify-self: end;+}++.severity-badge.info {+ background: #dbeafe;+ color: #1d4ed8;+}++.severity-badge.warn {+ background: #fef3c7;+ color: #d97706;+}++.severity-badge.error {+ background: #fee2e2;+ color: #dc2626;+}++.pagination {+ display: flex;+ justify-content: center;+ align-items: center;+ gap: 0.5rem;+ margin-top: 1.5rem;+}++.pagination button {+ padding: 0.5rem 1rem;+ font-size: 0.875rem;+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: 6px;+ cursor: pointer;+ color: var(--text-secondary);+ transition: all 0.2s;+}++.pagination button:hover:not(:disabled) {+ background: var(--bg-light);+}++.pagination button:disabled {+ opacity: 0.5;+ cursor: not-allowed;+}++.page-numbers {+ display: flex;+ gap: 0.25rem;+}++.page-numbers button {+ min-width: 36px;+ padding: 0.5rem;+}++.page-numbers button.active {+ background: var(--primary);+ border-color: var(--primary);+ color: white;+}++/* Empty Table State */+.empty-table-state {+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ padding: 4rem 2rem;+ text-align: center;+ color: var(--text-muted);+}++.empty-table-state svg {+ margin-bottom: 1rem;+ opacity: 0.4;+ color: var(--text-muted);+}++.empty-table-state h3 {+ font-size: 1.125rem;+ font-weight: 600;+ color: var(--text-secondary);+ margin: 0 0 0.5rem;+}++.empty-table-state p {+ margin: 0;+ font-size: 0.875rem;+ max-width: 300px;+}++/* Mobile Responsive */+@media (max-width: 768px) {+ .logs-page {+ padding: 1rem;+ }++ .filters-bar {+ flex-direction: column;+ gap: 0.75rem;+ }++ .search-input {+ max-width: none;+ }++ .filter-group {+ width: 100%;+ justify-content: space-between;+ }++ .filter-group select {+ flex: 1;+ padding: 0.75rem 0;+ }++ .logs-table-container {+ overflow-x: visible;+ border: none;+ background: transparent;+ box-shadow: none;+ }++ .logs-table {+ display: block;+ }++ .logs-table .table-row.header {+ display: none;+ }++ .logs-table .table-row:not(.header) {+ display: flex;+ flex-direction: column;+ gap: 0.5rem;+ padding: 1rem;+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: 12px;+ box-shadow: var(--shadow-sm);+ margin-bottom: 0.75rem;+ }++ .logs-table .table-row:not(.header):hover {+ background: var(--bg-white);+ }++ /* Action label prominent at top */+ .logs-table .table-row .action {+ font-size: 0.9375rem;+ font-weight: 600;+ order: 1;+ margin-bottom: 0.25rem;+ }++ /* Timestamp secondary */+ .logs-table .table-row .timestamp {+ order: 2;+ font-size: 0.75rem;+ }++ /* Session, API Key, IP - inline info */+ .logs-table .table-row > span:nth-child(3),+ .logs-table .table-row > span:nth-child(4),+ .logs-table .table-row > span:nth-child(5) {+ display: none;+ }++ /* Severity badge stays visible */+ .logs-table .table-row > span:last-child {+ order: 3;+ justify-self: flex-start;+ }++ .pagination {+ flex-wrap: wrap;+ gap: 0.5rem;+ }++ .pagination button {+ padding: 0.5rem 0.75rem;+ font-size: 0.8125rem;+ }++ .page-numbers button {+ min-width: 32px;+ padding: 0.5rem 0.25rem;+ }+}++@media (max-width: 480px) {+ .logs-page {+ padding: 0.75rem;+ }+}diff --git a/dashboard/src/pages/Logs.tsx b/dashboard/src/pages/Logs.tsxnew file mode 100644index 000000000..3fb84ad43--- /dev/null+++ b/dashboard/src/pages/Logs.tsx@@ -0,0 +1,157 @@+import { useState, useEffect, useCallback } from 'react';+import { Download, Search, Filter, Loader2, FileText } from 'lucide-react';+import { auditApi, type AuditLog } from '../services/api';+import { useDocumentTitle } from '../hooks/useDocumentTitle';+import { PageHeader } from '../components/PageHeader';+import './Logs.css';++export function Logs() {+ useDocumentTitle('Audit Logs');+ const [logs, setLogs] = useState<AuditLog[]>([]);+ const [total, setTotal] = useState(0);+ const [loading, setLoading] = useState(true);+ const [searchQuery, setSearchQuery] = useState('');+ const [severityFilter, setSeverityFilter] = useState('all');+ const [page, setPage] = useState(1);+ const limit = 20;++ const fetchLogs = useCallback(async () => {+ try {+ setLoading(true);+ const params: { severity?: string; limit: number; offset: number } = {+ limit,+ offset: (page - 1) * limit,+ };+ if (severityFilter !== 'all') params.severity = severityFilter;+ const result = await auditApi.list(params);+ setLogs(result.data);+ setTotal(result.total);+ } catch {+ // Handle error+ } finally {+ setLoading(false);+ }+ }, [severityFilter, page, limit]);++ useEffect(() => {+ fetchLogs();+ }, [fetchLogs]);++ const filteredLogs = logs.filter(log => {+ const matchesSearch =+ log.action.toLowerCase().includes(searchQuery.toLowerCase()) ||+ (log.errorMessage || '').toLowerCase().includes(searchQuery.toLowerCase());+ return matchesSearch;+ });++ const totalPages = Math.ceil(total / limit);++ const formatTimestamp = (date: string) => {+ return new Date(date).toLocaleString();+ };++ if (loading && logs.length === 0) {+ return (+ <div+ className="logs-page"+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '400px' }}+ >+ <Loader2 className="animate-spin" size={32} />+ </div>+ );+ }++ return (+ <div className="logs-page">+ <PageHeader+ title="Audit Logs"+ subtitle="Track and review all API actions and system events"+ actions={+ <button className="btn-secondary">+ <Download size={18} />+ Export CSV+ </button>+ }+ />++ <div className="filters-bar">+ <div className="search-input">+ <Search size={18} />+ <input+ type="text"+ placeholder="Search logs..."+ value={searchQuery}+ onChange={e => setSearchQuery(e.target.value)}+ />+ </div>++ <div className="filter-group">+ <Filter size={16} />+ <select+ value={severityFilter}+ onChange={e => {+ setSeverityFilter(e.target.value);+ setPage(1);+ }}+ >+ <option value="all">All Severities</option>+ <option value="info">Info</option>+ <option value="warn">Warning</option>+ <option value="error">Error</option>+ </select>+ </div>+ </div>++ <div className="logs-table-container">+ <div className="logs-table">+ <div className="table-row header">+ <span>Timestamp</span>+ <span>Action</span>+ <span>Session</span>+ <span>API Key</span>+ <span>IP Address</span>+ <span>Severity</span>+ </div>+ {filteredLogs.length === 0 ? (+ <div className="empty-table-state">+ <FileText size={48} strokeWidth={1} />+ <h3>No logs found</h3>+ <p>Audit logs will appear here as actions are performed</p>+ </div>+ ) : (+ filteredLogs.map(log => (+ <div key={log.id} className="table-row">+ <span className="timestamp">{formatTimestamp(log.createdAt)}</span>+ <span className="action">{log.action}</span>+ <span>{log.sessionName || log.sessionId || '—'}</span>+ <span className="api-key">{log.apiKeyName || '—'}</span>+ <span className="ip">{log.ipAddress || '—'}</span>+ <span>+ <span className={`severity-badge ${log.severity}`}>{log.severity.toUpperCase()}</span>+ </span>+ </div>+ ))+ )}+ </div>+ </div>++ {totalPages > 1 && (+ <div className="pagination">+ <button disabled={page === 1} onClick={() => setPage(p => p - 1)}>+ Previous+ </button>+ <span className="page-numbers">+ {Array.from({ length: Math.min(totalPages, 5) }, (_, i) => i + 1).map(p => (+ <button key={p} className={p === page ? 'active' : ''} onClick={() => setPage(p)}>+ {p}+ </button>+ ))}+ </span>+ <button disabled={page >= totalPages} onClick={() => setPage(p => p + 1)}>+ Next+ </button>+ </div>+ )}+ </div>+ );+}diff --git a/dashboard/src/pages/MessageTester.css b/dashboard/src/pages/MessageTester.cssnew file mode 100644index 000000000..59ba00135--- /dev/null+++ b/dashboard/src/pages/MessageTester.css@@ -0,0 +1,222 @@+.message-tester {+ padding: 2rem;+ width: 100%;+ box-sizing: border-box;+}++.message-tester .page-header {+ margin-bottom: 2rem;+}++/* H1 inherited from global */+.message-tester .page-header p {+ margin: 0;+ font-size: 0.9375rem;+ color: var(--text-secondary);+}++.tester-panels {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 1.5rem;+}++.compose-panel,+.response-panel {+ background: var(--bg-white);+ border-radius: 12px;+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+}++.compose-panel h2,+.response-panel h2 {+ /* Inherits from H2 */+ margin-bottom: 1.5rem;+}++.form-group {+ margin-bottom: 1.25rem;+}++.form-group label {+ display: block;+ font-size: 0.7rem;+ font-weight: 700;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ color: var(--text-secondary);+ margin-bottom: 0.5rem;+}++.form-group input,+.form-group select,+.form-group textarea {+ width: 100%;+ padding: 0.75rem 1rem;+ font-size: 0.9375rem;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ background: var(--bg-white);+ transition: border-color 0.2s;+}++.form-group input:focus,+.form-group select:focus,+.form-group textarea:focus {+ outline: none;+ border-color: var(--primary);+}++.form-group textarea {+ resize: vertical;+ min-height: 100px;+}++.form-group .hint {+ display: block;+ font-size: 0.75rem;+ color: var(--text-muted);+ margin-top: 0.375rem;+}++.toggle-group {+ display: flex;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ overflow: hidden;+}++.toggle-group button {+ flex: 1;+ padding: 0.625rem 1rem;+ font-size: 0.875rem;+ font-weight: 500;+ background: var(--bg-white);+ border: none;+ cursor: pointer;+ transition: all 0.2s;+ color: var(--text-secondary);+}++.toggle-group button:first-child {+ border-right: 1px solid var(--border);+}++.toggle-group button.active {+ background: var(--primary);+ color: white;+}++.send-btn {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.5rem;+ width: 100%;+ padding: 0.875rem 1.5rem;+ font-size: 1rem;+ font-weight: 600;+ color: white;+ background: var(--primary);+ border: none;+ border-radius: var(--radius);+ cursor: pointer;+ transition: background 0.2s;+}++.send-btn:hover:not(:disabled) {+ background: var(--primary-hover);+}++.send-btn:disabled {+ opacity: 0.7;+ cursor: not-allowed;+}++.response-status {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.75rem 1rem;+ border-radius: var(--radius);+ font-weight: 600;+ font-size: 0.9375rem;+ margin-bottom: 1rem;+}++.response-status.success {+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+}++.response-status.error {+ background: #FEE2E2;+ color: #DC2626;+}++.response-details {+ margin-bottom: 1rem;+}++.detail-row {+ display: flex;+ justify-content: space-between;+ padding: 0.625rem 0;+ border-bottom: 1px solid var(--border);+}++.detail-row:last-child {+ border-bottom: none;+}++.detail-label {+ font-size: 0.875rem;+ color: var(--text-secondary);+}++.detail-value {+ font-size: 0.875rem;+ color: var(--text-primary);+ font-weight: 500;+}++.detail-value.mono {+ font-family: monospace;+}++.response-json {+ background: #1E293B;+ border-radius: var(--radius);+ padding: 1rem;+ overflow-x: auto;+}++.response-json pre {+ margin: 0;+ color: #E2E8F0;+ font-size: 0.8125rem;+ font-family: 'JetBrains Mono', monospace;+ white-space: pre-wrap;+}++.response-empty {+ display: flex;+ align-items: center;+ justify-content: center;+ min-height: 200px;+ background: var(--bg-light);+ border-radius: var(--radius);+}++.response-empty p {+ color: var(--text-muted);+ margin: 0;+}++@media (max-width: 1000px) {+ .tester-panels {+ grid-template-columns: 1fr;+ }+}diff --git a/dashboard/src/pages/MessageTester.tsx b/dashboard/src/pages/MessageTester.tsxnew file mode 100644index 000000000..fb0b56b11--- /dev/null+++ b/dashboard/src/pages/MessageTester.tsx@@ -0,0 +1,309 @@+import { useState, useEffect } from 'react';+import { Send, CheckCircle, XCircle, Loader2 } from 'lucide-react';+import { sessionApi, messageApi, type Session } from '../services/api';+import { useDocumentTitle } from '../hooks/useDocumentTitle';+import { useRole } from '../hooks/useRole';+import { PageHeader } from '../components/PageHeader';+import './MessageTester.css';++interface ApiResponse {+ success: boolean;+ messageId?: string;+ timestamp: string;+ error?: string;+}++interface Group {+ id: string;+ name: string;+}++export function MessageTester() {+ useDocumentTitle('Message Tester');+ const { canWrite } = useRole();+ const [sessions, setSessions] = useState<Session[]>([]);+ const [session, setSession] = useState('');+ const [recipient, setRecipient] = useState('');+ const [recipientType, setRecipientType] = useState<'personal' | 'group'>('personal');+ const [groups, setGroups] = useState<Group[]>([]);+ const [selectedGroup, setSelectedGroup] = useState('');+ const [loadingGroups, setLoadingGroups] = useState(false);+ const [messageType, setMessageType] = useState<'text' | 'image' | 'video' | 'audio' | 'document'>('text');+ const [content, setContent] = useState('');+ const [mediaUrl, setMediaUrl] = useState('');+ const [isLoading, setIsLoading] = useState(false);+ const [response, setResponse] = useState<ApiResponse | null>(null);+ const [loadingSessions, setLoadingSessions] = useState(true);++ useEffect(() => {+ async function fetchSessions() {+ try {+ const data = await sessionApi.list();+ const readySessions = data.filter(s => s.status === 'ready');+ setSessions(readySessions);+ if (readySessions.length > 0) setSession(readySessions[0].id);+ } catch {+ // Handle error+ } finally {+ setLoadingSessions(false);+ }+ }+ fetchSessions();+ }, []);++ // Fetch groups when session changes and recipientType is group+ useEffect(() => {+ if (!session || recipientType !== 'group') {+ setGroups([]);+ setSelectedGroup('');+ return;+ }++ async function fetchGroups() {+ setLoadingGroups(true);+ try {+ const groupList = await sessionApi.getGroups(session);+ setGroups(groupList);+ if (groupList.length > 0) setSelectedGroup(groupList[0].id);+ } catch {+ setGroups([]);+ } finally {+ setLoadingGroups(false);+ }+ }+ fetchGroups();+ }, [session, recipientType]);++ const handleSend = async () => {+ // For groups, use selectedGroup; for personal, use recipient+ const targetId = recipientType === 'group' ? selectedGroup : recipient;+ if (!session || !targetId) return;+ setIsLoading(true);+ setResponse(null);++ // For personal, add @c.us suffix; for group, ID already has @g.us+ const chatId = recipientType === 'group' ? targetId : targetId.replace(/[^0-9]/g, '') + '@c.us';++ try {+ let result;+ if (messageType === 'text') {+ result = await messageApi.sendText(session, chatId, content);+ } else if (messageType === 'image') {+ result = await messageApi.sendImage(session, chatId, mediaUrl, content);+ } else if (messageType === 'video') {+ result = await messageApi.sendVideo(session, chatId, mediaUrl, content);+ } else if (messageType === 'audio') {+ result = await messageApi.sendAudio(session, chatId, mediaUrl);+ } else {+ result = await messageApi.sendDocument(session, chatId, mediaUrl, content);+ }++ // Infer success from having messageId - backend doesn't return success field+ setResponse({+ success: !!result.messageId,+ messageId: result.messageId,+ timestamp: result.timestamp ? new Date(result.timestamp * 1000).toISOString() : new Date().toISOString(),+ });+ } catch (err) {+ setResponse({+ success: false,+ timestamp: new Date().toISOString(),+ error: err instanceof Error ? err.message : 'Failed to send message',+ });+ } finally {+ setIsLoading(false);+ }+ };++ if (loadingSessions) {+ return (+ <div+ className="message-tester"+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '400px' }}+ >+ <Loader2 className="animate-spin" size={32} />+ </div>+ );+ }++ return (+ <div className="message-tester">+ <PageHeader title="Message Tester" subtitle="Send test messages through the API" />++ <div className="tester-panels">+ <div className="compose-panel">+ <h2>Send Test Message</h2>++ <div className="form-group">+ <label>Session</label>+ <select value={session} onChange={e => setSession(e.target.value)}>+ {sessions.length === 0 && <option value="">No ready sessions</option>}+ {sessions.map(s => (+ <option key={s.id} value={s.id}>+ {s.name} ({s.phone || 'No phone'})+ </option>+ ))}+ </select>+ </div>++ <div className="form-group">+ <label>Recipient Type</label>+ <div className="toggle-group">+ <button+ className={recipientType === 'personal' ? 'active' : ''}+ onClick={() => setRecipientType('personal')}+ >+ Personal+ </button>+ <button className={recipientType === 'group' ? 'active' : ''} onClick={() => setRecipientType('group')}>+ Group+ </button>+ </div>+ </div>++ <div className="form-group">+ <label>{recipientType === 'group' ? 'Select Group' : 'Recipient Phone Number'}</label>+ {recipientType === 'group' ? (+ <>+ <select+ value={selectedGroup}+ onChange={e => setSelectedGroup(e.target.value)}+ disabled={loadingGroups || groups.length === 0}+ >+ {loadingGroups && <option value="">Loading groups...</option>}+ {!loadingGroups && groups.length === 0 && <option value="">No groups found</option>}+ {groups.map(g => (+ <option key={g.id} value={g.id}>+ {g.name}+ </option>+ ))}+ </select>+ <span className="hint">Select a group from your WhatsApp</span>+ </>+ ) : (+ <>+ <input+ type="text"+ value={recipient}+ onChange={e => setRecipient(e.target.value)}+ placeholder="+62812345678"+ />+ <span className="hint">Use international format without spaces</span>+ </>+ )}+ </div>++ <div className="form-group">+ <label>Message Type</label>+ <div className="toggle-group">+ {(['text', 'image', 'video', 'audio', 'document'] as const).map(type => (+ <button+ key={type}+ className={messageType === type ? 'active' : ''}+ onClick={() => setMessageType(type)}+ >+ {type.charAt(0).toUpperCase() + type.slice(1)}+ </button>+ ))}+ </div>+ </div>++ {messageType === 'text' ? (+ <div className="form-group">+ <label>Message Content</label>+ <textarea+ value={content}+ onChange={e => setContent(e.target.value)}+ placeholder="Enter your message here..."+ rows={5}+ />+ </div>+ ) : (+ <>+ <div className="form-group">+ <label>Media URL</label>+ <input+ type="text"+ value={mediaUrl}+ onChange={e => setMediaUrl(e.target.value)}+ placeholder="https://example.com/file.jpg"+ />+ </div>+ {messageType !== 'audio' && (+ <div className="form-group">+ <label>{messageType === 'document' ? 'Filename' : 'Caption'} (optional)</label>+ <input+ type="text"+ value={content}+ onChange={e => setContent(e.target.value)}+ placeholder={messageType === 'document' ? 'document.pdf' : 'Enter caption...'}+ />+ </div>+ )}+ </>+ )}++ <button+ className="send-btn"+ onClick={handleSend}+ disabled={!canWrite || isLoading || !session || (recipientType === 'group' ? !selectedGroup : !recipient)}+ >+ {isLoading ? <Loader2 className="animate-spin" size={18} /> : <Send size={18} />}+ {isLoading ? 'Sending...' : canWrite ? 'Send Message' : 'View Only'}+ </button>+ </div>++ <div className="response-panel">+ <h2>API Response</h2>++ {response ? (+ <>+ <div className={`response-status ${response.success ? 'success' : 'error'}`}>+ {response.success ? (+ <>+ <CheckCircle size={20} />+ <span>200 OK - Success</span>+ </>+ ) : (+ <>+ <XCircle size={20} />+ <span>400 - Failed</span>+ </>+ )}+ </div>++ <div className="response-details">+ <div className="detail-row">+ <span className="detail-label">Timestamp</span>+ <span className="detail-value">{response.timestamp}</span>+ </div>+ {response.messageId && (+ <div className="detail-row">+ <span className="detail-label">Message ID</span>+ <span className="detail-value mono">{response.messageId}</span>+ </div>+ )}+ {response.error && (+ <div className="detail-row">+ <span className="detail-label">Error</span>+ <span className="detail-value" style={{ color: '#DC2626' }}>+ {response.error}+ </span>+ </div>+ )}+ </div>++ <div className="response-json">+ <pre>{JSON.stringify(response, null, 2)}</pre>+ </div>+ </>+ ) : (+ <div className="response-empty">+ <p>Send a message to see the API response</p>+ </div>+ )}+ </div>+ </div>+ </div>+ );+}diff --git a/dashboard/src/pages/Plugins.css b/dashboard/src/pages/Plugins.cssnew file mode 100644index 000000000..aba31ef48--- /dev/null+++ b/dashboard/src/pages/Plugins.css@@ -0,0 +1,585 @@+.plugins-page {+ padding: 2rem;+ width: 100%;+ box-sizing: border-box;+}++/* Engine Card */+.engine-card {+ background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);+ border: 1px solid rgba(34, 197, 94, 0.2);+ border-radius: 12px;+ padding: 1.5rem;+ margin-bottom: 2rem;+}++.engine-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+}++.engine-info {+ display: flex;+ align-items: center;+ gap: 1rem;+}++.engine-icon-wrapper {+ width: 48px;+ height: 48px;+ background: rgba(34, 197, 94, 0.15);+ border-radius: 12px;+ display: flex;+ align-items: center;+ justify-content: center;+}++.engine-icon-wrapper svg {+ color: #22c55e;+}++.engine-title {+ font-size: 1.125rem;+ font-weight: 600;+ color: var(--text-primary);+ margin: 0 0 0.25rem 0;+ text-transform: none;+ letter-spacing: normal;+}++.engine-name {+ font-size: 0.875rem;+ color: #22c55e;+}++.engine-features {+ margin-top: 1rem;+ padding-top: 1rem;+ border-top: 1px solid rgba(34, 197, 94, 0.15);+}++.features-label {+ font-size: 0.75rem;+ color: var(--text-secondary);+ margin-bottom: 0.5rem;+ text-transform: uppercase;+ letter-spacing: 0.05em;+}++.features-list {+ display: flex;+ flex-wrap: wrap;+ gap: 0.5rem;+}++.feature-tag {+ padding: 0.25rem 0.5rem;+ background: rgba(34, 197, 94, 0.1);+ color: #22c55e;+ border-radius: 4px;+ font-size: 0.75rem;+}++.feature-more {+ padding: 0.25rem 0.5rem;+ color: var(--text-muted);+ font-size: 0.75rem;+}++/* Plugins Grid */+.plugins-grid {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));+ gap: 1.5rem;+}++/* Plugin Card */+.plugin-card {+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: 12px;+ overflow: hidden;+ transition:+ transform 0.2s,+ box-shadow 0.2s;+}++.plugin-card:hover {+ transform: translateY(-2px);+ box-shadow: var(--shadow-md);+}++.plugin-card-header {+ padding: 1rem 1.25rem;+ display: flex;+ align-items: center;+ justify-content: space-between;+}++.plugin-card-header.type-engine {+ background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);+}++.plugin-card-header.type-storage {+ background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);+}++.plugin-card-header.type-queue {+ background: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);+}++.plugin-card-header.type-auth {+ background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);+}++.plugin-card-header.type-extension {+ background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);+}++.plugin-info {+ display: flex;+ align-items: center;+ gap: 0.75rem;+}++.plugin-icon-wrapper {+ width: 40px;+ height: 40px;+ background: rgba(255, 255, 255, 0.2);+ border-radius: 8px;+ display: flex;+ align-items: center;+ justify-content: center;+}++.plugin-icon-wrapper svg {+ color: #fff;+}++.plugin-name {+ font-size: 1rem;+ font-weight: 600;+ color: #fff;+ margin: 0;+ text-transform: none;+ letter-spacing: normal;+}++.plugin-version {+ font-size: 0.75rem;+ color: rgba(255, 255, 255, 0.75);+}++.plugin-builtin-badge {+ padding: 0.25rem 0.5rem;+ background: rgba(255, 255, 255, 0.2);+ color: #fff;+ font-size: 0.625rem;+ font-weight: 600;+ border-radius: 4px;+ text-transform: uppercase;+}++.plugin-card-body {+ padding: 1.25rem;+}++.plugin-description {+ color: var(--text-secondary);+ font-size: 0.875rem;+ margin-bottom: 1rem;+ line-height: 1.5;+}++.plugin-status-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ margin-bottom: 1rem;+}++.plugin-status {+ display: flex;+ align-items: center;+ gap: 0.5rem;+}++.status-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+}++.status-dot.enabled {+ background: #22c55e;+}++.status-dot.disabled {+ background: #eab308;+}++.status-dot.error {+ background: #ef4444;+}++.status-dot.installed {+ background: #64748b;+}++.status-text {+ font-size: 0.875rem;+ color: var(--text-primary);+ text-transform: capitalize;+}++.plugin-type-label {+ font-size: 0.625rem;+ color: var(--text-muted);+ text-transform: uppercase;+ letter-spacing: 0.05em;+}++.plugin-provides {+ display: flex;+ flex-wrap: wrap;+ gap: 0.375rem;+ margin-bottom: 1rem;+}++.provides-tag {+ padding: 0.25rem 0.5rem;+ background: var(--bg-light);+ color: var(--text-secondary);+ font-size: 0.75rem;+ border-radius: 4px;+}++.plugin-error {+ background: rgba(239, 68, 68, 0.1);+ border: 1px solid rgba(239, 68, 68, 0.2);+ border-radius: 6px;+ padding: 0.5rem 0.75rem;+ margin-bottom: 1rem;+}++.plugin-error-text {+ color: #ef4444;+ font-size: 0.75rem;+}++.plugin-actions {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding-top: 1rem;+ border-top: 1px solid var(--border);+}++.btn-toggle {+ flex: 1;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.5rem;+ padding: 0.625rem 1rem;+ border-radius: 8px;+ font-size: 0.875rem;+ font-weight: 500;+ cursor: pointer;+ transition: all 0.2s;+}++.btn-toggle.enable {+ background: rgba(34, 197, 94, 0.1);+ border: 1px solid rgba(34, 197, 94, 0.3);+ color: #22c55e;+}++.btn-toggle.enable:hover {+ background: rgba(34, 197, 94, 0.2);+}++.btn-toggle.disable {+ background: rgba(239, 68, 68, 0.1);+ border: 1px solid rgba(239, 68, 68, 0.3);+ color: #ef4444;+}++.btn-toggle.disable:hover {+ background: rgba(239, 68, 68, 0.2);+}++.btn-toggle:disabled {+ opacity: 0.5;+ cursor: not-allowed;+}++.btn-required {+ flex: 1;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.5rem;+ padding: 0.625rem 1rem;+ background: rgba(34, 197, 94, 0.15);+ border: 1px solid rgba(34, 197, 94, 0.4);+ color: #16a34a;+ font-size: 0.875rem;+ font-weight: 600;+ border-radius: 8px;+ cursor: default;+}++.btn-active {+ flex: 1;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.5rem;+ padding: 0.625rem 1rem;+ background: rgba(34, 197, 94, 0.1);+ border: 1px solid rgba(34, 197, 94, 0.3);+ color: #22c55e;+ font-size: 0.875rem;+ font-weight: 500;+ border-radius: 8px;+ cursor: default;+}++.btn-action {+ width: 36px;+ height: 36px;+ display: flex;+ align-items: center;+ justify-content: center;+ background: var(--bg-light);+ border: 1px solid var(--border);+ border-radius: 8px;+ cursor: pointer;+ transition: all 0.2s;+ padding: 0;+}++.btn-action:hover {+ background: var(--bg-white);+ border-color: var(--text-muted);+}++.btn-action svg {+ color: var(--text-secondary);+}++/* Error Banner */+.error-banner {+ background: rgba(239, 68, 68, 0.1);+ border: 1px solid rgba(239, 68, 68, 0.3);+ border-radius: 8px;+ padding: 1rem;+ margin-bottom: 1.5rem;+ display: flex;+ align-items: center;+ gap: 0.75rem;+}++.error-banner svg {+ color: #ef4444;+}++.error-banner-text {+ color: #ef4444;+}++/* Empty State */+.empty-state {+ text-align: center;+ padding: 4rem 2rem;+}++.empty-state svg {+ color: var(--text-muted);+ margin-bottom: 1rem;+}++.empty-state h3 {+ font-size: 1.25rem;+ color: var(--text-secondary);+ margin-bottom: 0.5rem;+}++.empty-state p {+ color: var(--text-muted);+}++/* Config Modal */+.config-modal {+ max-width: 500px;+ width: 90%;+}++.config-info-banner {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.75rem 1rem;+ background: rgba(251, 191, 36, 0.1);+ border: 1px solid rgba(251, 191, 36, 0.3);+ border-radius: 8px;+ margin-bottom: 1.5rem;+ color: #d97706;+ font-size: 0.875rem;+}++.config-form .form-group {+ margin-bottom: 1.25rem;+}++.config-form .form-group label {+ display: block;+ font-size: 0.875rem;+ font-weight: 600;+ color: var(--text-secondary);+ margin-bottom: 0.5rem;+}++.config-form .form-group input,+.config-form .form-group select {+ width: 100%;+ padding: 0.75rem 1rem;+ border: 1px solid var(--border);+ border-radius: 8px;+ font-size: 0.9375rem;+ background: var(--bg-light);+ transition: all 0.2s;+ box-sizing: border-box;+}++.config-form .form-group input:focus,+.config-form .form-group select:focus {+ outline: none;+ border-color: var(--primary);+ background: var(--bg-white);+ box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);+}++.toggle-group {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 1rem;+ background: var(--bg-light);+ border-radius: 8px;+}++.toggle-info {+ flex: 1;+}++.toggle-info label {+ display: block !important;+ margin-bottom: 0.25rem !important;+}++.toggle-info small {+ display: block;+ font-size: 0.75rem;+ color: var(--text-muted);+}++.toggle-switch {+ position: relative;+ display: inline-block;+ width: 48px;+ height: 26px;+ flex-shrink: 0;+}++.toggle-switch input {+ opacity: 0;+ width: 0;+ height: 0;+}++.toggle-slider {+ position: absolute;+ cursor: pointer;+ top: 0;+ left: 0;+ right: 0;+ bottom: 0;+ background-color: #cbd5e1;+ transition: 0.3s;+ border-radius: 26px;+}++.toggle-slider:before {+ position: absolute;+ content: '';+ height: 20px;+ width: 20px;+ left: 3px;+ bottom: 3px;+ background-color: white;+ transition: 0.3s;+ border-radius: 50%;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);+}++.toggle-switch input:checked + .toggle-slider {+ background-color: var(--primary, #22c55e);+}++.toggle-switch input:checked + .toggle-slider:before {+ transform: translateX(22px);+}++.no-config {+ text-align: center;+ padding: 2rem;+ color: var(--text-muted);+}++.no-config p {+ margin-top: 1rem;+}++.btn-primary {+ padding: 0.75rem 1.5rem;+ background: var(--primary, #22c55e);+ color: white;+ border: none;+ border-radius: 8px;+ font-size: 0.9375rem;+ font-weight: 600;+ cursor: pointer;+ transition: all 0.2s;+ display: flex;+ align-items: center;+ gap: 0.5rem;+}++.btn-primary:hover {+ background: #16a34a;+}++.btn-primary:disabled {+ opacity: 0.6;+ cursor: not-allowed;+}++/* Responsive */+@media (max-width: 768px) {+ .plugins-page {+ padding: 1rem;+ }++ .plugins-grid {+ grid-template-columns: 1fr;+ }++ .engine-header {+ flex-direction: column;+ align-items: flex-start;+ gap: 1rem;+ }+}diff --git a/dashboard/src/pages/Plugins.tsx b/dashboard/src/pages/Plugins.tsxnew file mode 100644index 000000000..096386081--- /dev/null+++ b/dashboard/src/pages/Plugins.tsx@@ -0,0 +1,446 @@+import { useState, useEffect } from 'react';+import {+ Puzzle,+ Power,+ PowerOff,+ Settings,+ CheckCircle,+ AlertCircle,+ Loader2,+ RefreshCw,+ Cpu,+ Database,+ Server,+ Shield,+ Zap,+ X,+} from 'lucide-react';+import { pluginsApi, infraApi } from '../services/api';+import type { Plugin, Engine } from '../services/api';+import { useDocumentTitle } from '../hooks/useDocumentTitle';+import { PageHeader } from '../components/PageHeader';+import './Plugins.css';++type PluginType = 'engine' | 'storage' | 'queue' | 'auth' | 'extension';++const pluginTypeIcons: Record<PluginType, typeof Puzzle> = {+ engine: Cpu,+ storage: Database,+ queue: Server,+ auth: Shield,+ extension: Zap,+};++interface EngineConfig {+ type: string;+ headless: boolean;+ sessionDataPath: string;+ browserArgs: string;+}++export default function Plugins() {+ useDocumentTitle('Plugins');+ const [plugins, setPlugins] = useState<Plugin[]>([]);+ const [engines, setEngines] = useState<Engine[]>([]);+ const [currentEngine, setCurrentEngine] = useState<string>('');+ const [loading, setLoading] = useState(true);+ const [actionLoading, setActionLoading] = useState<string | null>(null);+ const [error, setError] = useState<string | null>(null);++ // Config modal state+ const [showConfigModal, setShowConfigModal] = useState(false);+ const [configPlugin, setConfigPlugin] = useState<Plugin | null>(null);+ const [engineConfig, setEngineConfig] = useState<EngineConfig>({+ type: 'whatsapp-web.js',+ headless: true,+ sessionDataPath: '/data/sessions',+ browserArgs: '--no-sandbox --disable-gpu',+ });+ const [savingConfig, setSavingConfig] = useState(false);++ const fetchData = async () => {+ try {+ setLoading(true);+ setError(null);+ const [pluginsData, enginesData, currentEngineData, infraStatus] = await Promise.all([+ pluginsApi.list(),+ pluginsApi.getEngines(),+ pluginsApi.getCurrentEngine(),+ infraApi.getStatus(),+ ]);+ setPlugins(pluginsData);+ setEngines(enginesData);+ setCurrentEngine(currentEngineData.engineType);++ // Load engine config from infra status+ if (infraStatus.engine) {+ setEngineConfig({+ type: infraStatus.engine.type || 'whatsapp-web.js',+ headless: infraStatus.engine.headless ?? true,+ sessionDataPath: '/data/sessions',+ browserArgs: '--no-sandbox --disable-gpu',+ });+ }+ } catch (err) {+ setError(err instanceof Error ? err.message : 'Failed to load plugins');+ } finally {+ setLoading(false);+ }+ };++ useEffect(() => {+ fetchData();+ }, []);++ const handleToggle = async (plugin: Plugin) => {+ setActionLoading(plugin.id);+ try {+ if (plugin.status === 'enabled') {+ await pluginsApi.disable(plugin.id);+ } else {+ await pluginsApi.enable(plugin.id);+ }+ await fetchData();+ } catch (err) {+ setError(err instanceof Error ? err.message : 'Failed to toggle plugin');+ } finally {+ setActionLoading(null);+ }+ };++ const handleHealthCheck = async (pluginId: string) => {+ setActionLoading(pluginId);+ try {+ const result = await pluginsApi.healthCheck(pluginId);+ alert(result.healthy ? `✓ Healthy: ${result.message}` : `✗ Unhealthy: ${result.message}`);+ } catch (err) {+ alert(`Health check failed: ${err instanceof Error ? err.message : 'Unknown error'}`);+ } finally {+ setActionLoading(null);+ }+ };++ const handleOpenConfig = (plugin: Plugin) => {+ setConfigPlugin(plugin);+ setShowConfigModal(true);+ };++ const handleSaveConfig = async () => {+ setSavingConfig(true);+ try {+ // For now, show a success message - actual implementation would call API+ alert('Configuration saved! Server restart required to apply changes.');+ setShowConfigModal(false);+ } catch (err) {+ alert(`Failed to save config: ${err instanceof Error ? err.message : 'Unknown error'}`);+ } finally {+ setSavingConfig(false);+ }+ };++ if (loading) {+ return (+ <div+ className="plugins-page"+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '400px' }}+ >+ <Loader2 className="animate-spin" size={32} />+ </div>+ );+ }++ const currentEngineData = engines.find(e => e.id === currentEngine);++ return (+ <div className="plugins-page">+ <PageHeader+ title="Plugins"+ subtitle="Manage engines, storage backends, and extensions"+ actions={+ <button className="btn-secondary" onClick={fetchData}>+ <RefreshCw size={16} />+ Refresh+ </button>+ }+ />++ {/* Error Banner */}+ {error && (+ <div className="error-banner">+ <AlertCircle size={20} />+ <span className="error-banner-text">{error}</span>+ </div>+ )}++ {/* Current Engine Card */}+ <div className="engine-card">+ <div className="engine-header">+ <div className="engine-info">+ <div className="engine-icon-wrapper">+ <Cpu size={24} />+ </div>+ <div>+ <h3 className="engine-title">Active WhatsApp Engine</h3>+ <span className="engine-name">{currentEngine}</span>+ </div>+ </div>+ <span className="status-badge connected">Running</span>+ </div>++ {/* Engine Features */}+ {currentEngineData && currentEngineData.features.length > 0 && (+ <div className="engine-features">+ <p className="features-label">Supported Features:</p>+ <div className="features-list">+ {currentEngineData.features.slice(0, 8).map(feature => (+ <span key={feature} className="feature-tag">+ {feature}+ </span>+ ))}+ {currentEngineData.features.length > 8 && (+ <span className="feature-more">+{currentEngineData.features.length - 8} more</span>+ )}+ </div>+ </div>+ )}+ </div>++ {/* Plugins Grid */}+ <div className="plugins-grid">+ {plugins.map(plugin => {+ const TypeIcon = pluginTypeIcons[plugin.type as PluginType] || Puzzle;+ const isLoading = actionLoading === plugin.id;++ return (+ <div key={plugin.id} className="plugin-card">+ {/* Card Header */}+ <div className={`plugin-card-header type-${plugin.type}`}>+ <div className="plugin-info">+ <div className="plugin-icon-wrapper">+ <TypeIcon size={20} />+ </div>+ <div>+ <h3 className="plugin-name">{plugin.name}</h3>+ <span className="plugin-version">v{plugin.version}</span>+ </div>+ </div>+ {plugin.builtIn && <span className="plugin-builtin-badge">Built-in</span>}+ </div>++ {/* Card Body */}+ <div className="plugin-card-body">+ {/* Description */}+ <p className="plugin-description">{plugin.description || 'No description available'}</p>++ {/* Status */}+ <div className="plugin-status-row">+ <div className="plugin-status">+ <span className={`status-dot ${plugin.status}`} />+ <span className="status-text">{plugin.status}</span>+ </div>+ <span className="plugin-type-label">{plugin.type}</span>+ </div>++ {/* Error Display */}+ {plugin.error && (+ <div className="plugin-error">+ <p className="plugin-error-text">{plugin.error}</p>+ </div>+ )}++ {/* Provides */}+ {plugin.provides && plugin.provides.length > 0 && (+ <div className="plugin-provides">+ {plugin.provides.map(item => (+ <span key={item} className="provides-tag">+ {item}+ </span>+ ))}+ </div>+ )}++ {/* Actions */}+ <div className="plugin-actions">+ {/* Engine plugins: show Required if only engine, otherwise radio selection style */}+ {plugin.type === 'engine' ? (+ (() => {+ const enginePlugins = plugins.filter(p => p.type === 'engine');+ const isOnlyEngine = enginePlugins.length === 1;+ const isActive = plugin.status === 'enabled';++ if (isOnlyEngine && isActive) {+ // Only engine available - cannot disable+ return (+ <span className="btn-required">+ <CheckCircle size={16} />+ Required+ </span>+ );+ } else if (isActive) {+ // Multiple engines, this one is active+ return (+ <span className="btn-active">+ <CheckCircle size={16} />+ Active+ </span>+ );+ } else {+ // Not active, can switch to this engine+ return (+ <button+ onClick={() => handleToggle(plugin)}+ disabled={isLoading}+ className="btn-toggle enable"+ >+ {isLoading ? (+ <Loader2 size={16} className="animate-spin" />+ ) : (+ <>+ <Power size={16} />+ Activate+ </>+ )}+ </button>+ );+ }+ })()+ ) : (+ // Regular plugins: normal enable/disable+ <button+ onClick={() => handleToggle(plugin)}+ disabled={isLoading}+ className={`btn-toggle ${plugin.status === 'enabled' ? 'disable' : 'enable'}`}+ >+ {isLoading ? (+ <Loader2 size={16} className="animate-spin" />+ ) : plugin.status === 'enabled' ? (+ <>+ <PowerOff size={16} />+ Disable+ </>+ ) : (+ <>+ <Power size={16} />+ Enable+ </>+ )}+ </button>+ )}++ <button+ onClick={() => handleHealthCheck(plugin.id)}+ disabled={isLoading}+ className="btn-action"+ title="Health Check"+ >+ <CheckCircle size={16} />+ </button>++ <button className="btn-action" title="Configure" onClick={() => handleOpenConfig(plugin)}>+ <Settings size={16} />+ </button>+ </div>+ </div>+ </div>+ );+ })}+ </div>++ {/* Empty State */}+ {plugins.length === 0 && !loading && (+ <div className="empty-state">+ <Puzzle size={64} />+ <h3>No Plugins Found</h3>+ <p>Install plugins to extend OpenWA functionality</p>+ </div>+ )}++ {/* Config Modal */}+ {showConfigModal && configPlugin && (+ <div className="modal-overlay" onClick={() => setShowConfigModal(false)}>+ <div className="modal config-modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>Configure {configPlugin.name}</h2>+ <button className="btn-icon" onClick={() => setShowConfigModal(false)}>+ <X size={20} />+ </button>+ </div>++ <div className="modal-body">+ {configPlugin.type === 'engine' ? (+ <>+ <div className="config-info-banner">+ <AlertCircle size={16} />+ <span>Changes require server restart to take effect</span>+ </div>++ <div className="config-form">+ <div className="form-group">+ <label>Engine Type</label>+ <select+ value={engineConfig.type}+ onChange={e => setEngineConfig({ ...engineConfig, type: e.target.value })}+ >+ <option value="whatsapp-web.js">WhatsApp Web.js</option>+ </select>+ </div>++ <div className="form-group toggle-group">+ <div className="toggle-info">+ <label>Headless Mode</label>+ <small>Run browser without visible UI (recommended for production)</small>+ </div>+ <label className="toggle-switch">+ <input+ type="checkbox"+ checked={engineConfig.headless}+ onChange={e => setEngineConfig({ ...engineConfig, headless: e.target.checked })}+ />+ <span className="toggle-slider"></span>+ </label>+ </div>++ <div className="form-group">+ <label>Session Data Path</label>+ <input+ type="text"+ value={engineConfig.sessionDataPath}+ onChange={e => setEngineConfig({ ...engineConfig, sessionDataPath: e.target.value })}+ />+ </div>++ <div className="form-group">+ <label>Browser Arguments</label>+ <input+ type="text"+ value={engineConfig.browserArgs}+ onChange={e => setEngineConfig({ ...engineConfig, browserArgs: e.target.value })}+ placeholder="--no-sandbox --disable-gpu"+ />+ </div>+ </div>+ </>+ ) : (+ <div className="no-config">+ <Settings size={48} style={{ opacity: 0.3 }} />+ <p>No configuration options available for this plugin</p>+ </div>+ )}+ </div>++ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setShowConfigModal(false)}>+ Cancel+ </button>+ {configPlugin.type === 'engine' && (+ <button className="btn-primary" onClick={handleSaveConfig} disabled={savingConfig}>+ {savingConfig ? <Loader2 size={16} className="animate-spin" /> : 'Save Configuration'}+ </button>+ )}+ </div>+ </div>+ </div>+ )}+ </div>+ );+}diff --git a/dashboard/src/pages/Sessions.css b/dashboard/src/pages/Sessions.cssnew file mode 100644index 000000000..cb6a57a79--- /dev/null+++ b/dashboard/src/pages/Sessions.css@@ -0,0 +1,681 @@+.sessions-page {+ padding: 2rem;+ width: 100%;+ box-sizing: border-box;+}++.page-header {+ margin-bottom: 2rem;+ width: 100%;+}++.header-content {+ display: flex;+ justify-content: space-between;+ align-items: center;+ margin-bottom: 1rem;+ width: 100%;+}++/* H1 inherited from global */++.btn-primary {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.75rem 1.25rem;+ background: var(--primary);+ color: white;+ border: none;+ border-radius: var(--radius);+ font-size: 0.9375rem;+ font-weight: 600;+ cursor: pointer;+ transition: background 0.2s;+}++.btn-primary:hover {+ background: var(--primary-hover);+}++.filters-bar {+ display: flex;+ gap: 1rem;+ margin-bottom: 1.5rem;+}++.search-input {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ flex: 1;+ max-width: 400px;+ padding: 0.75rem 1rem;+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: var(--radius);+}++.search-input svg {+ color: var(--text-muted);+ flex-shrink: 0;+}++.search-input input {+ flex: 1;+ border: none;+ background: none;+ font-size: 0.9375rem;+ color: var(--text-primary);+}++.search-input input:focus {+ outline: none;+}++.filter-group {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0 1rem;+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: var(--radius);+}++.filter-group svg {+ color: var(--text-muted);+}++.filter-group select {+ padding: 0.75rem 0;+ border: none;+ background: none;+ background-image: none;+ font-size: 0.9375rem;+ color: var(--text-primary);+ cursor: pointer;+}++.filter-group select:focus {+ outline: none;+ box-shadow: none;+}++.sessions-grid {+ display: grid;+ grid-template-columns: repeat(4, 1fr);+ gap: 1.5rem;+ width: 100%;+}++.session-card {+ background: var(--bg-white);+ border-radius: 12px;+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+}++.card-header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ margin-bottom: 1.25rem;+}++.card-header h3 {+ /* Inherits from H3 */+ margin: 0;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ max-width: 180px;+}++.qr-placeholder {+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ padding: 2rem;+ background: var(--bg-light);+ border-radius: var(--radius);+ margin-bottom: 1rem;+}++.qr-icon {+ color: var(--text-muted);+ margin-bottom: 0.75rem;+}++.qr-placeholder p {+ margin: 0;+ color: var(--text-secondary);+ font-size: 0.875rem;+}++.session-info {+ margin-bottom: 1rem;+}++.info-row {+ display: flex;+ justify-content: space-between;+ padding: 0.5rem 0;+ border-bottom: 1px solid var(--border);+}++.info-row:last-child {+ border-bottom: none;+}++.info-label {+ font-size: 0.7rem;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ color: var(--text-secondary);+}++.info-value {+ font-size: 0.8125rem;+ color: var(--text-primary);+ font-weight: 500;+}++.info-value.mono {+ font-family: monospace;+}++.card-actions {+ display: flex;+ gap: 0.5rem;+ flex-wrap: wrap;+}++.btn-action {+ display: flex;+ align-items: center;+ gap: 0.375rem;+ padding: 0.5rem 0.75rem;+ font-size: 0.8125rem;+ font-weight: 500;+ border-radius: 6px;+ cursor: pointer;+ transition: all 0.2s;+ background: var(--bg-light);+ border: 1px solid var(--border);+ color: var(--text-secondary);+}++.btn-action:hover {+ background: var(--bg-white);+ color: var(--text-primary);+}++.btn-action.danger {+ color: #dc2626;+}++.btn-action.danger:hover {+ background: #fee2e2;+ border-color: #fecaca;+}++@media (max-width: 1400px) {+ .sessions-grid {+ grid-template-columns: repeat(3, 1fr);+ }+}++@media (max-width: 1000px) {+ .sessions-grid {+ grid-template-columns: repeat(2, 1fr);+ }+}++@media (max-width: 600px) {+ .sessions-grid {+ grid-template-columns: 1fr;+ }+}++/* Modal Overlay */+.modal-overlay {+ position: fixed;+ inset: 0;+ background: rgba(0, 0, 0, 0.5);+ backdrop-filter: blur(4px);+ display: flex;+ align-items: center;+ justify-content: center;+ z-index: 1000;+ animation: fadeIn 0.2s ease;+}++@keyframes fadeIn {+ from {+ opacity: 0;+ }+ to {+ opacity: 1;+ }+}++/* Modal Card */+.modal {+ background: var(--bg-white);+ border-radius: 16px;+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);+ width: 90%;+ max-width: 480px;+ animation: slideUp 0.3s ease;+ overflow: hidden;+}++@keyframes slideUp {+ from {+ opacity: 0;+ transform: translateY(20px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }+}++.modal-header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: 1.5rem 1.5rem 1rem;+ border-bottom: 1px solid var(--border);+}++.modal-header h2 {+ font-size: 1.25rem;+ font-weight: 700;+ color: var(--text-primary);+ margin: 0;+}++.modal-title {+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+}++.session-name {+ font-size: 0.875rem;+ font-weight: 500;+ color: var(--text-muted);+}++.modal-body {+ padding: 1.5rem;+}++.modal-body label {+ display: block;+ font-size: 0.875rem;+ font-weight: 600;+ color: var(--text-secondary);+ margin-bottom: 0.5rem;+}++.modal-body input {+ width: 100%;+ padding: 0.875rem 1rem;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ font-size: 0.9375rem;+ background: var(--bg-light);+ transition: all 0.2s;+ box-sizing: border-box;+}++.modal-body input:focus {+ outline: none;+ border-color: var(--primary);+ background: var(--bg-white);+ box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);+}++.modal-body input::placeholder {+ color: var(--text-muted);+}++.input-hint {+ margin: 0.5rem 0 0;+ font-size: 0.75rem;+ color: var(--text-muted);+}++.input-hint code {+ background: var(--bg-light);+ padding: 0.125rem 0.375rem;+ border-radius: 4px;+ font-family: 'JetBrains Mono', monospace;+ font-size: 0.7rem;+}++.input-error {+ margin: 0.5rem 0 0;+ font-size: 0.75rem;+ color: #dc2626;+ font-weight: 500;+}++.modal-footer {+ display: flex;+ justify-content: flex-end;+ gap: 0.75rem;+ padding: 1rem 1.5rem 1.5rem;+}++/* Secondary Button */+.btn-secondary {+ padding: 0.75rem 1.25rem;+ background: var(--bg-light);+ color: var(--text-secondary);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ font-size: 0.9375rem;+ font-weight: 600;+ cursor: pointer;+ transition: all 0.2s;+}++.btn-secondary:hover {+ background: var(--bg-white);+ border-color: var(--text-muted);+ color: var(--text-primary);+}++.btn-danger {+ padding: 0.75rem 1.25rem;+ background: #dc2626;+ color: white;+ border: none;+ border-radius: var(--radius);+ font-weight: 600;+ cursor: pointer;+ transition: all 0.2s;+}++.btn-danger:hover {+ background: #b91c1c;+}++.confirm-modal {+ max-width: 400px;+}++.confirm-modal .modal-body p {+ margin: 0 0 0.5rem 0;+}++.text-muted {+ color: var(--text-muted);+ font-size: 0.875rem;+}++/* Icon Button */+.btn-icon {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 36px;+ height: 36px;+ background: transparent;+ border: none;+ border-radius: 8px;+ cursor: pointer;+ color: var(--text-muted);+ transition: all 0.2s;+}++.btn-icon:hover {+ background: var(--bg-light);+ color: var(--text-primary);+}++/* Empty State */+.empty-state {+ grid-column: 1 / -1;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ padding: 4rem 2rem;+ text-align: center;+ color: var(--text-muted);+}++.empty-state svg {+ margin-bottom: 1rem;+ opacity: 0.5;+}++.empty-state h3 {+ font-size: 1.125rem;+ font-weight: 600;+ color: var(--text-secondary);+ margin: 0 0 0.5rem;+}++.empty-state p {+ margin: 0;+ font-size: 0.875rem;+}++/* Status Badge */+.status-badge {+ display: inline-flex;+ align-items: center;+ gap: 0.375rem;+ padding: 0.25rem 0.625rem;+ border-radius: 20px;+ font-size: 0.75rem;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.03em;+}++.status-badge.connected {+ background: rgba(34, 197, 94, 0.1);+ color: #16a34a;+}++.status-badge.disconnected {+ background: rgba(107, 114, 128, 0.1);+ color: #6b7280;+}++.status-badge.connecting {+ background: rgba(234, 179, 8, 0.1);+ color: #ca8a04;+}++.status-badge::before {+ content: '';+ width: 6px;+ height: 6px;+ border-radius: 50%;+ background: currentColor;+}++/* Detail Grid for Session Modal */+.detail-grid {+ display: grid;+ gap: 1rem;+}++.detail-item {+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+}++.detail-label {+ font-size: 0.75rem;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ color: var(--text-muted);+}++.detail-value {+ font-size: 0.9375rem;+ color: var(--text-primary);+ word-break: break-all;+}++.detail-value.mono {+ font-family: 'JetBrains Mono', monospace;+ font-size: 0.8125rem;+ background: var(--bg-light);+ padding: 0.5rem;+ border-radius: 6px;+}++/* Close Button - Always Visible */+.btn-close {+ display: flex;+ align-items: center;+ justify-content: center;+ width: 32px;+ height: 32px;+ background: var(--bg-light);+ border: 1px solid var(--border);+ border-radius: 8px;+ cursor: pointer;+ color: var(--text-secondary);+ transition: all 0.2s;+ flex-shrink: 0;+}++.btn-close svg {+ width: 20px !important;+ height: 20px !important;+ min-width: 20px;+ flex-shrink: 0;+}++.btn-close:hover {+ background: #fee2e2;+ border-color: #fecaca;+ color: #dc2626;+}++.btn-close:hover svg {+ stroke: #dc2626;+}++/* QR Modal Specific */+.qr-modal .modal-body {+ padding: 1.5rem;+}++.qr-instructions {+ margin-top: 1.5rem;+ text-align: left;+ background: var(--bg-light);+ border-radius: 12px;+ padding: 1rem 1.25rem;+}++.qr-step {+ margin: 0;+ padding: 0.5rem 0;+ font-size: 0.875rem;+ color: var(--text-secondary);+ border-bottom: 1px solid var(--border);+}++.qr-step:last-child {+ border-bottom: none;+}++.qr-step strong {+ color: var(--text-primary);+}++.qr-auto-refresh {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.5rem;+ margin-top: 1rem;+ font-size: 0.75rem;+ color: var(--text-muted);+}++.spin-slow {+ animation: spin 2s linear infinite;+}++@keyframes spin {+ from {+ transform: rotate(0deg);+ }+ to {+ transform: rotate(360deg);+ }+}++/* Status Pill for Card Headers */+.status-pill {+ display: inline-flex;+ padding: 0.25rem 0.75rem;+ border-radius: 20px;+ font-size: 0.75rem;+ font-weight: 600;+ text-transform: capitalize;+}++.status-pill.created,+.status-pill.idle {+ background: rgba(107, 114, 128, 0.1);+ color: #6b7280;+}++.status-pill.initializing,+.status-pill.connecting {+ background: rgba(234, 179, 8, 0.1);+ color: #ca8a04;+}++.status-pill.qr_ready {+ background: rgba(59, 130, 246, 0.1);+ color: #2563eb;+}++.status-pill.ready {+ background: rgba(34, 197, 94, 0.1);+ color: #16a34a;+}++.status-pill.disconnected {+ background: rgba(239, 68, 68, 0.1);+ color: #dc2626;+}++/* Small Button for QR Placeholder */+.btn-sm {+ padding: 0.5rem 1rem;+ font-size: 0.8125rem;+ font-weight: 600;+ background: var(--primary);+ color: white;+ border: none;+ border-radius: 6px;+ cursor: pointer;+ margin-top: 0.75rem;+ transition: background 0.2s;+}++.btn-sm:hover {+ background: var(--primary-hover);+}diff --git a/dashboard/src/pages/Sessions.tsx b/dashboard/src/pages/Sessions.tsxnew file mode 100644index 000000000..597214f9c--- /dev/null+++ b/dashboard/src/pages/Sessions.tsx@@ -0,0 +1,541 @@+import { useState, useEffect, useCallback, useRef } from 'react';+import { Plus, QrCode, RefreshCw, Trash2, Eye, Loader2, Play, Square, X, Search, Filter } from 'lucide-react';+import { sessionApi, type Session } from '../services/api';+import { useDocumentTitle } from '../hooks/useDocumentTitle';+import { useToast } from '../components/Toast';+import { useWebSocket } from '../hooks/useWebSocket';+import { useRole } from '../hooks/useRole';+import { PageHeader } from '../components/PageHeader';+import './Sessions.css';++export function Sessions() {+ useDocumentTitle('Sessions');+ const toast = useToast();+ const { canWrite } = useRole();+ const [sessions, setSessions] = useState<Session[]>([]);+ const [loading, setLoading] = useState(true);+ const [error, setError] = useState<string | null>(null);+ const [showCreateModal, setShowCreateModal] = useState(false);+ const [newSessionName, setNewSessionName] = useState('');+ const [creating, setCreating] = useState(false);+ const [qrData, setQrData] = useState<{ sessionId: string; sessionName: string; qrCode: string } | null>(null);+ const [searchQuery, setSearchQuery] = useState('');+ const [statusFilter, setStatusFilter] = useState('all');+ const [selectedSession, setSelectedSession] = useState<Session | null>(null);+ const [deleteConfirmId, setDeleteConfirmId] = useState<string | null>(null);++ // WebSocket for real-time session updates+ useWebSocket({+ onSessionStatus: useCallback(+ (event: { sessionId: string; status: string }) => {+ // Update session status in real-time+ setSessions(prev =>+ prev.map(s => (s.id === event.sessionId ? { ...s, status: event.status as Session['status'] } : s)),+ );+ // Show toast for important status changes+ if (event.status === 'ready') {+ toast.success('Session Ready', 'WhatsApp session is now connected');+ } else if (event.status === 'disconnected') {+ toast.warning('Session Disconnected', 'WhatsApp session was disconnected');+ }+ },+ [toast],+ ),+ });++ useEffect(() => {+ fetchSessions();+ }, []);++ // Auto-refresh QR code every 5 seconds when modal is open+ const qrRefreshInterval = useRef<ReturnType<typeof setInterval> | null>(null);+ const currentSessionName = useRef<string>('');++ const fetchQR = useCallback(async (sessionId: string) => {+ try {+ const qr = await sessionApi.getQR(sessionId);+ setQrData({ sessionId, sessionName: currentSessionName.current, qrCode: qr.qrCode });+ // Check if session became ready+ if (qr.status === 'ready') {+ setQrData(null);+ currentSessionName.current = '';+ fetchSessions();+ }+ } catch {+ // QR not available or session already connected - stop polling+ setQrData(null);+ currentSessionName.current = '';+ fetchSessions();+ }+ }, []);++ useEffect(() => {+ if (qrData) {+ // Preserve session name in ref for polling+ currentSessionName.current = qrData.sessionName;+ // Start polling for QR updates+ qrRefreshInterval.current = setInterval(() => {+ fetchQR(qrData.sessionId);+ }, 5000);+ }+ return () => {+ if (qrRefreshInterval.current) {+ clearInterval(qrRefreshInterval.current);+ }+ };+ }, [qrData, fetchQR]);++ const fetchSessions = async () => {+ try {+ setLoading(true);+ const data = await sessionApi.list();+ setSessions(data);+ } catch (err) {+ setError(err instanceof Error ? err.message : 'Failed to load sessions');+ } finally {+ setLoading(false);+ }+ };++ const handleCreate = async () => {+ if (!newSessionName.trim()) return;+ try {+ setCreating(true);+ const newSession = await sessionApi.create(newSessionName);+ setSessions([...sessions, newSession]);+ setNewSessionName('');+ setShowCreateModal(false);+ toast.success('Session Created', `Session "${newSession.name}" created successfully`);+ } catch (err) {+ const msg = err instanceof Error ? err.message : 'Failed to create session';+ setError(msg);+ toast.error('Create Failed', msg);+ } finally {+ setCreating(false);+ }+ };++ const handleDelete = async (id: string) => {+ const session = sessions.find(s => s.id === id);+ try {+ await sessionApi.delete(id);+ setSessions(sessions.filter(s => s.id !== id));+ toast.success('Session Deleted', session ? `Session "${session.name}" deleted` : 'Session deleted');+ } catch (err) {+ const msg = err instanceof Error ? err.message : 'Failed to delete session';+ console.error('Failed to delete:', err);+ toast.error('Delete Failed', msg);+ } finally {+ setDeleteConfirmId(null);+ }+ };++ const handleStart = async (id: string) => {+ // Find session and check if it's already started+ const session = sessions.find(s => s.id === id);+ if (session && ['initializing', 'connecting', 'qr_ready'].includes(session.status)) {+ // Session already started, just show QR+ handleShowQR(id);+ return;+ }++ try {+ await sessionApi.start(id);+ setSessions(sessions.map(s => (s.id === id ? { ...s, status: 'connecting' } : s)));+ // Refresh sessions and then fetch QR+ await fetchSessions();+ handleShowQR(id);+ } catch (err) {+ console.error('Failed to start:', err);+ // Refresh sessions to get real status+ await fetchSessions();+ // If error is "already started", try to show QR anyway+ if (err instanceof Error && err.message.includes('already started')) {+ handleShowQR(id);+ }+ }+ };++ const handleShowQR = async (id: string) => {+ // Find session name+ const session = sessions.find(s => s.id === id);+ const sessionName = session?.name || 'Unknown Session';+ try {+ const qr = await sessionApi.getQR(id);+ setQrData({ sessionId: id, sessionName, qrCode: qr.qrCode });+ } catch (err) {+ console.error('Failed to get QR:', err);+ setError('QR code not available yet. Try again in a moment.');+ }+ };++ const handleStop = async (id: string) => {+ try {+ await sessionApi.stop(id);+ setSessions(sessions.map(s => (s.id === id ? { ...s, status: 'disconnected' } : s)));+ if (qrData?.sessionId === id) setQrData(null);+ } catch (err) {+ console.error('Failed to stop:', err);+ // Refresh sessions to get real status+ fetchSessions();+ }+ };++ const formatLastActive = (date?: string) => {+ if (!date) return 'Never';+ const diff = Date.now() - new Date(date).getTime();+ if (diff < 60000) return 'Just now';+ if (diff < 3600000) return `${Math.floor(diff / 60000)} min ago`;+ return new Date(date).toLocaleDateString();+ };++ const formatStatus = (status: string) => {+ const statusMap: Record<string, string> = {+ created: 'New',+ idle: 'Idle',+ initializing: 'Starting...',+ connecting: 'Connecting...',+ qr_ready: 'Scan QR',+ ready: 'Connected',+ disconnected: 'Disconnected',+ };+ return statusMap[status] || status;+ };++ const filteredSessions = sessions.filter(s => {+ const matchesSearch =+ s.name.toLowerCase().includes(searchQuery.toLowerCase()) ||+ s.id.toLowerCase().includes(searchQuery.toLowerCase());+ const matchesStatus =+ statusFilter === 'all' ||+ (statusFilter === 'active' && s.status === 'ready') ||+ (statusFilter === 'inactive' && ['created', 'idle', 'disconnected'].includes(s.status)) ||+ (statusFilter === 'connecting' && ['initializing', 'connecting', 'qr_ready'].includes(s.status));+ return matchesSearch && matchesStatus;+ });++ if (loading) {+ return (+ <div+ className="sessions-page"+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '400px' }}+ >+ <Loader2 className="animate-spin" size={32} />+ </div>+ );+ }++ return (+ <div className="sessions-page">+ <PageHeader+ title="Sessions"+ subtitle="Manage your WhatsApp sessions and QR code connections"+ actions={+ canWrite && (+ <button className="btn-primary" onClick={() => setShowCreateModal(true)}>+ <Plus size={18} />+ New Session+ </button>+ )+ }+ />++ <div className="filters-bar">+ <div className="search-input">+ <Search size={18} />+ <input+ type="text"+ placeholder="Search sessions..."+ value={searchQuery}+ onChange={e => setSearchQuery(e.target.value)}+ />+ </div>++ <div className="filter-group">+ <Filter size={16} />+ <select value={statusFilter} onChange={e => setStatusFilter(e.target.value)}>+ <option value="all">All Status</option>+ <option value="active">Active (Connected)</option>+ <option value="inactive">Inactive</option>+ <option value="connecting">Connecting</option>+ </select>+ </div>+ </div>++ {error && (+ <div+ style={{+ background: '#FEE2E2',+ padding: '1rem',+ borderRadius: '8px',+ color: '#DC2626',+ marginBottom: '1rem',+ }}+ >+ {error}+ </div>+ )}++ {/* Create Modal */}+ {showCreateModal && (+ <div className="modal-overlay" onClick={() => setShowCreateModal(false)}>+ <div className="modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>Create New Session</h2>+ <button className="btn-icon" onClick={() => setShowCreateModal(false)}>+ <X size={20} />+ </button>+ </div>+ <div className="modal-body">+ <label>Session Name</label>+ <input+ type="text"+ placeholder="e.g., marketing-bot"+ value={newSessionName}+ onChange={e => {+ // Auto-convert to lowercase and replace spaces with hyphens+ const value = e.target.value.toLowerCase().replace(/\s+/g, '-');+ setNewSessionName(value);+ }}+ onKeyDown={e => e.key === 'Enter' && handleCreate()}+ />+ <p className="input-hint">+ Use lowercase letters, numbers, and hyphens only. Example: <code>customer-support</code>,{' '}+ <code>bot-1</code>+ </p>+ {newSessionName && !/^[a-z0-9-]+$/.test(newSessionName) && (+ <p className="input-error">Invalid characters. Only lowercase letters, numbers, and hyphens allowed.</p>+ )}+ {newSessionName && newSessionName.length > 50 && (+ <p className="input-error">Name must be 50 characters or less ({newSessionName.length}/50).</p>+ )}+ {newSessionName &&+ /^[a-z0-9-]+$/.test(newSessionName) &&+ newSessionName.length <= 50 &&+ sessions.some(s => s.name === newSessionName) && (+ <p className="input-error">Session with this name already exists.</p>+ )}+ </div>+ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setShowCreateModal(false)}>+ Cancel+ </button>+ <button+ className="btn-primary"+ onClick={handleCreate}+ disabled={+ creating ||+ !newSessionName.trim() ||+ !/^[a-z0-9-]+$/.test(newSessionName) ||+ newSessionName.length > 50 ||+ sessions.some(s => s.name === newSessionName)+ }+ >+ {creating ? <Loader2 className="animate-spin" size={16} /> : 'Create'}+ </button>+ </div>+ </div>+ </div>+ )}++ {/* QR Modal */}+ {qrData && (+ <div className="modal-overlay" onClick={() => setQrData(null)}>+ <div className="modal qr-modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <div className="modal-title">+ <h2>Scan QR Code</h2>+ <span className="session-name">{qrData.sessionName}</span>+ </div>+ <button className="btn-close" onClick={() => setQrData(null)} aria-label="Close">+ <X size={20} color="#64748b" />+ </button>+ </div>+ <div className="modal-body" style={{ textAlign: 'center' }}>+ {qrData.qrCode ? (+ <>+ <img src={qrData.qrCode} alt="QR Code" style={{ maxWidth: '280px', borderRadius: '12px' }} />+ <div className="qr-instructions">+ <p className="qr-step">+ <strong>1.</strong> Open WhatsApp on your phone+ </p>+ <p className="qr-step">+ <strong>2.</strong> Tap <strong>Menu</strong> → <strong>Linked Devices</strong>+ </p>+ <p className="qr-step">+ <strong>3.</strong> Tap <strong>Link a Device</strong> and scan this QR+ </p>+ </div>+ <p className="qr-auto-refresh">+ <RefreshCw size={14} className="spin-slow" /> QR updates automatically every 5 seconds+ </p>+ </>+ ) : (+ <div style={{ padding: '2rem' }}>+ <Loader2 className="animate-spin" size={48} />+ <p>Generating QR code...</p>+ </div>+ )}+ </div>+ </div>+ </div>+ )}++ {/* Session Detail Modal */}+ {selectedSession && (+ <div className="modal-overlay" onClick={() => setSelectedSession(null)}>+ <div className="modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>Session Details</h2>+ <button className="btn-icon" onClick={() => setSelectedSession(null)}>+ <X size={20} />+ </button>+ </div>+ <div className="modal-body">+ <div className="detail-grid">+ <div className="detail-item">+ <span className="detail-label">Name</span>+ <span className="detail-value">{selectedSession.name}</span>+ </div>+ <div className="detail-item">+ <span className="detail-label">Status</span>+ <span className={`status-badge ${selectedSession.status}`}>{selectedSession.status}</span>+ </div>+ <div className="detail-item">+ <span className="detail-label">Session ID</span>+ <span className="detail-value mono">{selectedSession.id}</span>+ </div>+ <div className="detail-item">+ <span className="detail-label">Phone Number</span>+ <span className="detail-value">{selectedSession.phone || 'Not connected'}</span>+ </div>+ <div className="detail-item">+ <span className="detail-label">Created</span>+ <span className="detail-value">{new Date(selectedSession.createdAt).toLocaleString()}</span>+ </div>+ <div className="detail-item">+ <span className="detail-label">Last Active</span>+ <span className="detail-value">+ {selectedSession.lastActive ? new Date(selectedSession.lastActive).toLocaleString() : 'Never'}+ </span>+ </div>+ </div>+ </div>+ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setSelectedSession(null)}>+ Close+ </button>+ </div>+ </div>+ </div>+ )}++ {/* Delete Confirm Modal */}+ {deleteConfirmId && (+ <div className="modal-overlay" onClick={() => setDeleteConfirmId(null)}>+ <div className="modal confirm-modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>Confirm Delete</h2>+ <button className="btn-icon" onClick={() => setDeleteConfirmId(null)}>+ <X size={20} />+ </button>+ </div>+ <div className="modal-body">+ <p>+ Are you sure you want to delete session{' '}+ <strong>"{sessions.find(s => s.id === deleteConfirmId)?.name}"</strong>?+ </p>+ <p className="text-muted">This action cannot be undone.</p>+ </div>+ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setDeleteConfirmId(null)}>+ Cancel+ </button>+ <button className="btn-danger" onClick={() => handleDelete(deleteConfirmId)}>+ Delete+ </button>+ </div>+ </div>+ </div>+ )}++ <div className="sessions-grid">+ {filteredSessions.length === 0 ? (+ <div className="empty-state">+ <QrCode size={48} />+ <h3>No sessions found</h3>+ <p>Create a new session to get started</p>+ </div>+ ) : (+ filteredSessions.map(session => (+ <div key={session.id} className="session-card">+ <div className="card-header">+ <h3 title={session.name}>{session.name}</h3>+ <span className={`status-pill ${session.status}`}>{formatStatus(session.status)}</span>+ </div>++ {session.status === 'initializing' || session.status === 'connecting' || session.status === 'qr_ready' ? (+ <div className="qr-placeholder">+ <QrCode size={80} className="qr-icon" />+ <p>{session.status === 'qr_ready' ? 'Scan QR code to connect' : 'Preparing QR code...'}</p>+ <button+ className="btn-sm"+ onClick={() => handleShowQR(session.id)}+ disabled={session.status !== 'qr_ready'}+ >+ {session.status === 'qr_ready' ? 'Show QR' : 'Loading...'}+ </button>+ </div>+ ) : (+ <div className="session-info">+ <div className="info-row">+ <span className="info-label">Phone</span>+ <span className="info-value">{session.phone || '—'}</span>+ </div>+ <div className="info-row">+ <span className="info-label">Session ID</span>+ <span className="info-value mono">{session.id.substring(0, 12)}</span>+ </div>+ <div className="info-row">+ <span className="info-label">Last Active</span>+ <span className="info-value">{formatLastActive(session.lastActive)}</span>+ </div>+ </div>+ )}++ <div className="card-actions">+ <button className="btn-action" onClick={() => setSelectedSession(session)}>+ <Eye size={16} />+ View+ </button>+ {canWrite &&+ (session.status === 'created' || session.status === 'idle' || session.status === 'disconnected') ? (+ <button className="btn-action" onClick={() => handleStart(session.id)}>+ <Play size={16} />+ Start+ </button>+ ) : canWrite && ['ready', 'initializing', 'connecting', 'qr_ready'].includes(session.status) ? (+ <button className="btn-action" onClick={() => handleStop(session.id)}>+ <Square size={16} />+ Stop+ </button>+ ) : canWrite ? (+ <button className="btn-action" onClick={() => handleStart(session.id)}>+ <RefreshCw size={16} />+ Reconnect+ </button>+ ) : null}+ {canWrite && (+ <button className="btn-action danger" onClick={() => setDeleteConfirmId(session.id)}>+ <Trash2 size={16} />+ Delete+ </button>+ )}+ </div>+ </div>+ ))+ )}+ </div>+ </div>+ );+}diff --git a/dashboard/src/pages/Webhooks.css b/dashboard/src/pages/Webhooks.cssnew file mode 100644index 000000000..ebd341bac--- /dev/null+++ b/dashboard/src/pages/Webhooks.css@@ -0,0 +1,468 @@+.webhooks-page {+ padding: 2rem;+ width: 100%;+ box-sizing: border-box;+}++.page-header {+ margin-bottom: 2rem;+}++.header-content {+ display: flex;+ justify-content: space-between;+ align-items: center;+}++/* H1 inherited from global */++.btn-primary {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.75rem 1.25rem;+ background: var(--primary);+ color: white;+ border: none;+ border-radius: var(--radius);+ font-size: 0.9375rem;+ font-weight: 600;+ cursor: pointer;+ transition: background 0.2s;+}++.btn-primary:hover {+ background: var(--primary-hover);+}++.webhooks-content {+ display: grid;+ grid-template-columns: 1fr 280px;+ gap: 1.5rem;+}++.webhooks-table-container {+ background: var(--bg-white);+ border-radius: 12px;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+ width: 100%;+ overflow-x: auto;+}++.webhooks-table {+ display: flex;+ flex-direction: column;+ width: 100%;+ min-width: 650px;+ font-size: 0.875rem;+}++/* Unified row styling - same class for header and data */+.webhooks-table .table-row {+ display: grid;+ grid-template-columns: 1fr 150px 140px 80px 100px;+ gap: 0.75rem;+ padding: 0.875rem 1.25rem;+ align-items: center;+ border-bottom: 1px solid var(--border);+}++.webhooks-table .table-row:last-child {+ border-bottom: none;+}++.webhooks-table .table-row.header {+ background: var(--bg-light);+ font-size: 0.7rem;+ font-weight: 700;+ color: var(--text-secondary);+ text-transform: uppercase;+ letter-spacing: 0.05em;+ border-bottom: 1px solid var(--border);+}++.webhooks-table .table-row:not(.header):hover {+ background: rgba(37, 211, 102, 0.05);+}++.webhooks-table .table-row:not(.header):nth-child(even) {+ background: rgba(0, 0, 0, 0.02);+}++.empty-table-state {+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ padding: 4rem 2rem;+ text-align: center;+ color: var(--text-muted);+}++.empty-table-state svg {+ margin-bottom: 1rem;+ opacity: 0.4;+ color: var(--text-muted);+}++.empty-table-state h3 {+ font-size: 1.125rem;+ font-weight: 600;+ color: var(--text-secondary);+ margin: 0 0 0.5rem;+}++.empty-table-state p {+ margin: 0;+ font-size: 0.875rem;+ max-width: 300px;+}++.name-cell {+ font-weight: 500;+ color: var(--text-primary);+ white-space: nowrap;+}++.url-cell {+ display: flex;+ align-items: center;+ gap: 0.5rem;+}++.url-cell code {+ font-size: 0.8125rem;+ color: var(--text-secondary);+ background: var(--bg-light);+ padding: 0.25rem 0.5rem;+ border-radius: 4px;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ flex: 1;+ min-width: 0;+}++.url-cell svg {+ color: var(--text-muted);+ flex-shrink: 0;+}++.events-cell {+ display: flex;+ flex-wrap: wrap;+ gap: 0.25rem;+}++.event-tag {+ font-size: 0.6875rem;+ padding: 0.25rem 0.5rem;+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+ border-radius: 4px;+ font-weight: 500;+ white-space: nowrap;+ border: none;+ cursor: default;+}++/* Modal event tags - clickable (webhooks only) */+.webhooks-page .modal-body .event-tag {+ font-size: 0.8125rem;+ padding: 0.5rem 0.75rem;+ background: var(--bg-light);+ color: var(--text-secondary);+ border: 1px solid var(--border);+ border-radius: 6px;+ cursor: pointer;+ transition: all 0.2s;+}++.webhooks-page .modal-body .event-tag:hover {+ border-color: var(--primary);+ color: var(--primary);+}++.webhooks-page .modal-body .event-tag.selected {+ background: var(--primary);+ color: white;+ border-color: var(--primary);+}++.status-badge {+ display: inline-block;+ padding: 0.25rem 0.75rem;+ border-radius: 9999px;+ font-size: 0.75rem;+ font-weight: 500;+ white-space: nowrap;+}++.status-badge.active {+ background: rgba(37, 211, 102, 0.1);+ color: var(--primary);+}++.status-badge.inactive {+ background: #f3f4f6;+ color: var(--text-muted);+}++.last-triggered {+ color: var(--text-secondary);+ font-size: 0.875rem;+ white-space: nowrap;+}++.actions-cell {+ display: flex;+ gap: 0.25rem;+ justify-content: flex-end;+}++.icon-btn {+ padding: 0.5rem;+ background: transparent;+ border: 1px solid var(--border);+ border-radius: 6px;+ cursor: pointer;+ color: var(--text-secondary);+ transition: all 0.2s;+ flex-shrink: 0;+}++.icon-btn:hover {+ background: var(--bg-light);+ color: var(--text-primary);+}++.icon-btn.danger:hover {+ background: #fee2e2;+ border-color: #fecaca;+ color: #dc2626;+}++.events-reference {+ background: var(--bg-white);+ border-radius: 12px;+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ border: 1px solid var(--border);+ height: fit-content;+}++.events-reference h3 {+ /* Inherits from H3 */+ margin-bottom: 1rem;+}++.events-list {+ display: flex;+ flex-direction: column;+ gap: 0.75rem;+}++.event-item {+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+}++.event-item code {+ font-size: 0.8125rem;+ color: var(--primary);+ background: rgba(37, 211, 102, 0.1);+ padding: 0.25rem 0.5rem;+ border-radius: 4px;+ width: fit-content;+}++.event-item span {+ font-size: 0.75rem;+ color: var(--text-secondary);+}++/* Responsive */+@media (max-width: 1024px) {+ .webhooks-content {+ grid-template-columns: 1fr;+ }++ .events-reference {+ display: none;+ }+}++/* Toast Notification */+.toast {+ position: fixed;+ top: 1.5rem;+ right: 1.5rem;+ display: flex;+ align-items: center;+ gap: 0.75rem;+ padding: 1rem 1.25rem;+ border-radius: 10px;+ font-size: 0.875rem;+ font-weight: 500;+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);+ z-index: 1000;+ animation: slideIn 0.3s ease;+}++@keyframes slideIn {+ from {+ transform: translateX(100%);+ opacity: 0;+ }+ to {+ transform: translateX(0);+ opacity: 1;+ }+}++.toast.success {+ background: #ecfdf5;+ border: 1px solid #a7f3d0;+ color: #047857;+}++.toast.error {+ background: #fef2f2;+ border: 1px solid #fecaca;+ color: #dc2626;+}++.toast-close {+ background: transparent;+ border: none;+ padding: 0.25rem;+ cursor: pointer;+ opacity: 0.6;+ color: inherit;+}++.toast-close:hover {+ opacity: 1;+}++/* Danger Button */+.btn-danger {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.75rem 1.25rem;+ background: #dc2626;+ color: white;+ border: none;+ border-radius: var(--radius);+ font-size: 0.9375rem;+ font-weight: 600;+ cursor: pointer;+ transition: background 0.2s;+}++.btn-danger:hover {+ background: #b91c1c;+}++/* Small Modal Variant */+.modal.modal-sm {+ max-width: 400px;+}++/* Disabled button */+.icon-btn:disabled {+ opacity: 0.5;+ cursor: not-allowed;+}++/* Animate spin for loading */+.animate-spin {+ animation: spin 1s linear infinite;+}++@keyframes spin {+ from {+ transform: rotate(0deg);+ }+ to {+ transform: rotate(360deg);+ }+}++/* Toggle Switch */+.toggle-group {+ display: flex;+ align-items: center;+ gap: 1rem;+ margin-top: 1.5rem;+ padding: 1rem 1.25rem;+ background: var(--bg-light);+ border-radius: var(--radius);+}++.toggle-label {+ font-weight: 500;+ color: var(--text-primary);+}++.toggle-switch {+ position: relative;+ display: inline-block;+ width: 48px;+ height: 26px;+}++.toggle-switch input {+ opacity: 0;+ width: 0;+ height: 0;+}++.toggle-slider {+ position: absolute;+ cursor: pointer;+ top: 0;+ left: 0;+ right: 0;+ bottom: 0;+ background-color: #cbd5e1;+ transition: 0.3s;+ border-radius: 26px;+}++.toggle-slider::before {+ position: absolute;+ content: '';+ height: 20px;+ width: 20px;+ left: 3px;+ bottom: 3px;+ background-color: white;+ transition: 0.3s;+ border-radius: 50%;+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);+}++.toggle-switch input:checked + .toggle-slider {+ background-color: var(--primary);+}++.toggle-switch input:checked + .toggle-slider::before {+ transform: translateX(22px);+}++.toggle-status {+ font-size: 0.875rem;+ font-weight: 500;+}++.toggle-status.active {+ color: var(--primary);+}++.toggle-status.inactive {+ color: var(--text-muted);+}diff --git a/dashboard/src/pages/Webhooks.tsx b/dashboard/src/pages/Webhooks.tsxnew file mode 100644index 000000000..0790e622b--- /dev/null+++ b/dashboard/src/pages/Webhooks.tsx@@ -0,0 +1,442 @@+import { useState, useEffect } from 'react';+import {+ Plus,+ Edit,+ Trash2,+ Play,+ ExternalLink,+ Loader2,+ X,+ Webhook as WebhookIcon,+ Check,+ AlertTriangle,+} from 'lucide-react';+import { webhookApi, sessionApi, type Webhook, type Session } from '../services/api';+import { useDocumentTitle } from '../hooks/useDocumentTitle';+import { useRole } from '../hooks/useRole';+import { PageHeader } from '../components/PageHeader';+import './Webhooks.css';++const availableEvents = [+ { name: 'message.received', description: 'When a message is received' },+ { name: 'message.sent', description: 'When a message is sent' },+ { name: 'session.connected', description: 'When a session connects' },+ { name: 'session.disconnected', description: 'When a session disconnects' },+ { name: 'session.qr', description: 'When QR code is generated' },+ { name: '*', description: 'All events' },+];++export function Webhooks() {+ useDocumentTitle('Webhooks');+ const { canWrite } = useRole();+ const [webhooks, setWebhooks] = useState<Webhook[]>([]);+ const [sessions, setSessions] = useState<Session[]>([]);+ const [loading, setLoading] = useState(true);+ const [showCreateModal, setShowCreateModal] = useState(false);+ const [showEditModal, setShowEditModal] = useState(false);+ const [showDeleteModal, setShowDeleteModal] = useState(false);+ const [deleteTarget, setDeleteTarget] = useState<{ sessionId: string; id: string; url: string } | null>(null);+ const [editWebhook, setEditWebhook] = useState<Webhook | null>(null);+ const [newWebhook, setNewWebhook] = useState({ url: '', events: ['message.received'], sessionId: '' });+ const [testingId, setTestingId] = useState<string | null>(null);+ const [toast, setToast] = useState<{ type: 'success' | 'error'; message: string } | null>(null);++ useEffect(() => {+ fetchData();+ }, []);++ useEffect(() => {+ if (toast) {+ const timer = setTimeout(() => setToast(null), 4000);+ return () => clearTimeout(timer);+ }+ }, [toast]);++ const fetchData = async () => {+ try {+ setLoading(true);+ const [webhooksData, sessionsData] = await Promise.all([+ webhookApi.listAll().catch(() => []),+ sessionApi.list().catch(() => []),+ ]);+ setWebhooks(webhooksData);+ setSessions(sessionsData);+ } catch {+ // Handle error+ } finally {+ setLoading(false);+ }+ };++ const handleCreate = async () => {+ if (!newWebhook.url || !newWebhook.sessionId) return;+ try {+ const created = await webhookApi.create(newWebhook.sessionId, {+ url: newWebhook.url,+ events: newWebhook.events,+ });+ setWebhooks([...webhooks, created]);+ setShowCreateModal(false);+ setNewWebhook({ url: '', events: ['message.received'], sessionId: '' });+ setToast({ type: 'success', message: 'Webhook created successfully' });+ } catch (err) {+ setToast({+ type: 'error',+ message: `Failed to create webhook: ${err instanceof Error ? err.message : 'Unknown error'}`,+ });+ }+ };++ const confirmDelete = (sessionId: string, id: string, url: string) => {+ setDeleteTarget({ sessionId, id, url });+ setShowDeleteModal(true);+ };++ const handleDelete = async () => {+ if (!deleteTarget) return;+ try {+ await webhookApi.delete(deleteTarget.sessionId, deleteTarget.id);+ setWebhooks(webhooks.filter(w => w.id !== deleteTarget.id));+ setShowDeleteModal(false);+ setDeleteTarget(null);+ setToast({ type: 'success', message: 'Webhook deleted successfully' });+ } catch (err) {+ setToast({+ type: 'error',+ message: `Failed to delete webhook: ${err instanceof Error ? err.message : 'Unknown error'}`,+ });+ }+ };++ const handleTest = async (sessionId: string, id: string) => {+ setTestingId(id);+ try {+ const result = await webhookApi.test(sessionId, id);+ if (result.success) {+ setToast({ type: 'success', message: `Webhook test successful! Status: ${result.statusCode}` });+ } else {+ setToast({ type: 'error', message: `Webhook test failed: ${result.error || `Status ${result.statusCode}`}` });+ }+ } catch (err) {+ setToast({+ type: 'error',+ message: `Failed to test webhook: ${err instanceof Error ? err.message : 'Unknown error'}`,+ });+ } finally {+ setTestingId(null);+ }+ };++ const openEdit = (webhook: Webhook) => {+ setEditWebhook({ ...webhook });+ setShowEditModal(true);+ };++ const handleEdit = async () => {+ if (!editWebhook) return;+ try {+ const updated = await webhookApi.update(editWebhook.sessionId, editWebhook.id, {+ url: editWebhook.url,+ events: editWebhook.events,+ active: editWebhook.active,+ });+ setWebhooks(webhooks.map(w => (w.id === updated.id ? updated : w)));+ setShowEditModal(false);+ setEditWebhook(null);+ setToast({ type: 'success', message: 'Webhook updated successfully' });+ } catch (err) {+ setToast({+ type: 'error',+ message: `Failed to update webhook: ${err instanceof Error ? err.message : 'Unknown error'}`,+ });+ }+ };++ const toggleEditEvent = (event: string) => {+ if (!editWebhook) return;+ setEditWebhook({+ ...editWebhook,+ events: editWebhook.events.includes(event)+ ? editWebhook.events.filter(e => e !== event)+ : [...editWebhook.events, event],+ });+ };++ const toggleNewEvent = (event: string) => {+ setNewWebhook(prev => ({+ ...prev,+ events: prev.events.includes(event) ? prev.events.filter(e => e !== event) : [...prev.events, event],+ }));+ };++ if (loading) {+ return (+ <div+ className="webhooks-page"+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '400px' }}+ >+ <Loader2 className="animate-spin" size={32} />+ </div>+ );+ }++ return (+ <div className="webhooks-page">+ {/* Toast Notification */}+ {toast && (+ <div className={`toast ${toast.type}`}>+ {toast.type === 'success' ? <Check size={18} /> : <AlertTriangle size={18} />}+ <span>{toast.message}</span>+ <button className="toast-close" onClick={() => setToast(null)}>+ <X size={16} />+ </button>+ </div>+ )}++ <PageHeader+ title="Webhooks"+ subtitle="Configure HTTP callbacks for real-time event notifications"+ actions={+ canWrite && (+ <button className="btn-primary" onClick={() => setShowCreateModal(true)}>+ <Plus size={18} />+ Add Webhook+ </button>+ )+ }+ />++ {/* Create Modal */}+ {showCreateModal && (+ <div className="modal-overlay" onClick={() => setShowCreateModal(false)}>+ <div className="modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>Create Webhook</h2>+ <button className="btn-icon" onClick={() => setShowCreateModal(false)}>+ <X size={20} />+ </button>+ </div>+ <div className="modal-body">+ <label>Session</label>+ <select+ value={newWebhook.sessionId}+ onChange={e => setNewWebhook({ ...newWebhook, sessionId: e.target.value })}+ >+ <option value="">Select session...</option>+ {sessions.map(s => (+ <option key={s.id} value={s.id}>+ {s.name}+ </option>+ ))}+ </select>+ <label>URL</label>+ <input+ type="url"+ placeholder="https://..."+ value={newWebhook.url}+ onChange={e => setNewWebhook({ ...newWebhook, url: e.target.value })}+ />+ <label>Events</label>+ <div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem' }}>+ {availableEvents.map(e => (+ <button+ key={e.name}+ type="button"+ className={`event-tag ${newWebhook.events.includes(e.name) ? 'selected' : ''}`}+ onClick={() => toggleNewEvent(e.name)}+ >+ {e.name}+ </button>+ ))}+ </div>+ </div>+ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setShowCreateModal(false)}>+ Cancel+ </button>+ <button className="btn-primary" onClick={handleCreate}>+ Create+ </button>+ </div>+ </div>+ </div>+ )}++ {/* Edit Modal */}+ {showEditModal && editWebhook && (+ <div className="modal-overlay" onClick={() => setShowEditModal(false)}>+ <div className="modal" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>Edit Webhook</h2>+ <button className="btn-icon" onClick={() => setShowEditModal(false)}>+ <X size={20} />+ </button>+ </div>+ <div className="modal-body">+ <label>URL</label>+ <input+ type="url"+ value={editWebhook.url}+ onChange={e => setEditWebhook({ ...editWebhook, url: e.target.value })}+ />+ <label>Events</label>+ <div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem' }}>+ {availableEvents.map(e => (+ <button+ key={e.name}+ type="button"+ className={`event-tag ${editWebhook.events.includes(e.name) ? 'selected' : ''}`}+ onClick={() => toggleEditEvent(e.name)}+ >+ {e.name}+ </button>+ ))}+ </div>+ <div className="toggle-group">+ <span className="toggle-label">Status</span>+ <label className="toggle-switch">+ <input+ type="checkbox"+ checked={editWebhook.active}+ onChange={e => setEditWebhook({ ...editWebhook, active: e.target.checked })}+ />+ <span className="toggle-slider"></span>+ </label>+ <span className={`toggle-status ${editWebhook.active ? 'active' : 'inactive'}`}>+ {editWebhook.active ? 'Active' : 'Inactive'}+ </span>+ </div>+ </div>+ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setShowEditModal(false)}>+ Cancel+ </button>+ <button className="btn-primary" onClick={handleEdit}>+ Save Changes+ </button>+ </div>+ </div>+ </div>+ )}++ {/* Delete Confirm Modal */}+ {showDeleteModal && deleteTarget && (+ <div className="modal-overlay" onClick={() => setShowDeleteModal(false)}>+ <div className="modal modal-sm" onClick={e => e.stopPropagation()}>+ <div className="modal-header">+ <h2>Delete Webhook</h2>+ <button className="btn-icon" onClick={() => setShowDeleteModal(false)}>+ <X size={20} />+ </button>+ </div>+ <div className="modal-body">+ <p>Are you sure you want to delete this webhook?</p>+ <code+ style={{+ display: 'block',+ marginTop: '0.5rem',+ padding: '0.5rem',+ background: 'var(--color-bg-secondary)',+ borderRadius: '4px',+ fontSize: '0.85rem',+ wordBreak: 'break-all',+ }}+ >+ {deleteTarget.url}+ </code>+ </div>+ <div className="modal-footer">+ <button className="btn-secondary" onClick={() => setShowDeleteModal(false)}>+ Cancel+ </button>+ <button className="btn-danger" onClick={handleDelete}>+ Delete+ </button>+ </div>+ </div>+ </div>+ )}++ <div className="webhooks-content">+ <div className="webhooks-table-container">+ <div className="webhooks-table">+ <div className="table-row header">+ <span>URL</span>+ <span>Events</span>+ <span>Session</span>+ <span>Status</span>+ <span>Actions</span>+ </div>+ {webhooks.length === 0 ? (+ <div className="empty-table-state">+ <WebhookIcon size={48} strokeWidth={1} />+ <h3>No webhooks configured</h3>+ <p>Add a webhook to receive real-time event notifications</p>+ </div>+ ) : (+ webhooks.map(webhook => (+ <div key={webhook.id} className="table-row">+ <span className="url-cell">+ <code>{webhook.url}</code>+ <ExternalLink size={14} />+ </span>+ <span className="events-cell">+ {webhook.events.map((event: string) => (+ <span key={event} className="event-tag">+ {event}+ </span>+ ))}+ </span>+ <span>+ {sessions.find(s => s.id === webhook.sessionId)?.name || webhook.sessionId.substring(0, 8)}+ </span>+ <span>+ <span className={`status-badge ${webhook.active ? 'active' : 'inactive'}`}>+ {webhook.active ? 'Active' : 'Inactive'}+ </span>+ </span>+ <span className="actions-cell">+ <button+ className="icon-btn"+ title="Test"+ onClick={() => handleTest(webhook.sessionId, webhook.id)}+ disabled={testingId === webhook.id}+ >+ {testingId === webhook.id ? <Loader2 size={16} className="animate-spin" /> : <Play size={16} />}+ </button>+ {canWrite && (+ <>+ <button className="icon-btn" title="Edit" onClick={() => openEdit(webhook)}>+ <Edit size={16} />+ </button>+ <button+ className="icon-btn danger"+ title="Delete"+ onClick={() => confirmDelete(webhook.sessionId, webhook.id, webhook.url)}+ >+ <Trash2 size={16} />+ </button>+ </>+ )}+ </span>+ </div>+ ))+ )}+ </div>+ </div>++ <div className="events-reference">+ <h3>Available Events</h3>+ <div className="events-list">+ {availableEvents.map(event => (+ <div key={event.name} className="event-item">+ <code>{event.name}</code>+ <span>{event.description}</span>+ </div>+ ))}+ </div>+ </div>+ </div>+ </div>+ );+}diff --git a/dashboard/src/services/api.ts b/dashboard/src/services/api.tsnew file mode 100644index 000000000..75e433993--- /dev/null+++ b/dashboard/src/services/api.ts@@ -0,0 +1,393 @@+// API Service Layer for OpenWA Dashboard+// Centralized API client with TypeScript types++const API_BASE_URL = '/api';++// =============================================================================+// Types+// =============================================================================++export interface Session {+ id: string;+ name: string;+ status: 'created' | 'idle' | 'initializing' | 'connecting' | 'qr_ready' | 'ready' | 'disconnected';+ phone?: string;+ pushName?: string;+ lastActive?: string;+ createdAt: string;+ updatedAt: string;+}++export interface SessionStats {+ total: number;+ active: number;+ ready: number;+ disconnected: number;+ byStatus: Record<string, number>;+ memoryUsage: { heapUsed: number; heapTotal: number; rss: number };+}++export interface Webhook {+ id: string;+ sessionId: string;+ url: string;+ events: string[];+ active: boolean;+ secret?: string;+ createdAt: string;+ updatedAt: string;+}++export interface ApiKey {+ id: string;+ name: string;+ keyPrefix: string;+ role: 'admin' | 'user' | 'readonly';+ allowedIps?: string[];+ allowedSessions?: string[];+ isActive: boolean;+ expiresAt?: string;+ lastUsedAt?: string;+ usageCount: number;+ createdAt: string;+ apiKey?: string; // Only returned on creation+}++export interface AuditLog {+ id: string;+ action: string;+ severity: 'info' | 'warn' | 'error';+ apiKeyId?: string;+ apiKeyName?: string;+ sessionId?: string;+ sessionName?: string;+ ipAddress?: string;+ method?: string;+ path?: string;+ statusCode?: number;+ errorMessage?: string;+ createdAt: string;+}++export interface MessageResponse {+ messageId: string;+ timestamp: number;+}++export interface HealthStatus {+ status: 'ok' | 'error';+ timestamp?: string;+ details?: {+ database?: { status: string };+ redis?: { status: string };+ queue?: { status: string };+ };+}++export interface InfraStatus {+ database: { connected: boolean; type: string; host: string };+ redis: { connected: boolean; host: string; port: number };+ queue: {+ enabled: boolean;+ messages: { pending: number; completed: number; failed: number };+ webhooks: { pending: number; completed: number; failed: number };+ };+ storage: { type: 'local' | 's3'; path?: string; bucket?: string };+ engine: { type: string; headless: boolean };+}++export interface SaveConfigPayload {+ database?: {+ type: 'sqlite' | 'postgres';+ builtIn?: boolean;+ host?: string;+ port?: string;+ username?: string;+ password?: string;+ database?: string;+ poolSize?: number;+ sslEnabled?: boolean;+ };+ redis?: {+ enabled?: boolean;+ builtIn?: boolean;+ host?: string;+ port?: string;+ password?: string;+ };+ queue?: {+ enabled?: boolean;+ };+ storage?: {+ type: 'local' | 's3';+ builtIn?: boolean;+ localPath?: string;+ s3Bucket?: string;+ s3Region?: string;+ s3AccessKey?: string;+ s3SecretKey?: string;+ s3Endpoint?: string;+ };+ engine?: {+ headless?: boolean;+ sessionDataPath?: string;+ browserArgs?: string;+ };+}++export interface Settings {+ general: { apiBaseUrl: string; sessionTimeout: number; autoReconnect: boolean; debugMode: boolean };+ api: { rateLimit: number; rateLimitWindow: number; enableDocs: boolean };+ notifications: { emailEnabled: boolean; notificationEmail: string; webhookAlerts: boolean };+}++// =============================================================================+// API Client+// =============================================================================++async function request<T>(endpoint: string, options: RequestInit = {}): Promise<T> {+ const url = `${API_BASE_URL}${endpoint}`;++ // Get API key from localStorage for authentication+ const apiKey = localStorage.getItem('openwa_api_key');++ const headers: HeadersInit = {+ 'Content-Type': 'application/json',+ ...(apiKey ? { 'X-API-Key': apiKey } : {}),+ ...options.headers,+ };++ const response = await fetch(url, { ...options, headers });++ if (!response.ok) {+ const error = await response.json().catch(() => ({ message: response.statusText }));+ throw new Error(error.message || `HTTP ${response.status}`);+ }++ if (response.status === 204) {+ return undefined as T;+ }++ return response.json();+}++// =============================================================================+// Session API+// =============================================================================++export const sessionApi = {+ list: () => request<Session[]>('/sessions'),+ get: (id: string) => request<Session>(`/sessions/${id}`),+ create: (name: string) =>+ request<Session>('/sessions', {+ method: 'POST',+ body: JSON.stringify({ name }),+ }),+ delete: (id: string) => request<void>(`/sessions/${id}`, { method: 'DELETE' }),+ start: (id: string) => request<Session>(`/sessions/${id}/start`, { method: 'POST' }),+ stop: (id: string) => request<Session>(`/sessions/${id}/stop`, { method: 'POST' }),+ getQR: (id: string) => request<{ qrCode: string; status: string }>(`/sessions/${id}/qr`),+ getStats: () => request<SessionStats>('/sessions/stats/overview'),+ getGroups: (id: string) => request<{ id: string; name: string }[]>(`/sessions/${id}/groups`),+};++// =============================================================================+// Webhook API+// =============================================================================++export const webhookApi = {+ listBySession: (sessionId: string) => request<Webhook[]>(`/sessions/${sessionId}/webhooks`),+ listAll: () => request<Webhook[]>('/webhooks'),+ get: (sessionId: string, id: string) => request<Webhook>(`/sessions/${sessionId}/webhooks/${id}`),+ create: (sessionId: string, data: { url: string; events: string[] }) =>+ request<Webhook>(`/sessions/${sessionId}/webhooks`, {+ method: 'POST',+ body: JSON.stringify(data),+ }),+ update: (sessionId: string, id: string, data: Partial<Webhook>) =>+ request<Webhook>(`/sessions/${sessionId}/webhooks/${id}`, {+ method: 'PUT',+ body: JSON.stringify(data),+ }),+ delete: (sessionId: string, id: string) =>+ request<void>(`/sessions/${sessionId}/webhooks/${id}`, { method: 'DELETE' }),+ test: (sessionId: string, id: string) =>+ request<{ success: boolean; statusCode?: number; error?: string }>(`/sessions/${sessionId}/webhooks/${id}/test`, {+ method: 'POST',+ }),+};++// =============================================================================+// API Key API+// =============================================================================++export const apiKeyApi = {+ list: () => request<ApiKey[]>('/auth/api-keys'),+ get: (id: string) => request<ApiKey>(`/auth/api-keys/${id}`),+ create: (data: {+ name: string;+ role: string;+ allowedIps?: string[];+ allowedSessions?: string[];+ expiresAt?: string;+ }) =>+ request<ApiKey>('/auth/api-keys', {+ method: 'POST',+ body: JSON.stringify(data),+ }),+ update: (id: string, data: Partial<ApiKey>) =>+ request<ApiKey>(`/auth/api-keys/${id}`, {+ method: 'PUT',+ body: JSON.stringify(data),+ }),+ delete: (id: string) => request<void>(`/auth/api-keys/${id}`, { method: 'DELETE' }),+ revoke: (id: string) => request<ApiKey>(`/auth/api-keys/${id}/revoke`, { method: 'POST' }),+};++// =============================================================================+// Audit/Logs API+// =============================================================================++export const auditApi = {+ list: (params?: { action?: string; severity?: string; limit?: number; offset?: number }) => {+ const query = new URLSearchParams();+ if (params?.action) query.set('action', params.action);+ if (params?.severity) query.set('severity', params.severity);+ if (params?.limit) query.set('limit', String(params.limit));+ if (params?.offset) query.set('offset', String(params.offset));+ const queryStr = query.toString();+ return request<{ data: AuditLog[]; total: number }>(`/audit${queryStr ? `?${queryStr}` : ''}`);+ },+};++// =============================================================================+// Message API+// =============================================================================++export const messageApi = {+ sendText: (sessionId: string, chatId: string, text: string) =>+ request<MessageResponse>(`/sessions/${sessionId}/messages/send-text`, {+ method: 'POST',+ body: JSON.stringify({ chatId, text }),+ }),+ sendImage: (sessionId: string, chatId: string, url: string, caption?: string) =>+ request<MessageResponse>(`/sessions/${sessionId}/messages/send-image`, {+ method: 'POST',+ body: JSON.stringify({ chatId, url, caption }),+ }),+ sendVideo: (sessionId: string, chatId: string, url: string, caption?: string) =>+ request<MessageResponse>(`/sessions/${sessionId}/messages/send-video`, {+ method: 'POST',+ body: JSON.stringify({ chatId, url, caption }),+ }),+ sendAudio: (sessionId: string, chatId: string, url: string) =>+ request<MessageResponse>(`/sessions/${sessionId}/messages/send-audio`, {+ method: 'POST',+ body: JSON.stringify({ chatId, url }),+ }),+ sendDocument: (sessionId: string, chatId: string, url: string, filename?: string) =>+ request<MessageResponse>(`/sessions/${sessionId}/messages/send-document`, {+ method: 'POST',+ body: JSON.stringify({ chatId, url, filename }),+ }),+};++// =============================================================================+// Health & Infrastructure API+// =============================================================================++export const healthApi = {+ check: () => request<HealthStatus>('/health'),+ ready: () => request<HealthStatus>('/health/ready'),+};++export const infraApi = {+ getStatus: () => request<InfraStatus>('/infra/status'),+ updateConfig: (config: Partial<InfraStatus>) =>+ request<InfraStatus>('/infra/config', {+ method: 'PUT',+ body: JSON.stringify(config),+ }),+ saveConfig: (config: SaveConfigPayload) =>+ request<{ message: string; saved: boolean; envPath: string; profiles: string[] }>('/infra/config', {+ method: 'PUT',+ body: JSON.stringify(config),+ }),+ restart: (profiles?: string[], profilesToRemove?: string[]) =>+ request<{+ message: string;+ restarting: boolean;+ profiles: string[];+ profilesToRemove: string[];+ estimatedTime: number;+ }>('/infra/restart', {+ method: 'POST',+ body: JSON.stringify({ profiles: profiles || [], profilesToRemove: profilesToRemove || [] }),+ }),+ healthCheck: () => request<{ status: string; timestamp: string }>('/infra/health'),+};++// =============================================================================+// Settings API+// =============================================================================++export const settingsApi = {+ get: () => request<Settings>('/settings'),+ update: (settings: Partial<Settings>) =>+ request<Settings>('/settings', {+ method: 'PUT',+ body: JSON.stringify(settings),+ }),+};++// =============================================================================+// Plugin Types+// =============================================================================++export interface Plugin {+ id: string;+ name: string;+ version: string;+ type: 'engine' | 'storage' | 'queue' | 'auth' | 'extension';+ description?: string;+ author?: string;+ status: 'installed' | 'enabled' | 'disabled' | 'error';+ config: Record<string, unknown>;+ builtIn: boolean;+ provides: string[];+ loadedAt?: string;+ enabledAt?: string;+ error?: string;+}++export interface Engine {+ id: string;+ name: string;+ enabled: boolean;+ features: string[];+}++// =============================================================================+// Plugins API+// =============================================================================++export const pluginsApi = {+ list: () => request<Plugin[]>('/plugins'),+ get: (id: string) => request<Plugin>(`/plugins/${id}`),+ enable: (id: string) =>+ request<{ success: boolean; message: string }>(`/plugins/${id}/enable`, {+ method: 'POST',+ }),+ disable: (id: string) =>+ request<{ success: boolean; message: string }>(`/plugins/${id}/disable`, {+ method: 'POST',+ }),+ updateConfig: (id: string, config: Record<string, unknown>) =>+ request<{ success: boolean; message: string }>(`/plugins/${id}/config`, {+ method: 'PUT',+ body: JSON.stringify({ config }),+ }),+ healthCheck: (id: string) => request<{ healthy: boolean; message?: string }>(`/plugins/${id}/health`),+ getEngines: () => request<Engine[]>('/infra/engines'),+ getCurrentEngine: () => request<{ engineType: string }>('/infra/engines/current'),+};diff --git a/dashboard/src/types/role.ts b/dashboard/src/types/role.tsnew file mode 100644index 000000000..50345332e--- /dev/null+++ b/dashboard/src/types/role.ts@@ -0,0 +1,11 @@+// Role types for RBAC+export type UserRole = 'admin' | 'operator' | 'viewer';++export interface RoleContextType {+ role: UserRole | null;+ setRole: (role: UserRole | null) => void;+ isAdmin: boolean;+ isOperator: boolean;+ isViewer: boolean;+ canWrite: boolean;+}diff --git a/dashboard/src/vite-env.d.ts b/dashboard/src/vite-env.d.tsnew file mode 100644index 000000000..54b2eb93a--- /dev/null+++ b/dashboard/src/vite-env.d.ts@@ -0,0 +1,4 @@+/// <reference types="vite/client" />++declare const __APP_VERSION__: string;+declare const __BUILD_TIME__: string;diff --git a/dashboard/tsconfig.app.json b/dashboard/tsconfig.app.jsonnew file mode 100644index 000000000..a9b5a59ca--- /dev/null+++ b/dashboard/tsconfig.app.json@@ -0,0 +1,28 @@+{+ "compilerOptions": {+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",+ "target": "ES2022",+ "useDefineForClassFields": true,+ "lib": ["ES2022", "DOM", "DOM.Iterable"],+ "module": "ESNext",+ "types": ["vite/client"],+ "skipLibCheck": true,++ /* Bundler mode */+ "moduleResolution": "bundler",+ "allowImportingTsExtensions": true,+ "verbatimModuleSyntax": true,+ "moduleDetection": "force",+ "noEmit": true,+ "jsx": "react-jsx",++ /* Linting */+ "strict": true,+ "noUnusedLocals": true,+ "noUnusedParameters": true,+ "erasableSyntaxOnly": true,+ "noFallthroughCasesInSwitch": true,+ "noUncheckedSideEffectImports": true+ },+ "include": ["src"]+}diff --git a/dashboard/tsconfig.json b/dashboard/tsconfig.jsonnew file mode 100644index 000000000..1ffef600d--- /dev/null+++ b/dashboard/tsconfig.json@@ -0,0 +1,7 @@+{+ "files": [],+ "references": [+ { "path": "./tsconfig.app.json" },+ { "path": "./tsconfig.node.json" }+ ]+}diff --git a/dashboard/tsconfig.node.json b/dashboard/tsconfig.node.jsonnew file mode 100644index 000000000..8a67f62f4--- /dev/null+++ b/dashboard/tsconfig.node.json@@ -0,0 +1,26 @@+{+ "compilerOptions": {+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",+ "target": "ES2023",+ "lib": ["ES2023"],+ "module": "ESNext",+ "types": ["node"],+ "skipLibCheck": true,++ /* Bundler mode */+ "moduleResolution": "bundler",+ "allowImportingTsExtensions": true,+ "verbatimModuleSyntax": true,+ "moduleDetection": "force",+ "noEmit": true,++ /* Linting */+ "strict": true,+ "noUnusedLocals": true,+ "noUnusedParameters": true,+ "erasableSyntaxOnly": true,+ "noFallthroughCasesInSwitch": true,+ "noUncheckedSideEffectImports": true+ },+ "include": ["vite.config.ts"]+}diff --git a/dashboard/vite.config.ts b/dashboard/vite.config.tsnew file mode 100644index 000000000..b4d8b7cd2--- /dev/null+++ b/dashboard/vite.config.ts@@ -0,0 +1,22 @@+import { defineConfig } from 'vite';+import react from '@vitejs/plugin-react';++// https://vite.dev/config/+export default defineConfig({+ plugins: [react()],+ appType: 'spa', // Enable SPA fallback for client-side routing+ define: {+ __APP_VERSION__: JSON.stringify(process.env.APP_VERSION || '0.2.1'),+ __BUILD_TIME__: JSON.stringify(new Date().toISOString()),+ },+ server: {+ port: 2886,+ proxy: {+ '/api': {+ target: 'http://localhost:2785',+ changeOrigin: true,+ secure: false,+ },+ },+ },+});diff --git a/docker-compose.dev.yml b/docker-compose.dev.ymlnew file mode 100644index 000000000..c258bad8c--- /dev/null+++ b/docker-compose.dev.yml@@ -0,0 +1,59 @@+# OpenWA - Docker Compose for Development+# Quick Start: docker compose -f docker-compose.dev.yml up -d++services:+ # API Backend+ openwa:+ build:+ context: .+ dockerfile: Dockerfile+ container_name: openwa-api+ ports:+ - '127.0.0.1:2785:2785'+ environment:+ - NODE_ENV=development+ - PORT=2785+ - DATABASE_TYPE=sqlite+ - DATABASE_NAME=/app/data/openwa.sqlite+ - DATABASE_SYNCHRONIZE=true+ - ENGINE_TYPE=whatsapp-web.js+ - SESSION_DATA_PATH=/app/data/sessions+ - PUPPETEER_HEADLESS=true+ - PUPPETEER_ARGS=--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-gpu+ - STORAGE_TYPE=local+ - STORAGE_LOCAL_PATH=/app/data/media+ - WEBHOOK_TIMEOUT=10000+ - WEBHOOK_MAX_RETRIES=3+ - QUEUE_ENABLED=false+ volumes:+ - ./data:/app/data+ restart: unless-stopped+ healthcheck:+ test:+ [+ 'CMD',+ 'node',+ '-e',+ "require('http').get('http://localhost:2785/api/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))",+ ]+ interval: 30s+ timeout: 10s+ retries: 3+ start_period: 30s++ # Dashboard Frontend+ dashboard:+ build:+ context: ./dashboard+ dockerfile: Dockerfile+ container_name: openwa-dashboard+ ports:+ - '127.0.0.1:2886:80'+ depends_on:+ openwa:+ condition: service_healthy+ restart: unless-stopped++networks:+ default:+ name: openwa-networkdiff --git a/docker-compose.yml b/docker-compose.ymlnew file mode 100644index 000000000..7dfd43c73--- /dev/null+++ b/docker-compose.yml@@ -0,0 +1,191 @@+# OpenWA - Docker Compose Configuration+# Smart Orchestration with Profiles++services:+ # ===== CORE: Traefik Reverse Proxy =====+ traefik:+ image: traefik:v3.0+ container_name: openwa-traefik+ profiles: ['with-proxy', 'full']+ restart: unless-stopped+ ports:+ - '127.0.0.1:${DASHBOARD_PORT:-2886}:80'+ - '127.0.0.1:8080:8080' # Traefik dashboard+ volumes:+ - ./traefik/traefik.yml:/etc/traefik/traefik.yml:ro+ - ./traefik/dynamic.yml:/etc/traefik/dynamic.yml:ro+ labels:+ - 'com.openwa.service=proxy'+ - 'com.openwa.core=true'++ # ===== CORE: OpenWA Backend API =====+ openwa-api:+ build:+ context: .+ dockerfile: Dockerfile+ container_name: openwa-api+ restart: unless-stopped+ ports:+ - '127.0.0.1:${API_PORT:-2785}:2785'+ expose:+ - '2785'+ environment:+ # Core+ - NODE_ENV=${NODE_ENV:-production}+ - PORT=2785+ - LOG_LEVEL=${LOG_LEVEL:-info}+ # Database+ - DATABASE_TYPE=${DATABASE_TYPE:-sqlite}+ - DATABASE_NAME=${DATABASE_NAME:-/app/data/openwa.sqlite}+ - DATABASE_HOST=${DATABASE_HOST:-postgres}+ - DATABASE_PORT=${DATABASE_PORT:-5432}+ - DATABASE_USERNAME=${DATABASE_USERNAME:-openwa}+ - DATABASE_PASSWORD=${DATABASE_PASSWORD:-openwa}+ - DATABASE_SYNCHRONIZE=${DATABASE_SYNCHRONIZE:-true}+ # Engine+ - ENGINE_TYPE=${ENGINE_TYPE:-whatsapp-web.js}+ - SESSION_DATA_PATH=/app/data/sessions+ - PUPPETEER_HEADLESS=${PUPPETEER_HEADLESS:-true}+ - PUPPETEER_ARGS=${PUPPETEER_ARGS:---no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-gpu}+ # Storage+ - STORAGE_TYPE=${STORAGE_TYPE:-local}+ - STORAGE_LOCAL_PATH=/app/data/media+ - S3_ENDPOINT=${S3_ENDPOINT:-http://minio:9000}+ - S3_ACCESS_KEY=${S3_ACCESS_KEY:-minioadmin}+ - S3_SECRET_KEY=${S3_SECRET_KEY:-minioadmin}+ - S3_BUCKET=${S3_BUCKET:-openwa}+ # Redis+ - REDIS_ENABLED=${REDIS_ENABLED:-false}+ - REDIS_HOST=${REDIS_HOST:-redis}+ - REDIS_PORT=${REDIS_PORT:-6379}+ # Webhook+ - WEBHOOK_TIMEOUT=${WEBHOOK_TIMEOUT:-10000}+ - WEBHOOK_MAX_RETRIES=${WEBHOOK_MAX_RETRIES:-3}+ - WEBHOOK_RETRY_DELAY=${WEBHOOK_RETRY_DELAY:-5000}+ # Rate Limit+ - RATE_LIMIT_TTL=${RATE_LIMIT_TTL:-60}+ - RATE_LIMIT_MAX=${RATE_LIMIT_MAX:-100}+ # Plugins+ - PLUGINS_ENABLED=${PLUGINS_ENABLED:-true}+ - PLUGINS_DIR=/app/data/plugins+ # Security+ - API_MASTER_KEY=${API_MASTER_KEY:-}+ volumes:+ - openwa-data:/app/data+ - /var/run/docker.sock:/var/run/docker.sock:ro+ - ./docker-compose.yml:/app/docker-compose.yml:ro+ depends_on:+ postgres:+ condition: service_healthy+ required: false+ redis:+ condition: service_healthy+ required: false+ healthcheck:+ test:+ [+ 'CMD',+ 'node',+ '-e',+ "require('http').get('http://localhost:2785/api/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))",+ ]+ interval: 30s+ timeout: 10s+ retries: 3+ start_period: 30s+ labels:+ - 'com.openwa.service=api'+ - 'com.openwa.core=true'++ # ===== CORE: Dashboard Frontend =====+ dashboard:+ build:+ context: ./dashboard+ dockerfile: Dockerfile.traefik+ container_name: openwa-dashboard+ profiles: ['with-dashboard', 'full']+ restart: unless-stopped+ expose:+ - '80'+ depends_on:+ - openwa-api+ labels:+ - 'com.openwa.service=dashboard'+ - 'com.openwa.core=true'++ # ===== OPTIONAL: Built-in PostgreSQL =====+ postgres:+ image: postgres:16-alpine+ container_name: openwa-postgres+ profiles: ['postgres']+ restart: unless-stopped+ environment:+ POSTGRES_USER: ${DATABASE_USERNAME:-openwa}+ POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-openwa}+ POSTGRES_DB: ${DATABASE_NAME:-openwa}+ volumes:+ - postgres-data:/var/lib/postgresql/data+ healthcheck:+ test: ['CMD-SHELL', 'pg_isready -U ${DATABASE_USERNAME:-openwa}']+ interval: 5s+ timeout: 3s+ retries: 5+ labels:+ - 'com.openwa.service=database'+ - 'com.openwa.builtin=true'++ # ===== OPTIONAL: Built-in Redis =====+ redis:+ image: redis:7-alpine+ container_name: openwa-redis+ profiles: ['redis']+ restart: unless-stopped+ command: redis-server --appendonly yes+ volumes:+ - redis-data:/data+ healthcheck:+ test: ['CMD', 'redis-cli', 'ping']+ interval: 5s+ timeout: 3s+ retries: 5+ labels:+ - 'com.openwa.service=cache'+ - 'com.openwa.builtin=true'++ # ===== OPTIONAL: Built-in MinIO (S3-compatible) =====+ minio:+ image: minio/minio+ container_name: openwa-minio+ profiles: ['minio']+ restart: unless-stopped+ command: server /data --console-address ":9001"+ environment:+ MINIO_ROOT_USER: ${S3_ACCESS_KEY:-minioadmin}+ MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY:-minioadmin}+ volumes:+ - minio-data:/data+ ports:+ - '127.0.0.1:9000:9000'+ - '127.0.0.1:9001:9001'+ healthcheck:+ test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']+ interval: 10s+ timeout: 5s+ retries: 3+ labels:+ - 'com.openwa.service=storage'+ - 'com.openwa.builtin=true'++volumes:+ openwa-data:+ driver: local+ postgres-data:+ driver: local+ redis-data:+ driver: local+ minio-data:+ driver: local++networks:+ default:+ name: openwa-networkdiff --git a/docs/01-project-overview.md b/docs/01-project-overview.mdnew file mode 100644index 000000000..0fb61a920--- /dev/null+++ b/docs/01-project-overview.md@@ -0,0 +1,297 @@+# 01 - Project Overview++## 1.1 Executive Summary++**OpenWA** is an open-source platform that provides an HTTP API for WhatsApp integration. This project is built as a free and fully open-source alternative to paid solutions such as WAHA Plus.++### Core Values++```+┌─────────────────────────────────────────────────────────────┐+│ OpenWA Values │+├─────────────────────────────────────────────────────────────┤+│ 🆓 100% Free │ No paywalled features │+│ 📖 Open Source │ MIT License, fork friendly │+│ 🔒 Self-Hosted │ Data stays on your own server │+│ 🚀 Production Ready │ Scalable & reliable │+│ 🎯 Developer First │ Simple, intuitive API │+└─────────────────────────────────────────────────────────────┘+```++## 1.2 Vision & Mission++### Vision+To become the most reliable open-source WhatsApp API gateway for production use.++### Mission+1. Provide a complete and free WhatsApp REST API+2. Build an active open-source community+3. Deliver excellent documentation and tooling+4. Ensure user data security and privacy++## 1.3 Problem Statement++```mermaid+flowchart LR+ subgraph Problems["❌ Current Problems"]+ P1[Existing solutions are paid]+ P2[Critical features are paywalled]+ P3[Vendor lock-in]+ P4[Data privacy concerns]+ end++ subgraph Solution["✅ OpenWA Solution"]+ S1[100% Free & Open Source]+ S2[All features included]+ S3[Self-hosted, no lock-in]+ S4[Data stays on your server]+ end++ P1 --> S1+ P2 --> S2+ P3 --> S3+ P4 --> S4+```++### Pain Points Addressed++| Pain Point | OpenWA Solution |+|------------|------------------|+| WAHA Plus charges for multi-session | Free unlimited multi-session |+| Dashboard only in paid tiers | Free dashboard |+| PostgreSQL support is paid | PostgreSQL included |+| Limited webhook management | Full webhook management |+| No source code access | Full source code available |++## 1.4 Project Goals++### Primary Goals++```mermaid+mindmap+ root((OpenWA Goals))+ Functional+ Complete REST API+ Multi-session+ Webhook support+ Media handling+ Technical+ High performance+ Scalable+ Secure+ Well documented+ Community+ Active contributors+ Strong documentation+ Example projects+ Support forum+```++### Success Metrics++| Metric | Target (6 months) | Target (1 year) |+|--------|-------------------|-----------------|+| GitHub Stars | 500+ | 2000+ |+| Active Contributors | 10+ | 30+ |+| Docker Pulls | 5,000+ | 20,000+ |+| Production Users | 100+ | 500+ |+| API Uptime | 99.5% | 99.9% |++## 1.5 Project Scope++### In Scope ✅++```+Phase 1 (MVP)+├── REST API+│ ├── Session management (create, delete, status)+│ ├── QR code authentication+│ ├── Send messages (text, image, video, audio, document)+│ ├── Receive messages via webhook+│ ├── Contact management+│ └── Basic group operations+├── Infrastructure+│ ├── Docker support+│ ├── SQLite database+│ ├── Swagger documentation+│ └── Health check endpoints+└── Documentation+ ├── API documentation+ ├── Setup guide+ └── Basic examples++Phase 2 (Production Ready)+├── Multi-session support+├── PostgreSQL support+├── Web Dashboard+├── Webhook management UI+├── Message queue (Redis/Bull)+├── Rate limiting+└── Authentication (API Key)++Phase 3 (Advanced)+├── Group management (create, modify, participants)+├── Channels/Newsletter support+├── Label management+├── Status/Stories+├── Proxy per session+├── Horizontal scaling+└── Metrics & monitoring+```++### Out of Scope ❌++- WhatsApp Business API (official Meta API)+- Mobile app+- End-user chat interface+- Message scheduling (to be a separate plugin)+- CRM features+- Billing/payment integration++## 1.6 Stakeholders++```mermaid+flowchart TB+ subgraph Primary["Primary Stakeholders"]+ D[Developers]+ B[Small Businesses]+ S[Startups]+ end++ subgraph Secondary["Secondary Stakeholders"]+ C[Community Contributors]+ I[Integration Partners]+ O[Open Source Community]+ end++ subgraph Users["End Users"]+ U1[Self-hosted Users]+ U2[Docker Users]+ U3[Cloud Deploy Users]+ end++ Primary --> Users+ Secondary --> Primary+```++### Target Users++1. **Developers** - Need WhatsApp integration for their applications+2. **Small Businesses** - Need customer service automation+3. **Startups** - Need cost-effective solutions+4. **Agencies** - Manage multiple WhatsApp accounts++## 1.7 Competitive Analysis++```mermaid+quadrantChart+ title Feature vs Cost Comparison+ x-axis Low Cost --> High Cost+ y-axis Basic Features --> Advanced Features+ quadrant-1 Premium Solutions+ quadrant-2 Our Target+ quadrant-3 Limited Free+ quadrant-4 Expensive Basic++ WAHA Plus: [0.7, 0.8]+ WAHA Core: [0.2, 0.4]+ Whapi.cloud: [0.8, 0.75]+ Green API: [0.6, 0.6]+ OpenWA: [0.1, 0.85]+```++### Feature Comparison++| Feature | OpenWA | WAHA Core | WAHA Plus | Whapi.cloud |+|---------|--------|-----------|-----------|-------------|+| Price | Free | Free | $50+/mo | $30+/mo |+| Open Source | ✅ | ❌ | ❌ | ❌ |+| Multi-session | ✅ | Limited | ✅ | ✅ |+| Dashboard | ✅ | ❌ | ✅ | ✅ |+| PostgreSQL | ✅ | ❌ | ✅ | N/A |+| Webhook UI | ✅ | ❌ | ✅ | ✅ |+| Self-hosted | ✅ | ✅ | ✅ | ❌ |+| Source code | ✅ | ❌ | ❌ | ❌ |++## 1.8 Technology Decisions++### Why These Technologies?++```mermaid+flowchart TB+ subgraph Runtime["Runtime & Framework"]+ N[Node.js 20 LTS] --> |"TypeScript support, async/await"| NE[NestJS]+ NE --> |"Modular, scalable, DI"| API[REST API]+ end++ subgraph Engine["WhatsApp Engine"]+ WW[whatsapp-web.js] --> |"Puppeteer based"| P[More stealth]+ P --> |"Real browser fingerprint"| S[Lower ban risk]+ end++ subgraph Storage["Data Storage"]+ SQ[SQLite] --> |"Development"| DEV[Easy setup]+ PG[PostgreSQL] --> |"Production"| PROD[Scalable]+ end++ subgraph Frontend["Dashboard"]+ R[React] --> V[Vite]+ V --> S[shadcn/ui]+ S --> L[Lucide Icons]+ L --> UI[Modern UI]+ end+```++### Technology Stack Summary++| Layer | Technology | Rationale |+|-------|------------|-----------|+| Runtime | Node.js 20 LTS | Stable, long-term support |+| Language | TypeScript | Type safety, better developer experience |+| Framework | NestJS | Enterprise-grade, modular |+| WA Engine | whatsapp-web.js | Mature, active community |+| Browser | Puppeteer/Chrome | Real browser, stealth |+| Database | SQLite (default) / PostgreSQL | Zero-config default, PostgreSQL for scaling |+| Cache | Redis | Fast, pub/sub support |+| Queue | Bull | Reliable job processing |+| Dashboard | React + Vite | Fast, modern |+| Styling | Tailwind CSS | Utility-first CSS |+| UI Components | shadcn/ui + Lucide | Accessible, polished |+| Container | Docker | Portable, consistent |++## 1.9 Constraints & Assumptions++### Constraints++1. **Technical**+ - WhatsApp Web protocol can change at any time+ - Puppeteer requires significant resources (~300-500MB RAM per session)+ - WhatsApp rate limiting++2. **Legal**+ - Unofficial API, not affiliated with Meta+ - Users are responsible for compliant usage++3. **Resource**+ - Open-source project, dependent on community contributions+ - Limited maintainer capacity initially++### Assumptions++1. Users have servers with at least 2GB RAM+2. Users are familiar with Docker or Node.js+3. Users understand the risks of using an unofficial API+4. WhatsApp Web will remain available++## 1.10 Document History++| Version | Date | Author | Changes |+|---------|------|--------|---------|+| 1.0 | 2026-02-02 | Team | Initial document |+---++<div align="center">++[Documentation Index](./README.md) · [Next: 02 - Requirements Specification →](./02-requirements-specification.md)++</div>diff --git a/docs/02-requirements-specification.md b/docs/02-requirements-specification.mdnew file mode 100644index 000000000..cb952d6fa--- /dev/null+++ b/docs/02-requirements-specification.md@@ -0,0 +1,492 @@+# 02 - Requirements Specification++## 2.1 Overview++This document defines the functional and non-functional requirements for OpenWA.++## 2.2 Functional Requirements++### 2.2.1 Session Management++```mermaid+flowchart LR+ subgraph Session["Session Lifecycle"]+ C[Create] --> A[Authenticate]+ A --> |QR Scan| R[Ready]+ R --> |Logout| D[Destroy]+ R --> |Disconnect| RC[Reconnect]+ RC --> R+ end+```++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-SM-001 | The system must create new sessions | High | 1 |+| FR-SM-002 | The system must generate a QR code for authentication | High | 1 |+| FR-SM-003 | The system must persist session state for reconnection | High | 1 |+| FR-SM-004 | The system must delete a session | High | 1 |+| FR-SM-005 | The system must display session status | High | 1 |+| FR-SM-006 | The system must support multiple sessions | High | 2 |+| FR-SM-007 | The system must auto-reconnect when the connection is lost | Medium | 2 |+| FR-SM-008 | The system must support session naming | Low | 2 |++### 2.2.2 Messaging++```mermaid+flowchart TB+ subgraph Outbound["Outbound Messages"]+ T[Text]+ I[Image]+ V[Video]+ A[Audio]+ D[Document]+ L[Location]+ CT[Contact]+ S[Sticker]+ end++ subgraph Inbound["Inbound Messages"]+ W[Webhook] --> P[Process]+ P --> ACK[Acknowledgment]+ end++ Outbound --> API[REST API]+ API --> WA[WhatsApp]+ WA --> Inbound+```++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-MSG-001 | The system must send text messages | High | 1 |+| FR-MSG-002 | The system must send images with captions | High | 1 |+| FR-MSG-003 | The system must send video messages | High | 1 |+| FR-MSG-004 | The system must send audio/voice notes | High | 1 |+| FR-MSG-005 | The system must send documents/files | High | 1 |+| FR-MSG-006 | The system must send locations | Medium | 2 |+| FR-MSG-007 | The system must send contact cards | Medium | 2 |+| FR-MSG-008 | The system must send stickers | Medium | 2 |+| FR-MSG-009 | The system must reply to a message | Medium | 2 |+| FR-MSG-010 | The system must forward messages | Low | 3 |+| FR-MSG-011 | The system must delete messages | Low | 3 |+| FR-MSG-012 | The system must react to messages | Low | 3 |+| FR-MSG-013 | The system must send bulk messages (batch) | Medium | 2 |+| FR-MSG-014 | The system must support template variables in bulk messages | Medium | 2 |+| FR-MSG-015 | The system must track status per message in a batch | Medium | 2 |+| FR-MSG-016 | The system must cancel a running batch | Medium | 2 |+| FR-MSG-017 | The system must apply delays between messages to reduce ban risk | High | 2 |+| FR-MSG-018 | The system must validate media size before sending | High | 1 |+| FR-MSG-019 | The system must support downloading media from a URL | High | 1 |++### 2.2.3 Webhook & Events++```mermaid+sequenceDiagram+ participant WA as WhatsApp+ participant OW as OpenWA+ participant WH as Webhook URL++ WA->>OW: New Message Event+ OW->>OW: Process & Store+ OW->>WH: POST /webhook+ WH-->>OW: 200 OK++ alt Webhook Failed+ OW->>OW: Queue for Retry+ OW->>WH: Retry (max 3x)+ end+```++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-WH-001 | The system must deliver events to webhook URLs | High | 1 |+| FR-WH-002 | The system must support multiple webhook URLs | Medium | 2 |+| FR-WH-003 | The system must retry failed webhooks (max 3x) | Medium | 2 |+| FR-WH-004 | The system must filter event types per webhook | Medium | 2 |+| FR-WH-005 | The system must log webhook delivery status | Medium | 2 |+| FR-WH-006 | The system must support webhook signature verification | Medium | 2 |+| FR-WH-007 | The system must provide an idempotency key per event | High | 2 |+| FR-WH-008 | The system must provide a delivery ID to track retries | Medium | 2 |+| FR-WH-009 | The system must support exponential backoff for retries | Medium | 2 |+| FR-WH-010 | The system must enable/disable webhooks without deletion | Low | 2 |++### 2.2.4 Real-time Updates (WebSocket)++```mermaid+flowchart LR+ subgraph WebSocket["WebSocket Features"]+ direction TB+ CONN[Connection Management]+ AUTH[Authentication]+ SUB[Event Subscription]+ PING[Keep-alive Ping/Pong]+ end++ subgraph Events["Real-time Events"]+ MSG[Message Events]+ SESS[Session Events]+ QR[QR Code Updates]+ end++ WebSocket --> Events+```++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-WS-001 | The system must provide a WebSocket endpoint for real-time updates | Medium | 2 |+| FR-WS-002 | The system must support API key authentication for WebSocket | Medium | 2 |+| FR-WS-003 | The system must allow subscribing to a specific session | Medium | 2 |+| FR-WS-004 | The system must allow subscribing to specific event types | Medium | 2 |+| FR-WS-005 | The system must implement ping/pong keep-alive | Medium | 2 |+| FR-WS-006 | The system must auto-reconnect with exponential backoff | Low | 3 |+| FR-WS-007 | The system must stream QR code updates in real time | High | 2 |++### 2.2.5 Contact Management++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-CT-001 | The system must retrieve all contacts | High | 1 |+| FR-CT-002 | The system must retrieve a contact by ID | High | 1 |+| FR-CT-003 | The system must check if a number exists on WhatsApp | High | 1 |+| FR-CT-004 | The system must retrieve a contact profile picture | Medium | 2 |+| FR-CT-005 | The system must block/unblock a contact | Low | 3 |++### 2.2.6 Group Management++```mermaid+flowchart TB+ subgraph GroupOps["Group Operations"]+ direction TB+ CR[Create Group]+ UP[Update Info]+ AD[Add Participants]+ RM[Remove Participants]+ PR[Promote to Admin]+ DM[Demote Admin]+ LV[Leave Group]+ end++ subgraph GroupInfo["Group Info"]+ GI[Get Info]+ GP[Get Participants]+ GL[Get Invite Link]+ end+```++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-GR-001 | The system must retrieve all groups | Medium | 2 |+| FR-GR-002 | The system must retrieve group info | Medium | 2 |+| FR-GR-003 | The system must retrieve group participants | Medium | 2 |+| FR-GR-004 | The system must create a group | Medium | 3 |+| FR-GR-005 | The system must update group info | Low | 3 |+| FR-GR-006 | The system must add participants | Low | 3 |+| FR-GR-007 | The system must remove participants | Low | 3 |+| FR-GR-008 | The system must promote/demote admins | Low | 3 |+| FR-GR-009 | The system must get/revoke invite links | Low | 3 |+| FR-GR-010 | The system must leave a group | Low | 3 |++### 2.2.7 Dashboard (Web UI)++```mermaid+flowchart LR+ subgraph Dashboard["Dashboard Features"]+ direction TB+ SS[Session Status]+ QR[QR Display]+ WM[Webhook Manager]+ LG[Logs Viewer]+ ST[Statistics]+ end++ Dashboard --> API[REST API]+ API --> BE[Backend]+```++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-UI-001 | The dashboard must display the status of all sessions | High | 2 |+| FR-UI-002 | The dashboard must display QR codes | High | 2 |+| FR-UI-003 | The dashboard must manage webhooks | Medium | 2 |+| FR-UI-004 | The dashboard must view logs | Medium | 2 |+| FR-UI-005 | The dashboard must test sending messages | Medium | 2 |+| FR-UI-006 | The dashboard must display statistics | Low | 3 |+| FR-UI-007 | The dashboard must support dark mode | Low | 3 |++### 2.2.8 Authentication & Authorization++```mermaid+flowchart TB+ subgraph Auth["Authentication Flow"]+ REQ[Request] --> KEY[API Key Check]+ KEY -->|Valid| IP[IP Whitelist Check]+ KEY -->|Invalid| R401[401 Unauthorized]+ IP -->|Allowed| PERM[Permission Check]+ IP -->|Blocked| R403[403 Forbidden - IP]+ PERM -->|Granted| PROC[Process Request]+ PERM -->|Denied| R403B[403 Forbidden - Permission]+ end+```++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-AU-001 | The system must support API key authentication | High | 2 |+| FR-AU-002 | The system must generate/revoke API keys | High | 2 |+| FR-AU-003 | The system must set permissions per API key | Medium | 3 |+| FR-AU-004 | The system must log API access | Medium | 2 |+| FR-AU-005 | The system must support IP whitelisting per API key | Medium | 2 |+| FR-AU-006 | The system must support CIDR notation for IP ranges | Low | 2 |+| FR-AU-007 | The system must set expiration dates for API keys | Medium | 2 |+| FR-AU-008 | The system must hash API keys before storage (SHA-256) | High | 2 |+| FR-AU-009 | The system must track last used timestamps per API key | Low | 2 |+| FR-AU-010 | The system must support a master API key from environment | High | 2 |+| FR-AU-011 | The system must support the `X-Request-ID` header for request tracing | Medium | 2 |++### 2.2.9 Bulk Operations++```mermaid+flowchart LR+ subgraph Batch["Batch Processing"]+ direction TB+ CREATE[Create Batch]+ QUEUE[Queue Messages]+ PROCESS[Process with Delay]+ TRACK[Track Progress]+ CANCEL[Cancel Option]+ end++ CREATE --> QUEUE --> PROCESS --> TRACK+ TRACK --> CANCEL+```++| ID | Requirement | Priority | Phase |+|----|-------------|----------|-------|+| FR-BK-001 | The system must accept batches up to 100 messages | Medium | 2 |+| FR-BK-002 | The system must apply delays between messages (configurable, min 1s) | High | 2 |+| FR-BK-003 | The system must randomize delays for natural behavior | Medium | 2 |+| FR-BK-004 | The system must track batch progress (sent/failed/pending) | Medium | 2 |+| FR-BK-005 | The system must cancel a running batch | Medium | 2 |+| FR-BK-006 | The system must support template variables in batches | Low | 3 |+| FR-BK-007 | The system must return a batch ID for status tracking | High | 2 |+| FR-BK-008 | The system must clean up completed batches after 24 hours | Low | 3 |++## 2.3 Non-Functional Requirements++### 2.3.1 Performance++```mermaid+flowchart LR+ subgraph Performance["Performance Targets"]+ RT[Response Time < 500ms]+ TP[Throughput 100 req/s]+ MS[Memory < 500MB/session]+ ST[Startup < 30s]+ end+```++| ID | Requirement | Target | Priority |+|----|-------------|--------|----------|+| NFR-PF-001 | API response time | < 500ms (p95) | High |+| NFR-PF-002 | Message send latency | < 2s | High |+| NFR-PF-003 | QR code generation | < 3s | High |+| NFR-PF-004 | Memory per session | < 500MB | High |+| NFR-PF-005 | Concurrent sessions | 10+ per instance | Medium |+| NFR-PF-006 | Webhook delivery | < 5s | Medium |+| NFR-PF-007 | Startup time | < 30s | Medium |++### 2.3.2 Reliability & Availability++| ID | Requirement | Target | Priority |+|----|-------------|--------|----------|+| NFR-RL-001 | Uptime | 99.5% | High |+| NFR-RL-002 | Auto-recovery after crash | < 60s | High |+| NFR-RL-003 | Session persistence | Survive restart | High |+| NFR-RL-004 | Graceful shutdown | Complete pending ops | Medium |+| NFR-RL-005 | Data durability | No message loss | High |++### 2.3.3 Scalability++```mermaid+flowchart TB+ subgraph Vertical["Vertical Scaling"]+ V1[More RAM]+ V2[More CPU]+ V3[More Sessions]+ end++ subgraph Horizontal["Horizontal Scaling"]+ H1[Multiple Instances]+ H2[Load Balancer]+ H3[Shared Storage]+ end++ Vertical --> Single[Single Instance]+ Horizontal --> Cluster[Cluster Mode]+```++| ID | Requirement | Target | Priority |+|----|-------------|--------|----------|+| NFR-SC-001 | Vertical scaling | 20+ sessions/instance | Medium |+| NFR-SC-002 | Horizontal scaling support | Multiple instances | Low |+| NFR-SC-003 | Stateless API design | Session-independent | High |++### 2.3.4 Security++| ID | Requirement | Description | Priority |+|----|-------------|-------------|----------|+| NFR-SE-001 | API Authentication | API key required | High |+| NFR-SE-002 | Data encryption | TLS for all connections | High |+| NFR-SE-003 | Secret management | Encrypted storage | High |+| NFR-SE-004 | Input validation | Sanitize all inputs | High |+| NFR-SE-005 | Rate limiting | Prevent abuse | Medium |+| NFR-SE-006 | Audit logging | Track all operations | Medium |+| NFR-SE-007 | CORS configuration | Configurable origins | Medium |++### 2.3.5 Maintainability++| ID | Requirement | Description | Priority |+|----|-------------|-------------|----------|+| NFR-MT-001 | Code coverage | > 80% unit tests | Medium |+| NFR-MT-002 | Documentation | API docs up-to-date | High |+| NFR-MT-003 | Logging | Structured logging | High |+| NFR-MT-004 | Modular architecture | Loosely coupled | High |+| NFR-MT-005 | Configuration | Environment-based | High |++### 2.3.6 Usability++| ID | Requirement | Description | Priority |+|----|-------------|-------------|----------|+| NFR-US-001 | Setup time | < 5 minutes with Docker | High |+| NFR-US-002 | API documentation | Swagger/OpenAPI | High |+| NFR-US-003 | Error messages | Clear & actionable | High |+| NFR-US-004 | Examples | Working code examples | Medium |+| NFR-US-005 | Dashboard UX | Intuitive interface | Medium |++### 2.3.7 Compatibility++| ID | Requirement | Description | Priority |+|----|-------------|-------------|----------|+| NFR-CP-001 | Node.js version | 18.x, 20.x LTS | High |+| NFR-CP-002 | Database support | SQLite, PostgreSQL | High |+| NFR-CP-003 | OS support | Linux, macOS, Windows | High |+| NFR-CP-004 | Docker support | Official image | High |+| NFR-CP-005 | ARM64 support | Apple Silicon, ARM servers | Medium |++## 2.4 Use Cases++### UC-001: Send Text Message++```mermaid+sequenceDiagram+ actor User+ participant API as OpenWA API+ participant Engine as WA Engine+ participant WA as WhatsApp++ User->>API: POST /api/sessions/:sessionId/messages/send-text+ API->>API: Validate request+ API->>Engine: sendMessage(chatId, text)+ Engine->>WA: Send via WhatsApp Web+ WA-->>Engine: Message sent+ Engine-->>API: Success response+ API-->>User: 200 OK {messageId}+```++**Actors**: External application, Developer+**Precondition**: Session is active and connected+**Main Flow**:+1. User sends a POST request with `chatId` and `text`+2. The system validates the request+3. The system sends the message via the WhatsApp engine+4. The system returns the `messageId`++**Alternative Flow**:+- Session not active → Return 400 error+- Invalid phone number → Return 400 error+- WhatsApp error → Return 500 error++### UC-002: Receive Message via Webhook++```mermaid+sequenceDiagram+ participant WA as WhatsApp+ participant Engine as WA Engine+ participant API as OpenWA+ participant WH as User Webhook++ WA->>Engine: New message received+ Engine->>API: Message event+ API->>API: Store message+ API->>WH: POST webhook payload+ WH-->>API: 200 OK+ API->>API: Mark delivered+```++**Actors**: WhatsApp, External webhook endpoint+**Precondition**: Webhook URL configured+**Main Flow**:+1. WhatsApp sends a message to the session+2. The engine receives and forwards to the API+3. The API stores the message and sends it to the webhook+4. The webhook endpoint acknowledges++**Alternative Flow**:+- Webhook failed → Retry 3x+- All retries failed → Log and mark failed++### UC-003: Create New Session++```mermaid+stateDiagram-v2+ [*] --> Creating: POST /sessions+ Creating --> WaitingQR: Generate QR+ WaitingQR --> Scanning: User scans QR+ WaitingQR --> Timeout: 60s timeout+ Scanning --> Authenticating: QR scanned+ Authenticating --> Ready: Auth success+ Authenticating --> Failed: Auth failed+ Ready --> [*]+ Timeout --> [*]+ Failed --> [*]+```++## 2.5 Requirements Traceability Matrix++| Requirement ID | Use Case | Test Case | Status |+|----------------|----------|-----------|--------|+| FR-SM-001 | UC-003 | TC-SM-001 | ✅ Implemented |+| FR-SM-002 | UC-003 | TC-SM-002 | ✅ Implemented |+| FR-MSG-001 | UC-001 | TC-MSG-001 | ✅ Implemented |+| FR-WH-001 | UC-002 | TC-WH-001 | ✅ Implemented |++## 2.6 Acceptance Criteria++### Phase 1 MVP Acceptance Criteria++```+✓ A single session can be created and authenticated+✓ QR code can be scanned and session connected+✓ Text messages can be sent+✓ Image messages can be sent+✓ Incoming messages are forwarded to webhooks+✓ API documentation is available via Swagger+✓ Docker image can be built and run+✓ Basic health check endpoint works+```++### Phase 2 Acceptance Criteria++```+✓ Multiple sessions can run concurrently+✓ Dashboard can display all sessions+✓ Webhooks can be managed via UI+✓ PostgreSQL can be used as storage+✓ API key authentication works+✓ Rate limiting is enabled+```+---++<div align="center">++[← 01 - Project Overview](./01-project-overview.md) · [Documentation Index](./README.md) · [Next: 03 - System Architecture →](./03-system-architecture.md)++</div>diff --git a/docs/03-system-architecture.md b/docs/03-system-architecture.mdnew file mode 100644index 000000000..4a791828b--- /dev/null+++ b/docs/03-system-architecture.md@@ -0,0 +1,1845 @@+# 03 - System Architecture++## 3.1 Architecture Overview++### High-Level Architecture++```mermaid+flowchart TB+ subgraph Clients["Clients"]+ C1[External Apps]+ C2[Dashboard]+ C3[n8n/Automation]+ end++ subgraph OpenWA["OpenWA Platform"]+ subgraph API["API Layer"]+ REST[REST API<br/>NestJS]+ WS[WebSocket<br/>Real-time]+ SWAGGER[Swagger<br/>Documentation]+ end++ subgraph Core["Core Services"]+ SM[Session<br/>Manager]+ MM[Message<br/>Manager]+ WH[Webhook<br/>Manager]+ QM[Queue<br/>Manager]+ end++ subgraph Engine["WhatsApp Engine"]+ WW[whatsapp-web.js]+ PP[Puppeteer]+ CH[Chrome/Chromium]+ end++ subgraph Storage["Storage Layer"]+ DB[(Database<br/>PostgreSQL/SQLite)]+ REDIS[(Redis<br/>Cache/Queue)]+ FS[File Storage<br/>Media Files]+ end+ end++ subgraph External["External"]+ WA[WhatsApp<br/>Servers]+ WEBHOOK[Webhook<br/>Endpoints]+ end++ Clients --> API+ API --> Core+ Core --> Engine+ Core --> Storage+ Engine --> WA+ Core --> WEBHOOK+```++### Component Interaction++```mermaid+sequenceDiagram+ participant Client+ participant API as REST API+ participant SM as Session Manager+ participant Engine as WA Engine+ participant DB as Database+ participant WA as WhatsApp++ Client->>API: Create Session+ API->>SM: createSession()+ SM->>DB: Save session config+ SM->>Engine: Initialize+ Engine->>WA: Connect+ WA-->>Engine: QR Code+ Engine-->>SM: QR Ready+ SM-->>API: QR Code data+ API-->>Client: QR Code response+```++## 3.2 Pluggable Architecture Philosophy++OpenWA is designed with a **Pluggable Architecture** that allows infrastructure components to be swapped without changing application code. This enables flexible deployments ranging from minimal single-session bots to enterprise-scale multi-tenant platforms.++### Design Philosophy++```mermaid+flowchart TB+ subgraph Philosophy["Core Design Principles"]+ P1[Program to Interfaces]+ P2[Dependency Injection]+ P3[Configuration-driven]+ P4[Zero Code Changes]+ end++ subgraph Benefits["Benefits"]+ B1[Scale Up/Down Freely]+ B2[Test in Isolation]+ B3[Swap Implementations]+ B4[Environment-specific Config]+ end++ P1 --> B3+ P2 --> B2+ P3 --> B4+ P4 --> B1+```++**Key Principles:**++| Principle | Description | Example |+|-----------|-------------|---------|+| **Program to Interfaces** | Core code depends on abstract interfaces, not concrete implementations | `IStorageAdapter` instead of `S3Client` |+| **Dependency Injection** | Adapters injected at runtime via NestJS DI container | `@Inject('STORAGE_ADAPTER')` |+| **Configuration-driven** | Adapter selection via environment variables | `STORAGE_TYPE=s3` |+| **Zero Code Changes** | Switch adapters without modifying application code | Change `.env`, restart |++### Adapter Categories++```mermaid+flowchart LR+ subgraph Core["Application Core"]+ APP[Business Logic]+ end++ subgraph Interfaces["Adapter Interfaces"]+ IE[IWhatsAppEngine]+ ID[IDatabaseAdapter]+ IS[IStorageAdapter]+ IC[ICacheAdapter]+ end++ subgraph Implementations["Concrete Implementations"]+ subgraph Engine+ E1[whatsapp-web.js]+ E2[Baileys]+ E3[MockEngine]+ end+ subgraph Database+ D1[SQLite]+ D2[PostgreSQL]+ end+ subgraph Storage+ S1[LocalFS]+ S2[S3/MinIO]+ end+ subgraph Cache+ C1[In-Memory]+ C2[Redis]+ end+ end++ APP --> Interfaces+ IE -.-> Engine+ ID -.-> Database+ IS -.-> Storage+ IC -.-> Cache+```++### Adapter Lifecycle State Machine++Each adapter follows a consistent lifecycle:++```mermaid+stateDiagram-v2+ [*] --> Uninitialized: Create Instance++ Uninitialized --> Initializing: initialize()+ Initializing --> Ready: Success+ Initializing --> Failed: Error++ Ready --> Active: First operation+ Active --> Ready: Operation complete+ Active --> Degraded: Transient error+ Degraded --> Active: Auto-recover+ Degraded --> Failed: Max retries exceeded++ Ready --> Disconnecting: shutdown()+ Active --> Disconnecting: shutdown()+ Degraded --> Disconnecting: shutdown()++ Disconnecting --> Disconnected: Cleanup complete+ Failed --> Disconnecting: shutdown()++ Disconnected --> [*]+```++```typescript+// common/interfaces/adapter-lifecycle.interface.ts++export enum AdapterState {+ UNINITIALIZED = 'uninitialized',+ INITIALIZING = 'initializing',+ READY = 'ready',+ ACTIVE = 'active',+ DEGRADED = 'degraded',+ FAILED = 'failed',+ DISCONNECTING = 'disconnecting',+ DISCONNECTED = 'disconnected',+}++export interface IAdapterLifecycle {+ /** Current adapter state */+ getState(): AdapterState;++ /** Initialize adapter with configuration */+ initialize(config: AdapterConfig): Promise<void>;++ /** Check if adapter is operational */+ isHealthy(): Promise<boolean>;++ /** Graceful shutdown */+ shutdown(): Promise<void>;++ /** State change event emitter */+ onStateChange(handler: (state: AdapterState) => void): void;+}+```++### Dependency Injection Configuration++OpenWA uses NestJS Dynamic Modules for adapter injection:++```typescript+// adapters/adapters.module.ts++import { DynamicModule, Global, Module } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';++@Global()+@Module({})+export class AdaptersModule {+ static forRoot(): DynamicModule {+ return {+ module: AdaptersModule,+ providers: [+ // Database Adapter+ {+ provide: 'DATABASE_ADAPTER',+ useFactory: (config: ConfigService) => {+ const type = config.get('database.type', 'sqlite');+ return DatabaseAdapterFactory.create(type, config);+ },+ inject: [ConfigService],+ },++ // Storage Adapter+ {+ provide: 'STORAGE_ADAPTER',+ useFactory: (config: ConfigService) => {+ const type = config.get('storage.type', 'local');+ return StorageAdapterFactory.create(type, config);+ },+ inject: [ConfigService],+ },++ // Cache Adapter+ {+ provide: 'CACHE_ADAPTER',+ useFactory: (config: ConfigService) => {+ const type = config.get('cache.type', 'memory');+ return CacheAdapterFactory.create(type, config);+ },+ inject: [ConfigService],+ },++ // Engine Adapter+ {+ provide: 'ENGINE_FACTORY',+ useFactory: (config: ConfigService) => {+ return new EngineFactory(config);+ },+ inject: [ConfigService],+ },+ ],+ exports: [+ 'DATABASE_ADAPTER',+ 'STORAGE_ADAPTER',+ 'CACHE_ADAPTER',+ 'ENGINE_FACTORY',+ ],+ };+ }+}+```++### Using Adapters in Services++```typescript+// modules/message/message.service.ts++@Injectable()+export class MessageService {+ constructor(+ @Inject('STORAGE_ADAPTER')+ private readonly storage: IStorageAdapter,++ @Inject('CACHE_ADAPTER')+ private readonly cache: ICacheAdapter,+ ) {}++ async saveMediaMessage(sessionId: string, media: Buffer, filename: string) {+ // Storage adapter handles whether it's local FS or S3+ const result = await this.storage.upload({+ buffer: media,+ filename,+ folder: `sessions/${sessionId}/media`,+ });++ // Cache adapter handles whether it's in-memory or Redis+ await this.cache.set(`media:${result.key}`, result.url, 3600);++ return result;+ }+}+```++### Runtime Configuration Flow++```mermaid+sequenceDiagram+ participant Env as .env File+ participant Config as ConfigService+ participant Factory as AdapterFactory+ participant DI as NestJS DI Container+ participant Service as Application Service++ Note over Env: STORAGE_TYPE=s3+ Env->>Config: Load configuration+ Config->>Factory: Get storage.type = 's3'+ Factory->>Factory: new S3StorageAdapter(config)+ Factory->>DI: Register as 'STORAGE_ADAPTER'+ DI->>Service: Inject IStorageAdapter+ Service->>Service: Use adapter (doesn't know it's S3)+```++### Adapter Selection Matrix++| Environment | Database | Storage | Cache | Engine | Use Case |+|-------------|----------|---------|-------|--------|----------|+| **Development** | SQLite | Local | Memory | Mock | Fast iteration, testing |+| **Testing** | SQLite | Local | Memory | Mock | CI/CD, unit tests |+| **Staging** | PostgreSQL | Local | Redis | whatsapp-web.js | Pre-production validation |+| **Production (Small)** | SQLite | Local | Memory | whatsapp-web.js | 1-3 sessions, VPS |+| **Production (Medium)** | PostgreSQL | Local | Redis | whatsapp-web.js | 5-10 sessions |+| **Production (Large)** | PostgreSQL | S3/MinIO | Redis | whatsapp-web.js | 10+ sessions, HA |++### Hot-Swap Considerations++> **Note:** Adapter hot-swap (changing adapter without restart) is **not supported** in v1.0. Changing adapter requires application restart.++Future considerations for hot-swap:+- Graceful connection draining+- State migration between adapters+- Zero-downtime switching++```mermaid+flowchart TD+ A[Config Change Detected] --> B{Hot-swap Supported?}+ B -->|v1.0: No| C[Log Warning]+ C --> D[Require Restart]++ B -->|Future: Yes| E[Drain Connections]+ E --> F[Initialize New Adapter]+ F --> G[Migrate State]+ G --> H[Switch Traffic]+ H --> I[Shutdown Old Adapter]+```++## 3.3 Layered Architecture++### Layered Architecture Pattern++```mermaid+flowchart TB+ subgraph Presentation["Presentation Layer"]+ direction LR+ REST[REST Controllers]+ WS[WebSocket Gateways]+ SWAGGER[OpenAPI Docs]+ end++ subgraph Application["Application Layer"]+ direction LR+ SESS[Session Service]+ MSG[Message Service]+ WH[Webhook Service]+ AUTH[Auth Service]+ end++ subgraph Domain["Domain Layer"]+ direction LR+ ENT[Entities]+ REPO[Repository Interfaces]+ EVT[Domain Events]+ end++ subgraph Infrastructure["Infrastructure Layer"]+ direction LR+ DB[Database]+ CACHE[Redis]+ ENGINE[WA Engine]+ HTTP[HTTP Client]+ end++ Presentation --> Application+ Application --> Domain+ Application --> Infrastructure+ Domain --> Infrastructure+```++## 3.4 Module Structure++### NestJS Module Organization++```+src/+├── main.ts # Application entry point+├── app.module.ts # Root module+│+├── common/ # Shared utilities+│ ├── decorators/+│ ├── filters/+│ ├── guards/+│ ├── interceptors/+│ ├── pipes/+│ └── utils/+│+├── config/ # Configuration+│ ├── config.module.ts+│ ├── config.service.ts+│ └── configuration.ts+│+├── modules/+│ ├── session/ # Session management+│ │ ├── session.module.ts+│ │ ├── session.controller.ts+│ │ ├── session.service.ts+│ │ ├── session.repository.ts+│ │ ├── dto/+│ │ └── entities/+│ │+│ ├── message/ # Message handling+│ │ ├── message.module.ts+│ │ ├── message.controller.ts+│ │ ├── message.service.ts+│ │ └── dto/+│ │+│ ├── webhook/ # Webhook management+│ │ ├── webhook.module.ts+│ │ ├── webhook.controller.ts+│ │ ├── webhook.service.ts+│ │ └── dto/+│ │+│ ├── contact/ # Contact management+│ │ ├── contact.module.ts+│ │ ├── contact.controller.ts+│ │ └── contact.service.ts+│ │+│ ├── group/ # Group management+│ │ ├── group.module.ts+│ │ ├── group.controller.ts+│ │ └── group.service.ts+│ │+│ ├── auth/ # Authentication+│ │ ├── auth.module.ts+│ │ ├── auth.guard.ts+│ │ └── api-key.strategy.ts+│ │+│ └── health/ # Health checks+│ ├── health.module.ts+│ └── health.controller.ts+│+├── engine/ # WhatsApp engine wrapper+│ ├── engine.module.ts+│ ├── engine.service.ts+│ ├── engine.factory.ts+│ └── interfaces/+│+├── queue/ # Job queue+│ ├── queue.module.ts+│ ├── processors/+│ └── jobs/+│+└── database/ # Database+ ├── database.module.ts+ ├── migrations/+ └── seeds/+```++## 3.5 Core Components Design++### 3.5.1 Session Manager++```mermaid+classDiagram+ class SessionManager {+ -sessions: Map~string, Session~+ -repository: SessionRepository+ -engineFactory: EngineFactory+ +createSession(config): Session+ +getSession(id): Session+ +deleteSession(id): void+ +getAllSessions(): Session[]+ +restoreSessions(): void+ }++ class Session {+ +id: string+ +name: string+ +status: SessionStatus+ +engine: WhatsAppEngine+ +config: SessionConfig+ +createdAt: Date+ +start(): void+ +stop(): void+ +getQR(): string+ }++ class SessionStatus {+ <<enumeration>>+ CREATED+ INITIALIZING+ QR_READY+ AUTHENTICATED+ READY+ DISCONNECTED+ FAILED+ }++ class WhatsAppEngine {+ <<interface>>+ +initialize(): void+ +sendMessage(chatId, content): MessageResult+ +onMessage(callback): void+ +getContacts(): Contact[]+ +disconnect(): void+ }++ SessionManager --> Session+ Session --> SessionStatus+ Session --> WhatsAppEngine+```++### 3.5.2 Message Flow++```mermaid+flowchart TB+ subgraph Outbound["Outbound Message Flow"]+ A1[API Request] --> V1[Validate]+ V1 --> Q1[Queue Job]+ Q1 --> P1[Process]+ P1 --> E1[Engine Send]+ E1 --> R1[Response]+ end++ subgraph Inbound["Inbound Message Flow"]+ E2[Engine Event] --> P2[Process]+ P2 --> S2[Store]+ S2 --> W2[Webhook Queue]+ W2 --> D2[Deliver]+ end+```++### 3.5.3 Webhook System++```mermaid+classDiagram+ class WebhookManager {+ -webhooks: Webhook[]+ -httpClient: HttpService+ -queue: Queue+ +registerWebhook(config): Webhook+ +removeWebhook(id): void+ +dispatch(event): void+ -deliverWithRetry(webhook, payload): void+ }++ class Webhook {+ +id: string+ +url: string+ +events: EventType[]+ +secret: string+ +active: boolean+ +retryCount: number+ +headers: Record+ }++ class WebhookPayload {+ +event: EventType+ +timestamp: Date+ +sessionId: string+ +data: any+ +signature: string+ }++ class EventType {+ <<enumeration>>+ MESSAGE_RECEIVED+ MESSAGE_SENT+ MESSAGE_ACK+ SESSION_STATUS+ QR_CODE+ }++ WebhookManager --> Webhook+ WebhookManager --> WebhookPayload+ Webhook --> EventType+```++## 3.6 Data Flow Diagrams++### 3.6.1 Send Message Flow++```mermaid+flowchart LR+ subgraph Request["1. Request"]+ A[Client] -->|POST /messages| B[Controller]+ end++ subgraph Validation["2. Validation"]+ B --> C{Valid?}+ C -->|No| D[400 Error]+ C -->|Yes| E[Service]+ end++ subgraph Processing["3. Processing"]+ E --> F[Get Session]+ F --> G{Session Ready?}+ G -->|No| H[400 Error]+ G -->|Yes| I[Queue Job]+ end++ subgraph Execution["4. Execution"]+ I --> J[Worker]+ J --> K[Engine]+ K --> L[WhatsApp]+ end++ subgraph Response["5. Response"]+ L --> M[Success]+ M --> N[Store]+ N --> O[Response]+ end+```++### 3.6.2 Webhook Delivery Flow++```mermaid+flowchart TB+ A[Event Triggered] --> B[Create Payload]+ B --> C[Sign Payload]+ C --> D[Queue Delivery Job]+ D --> E[Worker Process]+ E --> F{Deliver}+ F -->|Success| G[Mark Delivered]+ F -->|Failed| H{Retry < 3?}+ H -->|Yes| I[Delay & Retry]+ I --> E+ H -->|No| J[Mark Failed]+ J --> K[Log Error]+```++## 3.7 Technology Architecture++### 3.7.1 Runtime Environment++```mermaid+flowchart TB+ subgraph Container["Docker Container"]+ subgraph Node["Node.js Runtime"]+ NEST[NestJS Application]+ WW[whatsapp-web.js]+ end++ subgraph Browser["Headless Browser"]+ CHROME[Chromium]+ end++ Node --> Browser+ end++ subgraph External["External Services"]+ PG[(PostgreSQL)]+ RD[(Redis)]+ end++ Container --> External+```++### 3.7.2 Deployment Architecture++```mermaid+flowchart TB+ subgraph Production["Production Environment"]+ LB[Load Balancer] --> I1[Instance 1]+ LB --> I2[Instance 2]+ LB --> I3[Instance N]++ I1 --> DB[(PostgreSQL)]+ I2 --> DB+ I3 --> DB++ I1 --> REDIS[(Redis)]+ I2 --> REDIS+ I3 --> REDIS+ end++ subgraph Storage["Shared Storage"]+ S3[S3/MinIO<br/>Media Files]+ end++ I1 --> S3+ I2 --> S3+ I3 --> S3+```++## 3.8 API Architecture++### RESTful API Design++```mermaid+flowchart LR+ subgraph Endpoints["API Endpoints"]+ direction TB+ S["/api/sessions"]+ M["/api/sessions/:sessionId/messages"]+ W["/api/sessions/:sessionId/webhooks"]+ C["/api/sessions/:sessionId/contacts"]+ G["/api/sessions/:sessionId/groups"]+ H["/health"]+ end++ subgraph Methods["HTTP Methods"]+ GET+ POST+ PUT+ DELETE+ end++ subgraph Format["Response Format"]+ JSON[JSON Response]+ ERR[Error Format]+ PAGE[Pagination]+ end+```++### API Response Structure++```typescript+// Success Response+{+ "success": true,+ "data": { ... },+ "meta": {+ "timestamp": "2025-02-02T10:00:00Z",+ "requestId": "uuid"+ }+}++// Error Response+{+ "success": false,+ "error": {+ "code": "SESSION_NOT_FOUND",+ "message": "Session with id 'xxx' not found",+ "details": { ... }+ },+ "meta": {+ "timestamp": "2025-02-02T10:00:00Z",+ "requestId": "uuid"+ }+}++// Paginated Response+{+ "success": true,+ "data": [ ... ],+ "pagination": {+ "page": 1,+ "limit": 20,+ "total": 100,+ "totalPages": 5+ }+}+```++## 3.9 Security Architecture++```mermaid+flowchart TB+ subgraph External["External Request"]+ R[Request]+ end++ subgraph Security["Security Layers"]+ R --> HTTPS[HTTPS/TLS]+ HTTPS --> CORS[CORS Check]+ CORS --> RATE[Rate Limiter]+ RATE --> AUTH[API Key Auth]+ AUTH --> VAL[Input Validation]+ VAL --> APP[Application]+ end++ subgraph Internal["Internal Security"]+ APP --> ENC[Data Encryption]+ ENC --> LOG[Audit Logging]+ end+```++## 3.10 Error Handling Architecture++```mermaid+flowchart TB+ E[Error Occurs] --> T{Error Type}++ T -->|Validation| V[ValidationException]+ T -->|Not Found| N[NotFoundException]+ T -->|Auth| A[UnauthorizedException]+ T -->|Business| B[BusinessException]+ T -->|System| S[InternalException]++ V --> F[Exception Filter]+ N --> F+ A --> F+ B --> F+ S --> F++ F --> R[Formatted Response]+ F --> L[Log Error]++ L -->|Critical| AL[Alert]+```++## 3.11 Scalability Considerations++### Horizontal Scaling Strategy++```mermaid+flowchart TB+ subgraph Scaling["Scaling Strategy"]+ direction TB++ subgraph Stateless["Stateless Components"]+ API[API Servers]+ WORKER[Queue Workers]+ end++ subgraph Stateful["Stateful Components"]+ SESSION[Session Instances]+ end++ subgraph Shared["Shared State"]+ DB[(Database)]+ REDIS[(Redis)]+ S3[(Object Storage)]+ end+ end++ Stateless --> Shared+ Stateful --> Shared+```++### Session Affinity++```mermaid+flowchart LR+ subgraph Router["Request Router"]+ R[Request] --> H{Has Session ID?}+ H -->|Yes| A[Route to Affinity]+ H -->|No| B[Round Robin]+ end++ A --> I1[Instance 1<br/>Session A, B]+ A --> I2[Instance 2<br/>Session C, D]+ B --> I1+ B --> I2+```++---++## 3.12 Engine Abstraction Layer++> [!IMPORTANT]+> Engine abstraction is critical to mitigate **R001: WhatsApp Protocol Changes** in Risk Management. With an abstraction layer, we can easily switch to an alternative engine (e.g., Baileys) when needed.++### Strategy Pattern for Engine++```mermaid+classDiagram+ class IWhatsAppEngine {+ <<interface>>+ +initialize(config): Promise~void~+ +connect(): Promise~void~+ +disconnect(): Promise~void~+ +getStatus(): EngineStatus+ +sendTextMessage(chatId, text): Promise~MessageResult~+ +sendMediaMessage(chatId, media): Promise~MessageResult~+ +getQRCode(): Promise~string~+ +on(event, handler): void+ +off(event, handler): void+ }++ class WhatsAppWebJSEngine {+ -client: Client+ +initialize(): Promise~void~+ +connect(): Promise~void~+ +sendTextMessage(): Promise~MessageResult~+ }++ class BaileysEngine {+ -socket: WASocket+ +initialize(): Promise~void~+ +connect(): Promise~void~+ +sendTextMessage(): Promise~MessageResult~+ }++ class MockEngine {+ +initialize(): Promise~void~+ +sendTextMessage(): Promise~MessageResult~+ }++ class EngineFactory {+ +create(type: EngineType): IWhatsAppEngine+ }++ IWhatsAppEngine <|.. WhatsAppWebJSEngine+ IWhatsAppEngine <|.. BaileysEngine+ IWhatsAppEngine <|.. MockEngine+ EngineFactory --> IWhatsAppEngine+```++### Engine Interface Definition++```typescript+// engine/interfaces/whatsapp-engine.interface.ts+export interface IWhatsAppEngine {+ // Lifecycle+ initialize(config: EngineConfig): Promise<void>;+ connect(): Promise<void>;+ disconnect(): Promise<void>;+ destroy(): Promise<void>;++ // Status+ getStatus(): EngineStatus;+ isReady(): boolean;++ // Authentication+ getQRCode(): Promise<string | null>;+ getAuthState(): AuthState;++ // Messaging+ sendTextMessage(chatId: string, text: string, options?: SendOptions): Promise<MessageResult>;+ sendMediaMessage(chatId: string, media: MediaInput, options?: SendOptions): Promise<MessageResult>;+ sendLocationMessage(chatId: string, location: LocationInput): Promise<MessageResult>;+ sendContactMessage(chatId: string, contact: ContactInput): Promise<MessageResult>;++ // Contacts+ getContacts(): Promise<Contact[]>;+ getContactById(contactId: string): Promise<Contact | null>;+ getProfilePicture(contactId: string): Promise<string | null>;++ // Groups+ getGroups(): Promise<Group[]>;+ getGroupById(groupId: string): Promise<Group | null>;+ createGroup(name: string, participants: string[]): Promise<Group>;++ // Events+ on<T extends EngineEvent>(event: T, handler: EventHandler<T>): void;+ off<T extends EngineEvent>(event: T, handler: EventHandler<T>): void;+ once<T extends EngineEvent>(event: T, handler: EventHandler<T>): void;+}++export type EngineStatus = 'initializing' | 'qr_ready' | 'connecting' | 'ready' | 'disconnected' | 'error';++export interface EngineConfig {+ sessionId: string;+ authStatePath?: string;+ puppeteerOptions?: PuppeteerOptions;+ proxyUrl?: string;+}++export type EngineEvent =+ | 'qr'+ | 'ready'+ | 'authenticated'+ | 'disconnected'+ | 'message'+ | 'message_ack'+ | 'message_revoke'+ | 'state_changed';+```++### Engine Factory++```typescript+// engine/engine.factory.ts+import { Injectable } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import { IWhatsAppEngine } from './interfaces/whatsapp-engine.interface';+import { WhatsAppWebJSEngine } from './adapters/whatsapp-webjs.engine';+import { BaileysEngine } from './adapters/baileys.engine';+import { MockEngine } from './adapters/mock.engine';++export type EngineType = 'whatsapp-web.js' | 'baileys' | 'mock';++@Injectable()+export class EngineFactory {+ constructor(private config: ConfigService) {}++ create(type?: EngineType): IWhatsAppEngine {+ const engineType = type || this.config.get<EngineType>('engine.type', 'whatsapp-web.js');++ switch (engineType) {+ case 'whatsapp-web.js':+ return new WhatsAppWebJSEngine(this.config);++ case 'baileys':+ return new BaileysEngine(this.config);++ case 'mock':+ return new MockEngine();++ default:+ throw new Error(`Unknown engine type: ${engineType}`);+ }+ }+}+```++### WhatsApp-Web.js Adapter++```typescript+// engine/adapters/whatsapp-webjs.engine.ts+import { Client, LocalAuth } from 'whatsapp-web.js';+import { IWhatsAppEngine, EngineConfig, EngineStatus } from '../interfaces/whatsapp-engine.interface';++export class WhatsAppWebJSEngine implements IWhatsAppEngine {+ private client: Client | null = null;+ private status: EngineStatus = 'initializing';+ private eventEmitter = new EventEmitter();++ async initialize(config: EngineConfig): Promise<void> {+ this.client = new Client({+ authStrategy: new LocalAuth({+ clientId: config.sessionId,+ dataPath: config.authStatePath+ }),+ puppeteer: {+ headless: true,+ args: ['--no-sandbox', '--disable-setuid-sandbox'],+ ...config.puppeteerOptions,+ },+ });++ this.setupEventHandlers();+ }++ private setupEventHandlers(): void {+ this.client!.on('qr', (qr) => {+ this.status = 'qr_ready';+ this.eventEmitter.emit('qr', qr);+ });++ this.client!.on('ready', () => {+ this.status = 'ready';+ this.eventEmitter.emit('ready');+ });++ this.client!.on('disconnected', (reason) => {+ this.status = 'disconnected';+ this.eventEmitter.emit('disconnected', reason);+ });++ this.client!.on('message', (message) => {+ this.eventEmitter.emit('message', this.transformMessage(message));+ });+ }++ async connect(): Promise<void> {+ this.status = 'connecting';+ await this.client!.initialize();+ }++ async disconnect(): Promise<void> {+ await this.client?.logout();+ this.status = 'disconnected';+ }++ async sendTextMessage(chatId: string, text: string): Promise<MessageResult> {+ const message = await this.client!.sendMessage(chatId, text);+ return {+ messageId: message.id._serialized,+ timestamp: new Date(message.timestamp * 1000),+ status: 'sent',+ };+ }++ // ... other method implementations+}+```++### Baileys Adapter (Alternative Engine)++```typescript+// engine/adapters/baileys.engine.ts+import makeWASocket, {+ DisconnectReason,+ useMultiFileAuthState+} from '@whiskeysockets/baileys';+import { IWhatsAppEngine, EngineConfig, EngineStatus } from '../interfaces/whatsapp-engine.interface';++export class BaileysEngine implements IWhatsAppEngine {+ private socket: ReturnType<typeof makeWASocket> | null = null;+ private status: EngineStatus = 'initializing';+ private eventEmitter = new EventEmitter();++ async initialize(config: EngineConfig): Promise<void> {+ const { state, saveCreds } = await useMultiFileAuthState(+ config.authStatePath || `./.baileys_auth/${config.sessionId}`+ );++ this.socket = makeWASocket({+ auth: state,+ printQRInTerminal: false,+ });++ this.socket.ev.on('creds.update', saveCreds);+ this.setupEventHandlers();+ }++ private setupEventHandlers(): void {+ this.socket!.ev.on('connection.update', (update) => {+ const { connection, lastDisconnect, qr } = update;++ if (qr) {+ this.status = 'qr_ready';+ this.eventEmitter.emit('qr', qr);+ }++ if (connection === 'open') {+ this.status = 'ready';+ this.eventEmitter.emit('ready');+ }++ if (connection === 'close') {+ this.status = 'disconnected';+ const shouldReconnect = (lastDisconnect?.error as any)?.output?.statusCode !== DisconnectReason.loggedOut;+ this.eventEmitter.emit('disconnected', { shouldReconnect });+ }+ });++ this.socket!.ev.on('messages.upsert', ({ messages }) => {+ for (const msg of messages) {+ if (!msg.key.fromMe) {+ this.eventEmitter.emit('message', this.transformMessage(msg));+ }+ }+ });+ }++ async connect(): Promise<void> {+ this.status = 'connecting';+ // Baileys connects during initialize+ }++ async sendTextMessage(chatId: string, text: string): Promise<MessageResult> {+ const result = await this.socket!.sendMessage(chatId, { text });+ return {+ messageId: result!.key.id!,+ timestamp: new Date(),+ status: 'sent',+ };+ }++ // ... other method implementations+}+```++### Engine Selection Configuration++```yaml+# .env+ENGINE_TYPE=whatsapp-web.js # Options: whatsapp-web.js, baileys, mock++# For testing+ENGINE_TYPE=mock+```++### Migration Strategy++```mermaid+flowchart TB+ subgraph Current["Current State"]+ A[whatsapp-web.js\nPuppeteer-based]+ end++ subgraph Risk["Risk Detection"]+ B{Protocol\nBreaking?}+ end++ subgraph Migration["Migration Path"]+ C[Update whatsapp-web.js]+ D[Switch to Baileys]+ E[Community Fork]+ end++ subgraph Resolution["Resolution"]+ F[Service Restored]+ end++ A --> B+ B -->|Minor| C --> F+ B -->|Major wwebjs| D --> F+ B -->|Major Both| E --> F+```++### Engine Comparison++| Feature | whatsapp-web.js | Baileys |+|---------|-----------------|---------|+| **Protocol** | Web (Puppeteer) | Native WebSocket |+| **Resource Usage** | High (~500MB/session) | Low (~50MB/session) |+| **Stability** | Good | Good |+| **Community** | Large | Large |+| **Multi-device** | ✅ | ✅ |+| **QR Code** | ✅ | ✅ |+| **Phone Link** | ❌ | ✅ |+| **Maintenance** | Active | Active |++### Benefits of Abstraction++1. **Risk Mitigation** - Swap engines without changing application code+2. **Testing** - Use MockEngine for unit tests+3. **Flexibility** - Run different engines per environment+4. **Future-proof** - Easy to add new engine implementations+5. **A/B Testing** - Compare engine performance in production++---++## 3.13 Pluggable Adapters++OpenWA uses the adapter pattern for infrastructure components that can be swapped per deployment needs. This allows users with limited resources to run OpenWA without heavyweight external dependencies.++### Adapter Overview++```mermaid+flowchart TB+ subgraph Core["OpenWA Core"]+ APP[Application Logic]+ end++ subgraph Adapters["Pluggable Adapters"]+ subgraph Engine["WhatsApp Engine"]+ E1[whatsapp-web.js]+ E2[Baileys]+ E3[Mock]+ end++ subgraph Database["Database"]+ D1[SQLite]+ D2[PostgreSQL]+ end++ subgraph Storage["Media Storage"]+ S1[Local Filesystem]+ S2[S3]+ S3[MinIO]+ end++ subgraph Cache["Cache/Queue"]+ C1[In-Memory]+ C2[Redis]+ end+ end++ APP --> Engine+ APP --> Database+ APP --> Storage+ APP --> Cache+```++### Adapter Options++| Component | Options | Default | Notes |+|-----------|---------|---------|-------|+| **WhatsApp Engine** | whatsapp-web.js, Baileys, Mock | whatsapp-web.js | Mock for testing |+| **Database** | SQLite, PostgreSQL | SQLite | PostgreSQL for large-scale production |+| **Media Storage** | Local, S3, MinIO | Local | S3/MinIO for horizontal scaling |+| **Cache/Queue** | In-Memory, Redis | In-Memory | Redis for multi-instance |++### 3.13.1 Storage Adapter++The media storage abstraction enables storing media files (images, videos, documents) across different backends.++#### Interface Definition++```typescript+// storage/interfaces/storage-adapter.interface.ts+export interface IStorageAdapter {+ /**+ * Upload file to storage+ */+ upload(file: UploadInput): Promise<StorageResult>;++ /**+ * Download file from storage+ */+ download(key: string): Promise<Buffer>;++ /**+ * Delete file from storage+ */+ delete(key: string): Promise<void>;++ /**+ * Get a public/signed URL for a file+ */+ getUrl(key: string, expiresIn?: number): Promise<string>;++ /**+ * Check whether a file exists+ */+ exists(key: string): Promise<boolean>;+}++export interface UploadInput {+ buffer: Buffer;+ filename: string;+ mimetype: string;+ folder?: string;+}++export interface StorageResult {+ key: string;+ url: string;+ size: number;+ mimetype: string;+}+```++#### Local Storage Adapter++```typescript+// storage/adapters/local-storage.adapter.ts+import { Injectable } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import * as fs from 'fs/promises';+import * as path from 'path';+import { IStorageAdapter, UploadInput, StorageResult } from '../interfaces/storage-adapter.interface';++@Injectable()+export class LocalStorageAdapter implements IStorageAdapter {+ private readonly basePath: string;+ private readonly baseUrl: string;++ constructor(private config: ConfigService) {+ this.basePath = config.get('storage.local.path', './media');+ this.baseUrl = config.get('storage.local.baseUrl', '/media');+ }++ async upload(input: UploadInput): Promise<StorageResult> {+ const folder = input.folder || 'uploads';+ const key = `${folder}/${Date.now()}-${input.filename}`;+ const fullPath = path.join(this.basePath, key);++ // Ensure directory exists+ await fs.mkdir(path.dirname(fullPath), { recursive: true });++ // Write file+ await fs.writeFile(fullPath, input.buffer);++ return {+ key,+ url: `${this.baseUrl}/${key}`,+ size: input.buffer.length,+ mimetype: input.mimetype,+ };+ }++ async download(key: string): Promise<Buffer> {+ const fullPath = path.join(this.basePath, key);+ return fs.readFile(fullPath);+ }++ async delete(key: string): Promise<void> {+ const fullPath = path.join(this.basePath, key);+ await fs.unlink(fullPath).catch(() => {}); // Ignore if not exists+ }++ async getUrl(key: string): Promise<string> {+ return `${this.baseUrl}/${key}`;+ }++ async exists(key: string): Promise<boolean> {+ const fullPath = path.join(this.basePath, key);+ try {+ await fs.access(fullPath);+ return true;+ } catch {+ return false;+ }+ }+}+```++#### S3/MinIO Storage Adapter++```typescript+// storage/adapters/s3-storage.adapter.ts+import { Injectable } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import {+ S3Client,+ PutObjectCommand,+ GetObjectCommand,+ DeleteObjectCommand,+ HeadObjectCommand+} from '@aws-sdk/client-s3';+import { getSignedUrl } from '@aws-sdk/s3-request-presigner';+import { IStorageAdapter, UploadInput, StorageResult } from '../interfaces/storage-adapter.interface';++@Injectable()+export class S3StorageAdapter implements IStorageAdapter {+ private readonly client: S3Client;+ private readonly bucket: string;++ constructor(private config: ConfigService) {+ this.bucket = config.get('storage.s3.bucket');++ this.client = new S3Client({+ region: config.get('storage.s3.region', 'us-east-1'),+ endpoint: config.get('storage.s3.endpoint'), // For MinIO+ credentials: {+ accessKeyId: config.get('storage.s3.accessKeyId'),+ secretAccessKey: config.get('storage.s3.secretAccessKey'),+ },+ forcePathStyle: config.get('storage.s3.forcePathStyle', false), // true for MinIO+ });+ }++ async upload(input: UploadInput): Promise<StorageResult> {+ const folder = input.folder || 'uploads';+ const key = `${folder}/${Date.now()}-${input.filename}`;++ await this.client.send(new PutObjectCommand({+ Bucket: this.bucket,+ Key: key,+ Body: input.buffer,+ ContentType: input.mimetype,+ }));++ const url = await this.getUrl(key);++ return {+ key,+ url,+ size: input.buffer.length,+ mimetype: input.mimetype,+ };+ }++ async download(key: string): Promise<Buffer> {+ const response = await this.client.send(new GetObjectCommand({+ Bucket: this.bucket,+ Key: key,+ }));++ return Buffer.from(await response.Body!.transformToByteArray());+ }++ async delete(key: string): Promise<void> {+ await this.client.send(new DeleteObjectCommand({+ Bucket: this.bucket,+ Key: key,+ }));+ }++ async getUrl(key: string, expiresIn = 3600): Promise<string> {+ const command = new GetObjectCommand({+ Bucket: this.bucket,+ Key: key,+ });++ return getSignedUrl(this.client, command, { expiresIn });+ }++ async exists(key: string): Promise<boolean> {+ try {+ await this.client.send(new HeadObjectCommand({+ Bucket: this.bucket,+ Key: key,+ }));+ return true;+ } catch {+ return false;+ }+ }+}+```++#### Storage Factory++```typescript+// storage/storage.factory.ts+import { Injectable } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import { IStorageAdapter } from './interfaces/storage-adapter.interface';+import { LocalStorageAdapter } from './adapters/local-storage.adapter';+import { S3StorageAdapter } from './adapters/s3-storage.adapter';++export type StorageType = 'local' | 's3' | 'minio';++@Injectable()+export class StorageFactory {+ constructor(private config: ConfigService) {}++ create(type?: StorageType): IStorageAdapter {+ const storageType = type || this.config.get<StorageType>('storage.type', 'local');++ switch (storageType) {+ case 'local':+ return new LocalStorageAdapter(this.config);++ case 's3':+ case 'minio':+ return new S3StorageAdapter(this.config);++ default:+ throw new Error(`Unknown storage type: ${storageType}`);+ }+ }+}+```++### 3.13.2 Database Adapter++OpenWA supports SQLite for lightweight deployments and PostgreSQL for high-volume production.++#### Database Comparison++| Feature | SQLite | PostgreSQL |+|---------|--------|------------|+| **Setup** | Zero config | Requires server |+| **Concurrent writes** | Limited (1 writer) | Excellent |+| **Horizontal scaling** | ❌ | ✅ |+| **Table partitioning** | ❌ | ✅ |+| **Memory footprint** | ~10MB | ~100MB+ |+| **Backup** | Copy file | pg_dump |+| **Best for** | 1-5 sessions | 5+ sessions |++#### TypeORM Configuration++```typescript+// config/database.config.ts+import { ConfigService } from '@nestjs/config';+import { TypeOrmModuleOptions } from '@nestjs/typeorm';++export const getDatabaseConfig = (config: ConfigService): TypeOrmModuleOptions => {+ const dbType = config.get<'sqlite' | 'postgres'>('database.type', 'sqlite');++ const baseConfig = {+ entities: [__dirname + '/../**/*.entity{.ts,.js}'],+ migrations: [__dirname + '/../database/migrations/*{.ts,.js}'],+ synchronize: false,+ logging: config.get('database.logging', false),+ };++ if (dbType === 'sqlite') {+ return {+ ...baseConfig,+ type: 'sqlite',+ database: config.get('database.sqlite.path', './data/openwa.db'),+ // SQLite specific optimizations+ extra: {+ // Enable WAL mode for better concurrent reads+ PRAGMA: 'journal_mode = WAL',+ },+ };+ }++ // PostgreSQL+ return {+ ...baseConfig,+ type: 'postgres',+ url: config.get('database.url'),+ ssl: config.get('database.ssl', false)+ ? { rejectUnauthorized: false }+ : false,+ extra: {+ max: config.get('database.pool.max', 20),+ connectionTimeoutMillis: 5000,+ idleTimeoutMillis: 30000,+ },+ };+};+```++#### SQLite Considerations++```typescript+// database/sqlite-optimizations.ts++/**+ * SQLite-specific optimizations and limitations+ */+export const SQLITE_CONFIG = {+ // Recommendations+ maxConcurrentSessions: 5,+ maxMessagesBeforeCleanup: 100000,++ // Auto-cleanup settings (no partitioning available)+ messageRetentionDays: 30,+ logRetentionDays: 7,++ // Write queue to avoid SQLITE_BUSY+ enableWriteQueue: true,+ writeQueueConcurrency: 1,+};++/**+ * Middleware for SQLite write serialization+ */+@Injectable()+export class SqliteWriteQueueService {+ private writeQueue = new PQueue({ concurrency: 1 });++ async executeWrite<T>(operation: () => Promise<T>): Promise<T> {+ return this.writeQueue.add(operation);+ }+}+```++#### Migration Strategy++```typescript+// database/migrations/utils/database-aware-migration.ts++/**+ * Helper for writing migrations compatible with SQLite and PostgreSQL+ */+export abstract class DatabaseAwareMigration {+ protected isPostgres(queryRunner: QueryRunner): boolean {+ return queryRunner.connection.options.type === 'postgres';+ }++ protected isSqlite(queryRunner: QueryRunner): boolean {+ return queryRunner.connection.options.type === 'sqlite';+ }++ /**+ * Generate UUID default based on database type+ */+ protected getUuidDefault(queryRunner: QueryRunner): string {+ if (this.isPostgres(queryRunner)) {+ return 'gen_random_uuid()';+ }+ // SQLite: UUID must be generated at the application level+ return '';+ }++ /**+ * Get timestamp type based on database+ */+ protected getTimestampType(queryRunner: QueryRunner): string {+ if (this.isPostgres(queryRunner)) {+ return 'TIMESTAMP WITH TIME ZONE';+ }+ return 'DATETIME';+ }+}+```++### 3.13.3 Cache Adapter++For minimal deployments, in-memory cache is sufficient. For multi-instance deployments, Redis is required.++```typescript+// cache/cache.factory.ts+import { CacheModuleOptions } from '@nestjs/cache-manager';+import { ConfigService } from '@nestjs/config';+import { redisStore } from 'cache-manager-redis-store';++export const getCacheConfig = async (+ config: ConfigService+): Promise<CacheModuleOptions> => {+ const cacheType = config.get<'memory' | 'redis'>('cache.type', 'memory');++ if (cacheType === 'memory') {+ return {+ ttl: config.get('cache.ttl', 300) * 1000,+ max: config.get('cache.max', 1000),+ };+ }++ // Redis+ return {+ store: await redisStore({+ url: config.get('redis.url'),+ ttl: config.get('cache.ttl', 300),+ }),+ };+};+```++### 3.13.4 Deployment Profiles++OpenWA provides several deployment profiles for different needs:++```mermaid+flowchart LR+ subgraph Minimal["🪶 Minimal Profile"]+ M1[SQLite]+ M2[Local Storage]+ M3[In-Memory Cache]+ M4[Single Session]+ end++ subgraph Standard["⚡ Standard Profile"]+ S1[PostgreSQL]+ S2[Local Storage]+ S3[Redis]+ S4[Multi Session]+ end++ subgraph Enterprise["🏢 Enterprise Profile"]+ E1[PostgreSQL Cluster]+ E2[S3/MinIO]+ E3[Redis Cluster]+ E4[Horizontal Scaling]+ end+```++| Profile | Database | Storage | Cache | Sessions | RAM | Use Case |+|---------|----------|---------|-------|----------|-----|----------|+| **Minimal** | SQLite | Local | In-Memory | 1-3 | 512MB | Personal bot, testing |+| **Standard** | PostgreSQL | Local | Redis | 5-10 | 2GB | Small business |+| **Enterprise** | PostgreSQL | S3/MinIO | Redis | 10+ | 4GB+ | Agency, high volume |++### Configuration Examples++#### Minimal Profile (.env)++```bash+# Database+DATABASE_TYPE=sqlite+DATABASE_SQLITE_PATH=./data/openwa.db++# Storage+STORAGE_TYPE=local+STORAGE_LOCAL_PATH=./media++# Cache (in-memory, no config needed)+CACHE_TYPE=memory++# Session+MAX_SESSIONS=3++# No Redis needed+# REDIS_URL=+```++#### Standard Profile (.env)++```bash+# Database+DATABASE_TYPE=postgres+DATABASE_URL=postgresql://openwa:password@localhost:5432/openwa++# Storage+STORAGE_TYPE=local+STORAGE_LOCAL_PATH=./media++# Cache+CACHE_TYPE=redis+REDIS_URL=redis://localhost:6379++# Session+MAX_SESSIONS=10+```++#### Enterprise Profile (.env)++```bash+# Database+DATABASE_TYPE=postgres+DATABASE_URL=postgresql://openwa:password@db-cluster:5432/openwa+DATABASE_POOL_MAX=50++# Storage+STORAGE_TYPE=s3+STORAGE_S3_BUCKET=openwa-media+STORAGE_S3_REGION=ap-southeast-1+STORAGE_S3_ACCESS_KEY_ID=xxx+STORAGE_S3_SECRET_ACCESS_KEY=xxx+# For MinIO:+# STORAGE_S3_ENDPOINT=http://minio:9000+# STORAGE_S3_FORCE_PATH_STYLE=true++# Cache+CACHE_TYPE=redis+REDIS_URL=redis://redis-cluster:6379++# Session+MAX_SESSIONS=50++# Scaling+ENABLE_CLUSTER_MODE=true+```++### Auto-Detection & Recommendations++```typescript+// config/profile-detector.ts+import { Logger } from '@nestjs/common';++interface SystemResources {+ totalMemoryMB: number;+ availableMemoryMB: number;+ cpuCores: number;+}++export function detectRecommendedProfile(resources: SystemResources): string {+ const logger = new Logger('ProfileDetector');++ if (resources.totalMemoryMB < 1024) {+ logger.warn('Low memory detected. Using minimal profile.');+ logger.warn('Recommendation: SQLite + Local Storage + In-Memory Cache');+ return 'minimal';+ }++ if (resources.totalMemoryMB < 4096) {+ logger.log('Standard resources detected.');+ logger.log('Recommendation: PostgreSQL + Local Storage + Redis');+ return 'standard';+ }++ logger.log('High resources detected.');+ logger.log('Recommendation: PostgreSQL + S3 + Redis with clustering');+ return 'enterprise';+}+```+---++<div align="center">++[← 02 - Requirements Specification](./02-requirements-specification.md) · [Documentation Index](./README.md) · [Next: 04 - Security Design →](./04-security-design.md)++</div>diff --git a/docs/04-security-design.md b/docs/04-security-design.mdnew file mode 100644index 000000000..ff3c24697--- /dev/null+++ b/docs/04-security-design.md@@ -0,0 +1,937 @@+# 04 - Security Design++## 4.1 Security Overview++```mermaid+flowchart TB+ subgraph External["External Threats"]+ A1[Unauthorized Access]+ A2[Data Breach]+ A3[DDoS Attack]+ A4[Injection Attack]+ end++ subgraph Defense["Defense Layers"]+ D1[Authentication]+ D2[Encryption]+ D3[Rate Limiting]+ D4[Input Validation]+ D5[Audit Logging]+ end++ A1 --> D1+ A2 --> D2+ A3 --> D3+ A4 --> D4++ D1 --> APP[Application]+ D2 --> APP+ D3 --> APP+ D4 --> APP+ APP --> D5+```++## 4.2 Authentication++### API Key Authentication Flow++```mermaid+sequenceDiagram+ participant C as Client+ participant G as Auth Guard+ participant S as Service+ participant DB as Database++ C->>G: Request + X-API-Key+ G->>G: Hash API Key+ G->>DB: Find by hash+ alt Key Valid+ DB-->>G: API Key record+ G->>G: Check permissions+ G->>G: Check expiration+ G->>S: Forward request+ S-->>C: Response+ else Key Invalid+ G-->>C: 401 Unauthorized+ end+```++### API Key Format++```+Format: owa_<32-character-random-string>+Example: owa_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6++Storage: SHA-256 hash only (never store plain key)+```++### Permission Model++| Permission | Description |+|------------|-------------|+| `*` | Full access (admin) |+| `sessions:read` | View sessions |+| `sessions:write` | Create/delete sessions |+| `messages:send` | Send messages |+| `messages:read` | Read message history |+| `webhooks:manage` | CRUD webhooks |+| `contacts:read` | View contacts |+| `groups:read` | View groups |+| `groups:write` | Manage groups |++## 4.3 IP Whitelisting++IP whitelisting adds an extra security layer by restricting API key access to specific IP addresses.++### IP Whitelist Flow++```mermaid+flowchart TB+ REQ[Incoming Request] --> AUTH[API Key Valid?]+ AUTH -->|No| R401[401 Unauthorized]+ AUTH -->|Yes| WL{IP Whitelist Enabled?}+ WL -->|No| ALLOW[Allow Request]+ WL -->|Yes| CHECK{IP in Whitelist?}+ CHECK -->|No| R403[403 Forbidden]+ CHECK -->|Yes| ALLOW+ ALLOW --> PROCESS[Process Request]+```++### Configuration++```typescript+// API to manage IP whitelist+interface IpWhitelistEntry {+ id: string;+ apiKeyId: string;+ ipAddress: string; // Single IP: "203.0.113.50"+ cidrRange?: string; // CIDR: "10.0.0.0/24"+ description?: string;+ active: boolean;+ createdAt: Date;+}+```++### API Endpoints++#### Add IP to Whitelist++```http+POST /api/auth/api-keys/:apiKeyId/whitelist+```++**Request Body:**+```json+{+ "ipAddress": "203.0.113.50",+ "description": "Production server"+}+```++**For CIDR Range:**+```json+{+ "ipAddress": "10.0.0.0",+ "cidrRange": "10.0.0.0/24",+ "description": "Internal network"+}+```++#### List Whitelisted IPs++```http+GET /api/auth/api-keys/:apiKeyId/whitelist+```++#### Remove IP from Whitelist++```http+DELETE /api/auth/api-keys/:apiKeyId/whitelist/:entryId+```++### Implementation++```typescript+// IP Whitelist Guard+@Injectable()+export class IpWhitelistGuard implements CanActivate {+ constructor(+ private readonly ipWhitelistService: IpWhitelistService,+ ) {}++ async canActivate(context: ExecutionContext): Promise<boolean> {+ const request = context.switchToHttp().getRequest();+ const apiKeyId = request.apiKey?.id;++ if (!apiKeyId) {+ return true; // Let other guards handle missing API key+ }++ const clientIp = this.getClientIp(request);+ const whitelist = await this.ipWhitelistService.getByApiKey(apiKeyId);++ // If no whitelist entries, allow all IPs+ if (whitelist.length === 0) {+ return true;+ }++ // Check if IP matches any whitelist entry+ const isAllowed = whitelist.some(entry =>+ this.ipMatches(clientIp, entry)+ );++ if (!isAllowed) {+ throw new ForbiddenException({+ code: 'IP_NOT_WHITELISTED',+ message: `IP address ${clientIp} is not in the whitelist`,+ });+ }++ return true;+ }++ private getClientIp(request: Request): string {+ // Handle proxies (X-Forwarded-For, X-Real-IP)+ const forwarded = request.headers['x-forwarded-for'];+ if (forwarded) {+ return (forwarded as string).split(',')[0].trim();+ }+ return request.headers['x-real-ip'] as string ||+ request.socket.remoteAddress ||+ '';+ }++ private ipMatches(clientIp: string, entry: IpWhitelistEntry): boolean {+ if (!entry.active) return false;++ if (entry.cidrRange) {+ return this.ipInCidr(clientIp, entry.cidrRange);+ }++ return clientIp === entry.ipAddress;+ }++ private ipInCidr(ip: string, cidr: string): boolean {+ // IPv4-only example. For IPv6 support, use a library like ipaddr.js.+ const [range, bits] = cidr.split('/');+ const mask = ~(2 ** (32 - parseInt(bits)) - 1);++ const ipNum = this.ipToNumber(ip);+ const rangeNum = this.ipToNumber(range);++ return (ipNum & mask) === (rangeNum & mask);+ }++ private ipToNumber(ip: string): number {+ return ip.split('.').reduce(+ (acc, octet) => (acc << 8) + parseInt(octet), 0+ ) >>> 0;+ }+}+```++### Best Practices++| Practice | Description |+|----------|-------------|+| **Use CIDR notation** | For IP ranges, use CIDR instead of multiple entries |+| **Trusted Proxies** | Configure trusted proxies for accurate client IP |+| **Regular Review** | Review whitelist entries regularly |+| **Audit Logging** | Log all blocked attempts for monitoring |+| **Fallback Plan** | Prepare a process to update the whitelist when IPs change |++### IPv6 Support++For IPv6, use a library that supports IPv6 parsing (e.g., `ipaddr.js`) when performing `ipInCidr`.++## 4.4 Data Encryption++### Encryption Strategy++```mermaid+flowchart LR+ subgraph Transit["In Transit"]+ TLS[TLS 1.3]+ end++ subgraph Rest["At Rest"]+ AES[AES-256-GCM]+ end++ subgraph Sensitive["Sensitive Data"]+ AUTH[Auth State]+ PROXY[Proxy Credentials]+ SECRET[Webhook Secrets]+ end++ Sensitive --> AES+ AES --> DB[(Database)]+ Client --> TLS --> Server+```++### What Gets Encrypted++| Data | Encrypted | Method |+|------|-----------|--------|+| API Keys | Yes | SHA-256 hash |+| Auth State | Yes | AES-256-GCM |+| Webhook Secrets | Yes | AES-256-GCM |+| Proxy Passwords | Yes | AES-256-GCM |+| Message Content | Optional | AES-256-GCM |+| Session Config | No | - |++## 4.5 Input Validation++### Validation Rules++```mermaid+flowchart TB+ INPUT[User Input] --> V1{Type Check}+ V1 -->|Pass| V2{Length Check}+ V1 -->|Fail| ERR[400 Error]+ V2 -->|Pass| V3{Format Check}+ V2 -->|Fail| ERR+ V3 -->|Pass| V4{Sanitize}+ V3 -->|Fail| ERR+ V4 --> SAFE[Safe Input]+```++### Validation Examples++| Field | Rules |+|-------|-------|+| `chatId` | Pattern: `^\d+@(c\.us\|g\.us)$` |+| `phone` | Pattern: `^\d{10,15}$` |+| `url` | Valid URL, HTTPS only for webhooks |+| `text` | Max 65536 chars, sanitized |+| `sessionName` | Alphanumeric + hyphen, 3-50 chars |++### DTO Validation++```typescript+// Example DTO with validation+import { IsString, IsUrl, Matches, MaxLength } from 'class-validator';++export class SendTextDto {+ @IsString()+ @Matches(/^\d+@(c\.us|g\.us)$/, {+ message: 'Invalid chatId format',+ })+ chatId: string;++ @IsString()+ @MaxLength(65536)+ text: string;+}++export class CreateWebhookDto {+ @IsUrl({ protocols: ['https'], require_protocol: true })+ url: string;++ @IsArray()+ @IsIn(['message.received', 'message.sent', 'session.status'], { each: true })+ events: string[];+}+```++## 4.6 Rate Limiting++### Rate Limit Configuration++```mermaid+flowchart LR+ REQ[Request] --> RL{Rate Limiter}+ RL -->|Under Limit| APP[Application]+ RL -->|Over Limit| ERR[429 Too Many Requests]++ subgraph Limits["Limit Tiers"]+ T1[Global: 1000/min]+ T2[Per Key: 100/min]+ T3[Per Endpoint: varies]+ end+```++### Endpoint Limits++| Endpoint Category | Rate Limit | Window |+|-------------------|------------|--------|+| Session Create | 5 | 1 minute |+| Session Read | 60 | 1 minute |+| Message Send | 30 | 1 minute |+| Message Read | 60 | 1 minute |+| Webhook CRUD | 10 | 1 minute |+| Health Check | 120 | 1 minute |++### Response Headers++```http+X-RateLimit-Limit: 30+X-RateLimit-Remaining: 25+X-RateLimit-Reset: 1706868060+Retry-After: 45+```++## 4.7 CORS Configuration++### CORS Settings++```typescript+// Secure CORS configuration+const corsOptions = {+ origin: (origin, callback) => {+ const allowedOrigins = process.env.CORS_ORIGINS?.split(',') || [];++ // Allow requests with no origin (mobile apps, Postman)+ if (!origin) return callback(null, true);++ if (allowedOrigins.includes(origin) || allowedOrigins.includes('*')) {+ callback(null, true);+ } else {+ callback(new Error('Not allowed by CORS'));+ }+ },+ credentials: true,+ methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],+ allowedHeaders: ['Content-Type', 'X-API-Key', 'X-Request-ID'],+ exposedHeaders: ['X-RateLimit-Limit', 'X-RateLimit-Remaining'],+ maxAge: 86400, // 24 hours+};+```++## 4.8 Webhook Security++### Webhook Signature++```mermaid+sequenceDiagram+ participant OW as OpenWA+ participant WH as Webhook Endpoint++ OW->>OW: Create payload+ OW->>OW: Sign with HMAC-SHA256+ OW->>WH: POST + X-OpenWA-Signature+ WH->>WH: Verify signature+ WH->>WH: Process if valid+ WH-->>OW: 200 OK+```++### Signature Verification++```typescript+// OpenWA: Generate signature+function signPayload(payload: object, secret: string): string {+ const hmac = crypto.createHmac('sha256', secret);+ hmac.update(JSON.stringify(payload));+ return 'sha256=' + hmac.digest('hex');+}++// Client: Verify signature+function verifySignature(+ payload: string,+ signature: string,+ secret: string+): boolean {+ const expected = 'sha256=' + crypto+ .createHmac('sha256', secret)+ .update(payload)+ .digest('hex');++ return crypto.timingSafeEqual(+ Buffer.from(signature),+ Buffer.from(expected)+ );+}+```++## 4.9 Security Headers++### Recommended Headers++```typescript+// Helmet configuration+app.use(helmet({+ contentSecurityPolicy: {+ directives: {+ defaultSrc: ["'self'"],+ styleSrc: ["'self'", "'unsafe-inline'"],+ scriptSrc: ["'self'"],+ imgSrc: ["'self'", "data:", "https:"],+ },+ },+ hsts: {+ maxAge: 31536000,+ includeSubDomains: true,+ },+ noSniff: true,+ referrerPolicy: { policy: 'strict-origin-when-cross-origin' },+}));+```++### Security Headers Checklist++| Header | Value | Purpose |+|--------|-------|---------|+| `Strict-Transport-Security` | `max-age=31536000` | Force HTTPS |+| `X-Content-Type-Options` | `nosniff` | Prevent MIME sniffing |+| `X-Frame-Options` | `DENY` | Prevent clickjacking |+| `X-XSS-Protection` | `1; mode=block` | XSS filter |+| `Referrer-Policy` | `strict-origin` | Control referrer |++## 4.10 Audit Logging++### What Gets Logged++```mermaid+flowchart TB+ subgraph Events["Logged Events"]+ AUTH[Authentication attempts]+ SESS[Session operations]+ MSG[Message sends]+ WH[Webhook changes]+ ERR[Security errors]+ end++ Events --> LOG[Audit Log]+ LOG --> STORE[(Storage)]+ LOG --> ALERT[Alerts]+```++### Log Format++```json+{+ "timestamp": "2025-02-02T10:00:00.000Z",+ "level": "info",+ "event": "api.request",+ "requestId": "uuid",+ "apiKeyId": "uuid",+ "ip": "192.168.1.1",+ "method": "POST",+ "path": "/api/sessions/sess_123/messages/send-text",+ "statusCode": 200,+ "responseTime": 150,+ "userAgent": "MyApp/1.0"+}+```++### Security Alerts++| Event | Severity | Action |+|-------|----------|--------|+| Multiple failed auth | High | Alert + temp block |+| Rate limit exceeded | Medium | Log + block |+| Invalid signature | Medium | Log |+| Unusual activity | Low | Log |++## 4.11 Security Checklist++### Development++- [ ] Input validation on all endpoints+- [ ] SQL injection prevention (parameterized queries)+- [ ] XSS prevention (output encoding)+- [ ] CSRF protection (if using cookies)+- [ ] Secure dependencies (npm audit)+- [ ] No secrets in code++### Deployment++- [ ] HTTPS only (TLS 1.2+)+- [ ] Security headers configured+- [ ] Rate limiting enabled+- [ ] CORS properly configured+- [ ] Firewall rules set+- [ ] Regular security updates++### Operations++- [ ] Audit logging enabled+- [ ] Log monitoring setup+- [ ] Backup encryption+- [ ] Incident response plan+- [ ] Regular security audits++---++## 4.12 Secrets Management++### Secrets Inventory++| Secret Type | Storage | Rotation |+|-------------|---------|----------|+| Database credentials | Environment variable | 90 days |+| Redis password | Environment variable | 90 days |+| Encryption key | Environment variable | 365 days |+| API master key | Environment variable | 180 days |+| Webhook secrets | Database (encrypted) | Per webhook |+| Session auth state | File system (default) / Database (optional, encrypted) | Never (tied to WA session) |++### Environment Variables Security++```bash+# ❌ BAD: Secrets in code or docker-compose.yml+DATABASE_URL=postgresql://user:password123@localhost:5432/db++# ✅ GOOD: Use .env file (not committed)+DATABASE_URL=${DATABASE_URL}++# ✅ BETTER: Use Docker secrets or vault+docker secret create db_password ./secret.txt+```++### Docker Secrets++```yaml+# docker-compose.prod.yml+version: '3.8'++services:+ app:+ image: openwa:latest+ secrets:+ - db_password+ - encryption_key+ - api_master_key+ environment:+ - DATABASE_PASSWORD_FILE=/run/secrets/db_password+ - ENCRYPTION_KEY_FILE=/run/secrets/encryption_key++secrets:+ db_password:+ external: true+ encryption_key:+ external: true+ api_master_key:+ external: true+```++### Reading Secrets in Application++```typescript+// config/secrets.ts+import { readFileSync, existsSync } from 'fs';++export function getSecret(name: string): string {+ // Try file-based secret first (Docker secrets)+ const filePath = process.env[`${name}_FILE`];+ if (filePath && existsSync(filePath)) {+ return readFileSync(filePath, 'utf8').trim();+ }++ // Fall back to environment variable+ const envValue = process.env[name];+ if (!envValue) {+ throw new Error(`Secret ${name} not configured`);+ }++ return envValue;+}++// Usage+const encryptionKey = getSecret('ENCRYPTION_KEY');+const dbPassword = getSecret('DATABASE_PASSWORD');+```++### Key Rotation Procedure++```mermaid+flowchart TB+ A[Generate New Key] --> B[Update Secret Store]+ B --> C[Deploy with Both Keys]+ C --> D[Re-encrypt Data with New Key]+ D --> E[Verify All Data Accessible]+ E --> F[Remove Old Key]+ F --> G[Deploy with New Key Only]+```++```typescript+// Key rotation for encrypted data+async function rotateEncryptionKey(+ oldKey: string,+ newKey: string+): Promise<void> {+ // 1. Get all encrypted records+ const sessions = await sessionRepo.find();++ for (const session of sessions) {+ // 2. Decrypt with old key+ const authState = decrypt(session.authState, oldKey);++ // 3. Re-encrypt with new key+ session.authState = encrypt(authState, newKey);++ await sessionRepo.save(session);+ }++ logger.log('Key rotation completed', {+ recordsUpdated: sessions.length+ });+}+```++## 4.13 Dependency Security++### npm Audit Workflow++```bash+# Check for vulnerabilities+npm audit++# Auto-fix non-breaking vulnerabilities+npm audit fix++# View detailed report+npm audit --json > audit-report.json+```++### GitHub Dependabot Configuration++```yaml+# .github/dependabot.yml+version: 2+updates:+ - package-ecosystem: "npm"+ directory: "/"+ schedule:+ interval: "weekly"+ day: "monday"+ open-pull-requests-limit: 10+ groups:+ development-dependencies:+ dependency-type: "development"+ production-dependencies:+ dependency-type: "production"+ ignore:+ # Major version updates require manual review+ - dependency-name: "*"+ update-types: ["version-update:semver-major"]+```++### Security Scanning in CI++```yaml+# .github/workflows/security.yml+name: Security Scan++on:+ push:+ branches: [main, develop]+ schedule:+ - cron: '0 0 * * 1' # Weekly on Monday++jobs:+ audit:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4++ - name: Setup Node.js+ uses: actions/setup-node@v4+ with:+ node-version: '20'++ - name: Install dependencies+ run: npm ci++ - name: Run npm audit+ run: npm audit --audit-level=high++ - name: Run Snyk security scan+ uses: snyk/actions/node@master+ env:+ SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}+ with:+ args: --severity-threshold=high++ - name: SAST with CodeQL+ uses: github/codeql-action/analyze@v2+```++### Allowed/Blocked Packages++```json+// package.json+{+ "overrides": {+ // Force specific version for security fix+ "lodash": "^4.17.21"+ },+ "scripts": {+ "preinstall": "npx npm-force-resolutions"+ }+}+```++### Vulnerability Response Matrix++| Severity | Response Time | Action |+|----------|---------------|--------|+| Critical | 24 hours | Immediate patch or disable |+| High | 72 hours | Patch in next release |+| Medium | 2 weeks | Plan for next sprint |+| Low | 1 month | Backlog item |++## 4.14 Incident Response++### Incident Severity Levels++| Level | Description | Example | Response Time |+|-------|-------------|---------|---------------|+| P1 - Critical | Service down, data breach | Auth bypass, data leak | 15 minutes |+| P2 - High | Major feature broken | Session creation fails | 1 hour |+| P3 - Medium | Partial degradation | Slow webhook delivery | 4 hours |+| P4 - Low | Minor issue | UI glitch | 24 hours |++### Incident Response Flow++```mermaid+flowchart TB+ DETECT[Detect Incident] --> ASSESS[Assess Severity]+ ASSESS --> CONTAIN[Contain Threat]+ CONTAIN --> NOTIFY[Notify Stakeholders]+ NOTIFY --> INVESTIGATE[Investigate Root Cause]+ INVESTIGATE --> REMEDIATE[Remediate]+ REMEDIATE --> RECOVER[Recover Service]+ RECOVER --> POSTMORTEM[Post-mortem]+ POSTMORTEM --> IMPROVE[Implement Improvements]+```++### Security Incident Checklist++```markdown+## Immediate Actions (First 15 Minutes)+- [ ] Confirm incident is real (not false positive)+- [ ] Assess severity level+- [ ] Create incident channel/thread+- [ ] Assign incident commander++## Containment (First Hour)+- [ ] Identify affected systems+- [ ] Isolate compromised components+- [ ] Preserve evidence (logs, snapshots)+- [ ] Block attacker if identified++## Investigation+- [ ] Timeline of events+- [ ] Entry point identification+- [ ] Scope of compromise+- [ ] Data accessed/exfiltrated++## Recovery+- [ ] Patch vulnerability+- [ ] Reset compromised credentials+- [ ] Restore from clean backup if needed+- [ ] Verify system integrity++## Post-Incident+- [ ] Document lessons learned+- [ ] Update security controls+- [ ] Notify affected users if required+- [ ] Schedule blameless post-mortem+```++### Emergency Contacts++```yaml+# config/incident-response.yml+contacts:+ primary_oncall:+ name: "On-Call Engineer"+ phone: "+62xxx"+ slack: "@oncall"++ security_lead:+ name: "Security Lead"+ email: "[email protected]"++ escalation:+ - level: 1+ wait: 15m+ contact: primary_oncall+ - level: 2+ wait: 30m+ contact: security_lead++communication:+ internal_channel: "#incident-response"+ status_page: "https://status.openwa.dev"+```++### Runbooks++```markdown+## Runbook: Suspected Data Breach++### Detection Signals+- Unusual API access patterns+- Large data exports+- Authentication from new locations+- Failed auth attempts spike++### Immediate Steps+1. Rotate all API keys for affected accounts+2. Enable IP whitelisting if not already+3. Check audit logs for scope+4. Snapshot affected database++### Evidence Collection+- Export API access logs: `npm run logs:export --since="2h"`+- Database query logs+- Network traffic captures+- System metrics at incident time+```++### Post-Mortem Template++```markdown+# Incident Post-Mortem: [Title]++**Date:** YYYY-MM-DD+**Severity:** P1/P2/P3+**Duration:** X hours+**Author:** [Name]++## Summary+Brief description of what happened.++## Impact+- Users affected: X+- Data compromised: None/Partial/Full+- Revenue impact: $X++## Timeline+| Time (UTC) | Event |+|------------|-------|+| 10:00 | Alert triggered |+| 10:05 | Incident confirmed |+| 10:15 | Containment started |+| 11:00 | Root cause identified |+| 12:00 | Service restored |++## Root Cause+Technical explanation of what went wrong.++## What Went Well+- Detection was quick+- Communication was clear++## What Went Wrong+- Missing monitoring for X+- Delayed response due to Y++## Action Items+| Item | Owner | Due Date | Status |+|------|-------|----------|--------|+| Add monitoring for X | @eng | 2026-02-15 | Open |+| Update runbook | @security | 2026-02-10 | Open |++## Lessons Learned+Key takeaways for preventing future incidents.+```+---++<div align="center">++[← 03 - System Architecture](./03-system-architecture.md) · [Documentation Index](./README.md) · [Next: 05 - Database Design →](./05-database-design.md)++</div>diff --git a/docs/05-database-design.md b/docs/05-database-design.mdnew file mode 100644index 000000000..e84c23961--- /dev/null+++ b/docs/05-database-design.md@@ -0,0 +1,1028 @@+# 05 - Database Design++## 5.1 Overview++OpenWA uses a database to store:++- Session configuration & state+- Webhook configurations+- Message history (optional)+- API keys & authentication+- Audit logs++### Database Support++OpenWA supports two database backends that can be selected at deployment time:++| Database | Use Case | Sessions | Horizontal Scaling |+| -------------- | ------------------------------------------- | -------- | ------------------ |+| **SQLite** | Development, personal bot, low-resource VPS | 1-5 | ❌ |+| **PostgreSQL** | Production, multi-session, high volume | 5+ | ✅ |++> [!NOTE]+> **SQLite as a Production Option**+>+> SQLite can be used in production with limitations:+>+> - Maximum ~5 concurrent sessions (due to single-writer limitation)+> - No table partitioning support (requires auto-cleanup for messages)+> - No horizontal scaling support+> - Ideal for: personal bots, small businesses with 1-3 WhatsApp numbers+>+> For configuration, see [03 - System Architecture: Pluggable Adapters](./03-system-architecture.md#312-pluggable-adapters)++### Dual-Database Architecture++OpenWA v0.2+ implements a **dual-database architecture** that separates boot configuration from user data:++```+┌─────────────────────────────────────────────────────────────────┐+│ OpenWA Application │+├─────────────────────────────┬───────────────────────────────────┤+│ Main DB (SQLite) │ Data DB (Pluggable) │+│ Always ./data/main.db │ SQLite or PostgreSQL (config) │+├─────────────────────────────┼───────────────────────────────────┤+│ • api_keys │ • sessions │+│ • audit_logs │ • webhooks │+│ │ • messages │+│ │ • message_batches │+│ │ • contacts │+└─────────────────────────────┴───────────────────────────────────┘+```++| Component | Database | Location | Purpose |+| ----------- | -------------------- | -------------------- | ------------------------------------------ |+| **Main DB** | SQLite (always) | `./data/main.sqlite` | Boot-critical config, API keys, audit logs |+| **Data DB** | SQLite or PostgreSQL | Configurable | User data, sessions, messages, webhooks |++> [!IMPORTANT]+> **Why Dual-Database?**+>+> The Main DB is always SQLite to ensure the application can bootstrap without external dependencies:+>+> - API keys needed for authentication before any external DB connection+> - Audit logs must persist even if Data DB fails+> - Enables switching Data DB type without losing authentication++#### Pre-Bootstrap PostgreSQL Orchestration++When using PostgreSQL Built-in mode, OpenWA automatically:++1. Starts PostgreSQL container **before** NestJS bootstrap+2. Waits for health check (max 60 seconds)+3. Proceeds with application initialization++```typescript+// main.ts - Pre-bootstrap flow+if (process.env.POSTGRES_BUILTIN === 'true') {+ await preBootstrapPostgres(); // Start & wait for healthy+}+const app = await NestFactory.create(AppModule); // Then bootstrap+```++#### Data Migration API++OpenWA provides endpoints for migrating data between database types:++| Endpoint | Method | Description |+| ------------------------ | ------ | ------------------------------------ |+| `/api/infra/export-data` | GET | Export all Data DB tables as JSON |+| `/api/infra/import-data` | POST | Import JSON data (replaces existing) |++**Migration Workflow:**++```bash+# 1. Export from current database+curl -s 'http://localhost:2785/api/infra/export-data' \+ -H 'X-API-Key: YOUR_KEY' > backup.json++# 2. Change database configuration (SQLite → PostgreSQL or vice versa)++# 3. Restart application with new config++# 4. Import to new database+curl -X POST 'http://localhost:2785/api/infra/import-data' \+ -H 'X-API-Key: YOUR_KEY' \+ -H 'Content-Type: application/json' \+ -d @backup.json+```++#### Cross-Database Date Portability++To ensure date/time values work across both SQLite and PostgreSQL, OpenWA uses a `DateTransformer` that stores dates as ISO 8601 text strings:++```typescript+// src/common/transformers/date.transformer.ts+export const DateTransformer: ValueTransformer = {+ from: (value: string | null) => value ? new Date(value) : null,+ to: (value: Date | null) => value ? value.toISOString() : null,+};++// Usage in entities (Data DB only)+@Column({ type: 'text', nullable: true, transformer: DateTransformer })+connectedAt: Date | null;+```++> [!NOTE]+> Main DB entities (api_keys, audit_logs) use native SQLite `datetime` type since they always remain in SQLite.++## 5.2 Entity Relationship Diagram++```mermaid+erDiagram+ SESSION ||--o{ WEBHOOK : has+ SESSION ||--o{ MESSAGE : contains+ SESSION ||--o{ CONTACT : stores+ SESSION ||--o{ SESSION_LOG : generates+ API_KEY ||--o{ SESSION : manages+ API_KEY ||--o{ API_KEY_LOG : generates+ WEBHOOK ||--o{ WEBHOOK_LOG : generates++ SESSION {+ uuid id PK+ varchar name UK+ varchar status+ varchar phone+ varchar push_name+ json config+ json auth_state+ timestamp connected_at+ timestamp created_at+ timestamp updated_at+ }++ WEBHOOK {+ uuid id PK+ uuid session_id FK+ varchar url+ json events+ varchar secret+ json headers+ boolean active+ int retry_count+ timestamp last_triggered_at+ timestamp created_at+ timestamp updated_at+ }++ MESSAGE {+ uuid id PK+ uuid session_id FK+ varchar wa_message_id UK+ varchar chat_id+ varchar from_number+ varchar to_number+ varchar type+ text body+ json media+ int ack+ boolean from_me+ boolean is_group+ timestamp wa_timestamp+ timestamp created_at+ }++ CONTACT {+ uuid id PK+ uuid session_id FK+ varchar wa_contact_id UK+ varchar name+ varchar push_name+ varchar phone+ boolean is_my_contact+ boolean is_blocked+ varchar profile_pic_url+ timestamp created_at+ timestamp updated_at+ }++ API_KEY {+ uuid id PK+ varchar key_hash UK+ varchar name+ json permissions+ boolean active+ timestamp expires_at+ timestamp last_used_at+ timestamp created_at+ }++ SESSION_LOG {+ uuid id PK+ uuid session_id FK+ varchar event+ varchar status+ json data+ timestamp created_at+ }++ WEBHOOK_LOG {+ uuid id PK+ uuid webhook_id FK+ varchar event+ int status_code+ int attempt+ json payload+ json response+ text error+ timestamp created_at+ }++ API_KEY_LOG {+ uuid id PK+ uuid api_key_id FK+ varchar endpoint+ varchar method+ varchar ip_address+ text user_agent+ int status_code+ int response_time+ timestamp created_at+ }+```++## 5.3 Table Specifications++### 5.3.1 sessions++Stores WhatsApp session configuration and state.++```sql+CREATE TABLE sessions (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ name VARCHAR(100) NOT NULL UNIQUE,+ status VARCHAR(50) NOT NULL DEFAULT 'created',+ phone VARCHAR(20),+ push_name VARCHAR(100),+ config JSONB NOT NULL DEFAULT '{}',+ auth_state JSONB,+ connected_at TIMESTAMP WITH TIME ZONE,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),+ updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()+);++-- Indexes+CREATE INDEX idx_sessions_status ON sessions(status);+CREATE INDEX idx_sessions_phone ON sessions(phone);+CREATE INDEX idx_sessions_created_at ON sessions(created_at);+```++> [!NOTE]+> `auth_state` is optional and engine-specific. By default, `whatsapp-web.js` stores auth state on the filesystem, while Baileys can store an encrypted blob in the database when enabled. This column can store the blob or an encrypted pointer/path.++**Session Status Values:**++```mermaid+stateDiagram-v2+ [*] --> created: POST /sessions+ created --> initializing: start()+ initializing --> qr_ready: QR generated+ qr_ready --> authenticating: QR scanned+ authenticating --> ready: Auth success+ authenticating --> failed: Auth failed+ ready --> disconnected: Connection lost+ disconnected --> initializing: reconnect()+ ready --> [*]: DELETE+ failed --> [*]: DELETE+```++| Status | Description |+| ---------------- | ---------------------------- |+| `created` | Session created, not started |+| `initializing` | Starting browser & WhatsApp |+| `qr_ready` | QR code ready for scanning |+| `authenticating` | QR scanned, authenticating |+| `ready` | Connected and ready |+| `disconnected` | Disconnected, can reconnect |+| `failed` | Failed, needs recreation |++**Config Schema:**++```json+{+ "autoReconnect": true,+ "maxReconnectAttempts": 5,+ "puppeteer": {+ "headless": true,+ "args": ["--no-sandbox"]+ },+ "proxy": {+ "host": "proxy.example.com",+ "port": 8080,+ "username": "user",+ "password": "pass"+ }+}+```++---++### 5.3.2 webhooks++Stores webhook endpoint configurations.++```sql+CREATE TABLE webhooks (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,+ url VARCHAR(2048) NOT NULL,+ events JSONB NOT NULL DEFAULT '["message.received"]',+ secret VARCHAR(255),+ headers JSONB DEFAULT '{}',+ active BOOLEAN NOT NULL DEFAULT true,+ retry_count INTEGER NOT NULL DEFAULT 3,+ last_triggered_at TIMESTAMP WITH TIME ZONE,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),+ updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()+);++-- Indexes+CREATE INDEX idx_webhooks_session_id ON webhooks(session_id);+CREATE INDEX idx_webhooks_active ON webhooks(active);+```++**Events Schema (allowed values):**++```json+[+ "message.received",+ "message.sent",+ "message.ack",+ "message.revoked",+ "session.status",+ "session.qr",+ "session.authenticated",+ "session.disconnected",+ "group.join",+ "group.leave",+ "group.update"+]+```++---++### 5.3.3 messages++Stores message history (optional, can be disabled).++```sql+-- Main table with partitioning support (PostgreSQL 12+)+CREATE TABLE messages (+ id UUID NOT NULL DEFAULT gen_random_uuid(),+ session_id UUID NOT NULL,+ wa_message_id VARCHAR(100) NOT NULL,+ chat_id VARCHAR(100) NOT NULL,+ from_number VARCHAR(50) NOT NULL,+ to_number VARCHAR(50),+ type VARCHAR(50) NOT NULL,+ body TEXT,+ media JSONB,+ ack INTEGER DEFAULT 0,+ from_me BOOLEAN NOT NULL DEFAULT false,+ is_group BOOLEAN NOT NULL DEFAULT false,+ wa_timestamp TIMESTAMP WITH TIME ZONE NOT NULL,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),++ PRIMARY KEY (id, created_at),+ UNIQUE(session_id, wa_message_id, created_at)+) PARTITION BY RANGE (created_at);++> [!NOTE]+> In PostgreSQL, UNIQUE on a partitioned table must include the partition key (`created_at`), so uniqueness applies per partition. If you need global uniqueness for `wa_message_id`, use a separate reference table or store messages in a non-partitioned table.++-- Create partitions for each month (automated via pg_cron or application)+CREATE TABLE messages_y2025m01 PARTITION OF messages+ FOR VALUES FROM ('2025-01-01') TO ('2025-02-01');+CREATE TABLE messages_y2025m02 PARTITION OF messages+ FOR VALUES FROM ('2025-02-01') TO ('2025-03-01');+CREATE TABLE messages_y2025m03 PARTITION OF messages+ FOR VALUES FROM ('2025-03-01') TO ('2025-04-01');+-- Continue for other months...++-- Default partition for future data+CREATE TABLE messages_default PARTITION OF messages DEFAULT;++-- Indexes (created on each partition automatically)+CREATE INDEX idx_messages_session_id ON messages(session_id);+CREATE INDEX idx_messages_chat_id ON messages(chat_id);+CREATE INDEX idx_messages_wa_timestamp ON messages(wa_timestamp);+CREATE INDEX idx_messages_session_chat ON messages(session_id, chat_id);+CREATE INDEX idx_messages_type ON messages(type);+CREATE INDEX idx_messages_from_me ON messages(from_me) WHERE from_me = true;++-- Function to auto-create partitions+CREATE OR REPLACE FUNCTION create_messages_partition()+RETURNS void AS $$+DECLARE+ partition_date DATE;+ partition_name TEXT;+ start_date DATE;+ end_date DATE;+BEGIN+ -- Create partition for next month+ partition_date := DATE_TRUNC('month', NOW() + INTERVAL '1 month');+ partition_name := 'messages_y' || TO_CHAR(partition_date, 'YYYY') || 'm' || TO_CHAR(partition_date, 'MM');+ start_date := partition_date;+ end_date := partition_date + INTERVAL '1 month';++ -- Check if partition exists+ IF NOT EXISTS (+ SELECT 1 FROM pg_tables WHERE tablename = partition_name+ ) THEN+ EXECUTE format(+ 'CREATE TABLE %I PARTITION OF messages FOR VALUES FROM (%L) TO (%L)',+ partition_name, start_date, end_date+ );+ RAISE NOTICE 'Created partition: %', partition_name;+ END IF;+END;+$$ LANGUAGE plpgsql;++-- Schedule with pg_cron (run on 25th of each month)+-- SELECT cron.schedule('create-messages-partition', '0 0 25 * *', 'SELECT create_messages_partition()');+```++**Non-Partitioned Version (for SQLite or simpler installations):**++```sql+CREATE TABLE messages (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,+ wa_message_id VARCHAR(100) NOT NULL,+ chat_id VARCHAR(100) NOT NULL,+ from_number VARCHAR(50) NOT NULL,+ to_number VARCHAR(50),+ type VARCHAR(50) NOT NULL,+ body TEXT,+ media JSONB,+ ack INTEGER DEFAULT 0,+ from_me BOOLEAN NOT NULL DEFAULT false,+ is_group BOOLEAN NOT NULL DEFAULT false,+ wa_timestamp TIMESTAMP WITH TIME ZONE NOT NULL,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),++ UNIQUE(session_id, wa_message_id)+);++CREATE INDEX idx_messages_session_id ON messages(session_id);+CREATE INDEX idx_messages_chat_id ON messages(chat_id);+CREATE INDEX idx_messages_wa_timestamp ON messages(wa_timestamp);+CREATE INDEX idx_messages_created_at ON messages(created_at);+```++**Media Schema:**++```json+{+ "mimetype": "image/jpeg",+ "filename": "image.jpg",+ "filesize": 102400,+ "url": "https://storage.example.com/...",+ "caption": "Check this out!"+}+```++---++### 5.3.4 contacts++WhatsApp contacts cache.++```sql+CREATE TABLE contacts (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,+ wa_contact_id VARCHAR(100) NOT NULL,+ name VARCHAR(255),+ push_name VARCHAR(255),+ phone VARCHAR(20),+ is_my_contact BOOLEAN NOT NULL DEFAULT false,+ is_blocked BOOLEAN NOT NULL DEFAULT false,+ profile_pic_url TEXT,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),+ updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),++ UNIQUE(session_id, wa_contact_id)+);++-- Indexes+CREATE INDEX idx_contacts_session_id ON contacts(session_id);+CREATE INDEX idx_contacts_phone ON contacts(phone);+```++---++### 5.3.5 api_keys++Stores API keys for authentication.++```sql+CREATE TABLE api_keys (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ key_hash VARCHAR(64) NOT NULL UNIQUE,+ name VARCHAR(100) NOT NULL,+ permissions JSONB NOT NULL DEFAULT '["*"]',+ active BOOLEAN NOT NULL DEFAULT true,+ expires_at TIMESTAMP WITH TIME ZONE,+ last_used_at TIMESTAMP WITH TIME ZONE,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()+);++-- Indexes+CREATE INDEX idx_api_keys_key_hash ON api_keys(key_hash);+CREATE INDEX idx_api_keys_active ON api_keys(active);+```++**Permissions Schema:**++```json+["sessions:read", "sessions:write", "messages:send", "webhooks:manage"]+```++| Permission | Description |+| ----------------- | ---------------------- |+| `*` | Full access |+| `sessions:read` | Read session info |+| `sessions:write` | Create/delete sessions |+| `messages:send` | Send messages |+| `messages:read` | Read message history |+| `webhooks:manage` | Manage webhooks |+| `contacts:read` | Read contacts |+| `groups:read` | Read groups |+| `groups:write` | Manage groups |++---++### 5.3.6 session_logs++Audit log for session events.++```sql+CREATE TABLE session_logs (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,+ event VARCHAR(100) NOT NULL,+ status VARCHAR(50),+ data JSONB,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()+);++-- Indexes+CREATE INDEX idx_session_logs_session_id ON session_logs(session_id);+CREATE INDEX idx_session_logs_event ON session_logs(event);+CREATE INDEX idx_session_logs_created_at ON session_logs(created_at);++-- Auto-cleanup old logs (PostgreSQL)+-- Consider pg_cron or application-level cleanup+```++---++### 5.3.7 webhook_logs++Log delivery webhook.++```sql+CREATE TABLE webhook_logs (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ webhook_id UUID NOT NULL REFERENCES webhooks(id) ON DELETE CASCADE,+ event VARCHAR(100) NOT NULL,+ status_code INTEGER,+ attempt INTEGER NOT NULL DEFAULT 1,+ payload JSONB NOT NULL,+ response JSONB,+ error TEXT,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()+);++-- Indexes+CREATE INDEX idx_webhook_logs_webhook_id ON webhook_logs(webhook_id);+CREATE INDEX idx_webhook_logs_created_at ON webhook_logs(created_at);+CREATE INDEX idx_webhook_logs_status_code ON webhook_logs(status_code);+```++---++### 5.3.8 api_key_logs++Audit log for API access.++```sql+CREATE TABLE api_key_logs (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ api_key_id UUID REFERENCES api_keys(id) ON DELETE SET NULL,+ endpoint VARCHAR(255) NOT NULL,+ method VARCHAR(10) NOT NULL,+ ip_address VARCHAR(45),+ user_agent TEXT,+ status_code INTEGER NOT NULL,+ response_time INTEGER,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()+);++-- Indexes+CREATE INDEX idx_api_key_logs_api_key_id ON api_key_logs(api_key_id);+CREATE INDEX idx_api_key_logs_created_at ON api_key_logs(created_at);+CREATE INDEX idx_api_key_logs_endpoint ON api_key_logs(endpoint);+```++### 5.3.9 batch_jobs++Stores status for batch/bulk message jobs.++```sql+CREATE TABLE batch_jobs (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ batch_id VARCHAR(100) NOT NULL UNIQUE,+ session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,+ status VARCHAR(50) NOT NULL DEFAULT 'pending',+ total_messages INTEGER NOT NULL,+ sent_count INTEGER NOT NULL DEFAULT 0,+ failed_count INTEGER NOT NULL DEFAULT 0,+ cancelled_count INTEGER NOT NULL DEFAULT 0,+ options JSONB NOT NULL DEFAULT '{}',+ error TEXT,+ started_at TIMESTAMP WITH TIME ZONE,+ completed_at TIMESTAMP WITH TIME ZONE,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),+ updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()+);++-- Indexes+CREATE INDEX idx_batch_jobs_session_id ON batch_jobs(session_id);+CREATE INDEX idx_batch_jobs_status ON batch_jobs(status);+CREATE INDEX idx_batch_jobs_created_at ON batch_jobs(created_at);+```++**Batch Job Status Values:**++| Status | Description |+| ------------ | ------------------------------ |+| `pending` | Job created, not yet processed |+| `processing` | Sending messages in progress |+| `completed` | All messages processed |+| `cancelled` | Job cancelled by user |+| `failed` | Job failed (fatal error) |++---++### 5.3.10 batch_job_messages++Details of each message in a batch job.++```sql+CREATE TABLE batch_job_messages (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ batch_job_id UUID NOT NULL REFERENCES batch_jobs(id) ON DELETE CASCADE,+ chat_id VARCHAR(100) NOT NULL,+ message_type VARCHAR(50) NOT NULL,+ content JSONB NOT NULL,+ variables JSONB,+ status VARCHAR(50) NOT NULL DEFAULT 'pending',+ wa_message_id VARCHAR(100),+ error_code VARCHAR(100),+ error_message TEXT,+ sent_at TIMESTAMP WITH TIME ZONE,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()+);++-- Indexes+CREATE INDEX idx_batch_job_messages_batch_job_id ON batch_job_messages(batch_job_id);+CREATE INDEX idx_batch_job_messages_status ON batch_job_messages(status);+```++---++### 5.3.11 webhook_idempotency++Idempotency tracking for webhook delivery.++```sql+CREATE TABLE webhook_idempotency (+ idempotency_key VARCHAR(255) PRIMARY KEY,+ webhook_id UUID REFERENCES webhooks(id) ON DELETE CASCADE,+ event_type VARCHAR(100) NOT NULL,+ processed_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),+ response_status INTEGER,+ response_data JSONB+);++-- Index for cleanup job+CREATE INDEX idx_webhook_idempotency_processed_at ON webhook_idempotency(processed_at);++-- Auto-cleanup old entries (24 hours retention)+-- Run via pg_cron or application-level scheduler+-- DELETE FROM webhook_idempotency WHERE processed_at < NOW() - INTERVAL '24 hours';+```++---++### 5.3.12 ip_whitelist++IP whitelist for API key restrictions.++```sql+CREATE TABLE ip_whitelist (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ api_key_id UUID NOT NULL REFERENCES api_keys(id) ON DELETE CASCADE,+ ip_address VARCHAR(45) NOT NULL,+ cidr_range VARCHAR(50),+ description VARCHAR(255),+ active BOOLEAN NOT NULL DEFAULT true,+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),++ UNIQUE(api_key_id, ip_address)+);++-- Indexes+CREATE INDEX idx_ip_whitelist_api_key_id ON ip_whitelist(api_key_id);+CREATE INDEX idx_ip_whitelist_ip_address ON ip_whitelist(ip_address);+```++**IP Whitelist Examples:**++```sql+-- Allow specific IP+INSERT INTO ip_whitelist (api_key_id, ip_address, description)+VALUES ('uuid', '203.0.113.50', 'Production server');++-- Allow CIDR range+INSERT INTO ip_whitelist (api_key_id, ip_address, cidr_range, description)+VALUES ('uuid', '10.0.0.0', '10.0.0.0/24', 'Internal network');+```++---++## 5.4 Index Strategy++### Query Pattern Analysis++| Query Pattern | Indexes Used | Frequency |+| ------------------------------- | ------------------------------------------------------------- | --------- |+| Get session by ID | `sessions.id` (PK) | Very High |+| Get sessions by status | `idx_sessions_status` | High |+| Get messages by session + chat | `idx_messages_session_chat` | Very High |+| Get messages by timestamp range | `idx_messages_wa_timestamp` + partition pruning | High |+| Get webhooks by session | `idx_webhooks_session_id` | Medium |+| Authenticate API key | `idx_api_keys_key_hash` | Very High |+| Check IP whitelist | `idx_ip_whitelist_api_key_id` + `idx_ip_whitelist_ip_address` | High |++### Composite Index Guidelines++```sql+-- For frequently joined queries+CREATE INDEX idx_messages_session_chat_timestamp+ ON messages(session_id, chat_id, wa_timestamp DESC);++-- For filtering + sorting+CREATE INDEX idx_session_logs_session_event_created+ ON session_logs(session_id, event, created_at DESC);++-- Partial indexes for common filters+CREATE INDEX idx_sessions_ready+ ON sessions(id) WHERE status = 'ready';++CREATE INDEX idx_webhooks_active+ ON webhooks(session_id) WHERE active = true;++CREATE INDEX idx_api_keys_active_not_expired+ ON api_keys(key_hash) WHERE active = true AND (expires_at IS NULL OR expires_at > NOW());+```++### Index Maintenance++```sql+-- Check index usage+SELECT+ schemaname,+ tablename,+ indexname,+ idx_scan,+ idx_tup_read,+ idx_tup_fetch+FROM pg_stat_user_indexes+ORDER BY idx_scan DESC;++-- Find unused indexes+SELECT+ schemaname || '.' || relname AS table,+ indexrelname AS index,+ pg_size_pretty(pg_relation_size(i.indexrelid)) AS index_size,+ idx_scan as index_scans+FROM pg_stat_user_indexes ui+JOIN pg_index i ON ui.indexrelid = i.indexrelid+WHERE NOT indisunique+AND idx_scan < 50+ORDER BY pg_relation_size(i.indexrelid) DESC;++-- Reindex to reclaim space (run during maintenance window)+REINDEX TABLE messages;+REINDEX TABLE webhook_logs;+```++## 5.5 Data Flow++### Message Storage Flow++```mermaid+flowchart TB+ subgraph Inbound["Inbound Message"]+ E[Engine Event] --> P[Process]+ P --> S{Store Enabled?}+ S -->|Yes| DB[(Database)]+ S -->|No| W[Webhook Only]+ DB --> W+ end++ subgraph Outbound["Outbound Message"]+ A[API Request] --> V[Validate]+ V --> Q[Queue]+ Q --> EN[Engine Send]+ EN --> SR{Store Enabled?}+ SR -->|Yes| DBO[(Database)]+ SR -->|No| R[Response]+ DBO --> R+ end+```++### Session State Flow++```mermaid+flowchart LR+ subgraph Memory["In-Memory State"]+ WA[WhatsApp Client]+ QR[QR Code]+ CONN[Connection Status]+ end++ subgraph Persistent["Database State"]+ CONFIG[Session Config]+ AUTH[Auth State]+ LOGS[Session Logs]+ end++ Memory -->|Sync| Persistent+ Persistent -->|Restore| Memory+```++## 5.5 Migration Strategy++### Migration Files Structure++```+src/database/migrations/+├── 1706868000000-CreateSessionsTable.ts+├── 1706868000001-CreateWebhooksTable.ts+├── 1706868000002-CreateMessagesTable.ts+├── 1706868000003-CreateContactsTable.ts+├── 1706868000004-CreateApiKeysTable.ts+├── 1706868000005-CreateSessionLogsTable.ts+├── 1706868000006-CreateWebhookLogsTable.ts+└── 1706868000007-CreateApiKeyLogsTable.ts+```++### Sample Migration (TypeORM)++```typescript+import { MigrationInterface, QueryRunner, Table } from 'typeorm';++export class CreateSessionsTable1706868000000 implements MigrationInterface {+ public async up(queryRunner: QueryRunner): Promise<void> {+ await queryRunner.createTable(+ new Table({+ name: 'sessions',+ columns: [+ {+ name: 'id',+ type: 'uuid',+ isPrimary: true,+ generationStrategy: 'uuid',+ default: 'gen_random_uuid()',+ },+ {+ name: 'name',+ type: 'varchar',+ length: '100',+ isUnique: true,+ },+ {+ name: 'status',+ type: 'varchar',+ length: '50',+ default: "'created'",+ },+ // ... more columns+ {+ name: 'created_at',+ type: 'timestamp with time zone',+ default: 'NOW()',+ },+ {+ name: 'updated_at',+ type: 'timestamp with time zone',+ default: 'NOW()',+ },+ ],+ }),+ true,+ );++ await queryRunner.createIndex(+ 'sessions',+ new TableIndex({+ name: 'idx_sessions_status',+ columnNames: ['status'],+ }),+ );+ }++ public async down(queryRunner: QueryRunner): Promise<void> {+ await queryRunner.dropTable('sessions');+ }+}+```++## 5.6 Data Retention++### Retention Policies++| Data Type | Default Retention | Configurable |+| ------------ | ----------------- | ------------ |+| Sessions | Indefinite | No |+| Messages | 30 days | Yes |+| Session Logs | 7 days | Yes |+| Webhook Logs | 7 days | Yes |+| API Key Logs | 30 days | Yes |++### Cleanup Job++```typescript+// Scheduled job to clean up old data+@Cron('0 0 * * *') // Daily at midnight+async cleanupOldData() {+ const messageRetention = config.get('retention.messages', 30);+ const logsRetention = config.get('retention.logs', 7);++ await this.messageRepo.delete({+ createdAt: LessThan(subDays(new Date(), messageRetention)),+ });++ await this.sessionLogRepo.delete({+ createdAt: LessThan(subDays(new Date(), logsRetention)),+ });++ // ... more cleanup+}+```++## 5.7 Backup Strategy++### Backup Components++```mermaid+flowchart TB+ subgraph Backup["Backup Strategy"]+ DB[(Database)] --> DUMP[pg_dump]+ DUMP --> COMPRESS[Compress]+ COMPRESS --> ENCRYPT[Encrypt]+ ENCRYPT --> S3[S3/Cloud Storage]+ end++ subgraph Schedule["Schedule"]+ FULL[Full Backup<br/>Daily]+ INCR[Incremental<br/>Hourly]+ end++ Schedule --> Backup+```++### Backup Script Example++```bash+#!/bin/bash+# backup.sh++DATE=$(date +%Y%m%d_%H%M%S)+BACKUP_DIR="/backups"+DB_NAME="openwa"++# Create backup+pg_dump -Fc $DB_NAME > $BACKUP_DIR/openwa_$DATE.dump++# Compress+gzip $BACKUP_DIR/openwa_$DATE.dump++# Upload to S3 (optional)+aws s3 cp $BACKUP_DIR/openwa_$DATE.dump.gz s3://backups/openwa/++# Cleanup old backups (keep last 7 days)+find $BACKUP_DIR -name "*.dump.gz" -mtime +7 -delete+```++---++<div align="center">++[← 04 - Security Design](./04-security-design.md) · [Documentation Index](./README.md) · [Next: 06 - API Specification →](./06-api-specification.md)++</div>diff --git a/docs/06-api-specification.md b/docs/06-api-specification.mdnew file mode 100644index 000000000..65bb00227--- /dev/null+++ b/docs/06-api-specification.md@@ -0,0 +1,1730 @@+# 06 - API Specification++## 6.1 API Overview++### Base URL+```+Production: https://your-domain.com/api+Development: http://localhost:2785/api+```++### Authentication+```http+# API Key in Header+X-API-Key: your-api-key-here++# Or in Query Parameter (not recommended)+GET /api/sessions?apiKey=your-api-key-here+```++### Common Headers+```http+Content-Type: application/json+Accept: application/json+X-API-Key: your-api-key+X-Request-ID: optional-tracking-id (recommended)+```++## 6.2 Response Format++### Success Response++```json+{+ "success": true,+ "data": {},+ "meta": {+ "timestamp": "2025-02-02T10:00:00.000Z",+ "requestId": "550e8400-e29b-41d4-a716-446655440000",+ "version": "0.1.0"+ }+}+```++### Error Response++```json+{+ "success": false,+ "error": {+ "code": "ERROR_CODE",+ "message": "Human readable message",+ "details": {}+ },+ "meta": {+ "timestamp": "2025-02-02T10:00:00.000Z",+ "requestId": "550e8400-e29b-41d4-a716-446655440000"+ }+}+```++### Request ID Convention++- Recommended format: `req_<epoch_ms>` (example: `req_1706868000000`).+- `X-Request-ID` is returned in `meta.requestId` when provided by the client.++### Timestamp Conventions++- All API timestamps use ISO 8601 UTC (example: `2026-02-02T10:00:00.000Z`).+- If you need the original WhatsApp timestamp (epoch seconds), the field is named `waTimestamp`.++### Error Codes++#### General Error Codes++| Code | HTTP Status | Description |+|------|-------------|-------------|+| `VALIDATION_ERROR` | 400 | Invalid request parameters |+| `UNAUTHORIZED` | 401 | Missing or invalid API key |+| `FORBIDDEN` | 403 | Insufficient permissions |+| `NOT_FOUND` | 404 | Resource not found |+| `RATE_LIMITED` | 429 | Too many requests |+| `INTERNAL_ERROR` | 500 | Server error |++#### Session Error Codes++| Code | HTTP Status | Description |+|------|-------------|-------------|+| `SESSION_NOT_FOUND` | 404 | Session with the given ID was not found |+| `SESSION_NOT_READY` | 400 | Session not authenticated/connected |+| `SESSION_ALREADY_EXISTS` | 409 | Session with the given name already exists |+| `SESSION_INITIALIZING` | 400 | Session is currently initializing |+| `SESSION_QR_EXPIRED` | 400 | QR code expired, regeneration required |+| `SESSION_AUTH_FAILED` | 401 | WhatsApp authentication failed |+| `SESSION_DISCONNECTED` | 400 | Session disconnected from WhatsApp |+| `SESSION_LOGGED_OUT` | 400 | Session already logged out from WhatsApp |+| `SESSION_LIMIT_REACHED` | 403 | Maximum session limit reached |+| `SESSION_BANNED` | 403 | WhatsApp number has been banned |++#### Message Error Codes++| Code | HTTP Status | Description |+|------|-------------|-------------|+| `MESSAGE_SEND_FAILED` | 500 | Failed to send message to WhatsApp |+| `MESSAGE_NOT_FOUND` | 404 | Message not found |+| `MESSAGE_INVALID_CHAT_ID` | 400 | Invalid chatId format |+| `MESSAGE_NUMBER_NOT_ON_WHATSAPP` | 400 | Number is not registered on WhatsApp |+| `MESSAGE_MEDIA_TOO_LARGE` | 413 | Media size exceeds limit |+| `MESSAGE_MEDIA_DOWNLOAD_FAILED` | 400 | Failed to download media from URL |+| `MESSAGE_MEDIA_INVALID_FORMAT` | 400 | Unsupported media format |+| `MESSAGE_TEXT_TOO_LONG` | 400 | Message text exceeds character limit |+| `MESSAGE_BLOCKED_CONTACT` | 403 | Cannot send to a blocked contact |+| `MESSAGE_RATE_LIMITED` | 429 | Too many messages in a short time |+| `MESSAGE_QUOTED_NOT_FOUND` | 400 | Quoted message not found |++#### Webhook Error Codes++| Code | HTTP Status | Description |+|------|-------------|-------------|+| `WEBHOOK_NOT_FOUND` | 404 | Webhook not found |+| `WEBHOOK_URL_INVALID` | 400 | Invalid webhook URL |+| `WEBHOOK_URL_UNREACHABLE` | 400 | Webhook URL is unreachable |+| `WEBHOOK_DUPLICATE` | 409 | Webhook with this URL already exists |+| `WEBHOOK_LIMIT_REACHED` | 403 | Maximum webhook limit per session reached |++#### Group Error Codes++| Code | HTTP Status | Description |+|------|-------------|-------------|+| `GROUP_NOT_FOUND` | 404 | Group not found |+| `GROUP_NOT_ADMIN` | 403 | Not a group admin |+| `GROUP_PARTICIPANT_EXISTS` | 409 | Participant already exists in group |+| `GROUP_PARTICIPANT_NOT_FOUND` | 404 | Participant not found in the group |+| `GROUP_INVITE_INVALID` | 400 | Invalid invite link |+| `GROUP_NAME_TOO_LONG` | 400 | Group name exceeds character limit |++#### Contact Error Codes++| Code | HTTP Status | Description |+|------|-------------|-------------|+| `CONTACT_NOT_FOUND` | 404 | Contact not found |+| `CONTACT_BLOCKED` | 400 | Contact is already blocked |+| `CONTACT_NOT_BLOCKED` | 400 | Contact is not blocked |++## 6.3 Media Specifications++### Supported Media Types & Limits++```mermaid+flowchart LR+ subgraph Media["Media Types"]+ IMG[Image]+ VID[Video]+ AUD[Audio]+ DOC[Document]+ STK[Sticker]+ end++ subgraph Limits["Size Limits"]+ L1[16 MB]+ L2[64 MB]+ L3[16 MB]+ L4[100 MB]+ L5[500 KB]+ end++ IMG --> L1+ VID --> L2+ AUD --> L3+ DOC --> L4+ STK --> L5+```++### Image++| Attribute | Value |+|-----------|-------|+| **Max File Size** | 16 MB |+| **Supported Formats** | JPEG, PNG, WebP, GIF |+| **Max Resolution** | 4096 x 4096 pixels |+| **Recommended** | JPEG for photos, PNG for graphics |++```json+{+ "image": {+ "url": "https://example.com/image.jpg",+ "mimetype": "image/jpeg"+ },+ "caption": "Optional caption (max 1024 chars)"+}+```++### Video++| Attribute | Value |+|-----------|-------|+| **Max File Size** | 64 MB (WhatsApp limit: 16 MB in many regions) |+| **Supported Formats** | MP4, 3GP, AVI, MKV |+| **Recommended Codec** | H.264 video, AAC audio |+| **Max Duration** | ~3 menit (tergantung resolusi) |+| **Recommended Resolution** | 720p or lower |++```json+{+ "video": {+ "url": "https://example.com/video.mp4",+ "mimetype": "video/mp4"+ },+ "caption": "Optional caption (max 1024 chars)",+ "gifPlayback": false+}+```++### Audio++| Attribute | Value |+|-----------|-------|+| **Max File Size** | 16 MB |+| **Supported Formats** | MP3, OGG, M4A, AMR, WAV |+| **Voice Note (PTT)** | OGG Opus codec (auto-converted) |+| **Max Duration** | ~15 menit |++```json+{+ "audio": {+ "url": "https://example.com/audio.mp3",+ "mimetype": "audio/mpeg"+ },+ "ptt": true+}+```++### Document++| Attribute | Value |+|-----------|-------|+| **Max File Size** | 100 MB |+| **Supported Formats** | PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, ZIP, dll |+| **Filename** | Max 100 karakter |++```json+{+ "document": {+ "url": "https://example.com/file.pdf",+ "mimetype": "application/pdf"+ },+ "filename": "report-2025.pdf",+ "caption": "Optional caption"+}+```++### Sticker++| Attribute | Value |+|-----------|-------|+| **Max File Size** | 500 KB |+| **Format** | WebP |+| **Dimensions** | 512 x 512 pixels |+| **Animated** | Supported (WebP animated) |++```json+{+ "sticker": {+ "url": "https://example.com/sticker.webp",+ "mimetype": "image/webp"+ }+}+```++### Media Input Options++Media can be sent using three approaches:++```typescript+// Option 1: URL (recommended for large files)+{+ "image": {+ "url": "https://example.com/image.jpg"+ }+}++// Option 2: Base64 (for small files < 5MB)+{+ "image": {+ "base64": "data:image/jpeg;base64,/9j/4AAQ..."+ }+}++// Option 3: File path (for local files - server side only)+{+ "image": {+ "path": "/uploads/image.jpg"+ }+}+```++### Text Message Limits++| Type | Max Length |+|------|------------|+| Regular text message | 65,536 characters |+| Caption (image/video/document) | 1,024 characters |+| Group name | 100 characters |+| Group description | 2,048 characters |+| Contact name | 100 characters |++## 6.4 API Endpoints++### 6.4.1 Sessions++#### Create Session++```mermaid+sequenceDiagram+ Client->>API: POST /sessions+ API->>Engine: Initialize+ Engine-->>API: QR Code+ API-->>Client: Session created + QR+```++```http+POST /api/sessions+```++**Request Body:**+```json+{+ "name": "my-bot",+ "webhook": {+ "url": "https://your-server.com/webhook",+ "events": ["message.received", "message.sent"]+ }+}+```++**Response (201 Created):**+```json+{+ "success": true,+ "data": {+ "id": "sess_abc123",+ "name": "my-bot",+ "status": "INITIALIZING",+ "qr": null,+ "createdAt": "2025-02-02T10:00:00.000Z"+ }+}+```++---++#### List Sessions++```http+GET /api/sessions+```++**Query Parameters:**+| Parameter | Type | Description |+|-----------|------|-------------|+| `status` | string | Filter by status |+| `page` | number | Page number (default: 1) |+| `limit` | number | Items per page (default: 20) |++**Response (200 OK):**+```json+{+ "success": true,+ "data": [+ {+ "id": "sess_abc123",+ "name": "my-bot",+ "status": "CONNECTED",+ "phoneNumber": "628123456789",+ "createdAt": "2025-02-02T10:00:00.000Z"+ }+ ],+ "pagination": {+ "page": 1,+ "limit": 20,+ "total": 1,+ "totalPages": 1+ }+}+```++---++#### Get Session++```http+GET /api/sessions/:sessionId+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "id": "sess_abc123",+ "name": "my-bot",+ "status": "CONNECTED",+ "phoneNumber": "628123456789",+ "pushName": "My Bot",+ "platform": "android",+ "connectedAt": "2025-02-02T10:05:00.000Z",+ "createdAt": "2025-02-02T10:00:00.000Z"+ }+}+```++---++**Session Status Values (API):**++| Value | Description |+|-------|-------------|+| `INITIALIZING` | Session created, engine booting |+| `SCAN_QR` | QR code ready / waiting for scan |+| `CONNECTING` | QR scanned, connecting to WhatsApp |+| `CONNECTED` | Connected and ready |+| `DISCONNECTED` | Connection lost or logged out |+| `FAILED` | Fatal error, manual intervention required |++**Internal ↔ API Status Mapping:**++| Internal Status (engine/db) | API Status |+|-----------------------------|------------|+| `initializing` | `INITIALIZING` |+| `qr_ready` | `SCAN_QR` |+| `connecting` | `CONNECTING` |+| `ready` | `CONNECTED` |+| `disconnected` | `DISCONNECTED` |+| `error` | `FAILED` |++> Internal statuses appear in engine logs and database records. API responses and webhooks always use the API status values above.++---++#### Get Session QR Code++```http+GET /api/sessions/:sessionId/qr+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "code": "2@ABC123...",+ "image": "data:image/png;base64,..."+ }+}+```++---++#### Delete Session++```http+DELETE /api/sessions/:sessionId+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "message": "Session deleted successfully"+ }+}+```++---++#### Logout Session++```http+POST /api/sessions/:sessionId/logout+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "message": "Session logged out successfully"+ }+}+```++---++### 6.4.2 Messages++#### Send Text Message++```mermaid+flowchart LR+ A[Client] -->|POST| B[/messages/send-text]+ B --> C{Validate}+ C -->|OK| D[Queue]+ D --> E[Send]+ E --> F[Response]+```++```http+POST /api/sessions/:sessionId/messages/send-text+```++**Request Body:**+```json+{+ "chatId": "[email protected]",+ "text": "Hello, World!",+ "options": {+ "quotedMessageId": "optional_message_id",+ "mentionedIds": ["[email protected]"]+ }+}+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "messageId": "[email protected]_3EB0ABC123",+ "status": "sent",+ "timestamp": "2025-02-02T10:00:00.000Z"+ }+}+```++---++#### Send Image++```http+POST /api/sessions/:sessionId/messages/send-image+```++**Request Body:**+```json+{+ "chatId": "[email protected]",+ "image": {+ "url": "https://example.com/image.jpg"+ },+ "caption": "Check this out!"+}+```++**Alternative - Base64:**+```json+{+ "chatId": "[email protected]",+ "image": {+ "base64": "data:image/jpeg;base64,/9j/4AAQ..."+ },+ "caption": "Check this out!"+}+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "messageId": "[email protected]_3EB0ABC124",+ "status": "sent",+ "timestamp": "2025-02-02T10:00:00.000Z"+ }+}+```++---++#### Send Video++```http+POST /api/sessions/:sessionId/messages/send-video+```++**Request Body:**+```json+{+ "chatId": "[email protected]",+ "video": {+ "url": "https://example.com/video.mp4"+ },+ "caption": "Watch this!"+}+```++---++#### Send Audio++```http+POST /api/sessions/:sessionId/messages/send-audio+```++**Request Body:**+```json+{+ "chatId": "[email protected]",+ "audio": {+ "url": "https://example.com/audio.mp3"+ },+ "ptt": true+}+```++| Field | Type | Description |+|-------|------|-------------|+| `ptt` | boolean | Send as voice note (push-to-talk) |++---++#### Send Document++```http+POST /api/sessions/:sessionId/messages/send-document+```++**Request Body:**+```json+{+ "chatId": "[email protected]",+ "document": {+ "url": "https://example.com/file.pdf"+ },+ "filename": "report.pdf",+ "caption": "Here is the document"+}+```++---++#### Send Location++```http+POST /api/sessions/:sessionId/messages/send-location+```++**Request Body:**+```json+{+ "chatId": "[email protected]",+ "latitude": -6.2088,+ "longitude": 106.8456,+ "description": "Jakarta, Indonesia"+}+```++---++#### Send Contact++```http+POST /api/sessions/:sessionId/messages/send-contact+```++**Request Body:**+```json+{+ "chatId": "[email protected]",+ "contact": {+ "name": "John Doe",+ "phone": "628987654321"+ }+}+```++---++#### Send Bulk Messages++Send messages to multiple recipients in a single request. The system processes them asynchronously with delays between messages to reduce ban risk.++```mermaid+flowchart LR+ A[Client] -->|POST| B[/messages/send-bulk]+ B --> C[Validate]+ C --> D[Create Batch Job]+ D --> E[Queue Messages]+ E --> F[Process with Delay]+ F --> G[Batch ID Response]+```++```http+POST /api/sessions/:sessionId/messages/send-bulk+```++**Request Body:**+```json+{+ "batchId": "batch_custom_123",+ "messages": [+ {+ "chatId": "[email protected]",+ "type": "text",+ "content": {+ "text": "Hello {name}!"+ },+ "variables": {+ "name": "John"+ }+ },+ {+ "chatId": "[email protected]",+ "type": "image",+ "content": {+ "image": { "url": "https://example.com/promo.jpg" },+ "caption": "Special offer for {name}!"+ },+ "variables": {+ "name": "Jane"+ }+ }+ ],+ "options": {+ "delayBetweenMessages": 5000,+ "randomizeDelay": true,+ "stopOnError": false+ }+}+```++**Request Fields:**++| Field | Type | Required | Description |+|-------|------|----------|-------------|+| `batchId` | string | No | Custom batch ID (auto-generated if not provided) |+| `messages` | array | Yes | Array of messages (max 100 per request) |+| `messages[].chatId` | string | Yes | Recipient chat ID |+| `messages[].type` | string | Yes | Message type: `text`, `image`, `video`, `audio`, `document` |+| `messages[].content` | object | Yes | Message content based on type |+| `messages[].variables` | object | No | Variables for template substitution |+| `options.delayBetweenMessages` | number | No | Delay in ms (default: 3000, min: 1000) |+| `options.randomizeDelay` | boolean | No | Add random 0-2s to delay (default: true) |+| `options.stopOnError` | boolean | No | Stop batch on first error (default: false) |++**Response (202 Accepted):**+```json+{+ "success": true,+ "data": {+ "batchId": "batch_abc123xyz",+ "status": "processing",+ "totalMessages": 2,+ "estimatedCompletionTime": "2025-02-02T10:05:00.000Z",+ "statusUrl": "/api/sessions/sess_abc123/messages/batch/batch_abc123xyz"+ }+}+```++---++#### Get Batch Status++```http+GET /api/sessions/:sessionId/messages/batch/:batchId+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "batchId": "batch_abc123xyz",+ "status": "completed",+ "progress": {+ "total": 100,+ "sent": 95,+ "failed": 5,+ "pending": 0+ },+ "results": [+ {+ "chatId": "[email protected]",+ "status": "sent",+ "messageId": "[email protected]_3EB0ABC123"+ },+ {+ "chatId": "[email protected]",+ "status": "failed",+ "error": {+ "code": "MESSAGE_NUMBER_NOT_ON_WHATSAPP",+ "message": "Number not registered on WhatsApp"+ }+ }+ ],+ "startedAt": "2025-02-02T10:00:00.000Z",+ "completedAt": "2025-02-02T10:08:30.000Z"+ }+}+```++---++#### Cancel Batch++```http+POST /api/sessions/:sessionId/messages/batch/:batchId/cancel+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "batchId": "batch_abc123xyz",+ "status": "cancelled",+ "progress": {+ "total": 100,+ "sent": 45,+ "failed": 2,+ "cancelled": 53+ }+ }+}+```++---++#### Get Messages++```http+GET /api/sessions/:sessionId/chats/:chatId/messages+```++**Query Parameters:**+| Parameter | Type | Description |+|-----------|------|-------------|+| `limit` | number | Number of messages (default: 50) |+| `before` | string | Get messages before this ID |++**Response (200 OK):**+```json+{+ "success": true,+ "data": [+ {+ "id": "[email protected]_3EB0ABC123",+ "from": "[email protected]",+ "to": "[email protected]",+ "body": "Hello!",+ "type": "chat",+ "waTimestamp": 1706868000,+ "timestamp": "2025-02-02T10:00:00.000Z",+ "fromMe": false,+ "hasMedia": false+ }+ ]+}+```++---++### 6.4.3 Contacts++#### Get All Contacts++```http+GET /api/sessions/:sessionId/contacts+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": [+ {+ "id": "[email protected]",+ "name": "John Doe",+ "pushName": "John",+ "isMyContact": true,+ "isBlocked": false+ }+ ]+}+```++---++#### Check Number Exists++```http+GET /api/sessions/:sessionId/contacts/check/:phone+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "exists": true,+ "chatId": "[email protected]"+ }+}+```++---++#### Get Profile Picture++```http+GET /api/sessions/:sessionId/contacts/:contactId/profile-picture+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "url": "https://pps.whatsapp.net/..."+ }+}+```++---++### 6.4.4 Groups++#### Get All Groups++```http+GET /api/sessions/:sessionId/groups+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": [+ {+ "id": "[email protected]",+ "name": "Family Group",+ "description": "Family chat",+ "participantsCount": 10,+ "createdAt": "2024-01-01T00:00:00.000Z"+ }+ ]+}+```++---++#### Get Group Info++```http+GET /api/sessions/:sessionId/groups/:groupId+```++**Response (200 OK):**+```json+{+ "success": true,+ "data": {+ "id": "[email protected]",+ "name": "Family Group",+ "description": "Family chat",+ "owner": "[email protected]",+ "participants": [+ {+ "id": "[email protected]",+ "isAdmin": true,+ "isSuperAdmin": true+ }+ ],+ "createdAt": "2024-01-01T00:00:00.000Z"+ }+}+```++---++#### Create Group++```http+POST /api/sessions/:sessionId/groups+```++**Request Body:**+```json+{+ "name": "New Group",+ "participants": [+ "[email protected]",+ ]+}+```++---++### 6.4.5 Webhooks++#### Register Webhook++```http+POST /api/sessions/:sessionId/webhooks+```++**Request Body:**+```json+{+ "url": "https://your-server.com/webhook",+ "events": [+ "message.received",+ "message.sent",+ "message.ack",+ "session.status"+ ],+ "secret": "your-webhook-secret",+ "headers": {+ "X-Custom-Header": "value"+ }+}+```++**Response (201 Created):**+```json+{+ "success": true,+ "data": {+ "id": "wh_xyz789",+ "url": "https://your-server.com/webhook",+ "events": ["message.received", "message.sent"],+ "active": true,+ "createdAt": "2025-02-02T10:00:00.000Z"+ }+}+```++---++#### List Webhooks++```http+GET /api/sessions/:sessionId/webhooks+```++---++#### Delete Webhook++```http+DELETE /api/sessions/:sessionId/webhooks/:webhookId+```++---++### 6.4.6 Health++#### Basic Health Check++```http+GET /health+```++**Response (200 OK):**+```json+{+ "status": "ok",+ "timestamp": "2026-02-02T10:30:00Z"+}+```++The basic endpoint is public. The detailed endpoint requires an API key.++#### Detailed Health Check++```http+GET /health/detailed+```++**Response (200 OK):**+```json+{+ "status": "ok",+ "version": "0.1.0",+ "uptime": 3600,+ "timestamp": "2026-02-02T10:30:00Z",+ "checks": {+ "database": "ok",+ "redis": "ok",+ "sessions": {+ "total": 5,+ "connected": 4,+ "disconnected": 1+ }+ }+}+```++## 6.4 Webhook Events++### Event Structure++```json+{+ "event": "message.received",+ "timestamp": "2025-02-02T10:00:00.000Z",+ "sessionId": "sess_abc123",+ "deliveryId": "dlv_550e8400e29b41d4a716446655440000",+ "idempotencyKey": "msg_628123456789_1706868000000",+ "data": {},+ "signature": "sha256=..."+}+```++### Webhook Idempotency++OpenWA provides an idempotency mechanism to prevent duplicate processing on the client side.++#### Idempotency Headers & Fields++| Field/Header | Description |+|--------------|-------------|+| `deliveryId` | Unique ID for each delivery attempt |+| `idempotencyKey` | Unique key per event (same across retries) |+| `X-OpenWA-Delivery-Id` | Header carrying the delivery ID |+| `X-OpenWA-Idempotency-Key` | Header carrying the idempotency key |+| `X-OpenWA-Retry-Count` | Retry attempt number (0 = first attempt) |++#### Idempotency Key Format++```+Format: {event_type}_{unique_identifier}_{timestamp}++Examples:+- message.received: msg_{messageId}_{timestamp}+- message.sent: msg_{messageId}_{timestamp}+- message.ack: ack_{messageId}_{ackLevel}_{timestamp}+- session.status: sess_{sessionId}_{status}_{timestamp}+- group.join: grp_{groupId}_{participantId}_{timestamp}+```++#### Client-Side Idempotency Implementation++```typescript+// Recommended: Store processed idempotency keys+const processedEvents = new Map<string, number>(); // key -> timestamp+const IDEMPOTENCY_TTL = 24 * 60 * 60 * 1000; // 24 hours++async function handleWebhook(req: Request, res: Response) {+ const idempotencyKey = req.headers['x-openwa-idempotency-key'] as string;+ const retryCount = parseInt(req.headers['x-openwa-retry-count'] as string) || 0;++ // Check if already processed+ if (processedEvents.has(idempotencyKey)) {+ console.log(`Duplicate event ignored: ${idempotencyKey} (retry: ${retryCount})`);+ return res.status(200).json({ status: 'duplicate_ignored' });+ }++ try {+ // Process the webhook+ await processEvent(req.body);++ // Mark as processed+ processedEvents.set(idempotencyKey, Date.now());++ // Cleanup old entries periodically+ cleanupOldEntries();++ return res.status(200).json({ status: 'processed' });+ } catch (error) {+ // Return 500 to trigger retry+ return res.status(500).json({ error: error.message });+ }+}++function cleanupOldEntries() {+ const now = Date.now();+ for (const [key, timestamp] of processedEvents.entries()) {+ if (now - timestamp > IDEMPOTENCY_TTL) {+ processedEvents.delete(key);+ }+ }+}+```++#### Database-Based Idempotency (Production)++```sql+-- Create idempotency table+CREATE TABLE webhook_idempotency (+ idempotency_key VARCHAR(255) PRIMARY KEY,+ processed_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),+ response_data JSONB+);++-- Index for cleanup+CREATE INDEX idx_webhook_idempotency_processed_at+ ON webhook_idempotency(processed_at);++-- Cleanup job (run daily)+DELETE FROM webhook_idempotency+WHERE processed_at < NOW() - INTERVAL '24 hours';+```++```typescript+// Production implementation with PostgreSQL+async function handleWebhookWithDB(req: Request, res: Response) {+ const idempotencyKey = req.headers['x-openwa-idempotency-key'] as string;++ try {+ // Try to insert (will fail if duplicate)+ await db.query(`+ INSERT INTO webhook_idempotency (idempotency_key)+ VALUES ($1)+ ON CONFLICT (idempotency_key) DO NOTHING+ RETURNING idempotency_key+ `, [idempotencyKey]);++ const result = await db.query(+ 'SELECT 1 FROM webhook_idempotency WHERE idempotency_key = $1',+ [idempotencyKey]+ );++ if (result.rowCount === 0) {+ // Already processed+ return res.status(200).json({ status: 'duplicate_ignored' });+ }++ // Process the webhook+ await processEvent(req.body);++ return res.status(200).json({ status: 'processed' });+ } catch (error) {+ return res.status(500).json({ error: error.message });+ }+}+```++### Event Types++```mermaid+flowchart TB+ subgraph Events["Webhook Events"]+ direction TB++ subgraph Message["Message Events"]+ MR[message.received]+ MS[message.sent]+ MA[message.ack]+ MRV[message.revoked]+ end++ subgraph Session["Session Events"]+ SS[session.status]+ SQ[session.qr]+ SA[session.authenticated]+ SD[session.disconnected]+ end++ subgraph Group["Group Events"]+ GJ[group.join]+ GL[group.leave]+ GU[group.update]+ end+ end+```++### message.received++```json+{+ "event": "message.received",+ "timestamp": "2025-02-02T10:00:00.000Z",+ "sessionId": "sess_abc123",+ "data": {+ "id": "[email protected]_3EB0ABC123",+ "from": "[email protected]",+ "to": "[email protected]",+ "body": "Hello!",+ "type": "chat",+ "waTimestamp": 1706868000,+ "timestamp": "2025-02-02T10:00:00.000Z",+ "isGroup": false,+ "hasMedia": false,+ "contact": {+ "name": "John Doe",+ "pushName": "John"+ }+ }+}+```++### message.ack++```json+{+ "event": "message.ack",+ "timestamp": "2025-02-02T10:00:00.000Z",+ "sessionId": "sess_abc123",+ "data": {+ "messageId": "[email protected]_3EB0ABC123",+ "ack": 3,+ "ackName": "read"+ }+}+```++| Ack | Name | Description |+|-----|------|-------------|+| 0 | error | Error |+| 1 | pending | Pending |+| 2 | sent | Sent to server |+| 3 | delivered | Delivered |+| 4 | read | Read |+| 5 | played | Played (audio) |++### session.status++```json+{+ "event": "session.status",+ "timestamp": "2025-02-02T10:00:00.000Z",+ "sessionId": "sess_abc123",+ "data": {+ "status": "CONNECTED",+ "phoneNumber": "628123456789"+ }+}+```++## 6.5 Webhook Signature Verification++```javascript+const crypto = require('crypto');++function verifyWebhookSignature(payload, signature, secret) {+ const expected = 'sha256=' + crypto+ .createHmac('sha256', secret)+ .update(JSON.stringify(payload))+ .digest('hex');++ return crypto.timingSafeEqual(+ Buffer.from(signature),+ Buffer.from(expected)+ );+}++// Usage in Express+app.post('/webhook', (req, res) => {+ const signature = req.headers['x-openwa-signature'];++ if (!verifyWebhookSignature(req.body, signature, WEBHOOK_SECRET)) {+ return res.status(401).send('Invalid signature');+ }++ // Process webhook...+ res.status(200).send('OK');+});+```++## 6.6 Rate Limiting++| Endpoint Category | Rate Limit |+|-------------------|------------|+| Session management | 10 req/min |+| Send message | 60 req/min |+| Read operations | 120 req/min |+| Webhook management | 10 req/min |++**Rate Limit Headers:**+```http+X-RateLimit-Limit: 60+X-RateLimit-Remaining: 45+X-RateLimit-Reset: 1706868060+```++## 6.7 WebSocket Real-time API++In addition to the REST API, OpenWA provides WebSocket for real-time updates.++> [!IMPORTANT]+> The WebSocket format below is **canonical**. Client/server implementations must follow this `WSRequest/WSResponse` structure.++### Connection++**WebSocket URL:**+```+wss://your-domain.com/ws+wss://your-domain.com/ws?apiKey=your-api-key # browser fallback+```++**Header (recommended for non-browser clients):**+```http+X-API-Key: your-api-key+```++```javascript+// Browser (query param)+const ws = new WebSocket('wss://your-domain.com/ws?apiKey=your-api-key');+```++### Message Protocol++All messages use JSON format:++```typescript+// Client -> Server (Request)+interface WSRequest {+ type: 'subscribe' | 'unsubscribe' | 'ping';+ payload?: {+ sessionId?: string;+ events?: string[];+ };+ requestId?: string; // For tracking responses+}++// Server -> Client (Response/Event)+interface WSResponse {+ type: 'subscribed' | 'unsubscribed' | 'event' | 'error' | 'pong';+ payload: any;+ requestId?: string;+ timestamp: string; // ISO 8601 UTC+}+```++### Subscribe / Unsubscribe++```javascript+// Subscribe to specific session+ws.send(JSON.stringify({+ type: 'subscribe',+ payload: {+ sessionId: 'sess_abc123',+ events: ['message.received', 'message.ack', 'session.status']+ },+ requestId: 'req_001'+}));++// Subscribe to all sessions+ws.send(JSON.stringify({+ type: 'subscribe',+ payload: {+ sessionId: '*',+ events: ['*']+ }+}));++// Unsubscribe+ws.send(JSON.stringify({+ type: 'unsubscribe',+ payload: { sessionId: 'sess_abc123' }+}));+```++### Event Types++| Event | Description |+|-------|-------------|+| `session.status` | Session status changed (INITIALIZING, SCAN_QR, CONNECTING, CONNECTED, DISCONNECTED, FAILED) |+| `session.qr` | New QR code generated |+| `session.authenticated` | Session authenticated |+| `session.disconnected` | Session disconnected |+| `message.received` | New incoming message |+| `message.sent` | Message sent successfully |+| `message.ack` | Message acknowledgment (delivered, read) |+| `message.revoked` | Message was deleted |+| `group.join` | Group join event |+| `group.leave` | Group leave event |+| `group.update` | Group info updated |++### Event Payload Examples++**session.qr:**+```json+{+ "type": "event",+ "payload": {+ "event": "session.qr",+ "sessionId": "sess_abc123",+ "data": {+ "code": "2@ABC123XYZ...",+ "image": "data:image/png;base64,..."+ }+ },+ "timestamp": "2026-02-02T10:00:00.000Z"+}+```++**message.received:**+```json+{+ "type": "event",+ "payload": {+ "event": "message.received",+ "sessionId": "sess_abc123",+ "data": {+ "messageId": "[email protected]_3EB0ABC",+ "chatId": "[email protected]",+ "from": "[email protected]",+ "type": "text",+ "body": "Hello!",+ "waTimestamp": 1706868000,+ "timestamp": "2026-02-02T10:00:00.000Z",+ "isGroup": false+ }+ },+ "timestamp": "2026-02-02T10:00:00.000Z"+}+```++### Keep-Alive++```javascript+// Client should send ping every 30 seconds+setInterval(() => {+ ws.send(JSON.stringify({ type: 'ping', requestId: 'ping-001' }));+}, 30000);+```++### Quick Client Example (JavaScript)++```javascript+const ws = new WebSocket('ws://localhost:2785/ws?apiKey=your-api-key');+let pingInterval = null;++ws.onopen = () => {+ ws.send(JSON.stringify({+ type: 'subscribe',+ payload: {+ sessionId: 'sess_abc123',+ events: ['message.received', 'session.status']+ },+ requestId: 'req_001'+ }));++ pingInterval = setInterval(() => {+ ws.send(JSON.stringify({ type: 'ping', requestId: `ping_${Date.now()}` }));+ }, 30000);+};++ws.onmessage = (event) => {+ const msg = JSON.parse(event.data);+ if (msg.type === 'event') {+ console.log('Event:', msg.payload.event, msg.payload.data);+ }+};++ws.onclose = () => {+ if (pingInterval) clearInterval(pingInterval);+};+```++### Error Handling++```json+{+ "type": "error",+ "payload": {+ "code": "SESSION_NOT_FOUND",+ "message": "Session sess_xxx not found"+ },+ "requestId": "req_001",+ "timestamp": "2026-02-02T10:00:00.000Z"+}+```++## 6.8 OpenAPI/Swagger++Swagger UI tersedia di:+```+http://localhost:2785/api/docs+```++OpenAPI JSON:+```+http://localhost:2785/api/docs-json+```++## 6.9 SDK & Code Examples++### Official SDKs (Coming Soon)++| Language | Package | Status |+|----------|---------|--------|+| JavaScript/TypeScript | `@openwa/sdk` | 🔜 Planned |+| Python | `openwa-python` | 🔜 Planned |+| PHP | `openwa/php-sdk` | 🔜 Planned |+| Go | `openwa-go` | 🔜 Planned |++### cURL Examples++```bash+# Create session+curl -X POST http://localhost:2785/api/sessions \+ -H "Content-Type: application/json" \+ -H "X-API-Key: your-api-key" \+ -H "X-Request-ID: req_1706868000000" \+ -d '{"name": "my-bot"}'++# Send text message+curl -X POST http://localhost:2785/api/sessions/sess_abc123/messages/send-text \+ -H "Content-Type: application/json" \+ -H "X-API-Key: your-api-key" \+ -H "X-Request-ID: req_1706868000001" \+ -d '{+ "chatId": "[email protected]",+ "text": "Hello from OpenWA!"+ }'++# Send image+curl -X POST http://localhost:2785/api/sessions/sess_abc123/messages/send-image \+ -H "Content-Type: application/json" \+ -H "X-API-Key: your-api-key" \+ -H "X-Request-ID: req_1706868000002" \+ -d '{+ "chatId": "[email protected]",+ "image": {"url": "https://example.com/image.jpg"},+ "caption": "Check this out!"+ }'+```++### JavaScript/Node.js Example++```javascript+const axios = require('axios');++const api = axios.create({+ baseURL: 'http://localhost:2785/api',+ headers: {+ 'X-API-Key': 'your-api-key',+ 'Content-Type': 'application/json',+ 'X-Request-ID': `req_${Date.now()}`+ }+});++// Send message+async function sendMessage(sessionId, chatId, text) {+ const response = await api.post(+ `/sessions/${sessionId}/messages/send-text`,+ { chatId, text }+ );+ return response.data;+}++// Usage+sendMessage('sess_abc123', '[email protected]', 'Hello!')+ .then(result => console.log('Sent:', result.data.messageId))+ .catch(err => console.error('Error:', err.response?.data));+```++### Python Example++```python+import time+import requests++class OpenWA:+ def __init__(self, base_url, api_key):+ self.base_url = base_url+ self.headers = {+ 'X-API-Key': api_key,+ 'Content-Type': 'application/json',+ 'X-Request-ID': f'req_{int(time.time() * 1000)}'+ }++ def send_text(self, session_id, chat_id, text):+ response = requests.post(+ f'{self.base_url}/sessions/{session_id}/messages/send-text',+ headers=self.headers,+ json={'chatId': chat_id, 'text': text}+ )+ return response.json()++ def send_image(self, session_id, chat_id, image_url, caption=None):+ response = requests.post(+ f'{self.base_url}/sessions/{session_id}/messages/send-image',+ headers=self.headers,+ json={+ 'chatId': chat_id,+ 'image': {'url': image_url},+ 'caption': caption+ }+ )+ return response.json()++# Usage+client = OpenWA('http://localhost:2785/api', 'your-api-key')+result = client.send_text('sess_abc123', '[email protected]', 'Hello from Python!')+print(f"Message ID: {result['data']['messageId']}")+```++### WebSocket Client Example (JavaScript)++```javascript+const ws = new WebSocket('ws://localhost:2785/ws?apiKey=your-api-key');+let pingInterval = null;++ws.onopen = () => {+ ws.send(JSON.stringify({+ type: 'subscribe',+ payload: {+ sessionId: 'sess_abc123',+ events: ['message.received', 'session.status']+ },+ requestId: 'req_001'+ }));++ pingInterval = setInterval(() => {+ ws.send(JSON.stringify({ type: 'ping', requestId: `ping_${Date.now()}` }));+ }, 30000);+};++ws.onmessage = (event) => {+ const msg = JSON.parse(event.data);+ if (msg.type === 'event') {+ console.log('Event:', msg.payload.event, msg.payload.data);+ }+};++ws.onclose = () => {+ if (pingInterval) clearInterval(pingInterval);+};+```+---++<div align="center">++[← 05 - Database Design](./05-database-design.md) · [Documentation Index](./README.md) · [Next: 07 - API Collection →](./07-api-collection.md)++</div>diff --git a/docs/07-api-collection.md b/docs/07-api-collection.mdnew file mode 100644index 000000000..465257d78--- /dev/null+++ b/docs/07-api-collection.md@@ -0,0 +1,1371 @@+# 07 - API Collection++## 07.1 Overview++This document provides a complete collection of OpenWA API endpoints with request/response examples for each endpoint. It can be used as a quick reference or imported into tools such as Postman, Insomnia, or Bruno.++### Base URL++```+Development: http://localhost:2785+Production: https://api.your-domain.com+```++### Authentication++All endpoints (except `/health`) require an API Key:++```http+X-API-Key: your-api-key-here+```++### Response Format++```json+{+ "success": true,+ "data": { ... },+ "meta": {+ "timestamp": "2026-02-02T10:30:00Z",+ "requestId": "req_abc123"+ }+}+```++### Error Format++```json+{+ "success": false,+ "error": {+ "code": "VALIDATION_ERROR",+ "message": "Invalid phone number format",+ "details": {+ "field": "phone",+ "expected": "format: [email protected]"+ }+ },+ "meta": {+ "timestamp": "2026-02-02T10:30:00Z",+ "requestId": "req_abc123"+ }+}+```++## 07.2 Health & System++### GET /health++Basic health check.++```bash+curl http://localhost:2785/health+```++**Response:**+```json+{+ "status": "ok",+ "timestamp": "2026-02-02T10:30:00Z"+}+```++### GET /health/detailed++Detailed health check with system status.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/health/detailed+```++**Response:**+```json+{+ "status": "ok",+ "version": "0.1.0",+ "uptime": 86400,+ "timestamp": "2026-02-02T10:30:00Z",+ "checks": {+ "database": "ok",+ "redis": "ok",+ "sessions": {+ "total": 5,+ "connected": 4,+ "disconnected": 1+ }+ }+}+```++### GET /api/metrics++System metrics (Prometheus format).++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/metrics+```++**Response:**+```+# HELP openwa_sessions_total Total number of sessions+# TYPE openwa_sessions_total gauge+openwa_sessions_total{status="connected"} 4+openwa_sessions_total{status="disconnected"} 1++# HELP openwa_messages_total Total messages processed+# TYPE openwa_messages_total counter+openwa_messages_total{direction="incoming"} 15234+openwa_messages_total{direction="outgoing"} 8567++# HELP openwa_api_requests_total Total API requests+# TYPE openwa_api_requests_total counter+openwa_api_requests_total{method="GET",status="200"} 45678+openwa_api_requests_total{method="POST",status="200"} 12345+```++## 07.3 Sessions API++### GET /api/sessions++List all sessions.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions+```++**Query Parameters:**+| Parameter | Type | Description |+|-----------|------|-------------|+| status | string | Filter by status: `CONNECTED`, `DISCONNECTED`, `INITIALIZING` |+| limit | number | Max results (default: 20) |+| offset | number | Pagination offset |++**Response:**+```json+{+ "success": true,+ "data": [+ {+ "id": "default",+ "name": "Default Session",+ "status": "CONNECTED",+ "phoneNumber": "628123456789",+ "profileName": "John Doe",+ "profilePicture": "https://...",+ "createdAt": "2026-02-01T00:00:00Z",+ "lastSeen": "2026-02-02T10:30:00Z"+ }+ ],+ "meta": {+ "total": 1,+ "limit": 20,+ "offset": 0+ }+}+```++### POST /api/sessions++Create new session.++```bash+curl -X POST http://localhost:2785/api/sessions \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "id": "session-1",+ "name": "Customer Support",+ "config": {+ "autoReconnect": true,+ "webhookUrl": "https://your-server.com/webhook"+ }+ }'+```++**Request Body:**+| Field | Type | Required | Description |+|-------|------|----------|-------------|+| id | string | No | Session ID (auto-generated if not provided) |+| name | string | No | Display name |+| config.autoReconnect | boolean | No | Auto reconnect on disconnect (default: true) |+| config.webhookUrl | string | No | Webhook URL for this session |+| config.proxy | string | No | Proxy URL (http://user:pass@host:port) |++**Response:**+```json+{+ "success": true,+ "data": {+ "id": "session-1",+ "name": "Customer Support",+ "status": "INITIALIZING",+ "qr": null,+ "createdAt": "2026-02-02T10:30:00Z"+ }+}+```++### GET /api/sessions/:id++Get session details.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/session-1+```++**Response:**+```json+{+ "success": true,+ "data": {+ "id": "session-1",+ "name": "Customer Support",+ "status": "CONNECTED",+ "phoneNumber": "628123456789",+ "profileName": "John Doe",+ "profilePicture": "https://...",+ "pushName": "John",+ "platform": "android",+ "config": {+ "autoReconnect": true,+ "webhookUrl": "https://your-server.com/webhook"+ },+ "stats": {+ "messagesReceived": 1234,+ "messagesSent": 567,+ "lastMessageAt": "2026-02-02T10:25:00Z"+ },+ "createdAt": "2026-02-01T00:00:00Z",+ "lastSeen": "2026-02-02T10:30:00Z"+ }+}+```++### DELETE /api/sessions/:id++Delete session.++```bash+curl -X DELETE \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/session-1+```++**Query Parameters:**+| Parameter | Type | Description |+|-----------|------|-------------|+| keepAuth | boolean | Keep auth files for quick reconnect (default: false) |++**Response:**+```json+{+ "success": true,+ "data": {+ "message": "Session deleted successfully"+ }+}+```++### GET /api/sessions/:id/qr++Get QR code for authentication.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/session-1/qr+```++**Query Parameters:**+| Parameter | Type | Description |+|-----------|------|-------------|+| format | string | `base64` (default), `raw`, `image` |++**Response (format=base64):**+```json+{+ "success": true,+ "data": {+ "qr": "data:image/png;base64,iVBORw0KGgo...",+ "expiresAt": "2026-02-02T10:31:00Z"+ }+}+```++**Response (format=image):**+Returns PNG image directly with `Content-Type: image/png`++### POST /api/sessions/:id/restart++Restart session.++```bash+curl -X POST \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/session-1/restart+```++**Response:**+```json+{+ "success": true,+ "data": {+ "message": "Session restarting",+ "status": "INITIALIZING"+ }+}+```++### POST /api/sessions/:id/logout++Logout session (clear auth).++```bash+curl -X POST \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/session-1/logout+```++**Response:**+```json+{+ "success": true,+ "data": {+ "message": "Session logged out successfully"+ }+}+```++## 07.4 Messages API++### POST /api/sessions/:id/messages++Send message.++```bash+# Text message+curl -X POST http://localhost:2785/api/sessions/default/messages \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "phone": "[email protected]",+ "type": "text",+ "body": "Hello, World!"+ }'+```++**Request Body - Text:**+```json+{+ "phone": "[email protected]",+ "type": "text",+ "body": "Hello, World!",+ "options": {+ "quotedMessageId": "MSG_ABC123",+ "mentions": ["[email protected]"]+ }+}+```++**Request Body - Image:**+```json+{+ "phone": "[email protected]",+ "type": "image",+ "media": {+ "url": "https://example.com/image.jpg"+ },+ "caption": "Check this out!"+}+```++**Request Body - Image (Base64):**+```json+{+ "phone": "[email protected]",+ "type": "image",+ "media": {+ "base64": "iVBORw0KGgo...",+ "mimetype": "image/jpeg",+ "filename": "photo.jpg"+ },+ "caption": "Photo from base64"+}+```++**Request Body - Document:**+```json+{+ "phone": "[email protected]",+ "type": "document",+ "media": {+ "url": "https://example.com/document.pdf"+ },+ "filename": "report.pdf",+ "caption": "Monthly report"+}+```++**Request Body - Location:**+```json+{+ "phone": "[email protected]",+ "type": "location",+ "location": {+ "latitude": -6.2088,+ "longitude": 106.8456,+ "name": "Monas",+ "address": "Jakarta, Indonesia"+ }+}+```++**Request Body - Contact:**+```json+{+ "phone": "[email protected]",+ "type": "contact",+ "contact": {+ "name": "John Doe",+ "phone": "+628111222333"+ }+}+```++**Request Body - Buttons (Interactive):**+```json+{+ "phone": "[email protected]",+ "type": "buttons",+ "body": "Please choose an option:",+ "buttons": [+ { "id": "btn1", "text": "Option 1" },+ { "id": "btn2", "text": "Option 2" },+ { "id": "btn3", "text": "Option 3" }+ ],+ "footer": "Powered by OpenWA"+}+```++**Request Body - List (Interactive):**+```json+{+ "phone": "[email protected]",+ "type": "list",+ "body": "Please select from the menu:",+ "buttonText": "View Menu",+ "sections": [+ {+ "title": "Category 1",+ "rows": [+ { "id": "item1", "title": "Item 1", "description": "Description 1" },+ { "id": "item2", "title": "Item 2", "description": "Description 2" }+ ]+ }+ ],+ "footer": "Powered by OpenWA"+}+```++**Response:**+```json+{+ "success": true,+ "data": {+ "id": "MSG_ABC123DEF456",+ "phone": "[email protected]",+ "type": "text",+ "body": "Hello, World!",+ "status": "PENDING",+ "timestamp": "2026-02-02T10:30:00Z"+ }+}+```++### POST /api/sessions/:id/messages (Multipart)++Send message with file upload.++```bash+curl -X POST http://localhost:2785/api/sessions/default/messages \+ -H "X-API-Key: $API_KEY" \+ -F "[email protected]" \+ -F "type=image" \+ -F "media=@/path/to/image.jpg" \+ -F "caption=Uploaded via multipart"+```++### GET /api/sessions/:id/messages++Get message history.++```bash+curl -H "X-API-Key: $API_KEY" \+ "http://localhost:2785/api/sessions/default/[email protected]&limit=50"+```++**Query Parameters:**+| Parameter | Type | Description |+|-----------|------|-------------|+| phone | string | Filter by chat (required) |+| limit | number | Max results (default: 50, max: 200) |+| before | string | Messages before this ID |+| after | string | Messages after this ID |+| type | string | Filter by type: `chat`, `image`, `video`, etc. |++**Response:**+```json+{+ "success": true,+ "data": [+ {+ "id": "MSG_ABC123",+ "from": "[email protected]",+ "to": "[email protected]",+ "body": "Hello!",+ "type": "chat",+ "timestamp": "2026-02-02T10:25:00Z",+ "status": "READ",+ "isFromMe": false+ }+ ],+ "meta": {+ "hasMore": true,+ "nextCursor": "MSG_DEF456"+ }+}+```++### GET /api/sessions/:id/messages/:messageId++Get specific message.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/messages/MSG_ABC123+```++### DELETE /api/sessions/:id/messages/:messageId++Delete/revoke message.++```bash+curl -X DELETE \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/messages/MSG_ABC123+```++**Query Parameters:**+| Parameter | Type | Description |+|-----------|------|-------------|+| forEveryone | boolean | Delete for everyone (default: true) |++### POST /api/sessions/:id/messages/:messageId/react++React to message.++```bash+curl -X POST http://localhost:2785/api/sessions/default/messages/MSG_ABC123/react \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{"emoji": "👍"}'+```++## 07.5 Contacts API++### GET /api/sessions/:id/contacts++Get all contacts.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/contacts+```++**Response:**+```json+{+ "success": true,+ "data": [+ {+ "id": "[email protected]",+ "name": "John Doe",+ "pushName": "John",+ "shortName": "John",+ "isMyContact": true,+ "isBlocked": false,+ "profilePicture": "https://..."+ }+ ]+}+```++### GET /api/sessions/:id/contacts/:phone++Get contact info.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/contacts/628123456789+```++### GET /api/sessions/:id/contacts/:phone/exists++Check if number exists on WhatsApp.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/contacts/628123456789/exists+```++**Response:**+```json+{+ "success": true,+ "data": {+ "exists": true,+ "jid": "[email protected]"+ }+}+```++### POST /api/sessions/:id/contacts/:phone/block++Block contact.++```bash+curl -X POST \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/contacts/628123456789/block+```++### POST /api/sessions/:id/contacts/:phone/unblock++Unblock contact.++```bash+curl -X POST \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/contacts/628123456789/unblock+```++## 07.6 Groups API++### GET /api/sessions/:id/groups++Get all groups.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/groups+```++**Response:**+```json+{+ "success": true,+ "data": [+ {+ "id": "[email protected]",+ "name": "Family Group",+ "description": "Family chat",+ "participantsCount": 15,+ "isAdmin": true,+ "profilePicture": "https://...",+ "createdAt": "2025-01-15T00:00:00Z"+ }+ ]+}+```++### POST /api/sessions/:id/groups++Create new group.++```bash+curl -X POST http://localhost:2785/api/sessions/default/groups \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "name": "New Group",+ "participants": [+ "[email protected]",+ ]+ }'+```++**Response:**+```json+{+ "success": true,+ "data": {+ "id": "[email protected]",+ "name": "New Group",+ "inviteCode": "ABC123XYZ"+ }+}+```++### GET /api/sessions/:id/groups/:groupId++Get group info.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/groups/[email protected]+```++**Response:**+```json+{+ "success": true,+ "data": {+ "id": "[email protected]",+ "name": "Family Group",+ "description": "Family chat",+ "owner": "[email protected]",+ "participants": [+ {+ "id": "[email protected]",+ "isAdmin": true,+ "isSuperAdmin": false+ },+ {+ "id": "[email protected]",+ "isAdmin": false,+ "isSuperAdmin": false+ }+ ],+ "settings": {+ "announce": false,+ "restrict": false+ },+ "inviteCode": "ABC123XYZ",+ "createdAt": "2025-01-15T00:00:00Z"+ }+}+```++### PATCH /api/sessions/:id/groups/:groupId++Update group info.++```bash+curl -X PATCH http://localhost:2785/api/sessions/default/groups/[email protected] \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "name": "Updated Group Name",+ "description": "New description"+ }'+```++### DELETE /api/sessions/:id/groups/:groupId++Leave group.++```bash+curl -X DELETE \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/groups/[email protected]+```++### POST /api/sessions/:id/groups/:groupId/participants++Add participants to group.++```bash+curl -X POST http://localhost:2785/api/sessions/default/groups/[email protected]/participants \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "participants": ["[email protected]", "[email protected]"]+ }'+```++### DELETE /api/sessions/:id/groups/:groupId/participants++Remove participants from group.++```bash+curl -X DELETE http://localhost:2785/api/sessions/default/groups/[email protected]/participants \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "participants": ["[email protected]"]+ }'+```++### POST /api/sessions/:id/groups/:groupId/admins++Promote to admin.++```bash+curl -X POST http://localhost:2785/api/sessions/default/groups/[email protected]/admins \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "participants": ["[email protected]"]+ }'+```++### DELETE /api/sessions/:id/groups/:groupId/admins++Demote from admin.++```bash+curl -X DELETE http://localhost:2785/api/sessions/default/groups/[email protected]/admins \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "participants": ["[email protected]"]+ }'+```++### GET /api/sessions/:id/groups/:groupId/invite-code++Get group invite code.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/groups/[email protected]/invite-code+```++**Response:**+```json+{+ "success": true,+ "data": {+ "inviteCode": "ABC123XYZ",+ "inviteUrl": "https://chat.whatsapp.com/ABC123XYZ"+ }+}+```++### POST /api/sessions/:id/groups/:groupId/invite-code/revoke++Revoke and generate new invite code.++```bash+curl -X POST \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/groups/[email protected]/invite-code/revoke+```++## 07.7 Webhooks API++### GET /api/sessions/:sessionId/webhooks++List all webhooks.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/sess_abc123/webhooks+```++**Response:**+```json+{+ "success": true,+ "data": [+ {+ "id": "wh_123",+ "url": "https://your-server.com/webhook",+ "events": ["message.received", "message.ack"],+ "sessionId": "sess_abc123",+ "enabled": true,+ "secret": "whsec_***",+ "createdAt": "2026-02-01T00:00:00Z"+ }+ ]+}+```++### POST /api/sessions/:sessionId/webhooks++Create webhook.++```bash+curl -X POST http://localhost:2785/api/sessions/sess_abc123/webhooks \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "url": "https://your-server.com/webhook",+ "events": ["message.received", "message.ack", "session.status"],+ "headers": {+ "Authorization": "Bearer your-token"+ }+ }'+```++**Request Body:**+| Field | Type | Required | Description |+|-------|------|----------|-------------|+| url | string | Yes | Webhook endpoint URL |+| events | string[] | Yes | Events to subscribe |+| headers | object | No | Custom headers to send |+| secret | string | No | Secret for signature verification |++**Available Events:**+```+message.received - New incoming message+message.sent - Message sent+message.ack - Message status (sent, delivered, read)+message.revoked - Message deleted+session.status - Session status change+session.qr - QR code generated+session.authenticated - Session authenticated+session.disconnected - Session disconnected+group.join - Someone joined group+group.leave - Someone left group+group.update - Group settings changed+```++**Response:**+```json+{+ "success": true,+ "data": {+ "id": "wh_456",+ "url": "https://your-server.com/webhook",+ "events": ["message.received", "message.ack", "session.status"],+ "sessionId": "sess_abc123",+ "enabled": true,+ "secret": "whsec_abc123xyz",+ "createdAt": "2026-02-02T10:30:00Z"+ }+}+```++### GET /api/sessions/:sessionId/webhooks/:id++Get webhook details.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/sess_abc123/webhooks/wh_456+```++### PATCH /api/sessions/:sessionId/webhooks/:webhookId++Update webhook.++```bash+curl -X PATCH http://localhost:2785/api/sessions/sess_abc123/webhooks/wh_456 \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "events": ["message.received"],+ "enabled": false+ }'+```++### DELETE /api/sessions/:sessionId/webhooks/:webhookId++Delete webhook.++```bash+curl -X DELETE \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/sess_abc123/webhooks/wh_456+```++### GET /api/sessions/:sessionId/webhooks/:id/logs++Get webhook delivery logs.++```bash+curl -H "X-API-Key: $API_KEY" \+ "http://localhost:2785/api/sessions/sess_abc123/webhooks/wh_456/logs?limit=20"+```++**Response:**+```json+{+ "success": true,+ "data": [+ {+ "id": "log_789",+ "webhookId": "wh_456",+ "event": "message.received",+ "status": "success",+ "statusCode": 200,+ "duration": 150,+ "attempt": 1,+ "payload": { ... },+ "response": { ... },+ "createdAt": "2026-02-02T10:30:00Z"+ }+ ]+}+```++### POST /api/sessions/:sessionId/webhooks/:id/test++Test webhook.++```bash+curl -X POST \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/sess_abc123/webhooks/wh_456/test+```++**Response:**+```json+{+ "success": true,+ "data": {+ "status": "success",+ "statusCode": 200,+ "duration": 125,+ "response": {+ "received": true+ }+ }+}+```++## 07.8 API Keys API++### GET /api/api-keys++List API keys.++```bash+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/api-keys+```++**Response:**+```json+{+ "success": true,+ "data": [+ {+ "id": "key_123",+ "name": "Production Key",+ "prefix": "owa_prod_***",+ "permissions": ["*"],+ "sessionAccess": ["*"],+ "rateLimit": 1000,+ "lastUsed": "2026-02-02T10:30:00Z",+ "expiresAt": null,+ "createdAt": "2026-01-01T00:00:00Z"+ }+ ]+}+```++### POST /api/api-keys++Create API key.++```bash+curl -X POST http://localhost:2785/api/api-keys \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "name": "Integration Key",+ "permissions": ["sessions:read", "messages:write"],+ "sessionAccess": ["default"],+ "rateLimit": 100,+ "expiresAt": "2027-01-01T00:00:00Z"+ }'+```++**Permissions:**+```+* - All permissions+sessions:read - Read session info+sessions:write - Create/delete sessions+messages:read - Read messages+messages:write - Send messages+contacts:read - Read contacts+contacts:write - Block/unblock contacts+groups:read - Read group info+groups:write - Manage groups+webhooks:read - Read webhooks+webhooks:write - Manage webhooks+api-keys:read - Read API keys+api-keys:write - Manage API keys+```++**Response:**+```json+{+ "success": true,+ "data": {+ "id": "key_456",+ "name": "Integration Key",+ "key": "owa_abc123xyz789...",+ "permissions": ["sessions:read", "messages:write"],+ "sessionAccess": ["default"],+ "rateLimit": 100,+ "expiresAt": "2027-01-01T00:00:00Z",+ "createdAt": "2026-02-02T10:30:00Z"+ }+}+```++**Note:** The full `key` is only shown once at creation.++### DELETE /api/api-keys/:id++Revoke API key.++```bash+curl -X DELETE \+ -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/api-keys/key_456+```++## 07.9 Postman Collection++```json+{+ "info": {+ "name": "OpenWA API",+ "description": "OpenWA WhatsApp API Gateway",+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"+ },+ "variable": [+ {+ "key": "baseUrl",+ "value": "http://localhost:2785",+ "type": "string"+ },+ {+ "key": "apiKey",+ "value": "your-api-key",+ "type": "string"+ },+ {+ "key": "sessionId",+ "value": "default",+ "type": "string"+ }+ ],+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "key",+ "value": "X-API-Key",+ "type": "string"+ },+ {+ "key": "value",+ "value": "{{apiKey}}",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },+ "item": [+ {+ "name": "Health",+ "item": [+ {+ "name": "Health Check",+ "request": {+ "method": "GET",+ "url": "{{baseUrl}}/health"+ }+ },+ {+ "name": "Detailed Health",+ "request": {+ "method": "GET",+ "url": "{{baseUrl}}/health/detailed"+ }+ }+ ]+ },+ {+ "name": "Sessions",+ "item": [+ {+ "name": "List Sessions",+ "request": {+ "method": "GET",+ "url": "{{baseUrl}}/api/sessions"+ }+ },+ {+ "name": "Create Session",+ "request": {+ "method": "POST",+ "url": "{{baseUrl}}/api/sessions",+ "body": {+ "mode": "raw",+ "raw": "{\n \"id\": \"{{sessionId}}\",\n \"name\": \"My Session\"\n}",+ "options": {+ "raw": {+ "language": "json"+ }+ }+ }+ }+ },+ {+ "name": "Get Session",+ "request": {+ "method": "GET",+ "url": "{{baseUrl}}/api/sessions/{{sessionId}}"+ }+ },+ {+ "name": "Get QR Code",+ "request": {+ "method": "GET",+ "url": "{{baseUrl}}/api/sessions/{{sessionId}}/qr"+ }+ },+ {+ "name": "Delete Session",+ "request": {+ "method": "DELETE",+ "url": "{{baseUrl}}/api/sessions/{{sessionId}}"+ }+ }+ ]+ },+ {+ "name": "Messages",+ "item": [+ {+ "name": "Send Text Message",+ "request": {+ "method": "POST",+ "url": "{{baseUrl}}/api/sessions/{{sessionId}}/messages",+ "body": {+ "mode": "raw",+ "raw": "{\n \"phone\": \"[email protected]\",\n \"type\": \"text\",\n \"body\": \"Hello from OpenWA!\"\n}",+ "options": {+ "raw": {+ "language": "json"+ }+ }+ }+ }+ },+ {+ "name": "Send Image (URL)",+ "request": {+ "method": "POST",+ "url": "{{baseUrl}}/api/sessions/{{sessionId}}/messages",+ "body": {+ "mode": "raw",+ "raw": "{\n \"phone\": \"[email protected]\",\n \"type\": \"image\",\n \"media\": {\n \"url\": \"https://example.com/image.jpg\"\n },\n \"caption\": \"Check this out!\"\n}",+ "options": {+ "raw": {+ "language": "json"+ }+ }+ }+ }+ },+ {+ "name": "Get Message History",+ "request": {+ "method": "GET",+ "url": {+ "raw": "{{baseUrl}}/api/sessions/{{sessionId}}/[email protected]&limit=50",+ "host": ["{{baseUrl}}"],+ "path": ["api", "sessions", "{{sessionId}}", "messages"],+ "query": [+ {"key": "phone", "value": "[email protected]"},+ {"key": "limit", "value": "50"}+ ]+ }+ }+ }+ ]+ }+ ]+}+```++Download: [openwa-postman-collection.json](./assets/openwa-postman-collection.json)++## 07.10 cURL Examples Collection++```bash+#!/bin/bash+# openwa-curl-examples.sh++BASE_URL="http://localhost:2785"+API_KEY="your-api-key"+SESSION_ID="default"++# Health Check+echo "=== Health Check ==="+curl -s "$BASE_URL/health" | jq++# Create Session+echo "=== Create Session ==="+curl -s -X POST "$BASE_URL/api/sessions" \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d "{\"id\": \"$SESSION_ID\", \"name\": \"Test Session\"}" | jq++# Get QR Code+echo "=== Get QR Code ==="+curl -s "$BASE_URL/api/sessions/$SESSION_ID/qr" \+ -H "X-API-Key: $API_KEY" | jq -r '.data.qr'++# Send Text Message+echo "=== Send Text Message ==="+curl -s -X POST "$BASE_URL/api/sessions/$SESSION_ID/messages" \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "phone": "[email protected]",+ "type": "text",+ "body": "Hello from cURL!"+ }' | jq++# Send Image+echo "=== Send Image ==="+curl -s -X POST "$BASE_URL/api/sessions/$SESSION_ID/messages" \+ -H "X-API-Key: $API_KEY" \+ -F "[email protected]" \+ -F "type=image" \+ -F "media=@./test-image.jpg" \+ -F "caption=Uploaded via cURL" | jq++# Get Contacts+echo "=== Get Contacts ==="+curl -s "$BASE_URL/api/sessions/$SESSION_ID/contacts" \+ -H "X-API-Key: $API_KEY" | jq++# Get Groups+echo "=== Get Groups ==="+curl -s "$BASE_URL/api/sessions/$SESSION_ID/groups" \+ -H "X-API-Key: $API_KEY" | jq++# Create Webhook+echo "=== Create Webhook ==="+curl -s -X POST "$BASE_URL/api/sessions/$SESSION_ID/webhooks" \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "url": "https://your-server.com/webhook",+ "events": ["message.received", "message.ack"]+ }' | jq+```+---++<div align="center">++[← 06 - API Specification](./06-api-specification.md) · [Documentation Index](./README.md) · [Next: 08 - Development Guidelines →](./08-development-guidelines.md)++</div>diff --git a/docs/08-development-guidelines.md b/docs/08-development-guidelines.mdnew file mode 100644index 000000000..b5f3056ba--- /dev/null+++ b/docs/08-development-guidelines.md@@ -0,0 +1,1307 @@+# 08 - Development Guidelines++## 8.1 Project Structure++```+openwa/+├── src/+│ ├── main.ts # Application entry+│ ├── app.module.ts # Root module+│ │+│ ├── common/ # Shared code+│ │ ├── decorators/+│ │ ├── dto/+│ │ ├── exceptions/+│ │ ├── filters/+│ │ ├── guards/+│ │ ├── interceptors/+│ │ ├── interfaces/+│ │ ├── pipes/+│ │ └── utils/+│ │+│ ├── config/ # Configuration+│ │ ├── config.module.ts+│ │ └── configuration.ts+│ │+│ ├── modules/ # Feature modules+│ │ ├── session/+│ │ ├── message/+│ │ ├── webhook/+│ │ ├── contact/+│ │ ├── group/+│ │ ├── auth/+│ │ └── health/+│ │+│ ├── engine/ # WhatsApp engine+│ │ ├── engine.module.ts+│ │ ├── engine.service.ts+│ │ └── interfaces/+│ │+│ ├── queue/ # Job queues+│ │ ├── queue.module.ts+│ │ └── processors/+│ │+│ └── database/ # Database+│ ├── database.module.ts+│ ├── entities/+│ └── migrations/+│+├── test/ # Tests+│ ├── unit/+│ ├── integration/+│ └── e2e/+│+├── dashboard/ # Frontend dashboard+│ ├── src/+│ └── package.json+│+├── docs/ # Documentation+├── scripts/ # Utility scripts+├── docker/ # Docker files+│+├── .github/ # GitHub config+│ └── workflows/+│+├── package.json+├── tsconfig.json+├── nest-cli.json+├── .eslintrc.js+├── .prettierrc+├── docker-compose.yml+└── README.md+```++## 8.2 Coding Standards++### TypeScript Configuration++```json+// tsconfig.json+{+ "compilerOptions": {+ "module": "commonjs",+ "declaration": true,+ "removeComments": true,+ "emitDecoratorMetadata": true,+ "experimentalDecorators": true,+ "allowSyntheticDefaultImports": true,+ "target": "ES2022",+ "sourceMap": true,+ "outDir": "./dist",+ "baseUrl": "./",+ "incremental": true,+ "skipLibCheck": true,+ "strictNullChecks": true,+ "noImplicitAny": true,+ "strictBindCallApply": true,+ "forceConsistentCasingInFileNames": true,+ "noFallthroughCasesInSwitch": true,+ "paths": {+ "@/*": ["src/*"],+ "@common/*": ["src/common/*"],+ "@modules/*": ["src/modules/*"],+ "@config/*": ["src/config/*"]+ }+ }+}+```++### ESLint Configuration++```javascript+// .eslintrc.js+module.exports = {+ parser: '@typescript-eslint/parser',+ parserOptions: {+ project: 'tsconfig.json',+ sourceType: 'module',+ },+ plugins: ['@typescript-eslint/eslint-plugin'],+ extends: [+ 'plugin:@typescript-eslint/recommended',+ 'plugin:prettier/recommended',+ ],+ root: true,+ env: {+ node: true,+ jest: true,+ },+ ignorePatterns: ['.eslintrc.js'],+ rules: {+ '@typescript-eslint/interface-name-prefix': 'off',+ '@typescript-eslint/explicit-function-return-type': 'warn',+ '@typescript-eslint/explicit-module-boundary-types': 'warn',+ '@typescript-eslint/no-explicit-any': 'warn',+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],+ 'no-console': 'warn',+ },+};+```++### Naming Conventions++```typescript+// Files: kebab-case+session.controller.ts+send-message.dto.ts+api-key.guard.ts++// Classes: PascalCase+class SessionController {}+class SendMessageDto {}+class ApiKeyGuard {}++// Interfaces: PascalCase with 'I' prefix (optional)+interface ISessionConfig {}+interface SessionConfig {} // Also acceptable++// Functions/Methods: camelCase+function createSession() {}+async sendMessage() {}++// Variables: camelCase+const sessionId = 'abc';+let messageCount = 0;++// Constants: UPPER_SNAKE_CASE+const MAX_RETRY_COUNT = 3;+const DEFAULT_TIMEOUT = 30000;++// Enums: PascalCase with PascalCase values+enum SessionStatus {+ Created = 'created',+ Ready = 'ready',+ Disconnected = 'disconnected',+}+```++## 8.3 Module Structure++### Standard Module Template++```typescript+// modules/example/example.module.ts+import { Module } from '@nestjs/common';+import { TypeOrmModule } from '@nestjs/typeorm';+import { ExampleController } from './example.controller';+import { ExampleService } from './example.service';+import { ExampleRepository } from './example.repository';+import { Example } from './entities/example.entity';++@Module({+ imports: [TypeOrmModule.forFeature([Example])],+ controllers: [ExampleController],+ providers: [ExampleService, ExampleRepository],+ exports: [ExampleService],+})+export class ExampleModule {}+```++### Controller Template++```typescript+// modules/example/example.controller.ts+import {+ Controller,+ Get,+ Post,+ Body,+ Headers,+ Param,+ Delete,+ UseGuards,+ HttpCode,+ HttpStatus,+} from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';+import { ApiKeyGuard } from '@common/guards/api-key.guard';+import { ExampleService } from './example.service';+import { CreateExampleDto } from './dto/create-example.dto';+import { ExampleResponseDto } from './dto/example-response.dto';++@ApiTags('examples')+@Controller('examples')+@UseGuards(ApiKeyGuard)+export class ExampleController {+ constructor(private readonly exampleService: ExampleService) {}++ @Post()+ @HttpCode(HttpStatus.CREATED)+ @ApiOperation({ summary: 'Create example' })+ @ApiResponse({ status: 201, type: ExampleResponseDto })+ async create(+ @Body() dto: CreateExampleDto,+ @Headers('x-request-id') requestId?: string+ ): Promise<ExampleResponseDto> {+ return this.exampleService.create(dto, { requestId });+ }++ @Get(':id')+ @ApiOperation({ summary: 'Get example by ID' })+ @ApiResponse({ status: 200, type: ExampleResponseDto })+ async findOne(@Param('id') id: string): Promise<ExampleResponseDto> {+ return this.exampleService.findOne(id);+ }++ @Delete(':id')+ @HttpCode(HttpStatus.NO_CONTENT)+ @ApiOperation({ summary: 'Delete example' })+ async remove(@Param('id') id: string): Promise<void> {+ return this.exampleService.remove(id);+ }+}+```++### Service Template++```typescript+// modules/example/example.service.ts+import { Injectable, NotFoundException, Logger } from '@nestjs/common';+import { ExampleRepository } from './example.repository';+import { CreateExampleDto } from './dto/create-example.dto';+import { Example } from './entities/example.entity';++@Injectable()+export class ExampleService {+ private readonly logger = new Logger(ExampleService.name);++ constructor(private readonly repository: ExampleRepository) {}++ async create(+ dto: CreateExampleDto,+ context?: { requestId?: string }+ ): Promise<Example> {+ this.logger.log(`Creating example: ${dto.name}`, context);++ const example = this.repository.create(dto);+ return this.repository.save(example);+ }++ async findOne(id: string): Promise<Example> {+ const example = await this.repository.findOne({ where: { id } });++ if (!example) {+ throw new NotFoundException(`Example with ID ${id} not found`);+ }++ return example;+ }++ async remove(id: string): Promise<void> {+ const example = await this.findOne(id);+ await this.repository.remove(example);++ this.logger.log(`Deleted example: ${id}`);+ }+}+```++### DTO Template++```typescript+// modules/example/dto/create-example.dto.ts+import { IsString, IsOptional, MaxLength, IsUrl } from 'class-validator';+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';++export class CreateExampleDto {+ @ApiProperty({ description: 'Example name', example: 'My Example' })+ @IsString()+ @MaxLength(100)+ name: string;++ @ApiPropertyOptional({ description: 'Optional description' })+ @IsOptional()+ @IsString()+ @MaxLength(500)+ description?: string;++ @ApiPropertyOptional({ description: 'Callback URL' })+ @IsOptional()+ @IsUrl({ protocols: ['https'] })+ callbackUrl?: string;+}+```++## 8.4 Git Workflow++### Branch Strategy++```mermaid+gitGraph+ commit id: "initial"+ branch develop+ commit id: "setup"+ branch feature/session-api+ commit id: "session controller"+ commit id: "session service"+ checkout develop+ merge feature/session-api+ branch feature/webhook+ commit id: "webhook impl"+ checkout develop+ merge feature/webhook+ checkout main+ merge develop tag: "v1.0.0"+ checkout develop+ branch hotfix/bug-fix+ commit id: "fix bug"+ checkout main+ merge hotfix/bug-fix tag: "v1.0.1"+ checkout develop+ merge hotfix/bug-fix+```++### Branch Naming++```+main # Production-ready code+develop # Integration branch+feature/* # New features+bugfix/* # Bug fixes+hotfix/* # Production hotfixes+release/* # Release preparation++Examples:+feature/session-management+feature/webhook-retry+bugfix/qr-code-timeout+hotfix/security-patch+release/1.0.0+```++### Commit Message Convention++```+<type>(<scope>): <subject>++<body>++<footer>++Types:+- feat: New feature+- fix: Bug fix+- docs: Documentation+- style: Formatting (no code change)+- refactor: Code refactoring+- test: Adding tests+- chore: Maintenance++Examples:+feat(session): add multi-session support++- Implement session manager for multiple sessions+- Add session limit configuration+- Update documentation++Closes #123++fix(webhook): handle timeout errors gracefully++Previously, webhook timeouts would crash the worker.+Now they are caught and logged properly.++Fixes #456+```++### Pull Request Template++```markdown+## Description+Brief description of changes++## Type of Change+- [ ] Bug fix+- [ ] New feature+- [ ] Breaking change+- [ ] Documentation update++## Checklist+- [ ] Tests added/updated+- [ ] Documentation updated+- [ ] Lint passes+- [ ] Self-reviewed++## Screenshots (if applicable)++## Related Issues+Closes #+```++## 8.5 Testing Guidelines++### Test Structure++```+test/+├── unit/ # Unit tests+│ ├── services/+│ │ ├── session.service.spec.ts+│ │ └── message.service.spec.ts+│ └── utils/+│ └── encryption.spec.ts+│+├── integration/ # Integration tests+│ ├── session.integration.spec.ts+│ └── webhook.integration.spec.ts+│+└── e2e/ # End-to-end tests+ ├── app.e2e-spec.ts+ └── session.e2e-spec.ts+```++### Unit Test Example++```typescript+// test/unit/services/session.service.spec.ts+import { Test, TestingModule } from '@nestjs/testing';+import { SessionService } from '@modules/session/session.service';+import { SessionRepository } from '@modules/session/session.repository';+import { EngineService } from '@engine/engine.service';++describe('SessionService', () => {+ let service: SessionService;+ let repository: jest.Mocked<SessionRepository>;+ let engineService: jest.Mocked<EngineService>;++ beforeEach(async () => {+ const module: TestingModule = await Test.createTestingModule({+ providers: [+ SessionService,+ {+ provide: SessionRepository,+ useValue: {+ create: jest.fn(),+ save: jest.fn(),+ findOne: jest.fn(),+ delete: jest.fn(),+ },+ },+ {+ provide: EngineService,+ useValue: {+ createClient: jest.fn(),+ destroyClient: jest.fn(),+ },+ },+ ],+ }).compile();++ service = module.get<SessionService>(SessionService);+ repository = module.get(SessionRepository);+ engineService = module.get(EngineService);+ });++ describe('create', () => {+ it('should create a new session', async () => {+ const dto = { name: 'test-session' };+ const session = { id: 'uuid', ...dto, status: 'created' };++ repository.create.mockReturnValue(session as any);+ repository.save.mockResolvedValue(session as any);++ const result = await service.create(dto);++ expect(result).toEqual(session);+ expect(repository.create).toHaveBeenCalledWith(dto);+ expect(repository.save).toHaveBeenCalled();+ });++ it('should throw error if name already exists', async () => {+ const dto = { name: 'existing-session' };++ repository.save.mockRejectedValue({ code: '23505' }); // Unique violation++ await expect(service.create(dto)).rejects.toThrow();+ });+ });+});+```++### E2E Test Example++```typescript+// test/e2e/session.e2e-spec.ts+import { Test, TestingModule } from '@nestjs/testing';+import { INestApplication } from '@nestjs/common';+import * as request from 'supertest';+import { AppModule } from '@/app.module';++describe('Session (e2e)', () => {+ let app: INestApplication;+ const apiKey = 'test-api-key';++ beforeAll(async () => {+ const moduleFixture: TestingModule = await Test.createTestingModule({+ imports: [AppModule],+ }).compile();++ app = moduleFixture.createNestApplication();+ await app.init();+ });++ afterAll(async () => {+ await app.close();+ });++ describe('POST /api/sessions', () => {+ it('should create a session', () => {+ return request(app.getHttpServer())+ .post('/api/sessions')+ .set('X-API-Key', apiKey)+ .send({ name: 'e2e-test-session' })+ .expect(201)+ .expect((res) => {+ expect(res.body.success).toBe(true);+ expect(res.body.data.name).toBe('e2e-test-session');+ expect(res.body.data.status).toBe('created');+ });+ });++ it('should return 401 without API key', () => {+ return request(app.getHttpServer())+ .post('/api/sessions')+ .send({ name: 'test' })+ .expect(401);+ });+ });+});+```++### Test Coverage Requirements++| Type | Minimum Coverage |+|------|-----------------|+| Unit Tests | 80% |+| Integration Tests | 60% |+| E2E Tests | Critical paths |++## 8.6 Documentation Standards++### Code Documentation++```typescript+/**+ * Session service handles all session-related operations.+ *+ * @example+ * ```typescript+ * const session = await sessionService.create({ name: 'my-bot' });+ * console.log(session.id);+ * ```+ */+@Injectable()+export class SessionService {+ /**+ * Creates a new WhatsApp session.+ *+ * @param dto - Session creation parameters+ * @returns The created session with QR code if applicable+ * @throws {ConflictException} If session name already exists+ * @throws {ServiceUnavailableException} If max sessions reached+ */+ async create(dto: CreateSessionDto): Promise<Session> {+ // Implementation+ }+}+```++### API Documentation (Swagger)++```typescript+@ApiTags('sessions')+@Controller('sessions')+export class SessionController {+ @Post()+ @ApiOperation({+ summary: 'Create a new session',+ description: 'Creates a new WhatsApp session and returns QR code for authentication',+ })+ @ApiBody({ type: CreateSessionDto })+ @ApiResponse({+ status: 201,+ description: 'Session created successfully',+ type: SessionResponseDto,+ })+ @ApiResponse({+ status: 409,+ description: 'Session name already exists',+ })+ async create(@Body() dto: CreateSessionDto): Promise<SessionResponseDto> {+ // Implementation+ }+}+```++## 8.7 Error Handling++### Custom Exception Classes++```typescript+// common/exceptions/business.exception.ts+export class BusinessException extends HttpException {+ constructor(+ public readonly code: string,+ message: string,+ statusCode: HttpStatus = HttpStatus.BAD_REQUEST,+ public readonly details?: Record<string, any>,+ ) {+ super({ code, message, details }, statusCode);+ }+}++// Usage+throw new BusinessException(+ 'SESSION_NOT_READY',+ 'Session is not ready to send messages',+ HttpStatus.BAD_REQUEST,+ { sessionId, currentStatus: session.status }+);+```++### Global Exception Filter++```typescript+// common/filters/http-exception.filter.ts+@Catch()+export class AllExceptionsFilter implements ExceptionFilter {+ private readonly logger = new Logger(AllExceptionsFilter.name);++ catch(exception: unknown, host: ArgumentsHost): void {+ const ctx = host.switchToHttp();+ const response = ctx.getResponse<Response>();+ const request = ctx.getRequest<Request>();++ const status = exception instanceof HttpException+ ? exception.getStatus()+ : HttpStatus.INTERNAL_SERVER_ERROR;++ const errorResponse = this.formatError(exception, request);++ this.logger.error(+ `${request.method} ${request.url} - ${status}`,+ exception instanceof Error ? exception.stack : undefined,+ );++ response.status(status).json(errorResponse);+ }++ private formatError(exception: unknown, request: Request) {+ return {+ success: false,+ error: {+ code: this.getErrorCode(exception),+ message: this.getErrorMessage(exception),+ details: this.getErrorDetails(exception),+ },+ meta: {+ timestamp: new Date().toISOString(),+ requestId: request.headers['x-request-id'],+ path: request.url,+ },+ };+ }+}+```++---++## 8.8 Environment Setup++### Prerequisites++```bash+# Required+- Node.js 20 LTS+- npm 10++- Docker & Docker Compose+- Git++# Optional (for development)+- VS Code with extensions+- Postman or Insomnia+- pgAdmin or DBeaver+```++### Quick Start++```bash+# 1. Clone repository+git clone https://github.com/rmyndharis/OpenWA.git+cd openwa++# 2. Install dependencies+npm install++# 3. Copy environment file+cp .env.example .env++# 4. Start infrastructure services+docker compose up -d postgres redis++# 5. Run database migrations+npm run migration:run++# 6. Start development server+npm run start:dev+```++### VS Code Extensions++```json+// .vscode/extensions.json+{+ "recommendations": [+ "dbaeumer.vscode-eslint",+ "esbenp.prettier-vscode",+ "ms-azuretools.vscode-docker",+ "prisma.prisma",+ "humao.rest-client",+ "bradlc.vscode-tailwindcss",+ "orta.vscode-jest"+ ]+}+```++### VS Code Settings++```json+// .vscode/settings.json+{+ "editor.formatOnSave": true,+ "editor.defaultFormatter": "esbenp.prettier-vscode",+ "editor.codeActionsOnSave": {+ "source.fixAll.eslint": true+ },+ "typescript.preferences.importModuleSpecifier": "relative",+ "files.exclude": {+ "**/node_modules": true,+ "**/dist": true+ }+}+```++### Environment Variables++OpenWA supports multiple infrastructure configurations. Choose based on your needs:++#### Minimal Profile (Development / Single Session)++```bash+# .env.example (Minimal Profile)++# Application+NODE_ENV=development+PORT=2785+LOG_LEVEL=debug++# Database: SQLite (zero config)+DATABASE_TYPE=sqlite+DATABASE_SQLITE_PATH=./data/openwa.db++# Storage: Local filesystem+STORAGE_TYPE=local+STORAGE_LOCAL_PATH=./media++# Cache: In-memory (no Redis needed)+CACHE_TYPE=memory++# Security+ENCRYPTION_KEY=dev-encryption-key-change-in-production+API_KEY_MASTER=dev-master-key-change-in-production++# Session+SESSION_DATA_PATH=./.wwebjs_auth+MAX_SESSIONS=3++# Engine+ENGINE_TYPE=whatsapp-web.js+PUPPETEER_HEADLESS=true++# Development+SWAGGER_ENABLED=true+```++#### Standard Profile (Production / Multi-Session)++```bash+# .env.example (Standard Profile)++# Application+NODE_ENV=production+PORT=2785+LOG_LEVEL=info++# Database: PostgreSQL+DATABASE_TYPE=postgres+DATABASE_URL=postgresql://openwa:openwa@localhost:5432/openwa++# Storage: Local filesystem+STORAGE_TYPE=local+STORAGE_LOCAL_PATH=./media++# Cache: Redis+CACHE_TYPE=redis+REDIS_URL=redis://localhost:6379++# Security (generate with: openssl rand -base64 32)+ENCRYPTION_KEY=your-32-byte-encryption-key-here+API_KEY_MASTER=your-secure-master-key++# Session+SESSION_DATA_PATH=./.wwebjs_auth+MAX_SESSIONS=10++# Engine+ENGINE_TYPE=whatsapp-web.js+PUPPETEER_HEADLESS=true++# Development+SWAGGER_ENABLED=true+```++> [!TIP]+> For development, use the **Minimal Profile** with SQLite. No need to set up PostgreSQL or Redis.++## 8.9 Debugging Guide++### NestJS Debugging++```json+// .vscode/launch.json+{+ "version": "0.2.0",+ "configurations": [+ {+ "name": "Debug NestJS",+ "type": "node",+ "request": "launch",+ "runtimeExecutable": "npm",+ "runtimeArgs": ["run", "start:debug"],+ "console": "integratedTerminal",+ "restart": true,+ "autoAttachChildProcesses": true+ },+ {+ "name": "Debug Tests",+ "type": "node",+ "request": "launch",+ "runtimeExecutable": "npm",+ "runtimeArgs": ["run", "test:debug"],+ "console": "integratedTerminal"+ }+ ]+}+```++### Logging Best Practices++```typescript+// Use Logger from NestJS+import { Logger, Inject, Scope } from '@nestjs/common';+import { REQUEST } from '@nestjs/core';+import { Request } from 'express';++@Injectable({ scope: Scope.REQUEST })+export class MyService {+ private readonly logger = new Logger(MyService.name);++ constructor(@Inject(REQUEST) private readonly request: Request) {}++ async doSomething(id: string): Promise<void> {+ // Log entry with context+ const requestId = this.request?.requestId;+ this.logger.log(`Processing item`, { id, requestId });++ try {+ await this.process(id);+ this.logger.log(`Item processed successfully`, { id, requestId });+ } catch (error) {+ // Log error with full stack+ this.logger.error(`Failed to process item`, error.stack, { id, requestId });+ throw error;+ }+ }+}+```++> [!NOTE]+> Propagate `X-Request-ID` from controller to service and include it in all logs for easier cross-component tracing.++### Request ID Interceptor (Optional)++Use an interceptor to ensure every request has a `requestId` and propagate it to the response header.++```typescript+// common/interceptors/request-id.interceptor.ts+import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';+import { Observable } from 'rxjs';++@Injectable()+export class RequestIdInterceptor implements NestInterceptor {+ intercept(context: ExecutionContext, next: CallHandler): Observable<any> {+ const request = context.switchToHttp().getRequest();+ const response = context.switchToHttp().getResponse();++ const requestId = request.headers['x-request-id'] || `req_${Date.now()}`;+ request.requestId = requestId;+ response.setHeader('X-Request-ID', requestId);++ return next.handle();+ }+}+```++```typescript+// main.ts+async function bootstrap() {+ const app = await NestFactory.create(AppModule);+ app.useGlobalInterceptors(new RequestIdInterceptor());+ await app.listen(3000);+}+```++> [!NOTE]+> If you use `REQUEST` injection in a service, make sure the provider is **request-scoped** (`@Injectable({ scope: Scope.REQUEST })`) so requestId does not get mixed across requests.++### Debug WhatsApp Engine++```typescript+// Enable verbose logging for whatsapp-web.js+const client = new Client({+ puppeteer: {+ headless: false, // See browser window+ devtools: true, // Open DevTools automatically+ },+});++// Log all events for debugging+const events = ['qr', 'ready', 'authenticated', 'disconnected', 'message'];+events.forEach(event => {+ client.on(event, (...args) => {+ console.log(`[WA Event: ${event}]`, JSON.stringify(args, null, 2));+ });+});+```++### Common Debugging Commands++```bash+# Run single test file+npm test -- session.service.spec.ts++# Run tests with verbose output+npm test -- --verbose++# Check for TypeScript errors+npm run build -- --noEmit++# Lint with auto-fix+npm run lint -- --fix++# Debug database queries (TypeORM)+# Add to .env: DEBUG=typeorm:query++# View Docker logs+docker compose logs -f app+```++## 8.10 Performance Best Practices++### Database Queries++```typescript+// ❌ Bad: N+1 query problem+const sessions = await sessionRepo.find();+for (const session of sessions) {+ session.webhooks = await webhookRepo.find({ where: { sessionId: session.id } });+}++// ✅ Good: Use relations+const sessions = await sessionRepo.find({+ relations: ['webhooks'],+});++// ✅ Good: Use QueryBuilder for complex queries+const sessions = await sessionRepo+ .createQueryBuilder('session')+ .leftJoinAndSelect('session.webhooks', 'webhook')+ .where('session.status = :status', { status: 'ready' })+ .orderBy('session.createdAt', 'DESC')+ .take(10)+ .getMany();+```++### Caching Strategy++```typescript+// Cache frequently accessed data+@Injectable()+export class SessionService {+ constructor(+ private readonly cache: CacheService,+ private readonly repo: SessionRepository,+ ) {}++ async getSession(id: string): Promise<Session> {+ // Check cache first+ const cached = await this.cache.get<Session>(`session:${id}`);+ if (cached) return cached;++ // Fetch from database+ const session = await this.repo.findOne({ where: { id } });++ // Cache for 5 minutes+ await this.cache.set(`session:${id}`, session, 300);++ return session;+ }++ async updateSession(id: string, data: Partial<Session>): Promise<Session> {+ const session = await this.repo.update(id, data);++ // Invalidate cache+ await this.cache.del(`session:${id}`);++ return session;+ }+}+```++### Async Operations++```typescript+// ❌ Bad: Sequential execution+const contact1 = await getContact('id1');+const contact2 = await getContact('id2');+const contact3 = await getContact('id3');++// ✅ Good: Parallel execution+const [contact1, contact2, contact3] = await Promise.all([+ getContact('id1'),+ getContact('id2'),+ getContact('id3'),+]);++// ✅ Good: Batch processing with concurrency limit+import pLimit from 'p-limit';++const limit = pLimit(5); // Max 5 concurrent+const results = await Promise.all(+ chatIds.map(id => limit(() => sendMessage(id, text)))+);+```++### Memory Management++```typescript+// Session cleanup to prevent memory leaks+@Injectable()+export class SessionCleanupService {+ private readonly logger = new Logger(SessionCleanupService.name);++ @Cron('0 */5 * * * *') // Every 5 minutes+ async cleanupInactiveSessions(): Promise<void> {+ const inactiveThreshold = new Date(Date.now() - 30 * 60 * 1000); // 30 min++ const inactiveSessions = await this.sessionRepo.find({+ where: {+ status: 'disconnected',+ updatedAt: LessThan(inactiveThreshold),+ },+ });++ for (const session of inactiveSessions) {+ await this.engineService.destroy(session.id);+ this.logger.log(`Cleaned up inactive session: ${session.id}`);+ }+ }+}+```++## 8.11 Common Gotchas & Troubleshooting++### WhatsApp Engine Issues++```markdown+## QR Code Not Generated++**Symptom:** Session stuck in 'initializing' status++**Causes & Solutions:**+1. **Chrome/Puppeteer issue**+ - Ensure Chromium is installed: `which chromium`+ - Check Puppeteer args: `--no-sandbox --disable-setuid-sandbox`++2. **Previous session data corrupted**+ - Clear session folder: `rm -rf .wwebjs_auth/session-{id}`++3. **WhatsApp rate limit**+ - Wait 5-10 minutes before retrying++## Session Disconnects Randomly++**Causes & Solutions:**+1. **Memory pressure**+ - Monitor memory: `docker stats`+ - Increase container memory limit++2. **Network issues**+ - Check WebSocket connection stability+ - Implement auto-reconnect logic++3. **WhatsApp detected automation**+ - Add random delays between messages+ - Avoid sending too many messages quickly+```++### Database Issues++```markdown+## Connection Pool Exhausted++**Symptom:** "too many clients already" error++**Solution:**+```typescript+// config/typeorm.config.ts+{+ type: 'postgres',+ // Limit pool size+ extra: {+ max: 20, // Default is 10+ connectionTimeoutMillis: 5000,+ idleTimeoutMillis: 30000,+ },+}+```++## Migration Fails++**Symptom:** "relation already exists" error++**Solution:**+```bash+# Check migration status+npm run migration:show++# Revert last migration+npm run migration:revert++# Regenerate migration+npm run migration:generate -- -n FixMigration+```+```++### TypeScript/NestJS Issues++```markdown+## Circular Dependency++**Symptom:** "Cannot read property 'X' of undefined"++**Solution:**+```typescript+// Use forwardRef for circular deps+@Module({+ imports: [+ forwardRef(() => SessionModule),+ ],+})+export class WebhookModule {}++// In service+constructor(+ @Inject(forwardRef(() => SessionService))+ private readonly sessionService: SessionService,+) {}+```++## DI Token Not Found++**Symptom:** "Nest can't resolve dependencies"++**Solution:**+- Ensure provider is exported from its module+- Check if module is imported where needed+- Use @Injectable() decorator on services+```++### Docker Issues++```markdown+## Container Keeps Restarting++**Check logs:**+```bash+docker compose logs app --tail 100+```++**Common causes:**+1. Missing environment variables+2. Database not ready (use depends_on + healthcheck)+3. Port already in use++## Chrome Crashes in Docker++**Solution:**+```dockerfile+# Add shared memory size+docker run --shm-size=2gb openwa+```++Or in docker-compose.yml:+```yaml+services:+ app:+ shm_size: '2gb'+```+```++## 8.12 Contributing Guide++### Getting Started++```markdown+1. Fork the repository+2. Create feature branch: `git checkout -b feature/amazing-feature`+3. Make changes following our coding standards+4. Write/update tests+5. Run linter: `npm run lint`+6. Run tests: `npm test`+7. Commit: `git commit -m 'feat(scope): add amazing feature'`+8. Push: `git push origin feature/amazing-feature`+9. Open Pull Request+```++### Code Review Checklist++```markdown+- [ ] Code follows project style guide+- [ ] Tests are included and passing+- [ ] Documentation is updated+- [ ] No console.log statements+- [ ] Error handling is proper+- [ ] No hardcoded values+- [ ] Security considerations addressed+- [ ] Performance impact considered+```++### Issue Reporting++```markdown+**Bug Report Template:**+- **Description:** Clear description of the bug+- **Steps to Reproduce:** Numbered steps+- **Expected Behavior:** What should happen+- **Actual Behavior:** What actually happens+- **Environment:** Node version, OS, Docker version+- **Logs:** Relevant error logs+```+---++<div align="center">++[← 07 - API Collection](./07-api-collection.md) · [Documentation Index](./README.md) · [Next: 09 - Testing Strategy →](./09-testing-strategy.md)++</div>diff --git a/docs/09-testing-strategy.md b/docs/09-testing-strategy.mdnew file mode 100644index 000000000..fe47b526a--- /dev/null+++ b/docs/09-testing-strategy.md@@ -0,0 +1,721 @@+# 09 - Testing Strategy++## Implementation Status++> **Current Status: Minimal Implementation**+>+> This document outlines the planned testing strategy for OpenWA. The current implementation includes only foundational tests:+>+> | Test Type | Planned | Actual |+> |-----------|---------|--------|+> | Unit Tests | 60% coverage | 3 files |+> | Integration Tests | 30% coverage | Not yet |+> | E2E Tests | Critical paths | Not yet |+>+> **Existing test files:**+> - `src/common/services/logger.service.spec.ts` - Logger functionality+> - `src/modules/health/health.controller.spec.ts` - Health endpoints+> - `src/modules/webhook/utils/idempotency.util.spec.ts` - Idempotency utilities+>+> Comprehensive testing is planned for future releases. The strategy below serves as a guide for contributors and future development phases.++---++## 09.1 Overview++```mermaid+flowchart TB+ subgraph TestPyramid["Testing Pyramid"]+ direction TB+ E2E[E2E Tests<br/>10%]+ INT[Integration Tests<br/>30%]+ UNIT[Unit Tests<br/>60%]+ end++ subgraph Types["Test Types"]+ UT[Unit Tests]+ IT[Integration Tests]+ ET[E2E Tests]+ PT[Performance Tests]+ ST[Security Tests]+ end+```++### Testing Goals++| Goal | Target | Current | Priority |+|------|--------|---------|----------|+| Code Coverage | > 80% | ~5% | High |+| Integration Test Coverage | > 70% | 0% | High |+| E2E Critical Paths | 100% | 0% | High |+| Performance Benchmarks | Pass all | Not started | Medium |+| Security Scan | 0 Critical | ✅ Passing | High |++## 09.2 Unit Testing++### Framework & Tools++```json+{+ "devDependencies": {+ "jest": "^29.0.0",+ "@nestjs/testing": "^10.0.0",+ "ts-jest": "^29.0.0"+ }+}+```++### Test Structure++```+src/+├── modules/+│ ├── session/+│ │ ├── session.service.ts+│ │ └── session.service.spec.ts+│ ├── message/+│ │ ├── message.service.ts+│ │ └── message.service.spec.ts+│ └── webhook/+│ ├── webhook.service.ts+│ └── webhook.service.spec.ts+└── common/+ └── utils/+ ├── validator.ts+ └── validator.spec.ts+```++### Unit Test Examples++```typescript+// session.service.spec.ts+describe('SessionService', () => {+ let service: SessionService;+ let engineFactory: jest.Mocked<EngineFactory>;+ let repository: jest.Mocked<SessionRepository>;++ beforeEach(async () => {+ const module = await Test.createTestingModule({+ providers: [+ SessionService,+ {+ provide: EngineFactory,+ useValue: createMock<EngineFactory>(),+ },+ {+ provide: SessionRepository,+ useValue: createMock<SessionRepository>(),+ },+ ],+ }).compile();++ service = module.get(SessionService);+ engineFactory = module.get(EngineFactory);+ repository = module.get(SessionRepository);+ });++ describe('createSession', () => {+ it('should create a new session with default config', async () => {+ const dto = { name: 'test-session' };+ repository.findByName.mockResolvedValue(null);+ repository.save.mockResolvedValue({ id: 'sess_123', ...dto });++ const result = await service.createSession(dto);++ expect(result.id).toBe('sess_123');+ expect(repository.save).toHaveBeenCalledWith(+ expect.objectContaining({ name: 'test-session' })+ );+ });++ it('should throw error if session name already exists', async () => {+ const dto = { name: 'existing-session' };+ repository.findByName.mockResolvedValue({ id: 'sess_old' });++ await expect(service.createSession(dto))+ .rejects.toThrow('SESSION_ALREADY_EXISTS');+ });+ });++ describe('sendMessage', () => {+ it('should validate chatId format', async () => {+ const invalidChatId = 'invalid-format';++ await expect(+ service.sendMessage('sess_123', invalidChatId, 'Hello')+ ).rejects.toThrow('MESSAGE_INVALID_CHAT_ID');+ });+ });+});+```++### Mocking Guidelines++```typescript+// Mock WhatsApp Engine+const mockEngine = {+ initialize: jest.fn().mockResolvedValue(undefined),+ sendMessage: jest.fn().mockResolvedValue({ messageId: 'msg_123' }),+ getContacts: jest.fn().mockResolvedValue([]),+ disconnect: jest.fn(),+ on: jest.fn(),+};++// Mock Repository+const mockRepository = {+ findById: jest.fn(),+ findByName: jest.fn(),+ save: jest.fn(),+ update: jest.fn(),+ delete: jest.fn(),+};++// Mock HTTP Service (for webhooks)+const mockHttpService = {+ post: jest.fn().mockReturnValue(of({ data: {}, status: 200 })),+};+```++## 09.3 Integration Testing++### Test Database++```yaml+# docker-compose.test.yml+version: '3.8'+services:+ postgres-test:+ image: postgres:15+ environment:+ POSTGRES_DB: openwa_test+ POSTGRES_USER: test+ POSTGRES_PASSWORD: test+ ports:+ - "5433:5432"+ tmpfs:+ - /var/lib/postgresql/data++ redis-test:+ image: redis:7-alpine+ ports:+ - "6380:6379"+```++### Integration Test Examples++```typescript+// session.integration.spec.ts+describe('Session Integration', () => {+ let app: INestApplication;+ let dataSource: DataSource;++ beforeAll(async () => {+ const module = await Test.createTestingModule({+ imports: [AppModule],+ })+ .overrideProvider(EngineFactory)+ .useValue(mockEngineFactory)+ .compile();++ app = module.createNestApplication();+ await app.init();+ dataSource = module.get(DataSource);+ });++ afterAll(async () => {+ await dataSource.destroy();+ await app.close();+ });++ beforeEach(async () => {+ // Clean database before each test+ await dataSource.query('TRUNCATE TABLE sessions CASCADE');+ });++ describe('POST /api/sessions', () => {+ it('should create session and return QR code', async () => {+ const response = await request(app.getHttpServer())+ .post('/api/sessions')+ .set('X-API-Key', 'test-api-key')+ .send({ name: 'integration-test' })+ .expect(201);++ expect(response.body.success).toBe(true);+ expect(response.body.data.status).toBe('SCAN_QR');+ expect(response.body.data.qr).toBeDefined();+ });++ it('should reject duplicate session name', async () => {+ // Create first session+ await request(app.getHttpServer())+ .post('/api/sessions')+ .set('X-API-Key', 'test-api-key')+ .send({ name: 'duplicate-test' })+ .expect(201);++ // Try to create duplicate+ const response = await request(app.getHttpServer())+ .post('/api/sessions')+ .set('X-API-Key', 'test-api-key')+ .send({ name: 'duplicate-test' })+ .expect(409);++ expect(response.body.error.code).toBe('SESSION_ALREADY_EXISTS');+ });+ });++ describe('Webhook Delivery', () => {+ it('should deliver webhook on message received', async () => {+ // Setup webhook endpoint mock+ const webhookServer = await createMockWebhookServer(3001);++ // Create session with webhook+ await request(app.getHttpServer())+ .post('/api/sessions')+ .set('X-API-Key', 'test-api-key')+ .send({+ name: 'webhook-test',+ webhook: {+ url: 'http://localhost:3001/webhook',+ events: ['message.received']+ }+ });++ // Simulate incoming message+ await simulateIncomingMessage(app, 'webhook-test', {+ chatId: '[email protected]',+ text: 'Test message'+ });++ // Verify webhook was called+ expect(webhookServer.receivedPayloads).toHaveLength(1);+ expect(webhookServer.receivedPayloads[0].event).toBe('message.received');++ await webhookServer.close();+ });+ });+});+```++## 09.4 E2E Testing++### Critical User Journeys++```mermaid+flowchart LR+ subgraph Journey1["Session Lifecycle"]+ J1A[Create Session] --> J1B[Scan QR]+ J1B --> J1C[Verify Connected]+ J1C --> J1D[Logout]+ end++ subgraph Journey2["Messaging Flow"]+ J2A[Get Session] --> J2B[Send Text]+ J2B --> J2C[Verify Sent]+ J2C --> J2D[Check Webhook]+ end++ subgraph Journey3["Bulk Operations"]+ J3A[Create Batch] --> J3B[Monitor Progress]+ J3B --> J3C[Verify Results]+ end+```++### E2E Test Scenarios++| ID | Scenario | Steps | Expected Result |+|----|----------|-------|-----------------|+| E2E-001 | Session Creation | Create → Get QR → Verify status | Status = SCAN_QR |+| E2E-002 | Send Text Message | Send text → Check response → Verify webhook | Message delivered + webhook called |+| E2E-003 | Send Media | Send image → Check upload → Verify delivery | Media delivered |+| E2E-004 | Bulk Messaging | Create batch → Monitor → Verify all sent | 100% delivery |+| E2E-005 | Webhook Retry | Setup failing webhook → Verify 3 retries | 3 attempts logged |+| E2E-006 | Rate Limiting | Exceed rate limit → Check 429 response | Proper error + headers |+| E2E-007 | API Key Auth | Invalid key → Valid key → Permission check | Proper auth flow |+| E2E-008 | WebSocket Events | Connect → Subscribe → Receive event | Event delivered |++### E2E Test Implementation++```typescript+// e2e/session.e2e-spec.ts+describe('Session E2E', () => {+ let api: AxiosInstance;++ beforeAll(() => {+ api = axios.create({+ baseURL: process.env.TEST_API_URL || 'http://localhost:2785/api',+ headers: { 'X-API-Key': process.env.TEST_API_KEY }+ });+ });++ describe('Complete Session Lifecycle', () => {+ let sessionId: string;++ it('Step 1: Create new session', async () => {+ const response = await api.post('/sessions', {+ name: `e2e-test-${Date.now()}`+ });++ expect(response.status).toBe(201);+ expect(response.data.data.status).toBe('SCAN_QR');+ sessionId = response.data.data.id;+ });++ it('Step 2: Get QR code', async () => {+ const response = await api.get(`/sessions/${sessionId}/qr`);++ expect(response.status).toBe(200);+ expect(response.data.data.image).toMatch(/^data:image\/png;base64,/);+ });++ it('Step 3: Check session status', async () => {+ const response = await api.get(`/sessions/${sessionId}`);++ expect(response.status).toBe(200);+ expect(response.data.data.id).toBe(sessionId);+ });++ it('Step 4: Delete session', async () => {+ const response = await api.delete(`/sessions/${sessionId}`);++ expect(response.status).toBe(200);+ });++ it('Step 5: Verify session deleted', async () => {+ try {+ await api.get(`/sessions/${sessionId}`);+ fail('Should have thrown 404');+ } catch (error) {+ expect(error.response.status).toBe(404);+ }+ });+ });+});+```++## 09.5 Performance Testing++### Tools++- **k6** - Load testing+- **Artillery** - API stress testing++### Performance Test Scenarios++```javascript+// k6/load-test.js+import http from 'k6/http';+import { check, sleep } from 'k6';++export const options = {+ stages: [+ { duration: '30s', target: 20 }, // Ramp up+ { duration: '1m', target: 50 }, // Stay at 50 users+ { duration: '30s', target: 100 }, // Peak load+ { duration: '30s', target: 0 }, // Ramp down+ ],+ thresholds: {+ http_req_duration: ['p(95)<500'], // 95% requests under 500ms+ http_req_failed: ['rate<0.01'], // Less than 1% errors+ },+};++const BASE_URL = __ENV.API_URL || 'http://localhost:2785/api';+const API_KEY = __ENV.API_KEY || 'test-key';++export default function () {+ // Test: Get sessions+ const sessionsRes = http.get(`${BASE_URL}/sessions`, {+ headers: { 'X-API-Key': API_KEY },+ });++ check(sessionsRes, {+ 'status is 200': (r) => r.status === 200,+ 'response time < 500ms': (r) => r.timings.duration < 500,+ });++ sleep(1);++ // Test: Send message (if session exists)+ if (sessionsRes.json().data?.length > 0) {+ const sessionId = sessionsRes.json().data[0].id;+ const msgRes = http.post(+ `${BASE_URL}/sessions/${sessionId}/messages/send-text`,+ JSON.stringify({+ chatId: '[email protected]',+ text: `Load test message ${Date.now()}`+ }),+ {+ headers: {+ 'X-API-Key': API_KEY,+ 'Content-Type': 'application/json'+ }+ }+ );++ check(msgRes, {+ 'message sent': (r) => r.status === 200 || r.status === 400,+ 'response time < 2s': (r) => r.timings.duration < 2000,+ });+ }++ sleep(1);+}+```++### Performance Targets++| Metric | Target | Critical |+|--------|--------|----------|+| API Response Time (p95) | < 500ms | < 1000ms |+| Message Send Latency | < 2s | < 5s |+| QR Generation Time | < 3s | < 5s |+| Throughput | 100 req/s | 50 req/s |+| Memory per Session | < 500MB | < 800MB |+| Concurrent Sessions | 10+ | 5 |++## 09.6 Security Testing++### Checklist++```markdown+## Security Test Checklist++### Authentication+- [ ] API key required for all endpoints+- [ ] Invalid API key returns 401+- [ ] Expired API key rejected+- [ ] API key hash stored (not plain)++### Authorization+- [ ] Permission checks enforced+- [ ] Session isolation (can't access other sessions)+- [ ] IP whitelist working++### Input Validation+- [ ] SQL injection prevented+- [ ] XSS in webhook payloads prevented+- [ ] chatId format validated+- [ ] File upload size limits enforced++### Rate Limiting+- [ ] Rate limits working per endpoint+- [ ] Rate limit headers present+- [ ] 429 response on exceed++### Data Protection+- [ ] Sensitive data encrypted+- [ ] No secrets in logs+- [ ] Session auth state encrypted+```++### Security Test Examples++```typescript+// security.spec.ts+describe('Security Tests', () => {+ describe('Authentication', () => {+ it('should reject request without API key', async () => {+ const response = await request(app.getHttpServer())+ .get('/api/sessions')+ .expect(401);++ expect(response.body.error.code).toBe('UNAUTHORIZED');+ });++ it('should reject invalid API key', async () => {+ const response = await request(app.getHttpServer())+ .get('/api/sessions')+ .set('X-API-Key', 'invalid-key')+ .expect(401);++ expect(response.body.error.code).toBe('UNAUTHORIZED');+ });+ });++ describe('Input Validation', () => {+ it('should reject SQL injection in session name', async () => {+ const response = await request(app.getHttpServer())+ .post('/api/sessions')+ .set('X-API-Key', validApiKey)+ .send({ name: "'; DROP TABLE sessions; --" })+ .expect(400);++ expect(response.body.error.code).toBe('VALIDATION_ERROR');+ });++ it('should reject XSS in webhook URL', async () => {+ const response = await request(app.getHttpServer())+ .post('/api/sessions/sess_123/webhooks')+ .set('X-API-Key', validApiKey)+ .send({+ url: 'javascript:alert(1)',+ events: ['message.received']+ })+ .expect(400);++ expect(response.body.error.code).toBe('WEBHOOK_URL_INVALID');+ });+ });++ describe('Rate Limiting', () => {+ it('should block after exceeding rate limit', async () => {+ // Send 35 requests (limit is 30)+ for (let i = 0; i < 35; i++) {+ await request(app.getHttpServer())+ .get('/api/sessions')+ .set('X-API-Key', validApiKey);+ }++ const response = await request(app.getHttpServer())+ .get('/api/sessions')+ .set('X-API-Key', validApiKey)+ .expect(429);++ expect(response.headers['retry-after']).toBeDefined();+ });+ });+});+```++## 09.7 CI/CD Integration++### GitHub Actions Workflow++```yaml+# .github/workflows/test.yml+name: Tests++on:+ push:+ branches: [main, develop]+ pull_request:+ branches: [main]++jobs:+ unit-tests:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: '20'+ cache: 'npm'++ - run: npm ci+ - run: npm run test:cov++ - name: Upload coverage+ uses: codecov/codecov-action@v3+ with:+ files: ./coverage/lcov.info++ integration-tests:+ runs-on: ubuntu-latest+ services:+ postgres:+ image: postgres:15+ env:+ POSTGRES_DB: openwa_test+ POSTGRES_USER: test+ POSTGRES_PASSWORD: test+ ports:+ - 5432:5432+ redis:+ image: redis:7+ ports:+ - 6379:6379++ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: '20'++ - run: npm ci+ - run: npm run test:integration+ env:+ DATABASE_URL: postgresql://test:test@localhost:5432/openwa_test+ REDIS_URL: redis://localhost:6379++ e2e-tests:+ runs-on: ubuntu-latest+ needs: [unit-tests, integration-tests]+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: '20'++ - run: npm ci+ - run: npm run build+ - run: npm run test:e2e++ security-scan:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - run: npm audit --audit-level=high+ - uses: snyk/actions/node@master+ env:+ SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}+```++## 09.8 Test Reporting++### Coverage Requirements++| Area | Minimum Coverage |+|------|------------------|+| Services | 85% |+| Controllers | 80% |+| Guards | 90% |+| Utils | 95% |+| Overall | 80% |++### Test Report Template++```markdown+## Test Execution Report++**Date:** YYYY-MM-DD+**Version:** X.X.X+**Environment:** CI / Staging / Production++### Summary++| Type | Total | Passed | Failed | Skipped |+|------|-------|--------|--------|---------|+| Unit | 150 | 148 | 2 | 0 |+| Integration | 45 | 45 | 0 | 0 |+| E2E | 15 | 14 | 1 | 0 |++### Coverage++| Module | Lines | Functions | Branches |+|--------|-------|-----------|----------|+| session | 92% | 95% | 88% |+| message | 85% | 90% | 82% |+| webhook | 88% | 92% | 85% |+| **Total** | **87%** | **91%** | **84%** |++### Failed Tests++1. `message.service.spec.ts` - sendMedia timeout+ - **Cause:** Mock timeout misconfigured+ - **Action:** Fix in PR #123++### Performance Results++| Test | Target | Actual | Status |+|------|--------|--------|--------|+| API p95 latency | <500ms | 320ms | ✅ |+| Throughput | 100 req/s | 125 req/s | ✅ |+```+---++<div align="center">++[← 08 - Development Guidelines](./08-development-guidelines.md) · [Documentation Index](./README.md) · [Next: 10 - DevOps & Infrastructure →](./10-devops-infrastructure.md)++</div>diff --git a/docs/10-devops-infrastructure.md b/docs/10-devops-infrastructure.mdnew file mode 100644index 000000000..96d324f0a--- /dev/null+++ b/docs/10-devops-infrastructure.md@@ -0,0 +1,1196 @@+# 10 - DevOps & Infrastructure++## 10.1 Infrastructure Overview++```mermaid+flowchart TB+ subgraph Development["Development"]+ DEV[Local Docker Compose]+ end++ subgraph Staging["Staging"]+ STG[Single Server]+ end++ subgraph Production["Production"]+ LB[Load Balancer]+ LB --> APP1[App Instance 1]+ LB --> APP2[App Instance 2]+ APP1 --> DB[(PostgreSQL)]+ APP2 --> DB+ APP1 --> REDIS[(Redis)]+ APP2 --> REDIS+ end++ DEV --> |deploy| STG+ STG --> |promote| Production+```++## 10.2 Docker Configuration++### Dockerfile++```dockerfile+# Dockerfile (multi-stage build)++# Build stage+FROM node:20-slim AS build+WORKDIR /app+COPY package*.json ./+RUN npm ci+COPY . .+RUN npm run build++# Runtime stage+FROM node:20-slim++# Install Chrome dependencies+RUN apt-get update && apt-get install -y \+ chromium \+ curl \+ fonts-ipafont-gothic \+ fonts-wqy-zenhei \+ fonts-thai-tlwg \+ fonts-kacst \+ fonts-freefont-ttf \+ libxss1 \+ --no-install-recommends \+ && rm -rf /var/lib/apt/lists/*++# Set Chrome path for Puppeteer+ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true+ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium++# Create app directory+WORKDIR /app++# Copy package files & install production dependencies+COPY package*.json ./+RUN npm ci --only=production++# Copy build output+COPY --from=build /app/dist ./dist++# Create non-root user+RUN groupadd -r openwa && useradd -r -g openwa openwa+RUN chown -R openwa:openwa /app+USER openwa++# Expose port+EXPOSE 2785++# Health check+HEALTHCHECK --interval=30s --timeout=10s --start-period=60s \+ CMD curl -f http://localhost:2785/health || exit 1++# Start app+CMD ["node", "dist/main.js"]+```++### Docker Compose (Development)++```yaml+# docker-compose.yml+version: '3.8'++services:+ app:+ build:+ context: .+ target: build+ command: npm run start:dev+ ports:+ - "2785:2785"+ environment:+ - NODE_ENV=development+ - DATABASE_URL=postgresql://openwa:openwa@postgres:5432/openwa+ - REDIS_URL=redis://redis:6379+ - API_KEY_MASTER=dev-master-key+ volumes:+ - ./:/app+ - /app/node_modules+ - session-data:/app/.wwebjs_auth+ depends_on:+ - postgres+ - redis+ restart: unless-stopped++ postgres:+ image: postgres:16-alpine+ environment:+ - POSTGRES_USER=openwa+ - POSTGRES_PASSWORD=openwa+ - POSTGRES_DB=openwa+ volumes:+ - postgres-data:/var/lib/postgresql/data+ ports:+ - "5432:5432"++ redis:+ image: redis:7-alpine+ volumes:+ - redis-data:/data+ ports:+ - "6379:6379"++ dashboard:+ build:+ context: ./dashboard+ ports:+ - "2886:2886"+ environment:+ - VITE_API_URL=http://localhost:2785+ depends_on:+ - app++volumes:+ postgres-data:+ redis-data:+ session-data:+```++### Docker Compose (Production)++```yaml+# docker-compose.prod.yml+version: '3.8'++services:+ app:+ image: ghcr.io/rmyndharis/openwa:latest+ deploy:+ replicas: 1+ resources:+ limits:+ cpus: '2'+ memory: 2G+ reservations:+ cpus: '1'+ memory: 1G+ environment:+ - NODE_ENV=production+ - DATABASE_URL=${DATABASE_URL}+ - REDIS_URL=${REDIS_URL}+ - ENCRYPTION_KEY=${ENCRYPTION_KEY}+ volumes:+ - session-data:/app/.wwebjs_auth+ healthcheck:+ test: ["CMD", "curl", "-f", "http://localhost:2785/health"]+ interval: 30s+ timeout: 10s+ retries: 3+ restart: always++ nginx:+ image: nginx:alpine+ ports:+ - "80:80"+ - "443:443"+ volumes:+ - ./nginx.conf:/etc/nginx/nginx.conf:ro+ - ./certs:/etc/nginx/certs:ro+ depends_on:+ - app+ restart: always++volumes:+ session-data:+ driver: local+```++> [!NOTE]+> If running more than 1 replica, use shared storage for `SESSION_DATA_PATH` (NFS/S3/CSI) and enable sticky sessions. Local volumes are not suitable for multi-replica setups.++## 10.3 CI/CD Pipeline++### GitHub Actions Workflow++```yaml+# .github/workflows/ci.yml+name: CI/CD Pipeline++on:+ push:+ branches: [main, develop]+ pull_request:+ branches: [main]++env:+ REGISTRY: ghcr.io+ IMAGE_NAME: ${{ github.repository }}++jobs:+ test:+ runs-on: ubuntu-latest++ services:+ postgres:+ image: postgres:16+ env:+ POSTGRES_USER: test+ POSTGRES_PASSWORD: test+ POSTGRES_DB: test+ ports:+ - 5432:5432+ options: >-+ --health-cmd pg_isready+ --health-interval 10s+ --health-timeout 5s+ --health-retries 5++ steps:+ - uses: actions/checkout@v4++ - name: Setup Node.js+ uses: actions/setup-node@v4+ with:+ node-version: '20'+ cache: 'npm'++ - name: Install dependencies+ run: npm ci++ - name: Run linter+ run: npm run lint++ - name: Run tests+ run: npm run test:cov+ env:+ DATABASE_URL: postgresql://test:test@localhost:5432/test++ - name: Upload coverage+ uses: codecov/codecov-action@v3+ with:+ files: ./coverage/lcov.info++ build:+ needs: test+ runs-on: ubuntu-latest+ if: github.event_name == 'push'++ steps:+ - uses: actions/checkout@v4++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Login to Container Registry+ uses: docker/login-action@v3+ with:+ registry: ${{ env.REGISTRY }}+ username: ${{ github.actor }}+ password: ${{ secrets.GITHUB_TOKEN }}++ - name: Extract metadata+ id: meta+ uses: docker/metadata-action@v5+ with:+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}+ tags: |+ type=ref,event=branch+ type=sha,prefix=+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}++ - name: Build and push+ uses: docker/build-push-action@v5+ with:+ context: .+ push: true+ tags: ${{ steps.meta.outputs.tags }}+ labels: ${{ steps.meta.outputs.labels }}+ cache-from: type=gha+ cache-to: type=gha,mode=max++ deploy-staging:+ needs: build+ runs-on: ubuntu-latest+ if: github.ref == 'refs/heads/develop'+ environment: staging++ steps:+ - name: Deploy to Staging+ uses: appleboy/ssh-action@v1+ with:+ host: ${{ secrets.STAGING_HOST }}+ username: ${{ secrets.STAGING_USER }}+ key: ${{ secrets.STAGING_SSH_KEY }}+ script: |+ cd /opt/openwa+ docker compose pull+ docker compose up -d+ docker system prune -f++ deploy-production:+ needs: build+ runs-on: ubuntu-latest+ if: github.ref == 'refs/heads/main'+ environment: production++ steps:+ - name: Deploy to Production+ uses: appleboy/ssh-action@v1+ with:+ host: ${{ secrets.PROD_HOST }}+ username: ${{ secrets.PROD_USER }}+ key: ${{ secrets.PROD_SSH_KEY }}+ script: |+ cd /opt/openwa+ docker compose -f docker-compose.prod.yml pull+ docker compose -f docker-compose.prod.yml up -d --no-deps app+ docker system prune -f+```++## 10.4 Deployment Architecture++### Single Server Deployment++```mermaid+flowchart TB+ subgraph Server["Single Server"]+ NGINX[Nginx Reverse Proxy]+ NGINX --> APP[OpenWA App]+ APP --> PG[(PostgreSQL)]+ APP --> RD[(Redis)]+ APP --> FS[File Storage]+ end++ Internet --> NGINX+```++### Multi-Server Deployment++```mermaid+flowchart TB+ subgraph External["External"]+ CDN[CDN / CloudFlare]+ end++ subgraph LoadBalancer["Load Balancer"]+ LB[HAProxy / Nginx]+ end++ subgraph AppServers["Application Servers"]+ APP1[OpenWA 1]+ APP2[OpenWA 2]+ APP3[OpenWA N]+ end++ subgraph DataLayer["Data Layer"]+ PG[(PostgreSQL Primary)]+ PGR[(PostgreSQL Replica)]+ RD[(Redis Cluster)]+ S3[(S3 Storage)]+ end++ CDN --> LB+ LB --> APP1 & APP2 & APP3+ APP1 & APP2 & APP3 --> PG+ APP1 & APP2 & APP3 --> RD+ APP1 & APP2 & APP3 --> S3+ PG --> PGR+```++## 10.5 Environment Configuration++### Environment Variables++```bash+# .env.example++# ===========================================+# APPLICATION+# ===========================================+NODE_ENV=production+PORT=2785+API_PREFIX=/api+LOG_LEVEL=info+LOG_FORMAT=json++# ===========================================+# DATABASE (choose one)+# ===========================================+# Option 1: SQLite (for minimal deployments)+DATABASE_TYPE=sqlite+DATABASE_SQLITE_PATH=./data/openwa.db++# Option 2: PostgreSQL (for production)+# DATABASE_TYPE=postgres+# DATABASE_URL=postgresql://user:pass@localhost:5432/openwa+# DATABASE_POOL_MAX=20+# DATABASE_SSL=false++# ===========================================+# MEDIA STORAGE (choose one)+# ===========================================+# Option 1: Local filesystem (default)+STORAGE_TYPE=local+STORAGE_LOCAL_PATH=./media+STORAGE_LOCAL_BASE_URL=/media++# Option 2: S3+# STORAGE_TYPE=s3+# STORAGE_S3_BUCKET=openwa-media+# STORAGE_S3_REGION=ap-southeast-1+# STORAGE_S3_ACCESS_KEY_ID=your-access-key+# STORAGE_S3_SECRET_ACCESS_KEY=your-secret-key++# Option 3: MinIO (S3-compatible)+# STORAGE_TYPE=minio+# STORAGE_S3_BUCKET=openwa-media+# STORAGE_S3_ENDPOINT=http://minio:9000+# STORAGE_S3_ACCESS_KEY_ID=minioadmin+# STORAGE_S3_SECRET_ACCESS_KEY=minioadmin+# STORAGE_S3_FORCE_PATH_STYLE=true++# ===========================================+# CACHE & QUEUE (choose one)+# ===========================================+# Option 1: In-Memory (for single instance)+CACHE_TYPE=memory+CACHE_TTL=300+CACHE_MAX=1000++# Option 2: Redis (for multi-instance / production)+# CACHE_TYPE=redis+# REDIS_URL=redis://localhost:6379++# ===========================================+# WHATSAPP ENGINE+# ===========================================+ENGINE_TYPE=whatsapp-web.js+# ENGINE_TYPE=baileys+# ENGINE_TYPE=mock++# Session+SESSION_DATA_PATH=./.wwebjs_auth+MAX_SESSIONS=10++# Puppeteer (for whatsapp-web.js)+PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium+PUPPETEER_HEADLESS=true+PUPPETEER_ARGS=--no-sandbox,--disable-setuid-sandbox++# ===========================================+# SECURITY+# ===========================================+# Generate with: openssl rand -base64 32+ENCRYPTION_KEY=your-32-byte-encryption-key-here+API_KEY_MASTER=your-master-api-key++# ===========================================+# WEBHOOK+# ===========================================+WEBHOOK_TIMEOUT=30000+WEBHOOK_RETRY_COUNT=3+WEBHOOK_RETRY_DELAY=5000++# ===========================================+# RATE LIMITING+# ===========================================+RATE_LIMIT_WINDOW=60000+RATE_LIMIT_MAX=100+```++### Configuration Service++```typescript+// config/configuration.ts+export default () => ({+ port: parseInt(process.env.PORT, 10) || 3000,+ database: {+ url: process.env.DATABASE_URL,+ },+ redis: {+ url: process.env.REDIS_URL,+ },+ security: {+ encryptionKey: process.env.ENCRYPTION_KEY,+ masterApiKey: process.env.API_KEY_MASTER,+ },+ session: {+ dataPath: process.env.SESSION_DATA_PATH || './.wwebjs_auth',+ maxSessions: parseInt(process.env.MAX_SESSIONS, 10) || 10,+ },+ webhook: {+ timeout: parseInt(process.env.WEBHOOK_TIMEOUT, 10) || 30000,+ retryCount: parseInt(process.env.WEBHOOK_RETRY_COUNT, 10) || 3,+ retryDelay: parseInt(process.env.WEBHOOK_RETRY_DELAY, 10) || 5000,+ },+ rateLimit: {+ windowMs: parseInt(process.env.RATE_LIMIT_WINDOW, 10) || 60000,+ max: parseInt(process.env.RATE_LIMIT_MAX, 10) || 100,+ },+ puppeteer: {+ executablePath: process.env.PUPPETEER_EXECUTABLE_PATH,+ headless: process.env.PUPPETEER_HEADLESS !== 'false',+ args: process.env.PUPPETEER_ARGS?.split(',') || [],+ },+});+```++## 10.6 Monitoring & Observability++### Monitoring Stack++```mermaid+flowchart LR+ subgraph App["Application"]+ METRICS[Metrics Endpoint]+ LOGS[Structured Logs]+ TRACES[Traces]+ end++ subgraph Collection["Collection"]+ PROM[Prometheus]+ LOKI[Loki]+ TEMPO[Tempo]+ end++ subgraph Visualization["Visualization"]+ GRAF[Grafana]+ end++ subgraph Alerting["Alerting"]+ AM[AlertManager]+ SLACK[Slack]+ EMAIL[Email]+ end++ METRICS --> PROM --> GRAF+ LOGS --> LOKI --> GRAF+ TRACES --> TEMPO --> GRAF+ PROM --> AM+ AM --> SLACK & EMAIL+```++### Docker Compose Monitoring Stack++```yaml+# docker-compose.monitoring.yml+version: '3.8'++services:+ prometheus:+ image: prom/prometheus:v2.47.0+ volumes:+ - ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml+ - ./monitoring/alerts.yml:/etc/prometheus/alerts.yml+ - prometheus-data:/prometheus+ command:+ - '--config.file=/etc/prometheus/prometheus.yml'+ - '--storage.tsdb.retention.time=30d'+ ports:+ - "9090:9090"+ restart: unless-stopped++ grafana:+ image: grafana/grafana:10.1.0+ volumes:+ - ./monitoring/grafana/provisioning:/etc/grafana/provisioning+ - ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards+ - grafana-data:/var/lib/grafana+ environment:+ - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}+ - GF_USERS_ALLOW_SIGN_UP=false+ ports:+ - "3001:3000"+ depends_on:+ - prometheus+ - loki+ restart: unless-stopped++ loki:+ image: grafana/loki:2.9.0+ volumes:+ - ./monitoring/loki.yml:/etc/loki/local-config.yaml+ - loki-data:/loki+ command: -config.file=/etc/loki/local-config.yaml+ ports:+ - "3100:3100"+ restart: unless-stopped++ promtail:+ image: grafana/promtail:2.9.0+ volumes:+ - ./monitoring/promtail.yml:/etc/promtail/config.yml+ - /var/log:/var/log:ro+ - /var/lib/docker/containers:/var/lib/docker/containers:ro+ command: -config.file=/etc/promtail/config.yml+ depends_on:+ - loki+ restart: unless-stopped++ alertmanager:+ image: prom/alertmanager:v0.26.0+ volumes:+ - ./monitoring/alertmanager.yml:/etc/alertmanager/alertmanager.yml+ ports:+ - "9093:9093"+ restart: unless-stopped++ node-exporter:+ image: prom/node-exporter:v1.6.1+ volumes:+ - /proc:/host/proc:ro+ - /sys:/host/sys:ro+ - /:/rootfs:ro+ command:+ - '--path.procfs=/host/proc'+ - '--path.sysfs=/host/sys'+ ports:+ - "9100:9100"+ restart: unless-stopped++volumes:+ prometheus-data:+ grafana-data:+ loki-data:+```++### Prometheus Configuration++```yaml+# monitoring/prometheus.yml+global:+ scrape_interval: 15s+ evaluation_interval: 15s++alerting:+ alertmanagers:+ - static_configs:+ - targets: ['alertmanager:9093']++rule_files:+ - 'alerts.yml'++scrape_configs:+ - job_name: 'openwa'+ static_configs:+ - targets: ['app:2785']+ metrics_path: '/api/metrics'++ - job_name: 'node'+ static_configs:+ - targets: ['node-exporter:9100']++ - job_name: 'prometheus'+ static_configs:+ - targets: ['localhost:9090']+```++### Alert Rules++```yaml+# monitoring/alerts.yml+groups:+ - name: openwa-alerts+ rules:+ # High Error Rate+ - alert: HighErrorRate+ expr: |+ sum(rate(http_requests_total{status=~"5.."}[5m]))+ / sum(rate(http_requests_total[5m])) > 0.05+ for: 5m+ labels:+ severity: critical+ annotations:+ summary: "High error rate detected"+ description: "Error rate is {{ $value | humanizePercentage }} in last 5 minutes"++ # API Response Time+ - alert: HighResponseTime+ expr: |+ histogram_quantile(0.95,+ sum(rate(http_request_duration_seconds_bucket[5m])) by (le)+ ) > 1+ for: 5m+ labels:+ severity: warning+ annotations:+ summary: "High API response time"+ description: "95th percentile response time is {{ $value }}s"++ # Session Down+ - alert: SessionDisconnected+ expr: session_status{status="disconnected"} > 0+ for: 2m+ labels:+ severity: warning+ annotations:+ summary: "WhatsApp session disconnected"+ description: "Session {{ $labels.session_id }} has been disconnected"++ # Memory Usage+ - alert: HighMemoryUsage+ expr: |+ (node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes)+ / node_memory_MemTotal_bytes > 0.85+ for: 5m+ labels:+ severity: warning+ annotations:+ summary: "High memory usage"+ description: "Memory usage is {{ $value | humanizePercentage }}"++ # Webhook Failures+ - alert: WebhookDeliveryFailures+ expr: |+ sum(rate(webhook_deliveries_total{status="failed"}[5m]))+ / sum(rate(webhook_deliveries_total[5m])) > 0.1+ for: 5m+ labels:+ severity: warning+ annotations:+ summary: "High webhook delivery failure rate"+ description: "{{ $value | humanizePercentage }} webhooks failing"++ # Service Down+ - alert: ServiceDown+ expr: up{job="openwa"} == 0+ for: 1m+ labels:+ severity: critical+ annotations:+ summary: "OpenWA service is down"+ description: "The OpenWA application is not responding"+```++### AlertManager Configuration++```yaml+# monitoring/alertmanager.yml+global:+ resolve_timeout: 5m+ slack_api_url: '${SLACK_WEBHOOK_URL}'++route:+ group_by: ['alertname', 'severity']+ group_wait: 10s+ group_interval: 10s+ repeat_interval: 1h+ receiver: 'slack-notifications'+ routes:+ - match:+ severity: critical+ receiver: 'slack-critical'+ - match:+ severity: warning+ receiver: 'slack-warnings'++receivers:+ - name: 'slack-notifications'+ slack_configs:+ - channel: '#openwa-alerts'+ send_resolved: true++ - name: 'slack-critical'+ slack_configs:+ - channel: '#openwa-critical'+ send_resolved: true+ title: '🚨 CRITICAL: {{ .GroupLabels.alertname }}'+ text: '{{ range .Alerts }}{{ .Annotations.description }}{{ end }}'++ - name: 'slack-warnings'+ slack_configs:+ - channel: '#openwa-alerts'+ send_resolved: true+ title: '⚠️ WARNING: {{ .GroupLabels.alertname }}'+```++### Health Check Endpoint++```typescript+// health/health.controller.ts+@Controller('health')+export class HealthController {+ @Get()+ async basic(): Promise<{ status: string; timestamp: string }> {+ return {+ status: 'ok',+ timestamp: new Date().toISOString(),+ };+ }++ // Requires API key (protected via auth guard/middleware)+ @Get('detailed')+ async detailed(): Promise<HealthCheckResult> {+ return {+ status: 'ok',+ version: process.env.npm_package_version,+ uptime: process.uptime(),+ timestamp: new Date().toISOString(),+ checks: {+ database: await this.checkDatabase(),+ redis: await this.checkRedis(),+ sessions: await this.getSessionStats(),+ },+ };+ }+}+```++### Prometheus Metrics Implementation++```typescript+// metrics/metrics.service.ts+import { Injectable } from '@nestjs/common';+import { Registry, Counter, Gauge, Histogram, collectDefaultMetrics } from 'prom-client';++@Injectable()+export class MetricsService {+ private readonly registry: Registry;++ // Counters+ readonly httpRequestsTotal: Counter;+ readonly messagesSentTotal: Counter;+ readonly webhookDeliveriesTotal: Counter;++ // Gauges+ readonly activeSessions: Gauge;+ readonly connectedSessions: Gauge;+ readonly queueSize: Gauge;++ // Histograms+ readonly httpRequestDuration: Histogram;+ readonly messageSendDuration: Histogram;+ readonly webhookDeliveryDuration: Histogram;++ constructor() {+ this.registry = new Registry();+ collectDefaultMetrics({ register: this.registry });++ // HTTP Metrics+ this.httpRequestsTotal = new Counter({+ name: 'http_requests_total',+ help: 'Total HTTP requests',+ labelNames: ['method', 'path', 'status'],+ registers: [this.registry],+ });++ this.httpRequestDuration = new Histogram({+ name: 'http_request_duration_seconds',+ help: 'HTTP request duration in seconds',+ labelNames: ['method', 'path'],+ buckets: [0.01, 0.05, 0.1, 0.5, 1, 2, 5],+ registers: [this.registry],+ });++ // Message Metrics+ this.messagesSentTotal = new Counter({+ name: 'messages_sent_total',+ help: 'Total messages sent',+ labelNames: ['session_id', 'type', 'status'],+ registers: [this.registry],+ });++ this.messageSendDuration = new Histogram({+ name: 'message_send_duration_seconds',+ help: 'Message send duration in seconds',+ labelNames: ['session_id', 'type'],+ buckets: [0.1, 0.5, 1, 2, 5, 10],+ registers: [this.registry],+ });++ // Session Metrics+ this.activeSessions = new Gauge({+ name: 'active_sessions_total',+ help: 'Number of active sessions',+ registers: [this.registry],+ });++ this.connectedSessions = new Gauge({+ name: 'connected_sessions_total',+ help: 'Number of connected sessions',+ registers: [this.registry],+ });++ // Webhook Metrics+ this.webhookDeliveriesTotal = new Counter({+ name: 'webhook_deliveries_total',+ help: 'Total webhook deliveries',+ labelNames: ['event', 'status'],+ registers: [this.registry],+ });++ this.webhookDeliveryDuration = new Histogram({+ name: 'webhook_delivery_duration_seconds',+ help: 'Webhook delivery duration in seconds',+ labelNames: ['event'],+ buckets: [0.1, 0.5, 1, 2, 5, 10, 30],+ registers: [this.registry],+ });++ // Queue Metrics+ this.queueSize = new Gauge({+ name: 'message_queue_size',+ help: 'Current size of message queue',+ labelNames: ['queue_name'],+ registers: [this.registry],+ });+ }++ getMetrics(): Promise<string> {+ return this.registry.metrics();+ }+}+```++### Grafana Dashboard Definition++```json+// monitoring/grafana/dashboards/openwa.json+{+ "title": "OpenWA Dashboard",+ "uid": "openwa-main",+ "panels": [+ {+ "title": "Active Sessions",+ "type": "stat",+ "gridPos": { "x": 0, "y": 0, "w": 6, "h": 4 },+ "targets": [+ { "expr": "active_sessions_total" }+ ]+ },+ {+ "title": "Messages Sent (24h)",+ "type": "stat",+ "gridPos": { "x": 6, "y": 0, "w": 6, "h": 4 },+ "targets": [+ { "expr": "sum(increase(messages_sent_total[24h]))" }+ ]+ },+ {+ "title": "Error Rate",+ "type": "gauge",+ "gridPos": { "x": 12, "y": 0, "w": 6, "h": 4 },+ "targets": [+ {+ "expr": "sum(rate(http_requests_total{status=~\"5..\"}[5m])) / sum(rate(http_requests_total[5m])) * 100"+ }+ ]+ },+ {+ "title": "Request Rate",+ "type": "timeseries",+ "gridPos": { "x": 0, "y": 4, "w": 12, "h": 8 },+ "targets": [+ { "expr": "sum(rate(http_requests_total[5m])) by (status)", "legendFormat": "{{status}}" }+ ]+ },+ {+ "title": "Response Time (p95)",+ "type": "timeseries",+ "gridPos": { "x": 12, "y": 4, "w": 12, "h": 8 },+ "targets": [+ {+ "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))"+ }+ ]+ },+ {+ "title": "Messages by Type",+ "type": "piechart",+ "gridPos": { "x": 0, "y": 12, "w": 8, "h": 8 },+ "targets": [+ { "expr": "sum(messages_sent_total) by (type)", "legendFormat": "{{type}}" }+ ]+ },+ {+ "title": "Webhook Delivery Success Rate",+ "type": "timeseries",+ "gridPos": { "x": 8, "y": 12, "w": 8, "h": 8 },+ "targets": [+ {+ "expr": "sum(rate(webhook_deliveries_total{status=\"success\"}[5m])) / sum(rate(webhook_deliveries_total[5m])) * 100"+ }+ ]+ },+ {+ "title": "Memory Usage",+ "type": "timeseries",+ "gridPos": { "x": 16, "y": 12, "w": 8, "h": 8 },+ "targets": [+ { "expr": "process_resident_memory_bytes / 1024 / 1024", "legendFormat": "Memory (MB)" }+ ]+ }+ ]+}+```++### Structured Logging++```typescript+// common/logging/logger.service.ts+import { Injectable, LoggerService } from '@nestjs/common';+import * as winston from 'winston';++@Injectable()+export class AppLoggerService implements LoggerService {+ private logger: winston.Logger;++ constructor() {+ this.logger = winston.createLogger({+ level: process.env.LOG_LEVEL || 'info',+ format: winston.format.combine(+ winston.format.timestamp(),+ winston.format.json()+ ),+ defaultMeta: {+ service: 'openwa',+ version: process.env.npm_package_version+ },+ transports: [+ new winston.transports.Console(),+ // For Loki+ new winston.transports.Http({+ host: process.env.LOKI_HOST || 'loki',+ port: 3100,+ path: '/loki/api/v1/push',+ }),+ ],+ });+ }++ log(message: string, context?: object) {+ this.logger.info(message, { context });+ }++ error(message: string, trace?: string, context?: object) {+ this.logger.error(message, { trace, context });+ }++ warn(message: string, context?: object) {+ this.logger.warn(message, { context });+ }++ debug(message: string, context?: object) {+ this.logger.debug(message, { context });+ }+}++// Usage example+this.logger.log('Message sent', {+ sessionId: 'sess_123',+ chatId: '[email protected]',+ messageType: 'text',+ duration: 1.5+});+```++### Key Metrics to Monitor++| Category | Metric | Description | Alert Threshold |+|----------|--------|-------------|-----------------|+| **API** | `http_requests_total` | Request count by status | Error rate > 5% |+| **API** | `http_request_duration_seconds` | Request latency | p95 > 1s |+| **Sessions** | `active_sessions_total` | Total sessions | Near limit |+| **Sessions** | `connected_sessions_total` | Connected sessions | < active |+| **Messages** | `messages_sent_total` | Messages sent | Sudden drop |+| **Messages** | `message_send_duration_seconds` | Send latency | p95 > 5s |+| **Webhooks** | `webhook_deliveries_total` | Delivery status | Failure > 10% |+| **System** | `process_resident_memory_bytes` | Memory usage | > 80% |+| **System** | `nodejs_eventloop_lag_seconds` | Event loop lag | > 100ms |+++## 10.7 Backup & Recovery++### Backup Strategy++```mermaid+flowchart TB+ subgraph Daily["Daily Backup"]+ DB[(Database)] --> DUMP[pg_dump]+ DUMP --> COMPRESS[gzip]+ COMPRESS --> ENCRYPT[encrypt]+ ENCRYPT --> S3[S3 Storage]+ end++ subgraph Retention["Retention Policy"]+ D7[Daily: 7 days]+ W4[Weekly: 4 weeks]+ M12[Monthly: 12 months]+ end+```++### Backup Script++```bash+#!/bin/bash+# scripts/backup.sh++set -e++DATE=$(date +%Y%m%d_%H%M%S)+BACKUP_DIR="/backups"+S3_BUCKET="s3://openwa-backups"++# Database backup+echo "Backing up database..."+pg_dump -Fc $DATABASE_URL > $BACKUP_DIR/db_$DATE.dump+gzip $BACKUP_DIR/db_$DATE.dump++# Session data backup+echo "Backing up session data..."+tar -czf $BACKUP_DIR/sessions_$DATE.tar.gz /app/.wwebjs_auth++# Upload to S3+echo "Uploading to S3..."+aws s3 cp $BACKUP_DIR/db_$DATE.dump.gz $S3_BUCKET/database/+aws s3 cp $BACKUP_DIR/sessions_$DATE.tar.gz $S3_BUCKET/sessions/++# Cleanup local files older than 7 days+find $BACKUP_DIR -mtime +7 -delete++echo "Backup completed: $DATE"+```++### Recovery Procedure++```bash+#!/bin/bash+# scripts/restore.sh++set -e++BACKUP_DATE=$1++# Download from S3+aws s3 cp s3://openwa-backups/database/db_$BACKUP_DATE.dump.gz /tmp/+aws s3 cp s3://openwa-backups/sessions/sessions_$BACKUP_DATE.tar.gz /tmp/++# Restore database+gunzip /tmp/db_$BACKUP_DATE.dump.gz+pg_restore -d $DATABASE_URL /tmp/db_$BACKUP_DATE.dump++# Restore sessions+tar -xzf /tmp/sessions_$BACKUP_DATE.tar.gz -C /++echo "Restore completed"+```++## 10.8 Scaling Guidelines++### Vertical Scaling++| Sessions | RAM | CPU | Storage |+|----------|-----|-----|---------|+| 1-5 | 2GB | 2 cores | 20GB |+| 5-10 | 4GB | 4 cores | 50GB |+| 10-20 | 8GB | 8 cores | 100GB |+| 20+ | 16GB+ | 16+ cores | 200GB+ |++### Horizontal Scaling Checklist++- [ ] Shared PostgreSQL database+- [ ] Redis for session affinity+- [ ] Shared file storage (S3/NFS)+- [ ] Load balancer with sticky sessions+- [ ] Health check endpoints+- [ ] Graceful shutdown handling+---++<div align="center">++[← 09 - Testing Strategy](./09-testing-strategy.md) · [Documentation Index](./README.md) · [Next: 11 - Operational Runbooks →](./11-operational-runbooks.md)++</div>diff --git a/docs/11-operational-runbooks.md b/docs/11-operational-runbooks.mdnew file mode 100644index 000000000..842cafe3e--- /dev/null+++ b/docs/11-operational-runbooks.md@@ -0,0 +1,802 @@+# 11 - Operational Runbooks++## 11.1 Overview++This document contains Standard Operating Procedures (SOP) for OpenWA operations, including incident response, maintenance procedures, and troubleshooting guides.++### Runbook Structure++Each runbook follows this format:++```+## Runbook: [Title]+### Trigger+### Impact+### Prerequisites+### Steps+### Verification+### Rollback+```++## 11.2 Incident Response++### Runbook: Service Down++**Trigger:** Health check failing, API not responding++**Impact:** All sessions affected, messages not processing++**Prerequisites:**+- SSH access to server+- Docker CLI access+- Database access++**Steps:**++```bash+# 1. Check container status+docker compose ps++# 2. Check container logs+docker compose logs --tail=100 openwa++# 3. Check system resources+docker stats --no-stream+df -h+free -m++# 4. Identify root cause+# A. Container crashed+docker compose logs openwa 2>&1 | grep -i "error\|fatal\|crash"++# B. Out of memory+docker compose logs openwa 2>&1 | grep -i "oom\|memory"++# C. Database connection+docker compose logs openwa 2>&1 | grep -i "database\|connection refused"++# 5. Apply fix based on cause:++# A. Simple restart+docker compose restart openwa++# B. Full restart with cleanup+docker compose down+docker compose up -d++# C. Memory issues - increase limit+# Edit docker-compose.yml and increase memory limit+docker compose up -d++# D. Database issues+docker compose restart postgres+# Wait for postgres to be ready+sleep 10+docker compose restart openwa+```++**Verification:**++```bash+# Check health+curl http://localhost:2785/health++# Check all sessions reconnected+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions | jq '.[].status'++# Send test message+curl -X POST http://localhost:2785/api/sessions/default/messages \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{"phone": "[email protected]", "type": "text", "body": "Test after restart"}'+```++**Rollback:** Restore from backup if data corruption detected (see Runbook: Restore from Backup)++---++### Runbook: Session Disconnected++**Trigger:** Session status changed to DISCONNECTED, webhook not receiving messages++**Impact:** Single session affected++**Prerequisites:**+- API Key+- Physical access to phone (if QR needed)++**Steps:**++```bash+# 1. Check session status+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}++# 2. Check if auto-reconnect is working+docker compose logs openwa 2>&1 | grep -i "{sessionId}" | tail -20++# 3. Try session restart+curl -X POST -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/restart++# 4. Wait for reconnection (30 seconds)+sleep 30++# 5. Check status again+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}++# 6. If still disconnected, check phone:+# - Is phone connected to internet?+# - Is WhatsApp Web still linked in phone settings?+# - Has the phone been inactive for 14+ days?++# 7. If need to re-scan QR:+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/qr++# Display QR in terminal (requires qrencode)+curl -s -H "X-API-Key: $API_KEY" \+ "http://localhost:2785/api/sessions/{sessionId}/qr?format=raw" | qrencode -t ANSI+```++**Verification:**++```bash+# Session connected+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId} | jq '.status'+# Expected: "CONNECTED"++# Test message+curl -X POST http://localhost:2785/api/sessions/{sessionId}/messages \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{"phone": "[email protected]", "type": "text", "body": "Session reconnected"}'+```++---++### Runbook: High Memory Usage++**Trigger:** Memory usage > 80%, alerts from monitoring++**Impact:** Performance degradation, potential OOM++**Prerequisites:**+- SSH access+- Docker CLI++**Steps:**++```bash+# 1. Check current memory usage+docker stats --no-stream openwa+free -m++# 2. Identify memory consumers+# Check per-session memory+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/metrics/memory++# 3. Check for memory leaks+docker compose logs openwa 2>&1 | grep -i "heap\|memory\|gc"++# 4. Immediate actions:++# A. Clear message cache+curl -X POST -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/cache/clear++# B. Restart container (will reconnect sessions)+docker compose restart openwa++# C. If caused by too many sessions:+# List sessions sorted by memory+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions?sort=memory++# Consider removing unused sessions++# 5. Long-term fix:+# Edit docker-compose.yml+# Increase memory limit or reduce max sessions+```++**Verification:**++```bash+# Memory below threshold+docker stats --no-stream openwa+# Expected: Memory usage < 80%++# All sessions still connected+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions | jq '.[].status'+```++---++### Runbook: Webhook Delivery Failure++**Trigger:** Webhook success rate < 95%, alert from monitoring++**Impact:** External systems not receiving events++**Prerequisites:**+- API Key+- Access to webhook endpoint++**Steps:**++```bash+# 1. Check webhook status+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/webhooks++# 2. Check recent webhook logs+curl -H "X-API-Key: $API_KEY" \+ "http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId}/logs?status=failed&limit=20"++# 3. Identify failure reason:+# A. Endpoint not responding+curl -v https://your-webhook-endpoint.com/openwa++# B. SSL certificate issues+curl -v --insecure https://your-webhook-endpoint.com/openwa++# C. Timeout+curl -v --max-time 30 https://your-webhook-endpoint.com/openwa++# D. Authentication failed+curl -v -H "Authorization: Bearer token" \+ https://your-webhook-endpoint.com/openwa++# 4. Test webhook delivery+curl -X POST -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId}/test++# 5. Fix based on cause:++# A. Update webhook URL+curl -X PATCH http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId} \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{"url": "https://new-endpoint.com/webhook"}'++# B. Update authentication+curl -X PATCH http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId} \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{"headers": {"Authorization": "Bearer new-token"}}'++# C. Temporarily disable and re-enable+curl -X POST -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId}/disable++curl -X POST -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId}/enable++# 6. Retry failed deliveries+curl -X POST -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId}/retry-failed+```++**Verification:**++```bash+# Webhook test successful+curl -X POST -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId}/test+# Expected: {"status": "success"}++# Recent deliveries successful+curl -H "X-API-Key: $API_KEY" \+ "http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId}/logs?limit=5" | jq '.[].status'+# Expected: all "success"+```++---++## 11.3 Maintenance Procedures++### Runbook: Scheduled Maintenance++**Trigger:** Planned maintenance window++**Impact:** Service downtime during maintenance++**Prerequisites:**+- Scheduled maintenance window+- Backup verified+- User notification sent++**Steps:**++```bash+# 1. Pre-maintenance checks (1 hour before)+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/health/detailed+docker stats --no-stream++# 2. Notify users (via webhook or external system)+# Send maintenance notification++# 3. Create backup+./scripts/backup.sh++# Verify backup+ls -la /backups/openwa/$(date +%Y%m%d)/++# 4. Stop accepting new requests (if using load balancer)+# Remove from load balancer or set to maintenance mode++# 5. Wait for in-flight requests to complete (30 seconds)+sleep 30++# 6. Stop services+docker compose down++# 7. Perform maintenance tasks:+# - System updates+# - Docker updates+# - Configuration changes+# - Database migrations++# 8. Start services+docker compose up -d++# 9. Wait for health+sleep 30+curl http://localhost:2785/health++# 10. Verify all sessions reconnected+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions | jq '.[].status'++# 11. Re-enable in load balancer++# 12. Send maintenance complete notification+```++**Verification:**++```bash+# All services healthy+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/health/detailed++# All sessions connected+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions | jq '[.[] | select(.status == "CONNECTED")] | length'++# Test message flow+# Send test message and verify webhook received+```++---++### Runbook: Version Upgrade++**Trigger:** New version release++**Impact:** Brief downtime during upgrade++**Prerequisites:**+- Backup completed+- Release notes reviewed+- Breaking changes identified+- Rollback plan ready++**Steps:**++```bash+# 1. Review release notes+# Check for breaking changes, migration requirements++# 2. Create backup+./scripts/backup.sh+BACKUP_DIR="/backups/openwa/$(date +%Y%m%d-%H%M%S)"++# 3. Export current state+docker compose exec openwa npm run export -- --output /tmp/export.json+docker cp openwa:/tmp/export.json $BACKUP_DIR/++# 4. Stop services+docker compose down++# 5. Update version in docker-compose.yml+# Change: image: ghcr.io/rmyndharis/openwa:0.1.0+# To: image: ghcr.io/rmyndharis/openwa:0.2.0++# 6. Pull new image+docker compose pull++# 7. Run database migrations (if any)+docker compose run --rm openwa npm run migration:run++# 8. Start services+docker compose up -d++# 9. Wait for health+sleep 30+curl http://localhost:2785/health++# 10. Verify version+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/health/detailed | jq '.version'++# 11. Verify all sessions+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions++# 12. Test critical flows+./scripts/smoke-test.sh+```++**Verification:**++```bash+# Correct version+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/health/detailed | jq '.version'+# Expected: "0.2.0"++# All tests pass+./scripts/smoke-test.sh+# Expected: All tests pass+```++**Rollback:**++```bash+# 1. Stop services+docker compose down++# 2. Revert docker-compose.yml to previous version++# 3. Restore database+cp $BACKUP_DIR/openwa.db ./data/++# 4. Start with old version+docker compose up -d++# 5. Verify rollback+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/health/detailed | jq '.version'+```++---++### Runbook: Database Backup++**Trigger:** Daily schedule, before maintenance, before upgrade++**Impact:** None (online backup)++**Prerequisites:**+- Sufficient disk space+- Backup storage accessible++**Steps:**++```bash+#!/bin/bash+# scripts/backup.sh++set -e++DATE=$(date +%Y%m%d-%H%M%S)+BACKUP_DIR="/backups/openwa/$DATE"+RETENTION_DAYS=30++echo "Starting backup to $BACKUP_DIR"++# Create backup directory+mkdir -p "$BACKUP_DIR"++# 1. Backup database+if [ "$DATABASE_ADAPTER" = "postgresql" ]; then+ echo "Backing up PostgreSQL..."+ docker compose exec -T postgres pg_dump -U postgres openwa > "$BACKUP_DIR/database.sql"+else+ echo "Backing up SQLite..."+ # Use SQLite online backup+ docker compose exec openwa sqlite3 /app/data/openwa.db ".backup /tmp/backup.db"+ docker cp openwa:/tmp/backup.db "$BACKUP_DIR/openwa.db"+fi++# 2. Backup auth sessions+echo "Backing up auth sessions..."+cp -r ./data/.wwebjs_auth "$BACKUP_DIR/"++# 3. Backup configuration+echo "Backing up configuration..."+cp .env "$BACKUP_DIR/"+cp docker-compose.yml "$BACKUP_DIR/"++# 4. Backup media (optional, can be large)+if [ "$BACKUP_MEDIA" = "true" ]; then+ echo "Backing up media..."+ cp -r ./data/media "$BACKUP_DIR/"+fi++# 5. Create archive+echo "Creating archive..."+tar -czf "$BACKUP_DIR.tar.gz" -C "/backups/openwa" "$DATE"+rm -rf "$BACKUP_DIR"++# 6. Cleanup old backups+echo "Cleaning up old backups..."+find /backups/openwa -name "*.tar.gz" -mtime +$RETENTION_DAYS -delete++# 7. Verify backup+echo "Verifying backup..."+tar -tzf "$BACKUP_DIR.tar.gz" > /dev/null++echo "Backup completed: $BACKUP_DIR.tar.gz"+echo "Size: $(du -h "$BACKUP_DIR.tar.gz" | cut -f1)"+```++**Verification:**++```bash+# List backup contents+tar -tzf $BACKUP_DIR.tar.gz++# Check backup size+du -h $BACKUP_DIR.tar.gz++# Test restore to temp location+mkdir /tmp/restore-test+tar -xzf $BACKUP_DIR.tar.gz -C /tmp/restore-test+ls -la /tmp/restore-test/+rm -rf /tmp/restore-test+```++---++### Runbook: Restore from Backup++**Trigger:** Data corruption, accidental deletion, disaster recovery++**Impact:** Service downtime during restore++**Prerequisites:**+- Valid backup file+- Sufficient disk space+- SSH access++**Steps:**++```bash+#!/bin/bash+# scripts/restore.sh++BACKUP_FILE=$1++if [ -z "$BACKUP_FILE" ]; then+ echo "Usage: ./restore.sh <backup-file.tar.gz>"+ exit 1+fi++echo "WARNING: This will overwrite current data!"+read -p "Continue? (yes/no): " CONFIRM+if [ "$CONFIRM" != "yes" ]; then+ exit 0+fi++set -e++# 1. Stop services+echo "Stopping services..."+docker compose down++# 2. Extract backup+echo "Extracting backup..."+RESTORE_DIR="/tmp/restore-$(date +%s)"+mkdir -p "$RESTORE_DIR"+tar -xzf "$BACKUP_FILE" -C "$RESTORE_DIR"++# 3. Restore database+if [ -f "$RESTORE_DIR/*/database.sql" ]; then+ echo "Restoring PostgreSQL..."+ docker compose up -d postgres+ sleep 10+ docker compose exec -T postgres psql -U postgres openwa < "$RESTORE_DIR"/*/database.sql+elif [ -f "$RESTORE_DIR/*/openwa.db" ]; then+ echo "Restoring SQLite..."+ cp "$RESTORE_DIR"/*/openwa.db ./data/+fi++# 4. Restore auth sessions+echo "Restoring auth sessions..."+rm -rf ./data/.wwebjs_auth+cp -r "$RESTORE_DIR"/*/.wwebjs_auth ./data/++# 5. Restore configuration (optional - review first)+echo "Configuration files in backup:"+ls -la "$RESTORE_DIR"/*/.env "$RESTORE_DIR"/*/docker-compose.yml+read -p "Restore configuration? (yes/no): " RESTORE_CONFIG+if [ "$RESTORE_CONFIG" = "yes" ]; then+ cp "$RESTORE_DIR"/*/.env .+ cp "$RESTORE_DIR"/*/docker-compose.yml .+fi++# 6. Start services+echo "Starting services..."+docker compose up -d++# 7. Wait for health+echo "Waiting for health check..."+sleep 30+curl http://localhost:2785/health++# 8. Cleanup+rm -rf "$RESTORE_DIR"++echo "Restore completed!"+```++**Verification:**++```bash+# Health check+curl http://localhost:2785/health++# Verify sessions+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions++# Verify data integrity+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/default/messages?limit=1+```++---++## 11.4 Monitoring & Alerting++### Alert Response Matrix++| Alert | Severity | Response Time | Runbook |+|-------|----------|---------------|---------|+| Service Down | Critical | 5 min | Service Down |+| High Memory | Warning | 30 min | High Memory Usage |+| Session Disconnected | Warning | 15 min | Session Disconnected |+| Webhook Failures > 5% | Warning | 30 min | Webhook Delivery Failure |+| Disk Space < 10% | Critical | 15 min | Disk Space Low |+| Certificate Expiry < 7 days | Warning | 24 hours | Certificate Renewal |++### Runbook: Certificate Renewal++**Trigger:** Certificate expiring in < 7 days++**Impact:** HTTPS will fail when expired++**Steps:**++```bash+# Using certbot+sudo certbot renew++# Verify renewal+sudo certbot certificates++# Restart nginx/proxy+sudo systemctl restart nginx+# or+docker compose restart nginx++# Verify HTTPS+curl -v https://api.your-domain.com/health+```++---++### Runbook: Disk Space Low++**Trigger:** Disk usage > 90%++**Impact:** Service may fail to write data++**Steps:**++```bash+# 1. Check disk usage+df -h++# 2. Find large files+du -sh /var/lib/docker/*+du -sh ./data/*+du -sh ./logs/*++# 3. Clean up:++# A. Docker cleanup+docker system prune -af+docker volume prune -f++# B. Old logs+find ./logs -name "*.log" -mtime +7 -delete++# C. Old backups+find /backups -name "*.tar.gz" -mtime +30 -delete++# D. Message attachments (if backed up)+# Warning: This deletes media files+find ./data/media -mtime +30 -delete++# E. Truncate large log files+truncate -s 0 ./logs/openwa.log++# 4. Verify+df -h+```++---++## 11.5 Capacity Planning++### Resource Estimation++```+Per Session Requirements:+- Memory: 300-500MB (average 400MB)+- CPU: 0.1-0.2 cores idle, 0.5 cores peak+- Disk: 100MB base + ~1KB per message++Server Sizing:+┌──────────────┬─────────┬──────┬───────────┐+│ Sessions │ RAM │ CPU │ Disk │+├──────────────┼─────────┼──────┼───────────┤+│ 1-3 │ 2 GB │ 2 │ 20 GB │+│ 4-10 │ 4 GB │ 4 │ 50 GB │+│ 11-20 │ 8 GB │ 8 │ 100 GB │+│ 21-50 │ 16 GB │ 16 │ 200 GB │+│ 50+ │ 32 GB+ │ 32+ │ 500 GB+ │+└──────────────┴─────────┴──────┴───────────┘+```++### Scaling Decision Tree++```mermaid+flowchart TD+ A[Performance Issues?] --> B{CPU > 80%?}+ B -->|Yes| C[Add more CPU/Horizontal scale]+ B -->|No| D{Memory > 80%?}+ D -->|Yes| E[Add more RAM/Reduce sessions]+ D -->|No| F{Disk > 80%?}+ F -->|Yes| G[Add storage/Cleanup]+ F -->|No| H{Response time > 1s?}+ H -->|Yes| I[Check database/Add indexes]+ H -->|No| J[System OK]+```++---++## 11.6 Emergency Contacts++```+On-Call Schedule:+- Primary: Check PagerDuty/OpsGenie+- Secondary: Check escalation policy++Escalation Path:+1. On-call engineer (5 min response)+2. Team lead (15 min response)+3. Engineering manager (30 min response)++External Contacts:+- Cloud provider support: [support portal URL]+- Domain registrar: [support email]+- SSL provider: [support portal]+```+---++<div align="center">++[← 10 - DevOps & Infrastructure](./10-devops-infrastructure.md) · [Documentation Index](./README.md) · [Next: 12 - Troubleshooting & FAQ →](./12-troubleshooting-faq.md)++</div>diff --git a/docs/12-troubleshooting-faq.md b/docs/12-troubleshooting-faq.mdnew file mode 100644index 000000000..16d5caaa5--- /dev/null+++ b/docs/12-troubleshooting-faq.md@@ -0,0 +1,776 @@+# 12 - Troubleshooting & FAQ++## 12.1 Quick Diagnostics++### Health Check Commands++```bash+# Basic health check+curl http://localhost:2785/health++# Detailed health check+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/health/detailed++# Check specific session+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/health++# Check all services+docker compose ps+docker compose logs --tail=50++# System resources+docker stats openwa+```++### Diagnostic Flowchart++```mermaid+flowchart TD+ START[Issue Detected] --> Q1{API responding?}+ Q1 -->|No| A1[Check container status]+ Q1 -->|Yes| Q2{Session connected?}++ A1 --> A1a{Container running?}+ A1a -->|No| FIX1[docker compose up -d]+ A1a -->|Yes| A1b[Check logs for errors]++ Q2 -->|No| A2{QR scanned?}+ Q2 -->|Yes| Q3{Messages sending?}++ A2 -->|No| FIX2[Rescan QR code]+ A2 -->|Yes| A2a[Check auth files]++ Q3 -->|No| A3{Rate limited?}+ Q3 -->|Yes| DONE[System OK]++ A3 -->|Yes| FIX3[Wait or reduce rate]+ A3 -->|No| A3a[Check message format]+```++## 12.2 Connection Issues++### Issue: Container Won't Start++**Symptoms:**+- `docker compose up` fails+- Container exits immediately+- "Port already in use" error++**Solutions:**++```bash+# Check what's using the port+lsof -i :2785+# or+netstat -tlnp | grep 3000++# Kill process using port+kill -9 $(lsof -t -i:2785)++# Check Docker logs+docker compose logs openwa++# Common fixes+docker compose down --volumes # Reset volumes+docker system prune -f # Clean up Docker+docker compose pull # Get latest image+docker compose up -d+```++### Issue: Session Won't Connect++**Symptoms:**+- QR code generated but session stays "INITIALIZING"+- "TIMEOUT" status after scanning QR+- Session stuck in "CONNECTING" state++**Diagnostic:**++```bash+# Check session status+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}++# Check WhatsApp engine logs+docker compose logs openwa 2>&1 | grep -i "whatsapp\|puppeteer\|browser"++# Check auth folder+ls -la ./data/.wwebjs_auth/session-{sessionId}/+```++**Solutions:**++| Cause | Solution |+|-------|----------|+| Expired QR | Generate new QR (valid 60 seconds) |+| Auth folder corrupted | Delete and rescan |+| Browser crash | Restart container |+| Network issues | Check firewall/proxy |+| WhatsApp blocked | Use proxy |++```bash+# Clear auth and restart+rm -rf ./data/.wwebjs_auth/session-{sessionId}+docker compose restart openwa++# If using proxy+export PROXY_URL=http://proxy:8080+docker compose up -d+```++### Issue: Frequent Disconnections++**Symptoms:**+- Session disconnects every few hours+- "DISCONNECTED" status in logs+- Need to rescan QR frequently++**Causes & Solutions:**++```mermaid+flowchart LR+ A[Frequent Disconnects] --> B{Cause}+ B --> C[WhatsApp logout]+ B --> D[Memory issues]+ B --> E[Network unstable]+ B --> F[IP blocked]++ C --> C1[Check phone]+ D --> D1[Increase RAM]+ E --> E1[Check connectivity]+ F --> F1[Use residential proxy]+```++**Configuration fixes:**++```env+# Increase reconnection attempts+WA_RECONNECT_INTERVAL=5000+WA_MAX_RECONNECT_ATTEMPTS=10++# Enable session persistence+WA_PERSISTENT_SESSION=true++# Increase timeouts+WA_AUTH_TIMEOUT=120000+WA_QR_TIMEOUT=60000+```++## 12.3 Messaging Issues++### Issue: Messages Not Sending++**Symptoms:**+- API returns 200 but message not delivered+- "Message send failed" errors+- Messages stuck in queue++**Diagnostic:**++```bash+# Check message status+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/messages/{messageId}++# Check queue status+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/queues/status++# Check rate limit status+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/rate-limit+```++**Common Causes:**++| Cause | Symptom | Solution |+|-------|---------|----------|+| Invalid phone number | 400 error | Format: `[email protected]` |+| Rate limited | 429 error | Reduce sending rate |+| Session disconnected | 503 error | Reconnect session |+| Media too large | 413 error | Compress or reduce size |+| Number not on WhatsApp | Message fails silently | Verify number first |++**Phone Number Validation:**++```typescript+// Correct format+const validFormats = [+ '[email protected]', // Indonesian+ '[email protected]', // US+ '[email protected]', // Group ID+];++// API to check if number exists+// GET /api/sessions/{id}/contacts/{phone}/exists+curl -H "X-API-Key: $API_KEY" \+ "http://localhost:2785/api/sessions/default/contacts/628123456789/exists"+```++### Issue: Media Upload Fails++**Symptoms:**+- "File too large" error+- "Unsupported media type" error+- Upload timeout++**Solutions:**++```bash+# Check file size limit+echo $MAX_FILE_SIZE # Default: 16MB++# Increase limit in docker-compose.yml+environment:+ - MAX_FILE_SIZE=64mb+ - UPLOAD_TIMEOUT=60000++# Supported formats+# Images: jpg, jpeg, png, gif, webp+# Videos: mp4, 3gp+# Audio: mp3, ogg, wav, opus+# Documents: pdf, doc, docx, xls, xlsx, ppt, pptx+```++**Media Compression:**++```bash+# Compress image before sending+curl -X POST http://localhost:2785/api/sessions/{id}/messages \+ -H "X-API-Key: $API_KEY" \+ -F "[email protected]" \+ -F "type=image" \+ -F "[email protected]" \+ -F "compress=true" # Enable compression+```++### Issue: Webhook Not Receiving Messages++**Symptoms:**+- Messages received but webhook not triggered+- Webhook URL returns errors+- Duplicate webhook calls++**Diagnostic:**++```bash+# Check webhook configuration+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/webhooks++# Check webhook logs+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{sessionId}/webhooks/{webhookId}/logs?limit=20++# Test webhook endpoint+curl -X POST http://your-webhook-url \+ -H "Content-Type: application/json" \+ -d '{"test": true}'+```++**Solutions:**++```yaml+# Webhook configuration+webhook:+ url: https://your-server.com/webhook+ events:+ - message.received+ - message.ack+ - session.status+ retry:+ max_attempts: 3+ delay: 5000+ timeout: 30000+ headers:+ Authorization: "Bearer your-token"+```++## 12.4 Performance Issues++### Issue: High Memory Usage++**Symptoms:**+- Container using > 1GB RAM per session+- OOM (Out of Memory) kills+- Slow response times++**Diagnostic:**++```bash+# Check memory usage+docker stats openwa --no-stream++# Check per-session memory+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/metrics/memory++# Expected: ~300-500MB per session+```++**Solutions:**++```yaml+# docker-compose.yml - Set memory limits+services:+ openwa:+ deploy:+ resources:+ limits:+ memory: 2G+ reservations:+ memory: 512M+ environment:+ # Optimize Puppeteer+ - PUPPETEER_ARGS=--disable-dev-shm-usage,--disable-gpu,--no-sandbox+ # Limit cache+ - WA_CACHE_SIZE=1000+ # Disable media caching+ - CACHE_MEDIA=false+```++**Memory Optimization Tips:**++| Optimization | Impact | Trade-off |+|--------------|--------|-----------|+| Disable media cache | -30% RAM | Slower media re-send |+| Reduce message history | -20% RAM | Less searchable history |+| Headless Chrome flags | -15% RAM | None |+| Limit concurrent sessions | Linear | Fewer sessions |++### Issue: Slow API Response++**Symptoms:**+- API takes > 1 second to respond+- Timeout errors+- High latency for simple operations++**Diagnostic:**++```bash+# Measure API response time+time curl http://localhost:2785/health++# Check database query times+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/metrics/database++# Check queue depth+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/queues/status+```++**Solutions:**++```sql+-- SQLite: Add indexes+CREATE INDEX IF NOT EXISTS idx_messages_session_id ON messages(session_id);+CREATE INDEX IF NOT EXISTS idx_messages_created_at ON messages(created_at);+CREATE INDEX IF NOT EXISTS idx_contacts_session_id ON contacts(session_id);++-- PostgreSQL: Analyze tables+ANALYZE sessions;+ANALYZE messages;+ANALYZE contacts;+```++```yaml+# Enable connection pooling (PostgreSQL)+database:+ type: postgresql+ pool:+ min: 5+ max: 20+ idle_timeout: 30000++# Enable Redis caching+cache:+ adapter: redis+ ttl: 3600+```++## 12.5 Database Issues++### Issue: Database Locked (SQLite)++**Symptoms:**+- "SQLITE_BUSY" errors+- "database is locked" messages+- Write operations failing++**Solutions:**++```bash+# Check for long-running queries+sqlite3 ./data/openwa.db ".timeout 30000"++# Increase timeout in configuration+DATABASE_SQLITE_BUSY_TIMEOUT=30000++# Check WAL mode+sqlite3 ./data/openwa.db "PRAGMA journal_mode;"+# Should return: wal++# Enable WAL mode+sqlite3 ./data/openwa.db "PRAGMA journal_mode=WAL;"+```++**When to Migrate to PostgreSQL:**++```mermaid+flowchart TD+ A[SQLite Issues] --> B{Concurrent sessions?}+ B -->|> 5| C[Migrate to PostgreSQL]+ B -->|≤ 5| D{Write-heavy?}+ D -->|Yes| C+ D -->|No| E[Optimize SQLite]++ E --> E1[Enable WAL mode]+ E --> E2[Increase timeout]+ E --> E3[Add indexes]+```++### Issue: Database Migration Failed++**Symptoms:**+- "Migration failed" errors+- Schema mismatch+- Missing tables++**Solutions:**++```bash+# Check migration status+npm run migration:status++# Show pending migrations+npm run migration:show++# Force run specific migration+npm run migration:run -- --name CreateSessionsTable++# Rollback last migration+npm run migration:revert++# Sync schema (development only!)+npm run schema:sync+```++## 12.6 Docker Issues++### Issue: Volume Permissions++**Symptoms:**+- "Permission denied" errors+- Can't write to data directory+- Auth files not persisting++**Solutions:**++```bash+# Check current permissions+ls -la ./data/++# Fix ownership (use your user ID)+sudo chown -R $(id -u):$(id -g) ./data/++# Or use Docker's user mapping+# docker-compose.yml+services:+ openwa:+ user: "1000:1000" # Your UID:GID+```++### Issue: Container Networking++**Symptoms:**+- Can't connect to database container+- Webhook calls fail from container+- "Connection refused" errors++**Solutions:**++```yaml+# docker-compose.yml - Ensure proper networking+services:+ openwa:+ networks:+ - openwa-network+ extra_hosts:+ - "host.docker.internal:host-gateway" # Access host from container++ postgres:+ networks:+ - openwa-network++networks:+ openwa-network:+ driver: bridge+```++```bash+# Test connectivity from container+docker exec openwa ping postgres+docker exec openwa curl http://host.docker.internal:8080+```++## 12.7 Frequently Asked Questions++### General Questions++**Q: Is OpenWA safe to use?**+> A: OpenWA uses unofficial WhatsApp Web API. While we implement best practices to avoid detection, there's inherent risk of account restrictions. We recommend:+> - Use dedicated phone number (not personal)+> - Don't send spam or bulk unsolicited messages+> - Follow WhatsApp's Terms of Service+> - Implement rate limiting++**Q: How many sessions can I run?**+> A: Depends on your server resources:+> - 2GB RAM: 3-5 sessions+> - 4GB RAM: 8-10 sessions+> - 8GB RAM: 15-20 sessions+> Each session uses ~300-500MB RAM.++**Q: Can I use WhatsApp Business account?**+> A: Yes, OpenWA works with both personal and WhatsApp Business accounts. Note that WhatsApp Business API (official Meta API) is different and not supported.++**Q: How to avoid getting banned?**+> Best practices:+> - Don't send > 200 messages/day for new numbers+> - Gradually increase volume+> - Avoid identical messages to multiple recipients+> - Use random delays between messages+> - Don't send to numbers that haven't messaged you first++### Technical Questions++**Q: How to send messages to groups?**+```bash+# Get group list+curl -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions/{id}/groups++# Send to group+curl -X POST http://localhost:2785/api/sessions/{id}/messages \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "phone": "[email protected]",+ "type": "text",+ "body": "Hello group!"+ }'+```++**Q: How to handle message replies?**+```bash+# Reply to specific message+curl -X POST http://localhost:2785/api/sessions/{id}/messages \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "phone": "[email protected]",+ "type": "text",+ "body": "This is a reply",+ "quotedMessageId": "ABC123_DEF456"+ }'+```++**Q: How to use with n8n?**+> See [n8n Integration Guide](./examples/n8n-integration.md). Quick setup:+> 1. Add HTTP Request node+> 2. Set URL: `http://openwa:2785/api/sessions/{id}/messages`+> 3. Add header: `X-API-Key: your-key`+> 4. Configure webhook trigger for incoming messages++**Q: How to run behind reverse proxy (nginx)?**+```nginx+# nginx.conf+server {+ listen 443 ssl;+ server_name api.example.com;++ location / {+ proxy_pass http://localhost:2785;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection 'upgrade';+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ proxy_set_header X-Forwarded-Proto $scheme;+ proxy_cache_bypass $http_upgrade;++ # Timeouts for long-polling+ proxy_read_timeout 300;+ proxy_connect_timeout 300;+ proxy_send_timeout 300;+ }+}+```++**Q: How to backup sessions automatically?**+```bash+#!/bin/bash+# backup-cron.sh - Add to crontab: 0 */6 * * * /path/to/backup-cron.sh++BACKUP_DIR="/backups/openwa"+DATE=$(date +%Y%m%d-%H%M%S)++# Create backup directory+mkdir -p "$BACKUP_DIR/$DATE"++# Backup database+if [ "$DATABASE_ADAPTER" = "postgresql" ]; then+ pg_dump $DATABASE_URL > "$BACKUP_DIR/$DATE/database.sql"+else+ cp ./data/openwa.db "$BACKUP_DIR/$DATE/"+fi++# Backup auth sessions+cp -r ./data/.wwebjs_auth "$BACKUP_DIR/$DATE/"++# Keep only last 7 days+find "$BACKUP_DIR" -type d -mtime +7 -exec rm -rf {} \;++echo "Backup completed: $BACKUP_DIR/$DATE"+```++### Webhook Questions++**Q: What events can I subscribe to?**+```yaml+available_events:+ # Messages+ - message.received # New incoming message+ - message.sent # Message sent+ - message.ack # Message status update (sent, delivered, read)+ - message.revoked # Message deleted++ # Session+ - session.status # Session status change+ - session.qr # New QR code generated+ - session.authenticated # Session authenticated+ - session.disconnected # Session disconnected++ # Groups+ - group.join # Someone joined group+ - group.leave # Someone left group+ - group.update # Group settings changed++ # Contacts+ - contact.update # Contact info changed+ - presence.update # Contact online/offline status+```++**Q: Webhook payload format?**+```json+{+ "event": "message.received",+ "timestamp": "2026-02-02T10:30:00Z",+ "sessionId": "sess_abc123",+ "data": {+ "id": "ABC123_DEF456",+ "from": "[email protected]",+ "to": "[email protected]",+ "body": "Hello!",+ "type": "chat",+ "timestamp": 1706868600,+ "isGroup": false,+ "author": null,+ "hasMedia": false,+ "media": null+ }+}+```++## 12.8 Error Code Reference++### HTTP Error Codes++| Code | Meaning | Common Cause | Solution |+|------|---------|--------------|----------|+| 400 | Bad Request | Invalid parameters | Check request body/params |+| 401 | Unauthorized | Missing/invalid API key | Add X-API-Key header |+| 403 | Forbidden | Insufficient permissions | Check API key permissions |+| 404 | Not Found | Invalid session/endpoint | Verify session exists |+| 409 | Conflict | Session already exists | Use different session ID |+| 413 | Payload Too Large | File too large | Reduce file size |+| 429 | Too Many Requests | Rate limited | Reduce request rate |+| 500 | Internal Error | Server error | Check logs |+| 503 | Service Unavailable | Session disconnected | Reconnect session |++### WhatsApp Error Codes++| Code | Meaning | Solution |+|------|---------|----------|+| `WA_SESSION_NOT_FOUND` | Session doesn't exist | Create session first |+| `WA_SESSION_NOT_READY` | Session not connected | Wait for connection or rescan QR |+| `WA_INVALID_PHONE` | Invalid phone format | Use format: [email protected] |+| `WA_NUMBER_NOT_EXISTS` | Number not on WhatsApp | Verify number |+| `WA_RATE_LIMITED` | Too many messages | Wait and reduce rate |+| `WA_MEDIA_ERROR` | Media processing failed | Check file format/size |+| `WA_GROUP_NOT_FOUND` | Group doesn't exist | Verify group ID |+| `WA_NOT_ADMIN` | Not group admin | Need admin rights |++## 12.9 Getting Help++### Before Asking for Help++1. **Check this FAQ** - Most common issues are covered+2. **Check logs** - `docker compose logs openwa --tail=100`+3. **Try basic troubleshooting** - Restart, clear cache, etc.+4. **Search GitHub issues** - Your issue might be already reported++### Reporting Issues++When creating GitHub issue, include:++```markdown+## Environment+- OpenWA version: x.x.x+- Docker version: x.x.x+- OS: Ubuntu 22.04 / macOS / Windows+- Database: SQLite / PostgreSQL+- Sessions count: X++## Issue Description+[Clear description of the problem]++## Steps to Reproduce+1. Step one+2. Step two+3. ...++## Expected Behavior+[What should happen]++## Actual Behavior+[What actually happens]++## Logs+```+[Paste relevant logs here]+```++## Configuration+```yaml+# Sanitized docker-compose.yml or .env+```+```++### Community Resources++- **GitHub Issues**: [github.com/rmyndharis/OpenWA/issues](https://github.com/rmyndharis/OpenWA/issues)+- **Discussions**: [github.com/rmyndharis/OpenWA/discussions](https://github.com/rmyndharis/OpenWA/discussions)+- **Discord**: [discord.gg/openwa](https://discord.gg/openwa) (if available)+- **Stack Overflow**: Tag with `openwa`+---++<div align="center">++[← 11 - Operational Runbooks](./11-operational-runbooks.md) · [Documentation Index](./README.md) · [Next: 13 - Horizontal Scaling Guide →](./13-horizontal-scaling.md)++</div>diff --git a/docs/13-horizontal-scaling.md b/docs/13-horizontal-scaling.mdnew file mode 100644index 000000000..5c786f665--- /dev/null+++ b/docs/13-horizontal-scaling.md@@ -0,0 +1,531 @@+# 13 - Horizontal Scaling Guide++This guide explains how to deploy OpenWA in a horizontally scaled environment for high availability and increased capacity.++## 13.1 Architecture Overview++```mermaid+flowchart TB+ subgraph LB["Load Balancer"]+ NGINX[Nginx/Traefik]+ end++ subgraph Nodes["OpenWA Nodes"]+ N1[OpenWA Node 1]+ N2[OpenWA Node 2]+ N3[OpenWA Node 3]+ end++ subgraph Storage["Shared Storage"]+ PG[(PostgreSQL)]+ REDIS[(Redis)]+ S3[S3/MinIO<br/>Media Storage]+ end++ LB --> N1+ LB --> N2+ LB --> N3++ N1 --> PG+ N2 --> PG+ N3 --> PG++ N1 --> REDIS+ N2 --> REDIS+ N3 --> REDIS++ N1 --> S3+ N2 --> S3+ N3 --> S3+```++### Key Principles++| Principle | Description |+| -------------------- | ------------------------------------------------------------- |+| **Session Affinity** | WhatsApp sessions are stateful and must stay on the same node |+| **Shared Database** | PostgreSQL stores all persistent data across nodes |+| **Redis for State** | Shared cache and queue coordination |+| **Sticky Sessions** | Load balancer routes session requests to the correct node |++## 13.2 Session Affinity Strategy++Since WhatsApp sessions maintain WebSocket connections and browser instances, they cannot be freely moved between nodes.++### Strategy 1: Session-to-Node Mapping (Recommended)++Store session-node mapping in the database:++```sql+-- Sessions table includes node assignment+ALTER TABLE sessions ADD COLUMN node_id VARCHAR(50);+ALTER TABLE sessions ADD COLUMN node_url VARCHAR(255);+```++The load balancer reads the mapping and routes accordingly.++### Strategy 2: Consistent Hashing++Route sessions based on session ID hash:++```typescript+function getNodeForSession(sessionId: string, nodes: string[]): string {+ const hash = crypto.createHash('md5').update(sessionId).digest('hex');+ const index = parseInt(hash.substring(0, 8), 16) % nodes.length;+ return nodes[index];+}+```++### Strategy 3: Session Claim++Each node "claims" sessions on startup and releases them on shutdown.++## 13.3 Docker Swarm Deployment++### docker-compose.swarm.yml++```yaml+version: '3.8'++services:+ openwa:+ image: ghcr.io/rmyndharis/openwa:0.2.0+ deploy:+ replicas: 3+ update_config:+ parallelism: 1+ delay: 30s+ restart_policy:+ condition: on-failure+ max_attempts: 3+ resources:+ limits:+ memory: 2G+ reservations:+ memory: 512M+ environment:+ - NODE_ENV=production+ - DATABASE_TYPE=postgres+ - DATABASE_HOST=postgres+ - DATABASE_NAME=openwa+ - DATABASE_USER=openwa+ - DATABASE_PASSWORD=${DB_PASSWORD}+ - REDIS_HOST=redis+ - ENABLE_QUEUE=true+ - NODE_ID={{.Node.Hostname}}-{{.Task.Slot}}+ volumes:+ - sessions:/app/data/sessions+ networks:+ - openwa-net+ depends_on:+ - postgres+ - redis++ postgres:+ image: postgres:16-alpine+ deploy:+ replicas: 1+ placement:+ constraints:+ - node.role == manager+ environment:+ - POSTGRES_DB=openwa+ - POSTGRES_USER=openwa+ - POSTGRES_PASSWORD=${DB_PASSWORD}+ volumes:+ - postgres-data:/var/lib/postgresql/data+ networks:+ - openwa-net++ redis:+ image: redis:7-alpine+ deploy:+ replicas: 1+ command: redis-server --appendonly yes+ volumes:+ - redis-data:/data+ networks:+ - openwa-net++ traefik:+ image: traefik:v3.0+ deploy:+ replicas: 1+ placement:+ constraints:+ - node.role == manager+ ports:+ - '80:80'+ - '443:443'+ volumes:+ - /var/run/docker.sock:/var/run/docker.sock:ro+ command:+ - '--providers.swarm=true'+ - '--entrypoints.web.address=:80'+ - '--entrypoints.websecure.address=:443'+ networks:+ - openwa-net++volumes:+ postgres-data:+ redis-data:+ sessions:++networks:+ openwa-net:+ driver: overlay+```++### Deploy to Swarm++```bash+# Initialize swarm (if not already)+docker swarm init++# Deploy stack+docker stack deploy -c docker-compose.swarm.yml openwa++# Scale up/down+docker service scale openwa_openwa=5++# Check status+docker service ls+docker service ps openwa_openwa+```++## 13.4 Kubernetes Deployment++### k8s/namespace.yaml++```yaml+apiVersion: v1+kind: Namespace+metadata:+ name: openwa+```++### k8s/configmap.yaml++```yaml+apiVersion: v1+kind: ConfigMap+metadata:+ name: openwa-config+ namespace: openwa+data:+ NODE_ENV: 'production'+ DATABASE_TYPE: 'postgres'+ DATABASE_HOST: 'postgres-service'+ DATABASE_PORT: '5432'+ DATABASE_NAME: 'openwa'+ REDIS_HOST: 'redis-service'+ REDIS_PORT: '6379'+ ENABLE_QUEUE: 'true'+ API_PORT: '3000'+```++### k8s/secret.yaml++```yaml+apiVersion: v1+kind: Secret+metadata:+ name: openwa-secrets+ namespace: openwa+type: Opaque+stringData:+ DATABASE_USER: openwa+ DATABASE_PASSWORD: your-secure-password+ ADMIN_API_KEY: your-admin-api-key+ WEBHOOK_SECRET: your-webhook-secret+```++### k8s/deployment.yaml++```yaml+apiVersion: apps/v1+kind: StatefulSet+metadata:+ name: openwa+ namespace: openwa+spec:+ serviceName: openwa+ replicas: 3+ selector:+ matchLabels:+ app: openwa+ template:+ metadata:+ labels:+ app: openwa+ spec:+ containers:+ - name: openwa+ image: ghcr.io/rmyndharis/openwa:0.2.0+ ports:+ - containerPort: 3000+ name: http+ envFrom:+ - configMapRef:+ name: openwa-config+ - secretRef:+ name: openwa-secrets+ env:+ - name: NODE_ID+ valueFrom:+ fieldRef:+ fieldPath: metadata.name+ resources:+ requests:+ memory: '512Mi'+ cpu: '250m'+ limits:+ memory: '2Gi'+ cpu: '1000m'+ volumeMounts:+ - name: session-data+ mountPath: /app/data/sessions+ livenessProbe:+ httpGet:+ path: /api/health+ port: 3000+ initialDelaySeconds: 30+ periodSeconds: 10+ readinessProbe:+ httpGet:+ path: /api/health/ready+ port: 3000+ initialDelaySeconds: 10+ periodSeconds: 5+ volumeClaimTemplates:+ - metadata:+ name: session-data+ spec:+ accessModes: ['ReadWriteOnce']+ resources:+ requests:+ storage: 10Gi+```++### k8s/service.yaml++```yaml+apiVersion: v1+kind: Service+metadata:+ name: openwa-service+ namespace: openwa+spec:+ type: ClusterIP+ selector:+ app: openwa+ ports:+ - port: 80+ targetPort: 3000+ name: http+---+apiVersion: v1+kind: Service+metadata:+ name: openwa-headless+ namespace: openwa+spec:+ clusterIP: None+ selector:+ app: openwa+ ports:+ - port: 3000+ name: http+```++### k8s/ingress.yaml++```yaml+apiVersion: networking.k8s.io/v1+kind: Ingress+metadata:+ name: openwa-ingress+ namespace: openwa+ annotations:+ nginx.ingress.kubernetes.io/affinity: 'cookie'+ nginx.ingress.kubernetes.io/session-cookie-name: 'openwa-session'+ nginx.ingress.kubernetes.io/session-cookie-max-age: '172800'+spec:+ ingressClassName: nginx+ rules:+ - host: openwa.example.com+ http:+ paths:+ - path: /+ pathType: Prefix+ backend:+ service:+ name: openwa-service+ port:+ number: 80+ tls:+ - hosts:+ - openwa.example.com+ secretName: openwa-tls+```++### Deploy to Kubernetes++```bash+# Apply all manifests+kubectl apply -f k8s/++# Check pods+kubectl get pods -n openwa++# Check logs+kubectl logs -f deployment/openwa -n openwa++# Scale+kubectl scale statefulset openwa --replicas=5 -n openwa+```++## 13.5 Load Balancer Configuration++### Traefik Dynamic Config++```yaml+# traefik/dynamic-scaling.yml+http:+ routers:+ openwa:+ rule: 'Host(`openwa.example.com`)'+ service: openwa+ middlewares:+ - sticky-session++ middlewares:+ sticky-session:+ headers:+ customResponseHeaders:+ X-OpenWA-Node: '{{.Node}}'++ services:+ openwa:+ loadBalancer:+ sticky:+ cookie:+ name: openwa_node+ secure: true+ httpOnly: true+ servers:+ - url: 'http://openwa-1:2785'+ - url: 'http://openwa-2:2785'+ - url: 'http://openwa-3:2785'+ healthCheck:+ path: /api/health+ interval: 10s+ timeout: 3s+```++### Nginx Upstream Config++```nginx+upstream openwa {+ ip_hash; # Sticky sessions based on client IP++ server openwa-1:2785 weight=1 max_fails=3 fail_timeout=30s;+ server openwa-2:2785 weight=1 max_fails=3 fail_timeout=30s;+ server openwa-3:2785 weight=1 max_fails=3 fail_timeout=30s;+}++server {+ listen 80;+ server_name openwa.example.com;++ location / {+ proxy_pass http://openwa;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection "upgrade";+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;++ # Session affinity cookie+ proxy_cookie_path / "/; SameSite=Strict; HttpOnly";+ }++ location /api/health {+ proxy_pass http://openwa;+ proxy_connect_timeout 5s;+ proxy_read_timeout 5s;+ }+}+```++## 13.6 Capacity Planning++### Resource Requirements per Node++| Sessions | Memory | CPU | Disk |+| -------- | ------ | -------- | ----- |+| 1-5 | 1 GB | 0.5 vCPU | 5 GB |+| 5-10 | 2 GB | 1 vCPU | 10 GB |+| 10-25 | 4 GB | 2 vCPU | 25 GB |+| 25-50 | 8 GB | 4 vCPU | 50 GB |++### Scaling Guidelines++| Metric | Threshold | Action |+| ----------------------------- | ---------- | ---------- |+| CPU > 80% | 5 minutes | Scale up |+| Memory > 85% | 5 minutes | Scale up |+| CPU < 30% | 15 minutes | Scale down |+| Active sessions per node > 20 | - | Scale up |++### Benchmarks++Tested on 2 vCPU / 4GB RAM nodes:++| Nodes | Sessions | Messages/sec | p95 Latency |+| ----- | -------- | ------------ | ----------- |+| 1 | 10 | 50 | 150ms |+| 3 | 30 | 150 | 180ms |+| 5 | 50 | 250 | 200ms |++## 13.7 Monitoring++### Prometheus Metrics (Future)++```yaml+# prometheus/openwa-rules.yaml+groups:+ - name: openwa+ rules:+ - alert: HighMemoryUsage+ expr: container_memory_usage_bytes{container="openwa"} > 1.8e9+ for: 5m+ labels:+ severity: warning+ annotations:+ summary: 'OpenWA node high memory usage'++ - alert: NodeDown+ expr: up{job="openwa"} == 0+ for: 1m+ labels:+ severity: critical+ annotations:+ summary: 'OpenWA node is down'+```++### Health Check Endpoints++| Endpoint | Purpose |+| ---------------------- | ------------------------------- |+| `/api/health` | Liveness probe |+| `/api/health/ready` | Readiness probe |+| `/api/health/detailed` | Full status with DB/Redis check |+---++<div align="center">++[← 12 - Troubleshooting & FAQ](./12-troubleshooting-faq.md) · [Documentation Index](./README.md) · [Next: 14 - Migration Guide →](./14-migration-guide.md)++</div>diff --git a/docs/14-migration-guide.md b/docs/14-migration-guide.mdnew file mode 100644index 000000000..f84cb8c5e--- /dev/null+++ b/docs/14-migration-guide.md@@ -0,0 +1,1274 @@+# 14 - Migration Guide++## 14.1 Overview++This document provides a comprehensive guide for migrating OpenWA, including:++- Database migration (SQLite → PostgreSQL)+- Version upgrades (v0.1 → v0.2 → v1.0)+- Transfer session authentication state+- Rollback procedures++```mermaid+flowchart TB+ subgraph Migration Types+ DB[Database Migration]+ VER[Version Upgrade]+ ENV[Environment Migration]+ end++ subgraph Targets+ DB --> PG[SQLite → PostgreSQL]+ DB --> SCALE[Single → Multi-node]+ VER --> MINOR[Minor Upgrade]+ VER --> MAJOR[Major Upgrade]+ ENV --> DEV[Dev → Staging]+ ENV --> PROD[Staging → Production]+ end+```++## 14.2 Pre-Migration Checklist++### Universal Checklist++```markdown+## Pre-Migration Checklist++### Backup++- [ ] Database backup completed+- [ ] Session auth files backed up (.wwebjs_auth/)+- [ ] Environment variables documented+- [ ] Docker volumes backed up (if applicable)++### Documentation++- [ ] Current version documented+- [ ] Active sessions list exported+- [ ] Webhook configurations exported+- [ ] API keys documented++### Communication++- [ ] Maintenance window scheduled+- [ ] Users notified+- [ ] Rollback plan prepared+- [ ] Support team briefed++### Verification++- [ ] Target environment ready+- [ ] Network connectivity tested+- [ ] Disk space sufficient (2x current size)+- [ ] New version tested in staging+```++## 14.3 Database Migration: SQLite → PostgreSQL++### When to Migrate++```mermaid+flowchart TD+ A[Current Setup] --> B{Check Conditions}+ B -->|Sessions > 5| C[Consider PostgreSQL]+ B -->|Messages > 100K| C+ B -->|Need HA| C+ B -->|Concurrent writes high| C+ B -->|Sessions ≤ 5| D[Stay with SQLite]+ B -->|Low volume| D+ C --> E[Plan Migration]+ D --> F[Optimize SQLite]+```++| Condition | SQLite OK | Migrate to PostgreSQL |+| ------------------ | ---------- | --------------------- |+| Sessions | 1-5 | 6+ |+| Messages/day | < 10,000 | > 10,000 |+| Concurrent users | < 10 | > 10 |+| High Availability | Not needed | Required |+| Horizontal scaling | Not needed | Required |++### API-Based Migration (Recommended for v0.2+)++OpenWA v0.2+ includes built-in migration API endpoints that leverage the **Dual-Database Architecture**:++```bash+# Step 1: Export all Data DB tables+curl -s 'http://localhost:2785/api/infra/export-data' \+ -H 'X-API-Key: YOUR_KEY' > data-backup.json++# Step 2: Change database configuration in .env or Dashboard+# From: DATABASE_TYPE=sqlite+# To: DATABASE_TYPE=postgres+# POSTGRES_BUILTIN=true++# Step 3: Restart with new configuration+docker compose --profile with-dashboard --profile with-proxy up -d++# Step 4: Import data to new database+curl -X POST 'http://localhost:2785/api/infra/import-data' \+ -H 'X-API-Key: YOUR_KEY' \+ -H 'Content-Type: application/json' \+ -d @data-backup.json+```++> [!NOTE]+> **Dual-Database Architecture**+>+> OpenWA separates databases:+>+> - **Main DB** (SQLite): API keys, audit logs - never migrated, always local+> - **Data DB** (Pluggable): Sessions, webhooks, messages - this is what gets migrated+>+> See [05 - Database Design: Dual-Database Architecture](./05-database-design.md#dual-database-architecture)++**Export Response Example:**++```json+{+ "exportedAt": "2026-02-05T02:30:00.000Z",+ "dataDbType": "sqlite",+ "tables": {+ "sessions": [...],+ "webhooks": [...],+ "messages": [...],+ "messageBatches": [...]+ },+ "counts": {+ "sessions": 5,+ "webhooks": 12,+ "messages": 1500,+ "messageBatches": 3+ }+}+```++### Storage Migration (Local ↔ S3/MinIO)++OpenWA v0.2+ supports migrating media files between storage backends:++```bash+# Step 1: Check current storage file count+curl -s 'http://localhost:2785/api/infra/storage/files/count' \+ -H 'X-API-Key: YOUR_KEY'+# Response: { "storageType": "local", "count": 150, "sizeBytes": 15000000 }++# Step 2: Export all files as tar.gz+curl -s 'http://localhost:2785/api/infra/storage/export' \+ -H 'X-API-Key: YOUR_KEY'+# Response: { "message": "Storage export completed", "download": "/app/data/storage-export-xxx.tar.gz" }++# Step 3: Change storage configuration+# From: STORAGE_TYPE=local+# To: STORAGE_TYPE=s3+# MINIO_BUILTIN=true # or false for external S3++# Step 4: Restart with new configuration+docker compose up -d++# Step 5: Import files to new storage+curl -X POST 'http://localhost:2785/api/infra/storage/import' \+ -H 'X-API-Key: YOUR_KEY' \+ -H 'Content-Type: application/json' \+ -d '{"filePath": "/app/data/storage-export-xxx.tar.gz"}'+```++| Scenario | Support | Method |+| ---------------------------- | ------- | ------------------------ |+| Local → Built-in MinIO | ✅ | Export → Config → Import |+| Local → External S3 | ✅ | Export → Config → Import |+| Built-in MinIO → External S3 | ✅ | Export → Config → Import |+| S3 → Local | ✅ | Export → Config → Import |++### Redis Migration (Cache)++Redis in OpenWA is used **only for caching** with TTL-based expiration. Cache data is ephemeral and automatically regenerates from the database.++**No migration API needed** - just change configuration:++```bash+# Switch from built-in to external Redis+REDIS_ENABLED=true+REDIS_BUILTIN=false # false = external Redis+REDIS_HOST=your-redis-host.com+REDIS_PORT=6379+REDIS_PASSWORD=optional+```++| Scenario | Support | Notes |+| ------------------------- | ------- | ---------------------------- |+| Built-in → External Redis | ✅ | Config change only |+| External → Built-in Redis | ✅ | Config change only |+| Enable → Disable Redis | ✅ | App uses memory fallback |+| Disable → Enable Redis | ✅ | Cache rebuilds automatically |++> [!TIP]+> **Cache Warm-up**: After switching Redis instances, the cache will automatically rebuild as requests come in. No data migration is necessary.++### BullMQ Migration (Queue System)++BullMQ stores job data in Redis. When switching Redis instances, pending jobs may be lost.++**Best Practice - Drain Queue Before Switching:**++```bash+# Step 1: Check queue status via Bull Board+# Visit: http://localhost:2785/admin/queues++# Step 2: Wait until MESSAGE and WEBHOOK queues are empty+# Or check via API:+curl -s 'http://localhost:2785/api/infra/status' \+ -H 'X-API-Key: YOUR_KEY' | jq '.queue'+# Wait for: pending: 0++# Step 3: Change Redis configuration+REDIS_HOST=new-redis-host.com++# Step 4: Restart application+docker compose up -d+```++| Scenario | Support | Notes |+| ------------------------- | ------- | ----------------- |+| Queue Disabled → Enabled | ✅ | Config change |+| Queue Enabled → Disabled | ⚠️ | Drain queue first |+| Built-in → External Redis | ⚠️ | Drain queue first |++> [!WARNING]+> **Job Loss Prevention**: Always ensure the MESSAGE and WEBHOOK queues are empty before switching Redis instances. Check `/admin/queues` dashboard.++### Infrastructure Migration Summary++| Component | Migration Method | API Endpoint |+| ------------ | -------------------- | -------------------------------------------------------- |+| **Database** | Export/Import JSON | `/api/infra/export-data`, `/api/infra/import-data` |+| **Storage** | Export/Import tar.gz | `/api/infra/storage/export`, `/api/infra/storage/import` |+| **Redis** | Config change only | N/A (cache auto-rebuilds) |+| **BullMQ** | Drain then config | N/A (wait for empty queues) |++### Migration Script (Legacy)++```typescript+// scripts/migrate-sqlite-to-postgres.ts++import { DataSource } from 'typeorm';+import * as sqlite3 from 'sqlite3';+import { Client } from 'pg';++interface MigrationConfig {+ sqlitePath: string;+ postgresUrl: string;+ batchSize: number;+}++interface MigrationResult {+ table: string;+ rowsMigrated: number;+ duration: number;+ errors: string[];+}++async function migrateSqliteToPostgres(config: MigrationConfig): Promise<MigrationResult[]> {+ const results: MigrationResult[] = [];++ // 1. Connect to both databases+ console.log('🔌 Connecting to databases...');++ const sqliteDb = new sqlite3.Database(config.sqlitePath);+ const pgClient = new Client({ connectionString: config.postgresUrl });+ await pgClient.connect();++ // 2. Get list of tables+ const tables = await getSqliteTables(sqliteDb);+ console.log(`📋 Found ${tables.length} tables to migrate`);++ // 3. Migration order (respect foreign keys)+ const migrationOrder = [+ 'sessions',+ 'api_keys',+ 'webhooks',+ 'contacts',+ 'messages',+ 'media_files',+ 'webhook_logs',+ 'audit_logs',+ ];++ // 4. Migrate each table+ for (const table of migrationOrder) {+ if (!tables.includes(table)) continue;++ const startTime = Date.now();+ const result = await migrateTable(sqliteDb, pgClient, table, config.batchSize);+ result.duration = Date.now() - startTime;+ results.push(result);++ console.log(`✅ ${table}: ${result.rowsMigrated} rows in ${result.duration}ms`);+ }++ // 5. Reset sequences+ await resetPostgresSequences(pgClient, migrationOrder);++ // 6. Cleanup+ sqliteDb.close();+ await pgClient.end();++ return results;+}++async function migrateTable(+ sqlite: sqlite3.Database,+ pg: Client,+ table: string,+ batchSize: number,+): Promise<MigrationResult> {+ const result: MigrationResult = {+ table,+ rowsMigrated: 0,+ duration: 0,+ errors: [],+ };++ return new Promise(resolve => {+ let offset = 0;++ const processBatch = () => {+ sqlite.all(`SELECT * FROM ${table} LIMIT ${batchSize} OFFSET ${offset}`, async (err, rows: any[]) => {+ if (err) {+ result.errors.push(err.message);+ resolve(result);+ return;+ }++ if (rows.length === 0) {+ resolve(result);+ return;+ }++ // Insert into PostgreSQL+ for (const row of rows) {+ try {+ const columns = Object.keys(row);+ const values = Object.values(row);+ const placeholders = values.map((_, i) => `$${i + 1}`).join(', ');++ await pg.query(+ `INSERT INTO ${table} (${columns.join(', ')}) VALUES (${placeholders})+ ON CONFLICT DO NOTHING`,+ values,+ );+ result.rowsMigrated++;+ } catch (insertErr: any) {+ result.errors.push(`Row error: ${insertErr.message}`);+ }+ }++ offset += batchSize;+ processBatch();+ });+ };++ processBatch();+ });+}++async function resetPostgresSequences(pg: Client, tables: string[]): Promise<void> {+ for (const table of tables) {+ try {+ await pg.query(`+ SELECT setval(+ pg_get_serial_sequence('${table}', 'id'),+ COALESCE((SELECT MAX(id) FROM ${table}), 0) + 1,+ false+ )+ `);+ } catch (err) {+ // Table might not have serial id+ }+ }+}++function getSqliteTables(db: sqlite3.Database): Promise<string[]> {+ return new Promise((resolve, reject) => {+ db.all("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'", (err, rows: any[]) => {+ if (err) reject(err);+ else resolve(rows.map(r => r.name));+ });+ });+}++// CLI Entry point+const config: MigrationConfig = {+ sqlitePath: process.env.SQLITE_PATH || './data/openwa.db',+ postgresUrl: process.env.DATABASE_URL || 'postgresql://user:pass@localhost:5432/openwa',+ batchSize: parseInt(process.env.BATCH_SIZE || '1000'),+};++migrateSqliteToPostgres(config)+ .then(results => {+ console.log('\n📊 Migration Summary:');+ console.table(+ results.map(r => ({+ Table: r.table,+ Rows: r.rowsMigrated,+ 'Time (ms)': r.duration,+ Errors: r.errors.length,+ })),+ );+ })+ .catch(console.error);+```++### Step-by-Step Migration++```bash+# Step 1: Stop OpenWA+docker compose down++# Step 2: Backup current data+cp -r ./data ./data-backup-$(date +%Y%m%d)+docker exec openwa-db pg_dump -U postgres openwa > backup.sql++# Step 3: Setup PostgreSQL (if not exists)+docker compose -f docker-compose.postgres.yml up -d postgres++# Step 4: Run migration script+npx ts-node scripts/migrate-sqlite-to-postgres.ts++# Step 5: Update environment+export DATABASE_ADAPTER=postgresql+export DATABASE_URL=postgresql://user:pass@localhost:5432/openwa++# Step 6: Verify migration+psql $DATABASE_URL -c "SELECT COUNT(*) FROM sessions;"+psql $DATABASE_URL -c "SELECT COUNT(*) FROM messages;"++# Step 7: Start with PostgreSQL+docker compose -f docker-compose.postgres.yml up -d++# Step 8: Verify functionality+curl http://localhost:2785/health+```++### Verification Queries++```sql+-- Compare row counts+-- Run on both SQLite and PostgreSQL++-- Sessions+SELECT 'sessions' as table_name, COUNT(*) as count FROM sessions+UNION ALL+SELECT 'messages', COUNT(*) FROM messages+UNION ALL+SELECT 'contacts', COUNT(*) FROM contacts+UNION ALL+SELECT 'webhooks', COUNT(*) FROM webhooks+UNION ALL+SELECT 'api_keys', COUNT(*) FROM api_keys;++-- Verify foreign key integrity+SELECT m.id, m.session_id+FROM messages m+LEFT JOIN sessions s ON m.session_id = s.id+WHERE s.id IS NULL;++-- Check for data integrity+SELECT session_id, COUNT(*) as msg_count+FROM messages+GROUP BY session_id+ORDER BY msg_count DESC+LIMIT 10;+```++## 14.4 Session Auth State Transfer++### Understanding Session Auth++```+Session Auth Structure:+.wwebjs_auth/+├── session-{sessionId}/+│ ├── Default/+│ │ ├── IndexedDB/+│ │ ├── Local Storage/+│ │ └── Session Storage/+│ └── ... (Chrome profile data)+```++### Transfer Methods++#### Method 1: Direct File Copy (Same Host)++```bash+#!/bin/bash+# transfer-session.sh++SOURCE_DIR="/old-server/data/.wwebjs_auth"+TARGET_DIR="/new-server/data/.wwebjs_auth"+SESSION_ID=$1++if [ -z "$SESSION_ID" ]; then+ echo "Usage: ./transfer-session.sh <session-id>"+ exit 1+fi++# Stop both instances+echo "⏹️ Stopping services..."+ssh old-server "docker compose down"+ssh new-server "docker compose down"++# Copy session data+echo "📦 Copying session data..."+rsync -avz --progress \+ "old-server:${SOURCE_DIR}/session-${SESSION_ID}/" \+ "${TARGET_DIR}/session-${SESSION_ID}/"++# Copy database record+echo "📄 Exporting session record..."+ssh old-server "sqlite3 /data/openwa.db \+ \"SELECT * FROM sessions WHERE id='${SESSION_ID}'\" \+ -csv" > session_record.csv++# Import to new database+echo "📥 Importing session record..."+ssh new-server "sqlite3 /data/openwa.db \+ \".import session_record.csv sessions\""++# Start new server+echo "▶️ Starting new server..."+ssh new-server "docker compose up -d"++echo "✅ Session ${SESSION_ID} transferred successfully"+```++#### Method 2: Export/Import via API++```typescript+// Export session from old server+// GET /api/sessions/{id}/export++interface SessionExport {+ session: {+ id: string;+ name: string;+ phoneNumber: string;+ status: string;+ config: object;+ };+ authData: string; // Base64 encoded tar.gz of auth folder+ webhooks: WebhookConfig[];+ contacts: Contact[];+}++// api/sessions/export.controller.ts+@Get(':id/export')+@UseGuards(ApiKeyGuard)+async exportSession(@Param('id') id: string): Promise<SessionExport> {+ const session = await this.sessionService.findOne(id);++ // Create tar.gz of auth folder+ const authPath = path.join(this.authDir, `session-${id}`);+ const tarBuffer = await this.createTarGz(authPath);++ return {+ session: {+ id: session.id,+ name: session.name,+ phoneNumber: session.phoneNumber,+ status: 'exported',+ config: session.config,+ },+ authData: tarBuffer.toString('base64'),+ webhooks: await this.webhookService.findBySession(id),+ contacts: await this.contactService.findBySession(id),+ };+}++// Import session to new server+// POST /api/sessions/import++@Post('import')+@UseGuards(ApiKeyGuard)+async importSession(@Body() data: SessionExport): Promise<Session> {+ // 1. Create session record+ const session = await this.sessionService.create({+ id: data.session.id,+ name: data.session.name,+ config: data.session.config,+ });++ // 2. Extract auth data+ const authBuffer = Buffer.from(data.authData, 'base64');+ const authPath = path.join(this.authDir, `session-${session.id}`);+ await this.extractTarGz(authBuffer, authPath);++ // 3. Import webhooks+ for (const webhook of data.webhooks) {+ await this.webhookService.create({+ ...webhook,+ sessionId: session.id,+ });+ }++ // 4. Import contacts+ for (const contact of data.contacts) {+ await this.contactService.create({+ ...contact,+ sessionId: session.id,+ });+ }++ // 5. Initialize session (will use existing auth)+ await this.whatsappService.initSession(session.id);++ return session;+}+```++### Bulk Session Transfer++```typescript+// scripts/bulk-transfer-sessions.ts++interface TransferConfig {+ sourceUrl: string;+ sourceApiKey: string;+ targetUrl: string;+ targetApiKey: string;+ sessionIds: string[] | 'all';+}++async function bulkTransferSessions(config: TransferConfig): Promise<void> {+ const axios = require('axios');++ // Get session list+ let sessionIds = config.sessionIds;+ if (sessionIds === 'all') {+ const response = await axios.get(`${config.sourceUrl}/api/sessions`, {+ headers: { 'X-API-Key': config.sourceApiKey },+ });+ sessionIds = response.data.map((s: any) => s.id);+ }++ console.log(`📋 Transferring ${sessionIds.length} sessions...`);++ for (const sessionId of sessionIds) {+ try {+ console.log(`\n🔄 Processing session: ${sessionId}`);++ // 1. Stop session on source+ await axios.post(+ `${config.sourceUrl}/api/sessions/${sessionId}/stop`,+ {},+ { headers: { 'X-API-Key': config.sourceApiKey } },+ );++ // 2. Export from source+ const exportResponse = await axios.get(`${config.sourceUrl}/api/sessions/${sessionId}/export`, {+ headers: { 'X-API-Key': config.sourceApiKey },+ });++ // 3. Import to target+ await axios.post(`${config.targetUrl}/api/sessions/import`, exportResponse.data, {+ headers: { 'X-API-Key': config.targetApiKey },+ });++ console.log(`✅ Session ${sessionId} transferred`);+ } catch (error: any) {+ console.error(`❌ Failed to transfer ${sessionId}: ${error.message}`);+ }+ }+}+```++## 14.5 Version Upgrade Guide++### Upgrade Matrix++```mermaid+flowchart LR+ V01[v0.1.x] -->|Direct| V02[v0.2.x]+ V02 -->|Direct| V10[v1.0.x]+ V01 -->|"Via v0.2"| V10+ V10 -->|Direct| V11[v1.1.x]+ V11 -->|Direct| V12[v1.2.x]+```++| From | To | Migration Type | Downtime |+| ------ | ------ | ------------------------- | --------- |+| v0.1.x | v0.2.x | Schema migration | 5-10 min |+| v0.2.x | v1.0.x | Schema + Config migration | 10-15 min |+| v0.1.x | v1.0.x | Must go via v0.2.x | 15-25 min |+| v1.x | v1.y | Usually automatic | < 5 min |++### v0.1 → v0.2 Migration++#### Breaking Changes in v0.2++```yaml+breaking_changes:+ api:+ - path: /api/session → /api/sessions (plural)+ - path: /api/send → /api/sessions/{id}/messages+ - auth: Basic Auth → API Key++ config:+ - DATABASE_PATH → DATABASE_URL (for PostgreSQL)+ - WEBHOOK_URL → Managed via API++ database:+ - New tables: api_keys, webhook_logs+ - Modified: sessions (added config JSON column)+ - Modified: messages (added metadata column)+```++#### Migration Steps++```bash+#!/bin/bash+# upgrade-v01-to-v02.sh++set -e++echo "🚀 Upgrading OpenWA v0.1.x → v0.2.x"++# 1. Backup+echo "📦 Creating backup..."+BACKUP_DIR="./backups/v01-$(date +%Y%m%d-%H%M%S)"+mkdir -p "$BACKUP_DIR"+cp -r ./data "$BACKUP_DIR/"+cp .env "$BACKUP_DIR/"++# 2. Stop current version+echo "⏹️ Stopping v0.1..."+docker compose down++# 3. Run database migrations+echo "🔄 Running migrations..."+docker run --rm \+ -v $(pwd)/data:/app/data \+ -e DATABASE_URL=sqlite:///app/data/openwa.db \+ ghcr.io/rmyndharis/openwa:0.2.0 \+ npm run migration:run++# 4. Migrate configuration+echo "⚙️ Migrating configuration..."+cat > .env.new << 'EOF'+# OpenWA v0.2.x Configuration++# Database (unchanged if using SQLite)+DATABASE_ADAPTER=sqlite+DATABASE_URL=sqlite:./data/openwa.db++# New in v0.2: API Key Authentication+API_KEY_ENABLED=true+# Generate with: openssl rand -hex 32+API_KEY=your-generated-api-key++# Webhook (now managed via API, but can set default)+DEFAULT_WEBHOOK_URL=${WEBHOOK_URL:-}++# Other settings migrated from v0.1+NODE_ENV=${NODE_ENV:-production}+PORT=${PORT:-3000}+LOG_LEVEL=${LOG_LEVEL:-info}+EOF++# Merge with existing .env+source .env+envsubst < .env.new > .env.migrated+mv .env.migrated .env+rm .env.new++# 5. Start new version+echo "▶️ Starting v0.2..."+docker compose pull+docker compose up -d++# 6. Wait for health+echo "⏳ Waiting for health check..."+sleep 10+curl -f http://localhost:2785/health || exit 1++# 7. Create API key for existing integrations+echo "🔑 Creating API key..."+docker exec openwa npm run cli -- create-api-key --name "migrated-key"++echo "✅ Upgrade complete!"+echo ""+echo "⚠️ IMPORTANT: Update your API clients:"+echo " - Change /api/session to /api/sessions"+echo " - Change /api/send to /api/sessions/{id}/messages"+echo " - Add X-API-Key header to all requests"+```++### v0.2 → v1.0 Migration++#### Breaking Changes in v1.0++```yaml+breaking_changes:+ api:+ - Groups API restructured+ - Webhook payload format v2+ - Rate limiting enforced++ config:+ - ENGINE_TYPE required (default: whatsapp-web.js)+ - STORAGE_ADAPTER required (default: local)++ database:+ - New tables: groups, group_participants, channels+ - sessions.status enum expanded+```++#### Migration Steps++```bash+#!/bin/bash+# upgrade-v02-to-v10.sh++set -e++echo "🚀 Upgrading OpenWA v0.2.x → v1.0.0"++# Pre-flight checks+CURRENT_VERSION=$(docker inspect ghcr.io/rmyndharis/openwa --format '{{.Config.Labels.version}}' 2>/dev/null || echo "unknown")+echo "Current version: $CURRENT_VERSION"++# 1. Comprehensive backup+echo "📦 Creating comprehensive backup..."+BACKUP_DIR="./backups/v02-$(date +%Y%m%d-%H%M%S)"+mkdir -p "$BACKUP_DIR"++# Backup database+if [ "$DATABASE_ADAPTER" = "postgresql" ]; then+ pg_dump $DATABASE_URL > "$BACKUP_DIR/database.sql"+else+ cp ./data/openwa.db "$BACKUP_DIR/"+fi++# Backup auth sessions+cp -r ./data/.wwebjs_auth "$BACKUP_DIR/"++# Backup config+cp .env "$BACKUP_DIR/"+cp docker-compose.yml "$BACKUP_DIR/"++# 2. Export webhook configurations (per session, new format in v1.0)+echo "📤 Exporting webhooks..."+for sessionId in $(curl -s -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions | jq -r '.data[].id'); do+ curl -s -H "X-API-Key: $API_KEY" \+ "http://localhost:2785/api/sessions/${sessionId}/webhooks" \+ > "$BACKUP_DIR/webhooks_${sessionId}.json"+done++# 3. Stop services+echo "⏹️ Stopping v0.2..."+docker compose down++# 4. Update configuration+echo "⚙️ Updating configuration..."+cat >> .env << 'EOF'++# New in v1.0+ENGINE_TYPE=whatsapp-web.js+STORAGE_ADAPTER=local+CACHE_ADAPTER=memory++# Webhook v2 format (recommended)+WEBHOOK_VERSION=2+EOF++# 5. Run database migrations+echo "🔄 Running migrations..."+docker run --rm \+ -v $(pwd)/data:/app/data \+ --env-file .env \+ ghcr.io/rmyndharis/openwa:1.0.0 \+ npm run migration:run++# 6. Migrate webhooks to new format+echo "🔄 Migrating webhooks..."+docker run --rm \+ -v $(pwd)/data:/app/data \+ -v "$BACKUP_DIR/webhooks.json:/tmp/webhooks.json" \+ --env-file .env \+ ghcr.io/rmyndharis/openwa:1.0.0 \+ npm run cli -- migrate-webhooks /tmp/webhooks.json++# 7. Start new version+echo "▶️ Starting v1.0..."+sed -i 's/:0.2./:1.0./g' docker-compose.yml+docker compose pull+docker compose up -d++# 8. Health check+echo "⏳ Waiting for health check..."+for i in {1..30}; do+ if curl -sf http://localhost:2785/health > /dev/null; then+ echo "✅ Health check passed"+ break+ fi+ sleep 2+done++# 9. Verify sessions+echo "🔍 Verifying sessions..."+curl -s -H "X-API-Key: $API_KEY" \+ http://localhost:2785/api/sessions | jq '.[] | {id, status}'++echo ""+echo "✅ Upgrade to v1.0.0 complete!"+echo ""+echo "📝 Post-upgrade tasks:"+echo " 1. Update webhook consumers for v2 payload format"+echo " 2. Test all active sessions"+echo " 3. Review new rate limits"+echo " 4. Check Groups API if used"+```++## 14.6 Rollback Procedures++### Quick Rollback (< 24 hours)++```bash+#!/bin/bash+# rollback.sh++BACKUP_DIR=$1+TARGET_VERSION=$2++if [ -z "$BACKUP_DIR" ] || [ -z "$TARGET_VERSION" ]; then+ echo "Usage: ./rollback.sh <backup-dir> <target-version>"+ echo "Example: ./rollback.sh ./backups/v02-20260215-120000 0.2.0"+ exit 1+fi++echo "🔄 Rolling back to v${TARGET_VERSION}..."++# 1. Stop current+docker compose down++# 2. Restore database+echo "📥 Restoring database..."+if [ -f "$BACKUP_DIR/database.sql" ]; then+ # PostgreSQL+ psql $DATABASE_URL < "$BACKUP_DIR/database.sql"+else+ # SQLite+ cp "$BACKUP_DIR/openwa.db" ./data/+fi++# 3. Restore auth sessions+echo "📥 Restoring auth sessions..."+rm -rf ./data/.wwebjs_auth+cp -r "$BACKUP_DIR/.wwebjs_auth" ./data/++# 4. Restore configuration+echo "📥 Restoring configuration..."+cp "$BACKUP_DIR/.env" .+cp "$BACKUP_DIR/docker-compose.yml" .++# 5. Start old version+echo "▶️ Starting v${TARGET_VERSION}..."+docker compose pull+docker compose up -d++# 6. Verify+sleep 10+curl -f http://localhost:2785/health && echo "✅ Rollback successful"+```++### Rollback Decision Tree++```mermaid+flowchart TD+ A[Issue Detected] --> B{Severity?}+ B -->|Critical| C[Immediate Rollback]+ B -->|High| D{Fix Available?}+ B -->|Medium| E{Can Wait?}++ D -->|Yes| F[Apply Hotfix]+ D -->|No| C++ E -->|Yes| G[Schedule Fix]+ E -->|No| D++ C --> H{Backup Age?}+ H -->|< 24h| I[Full Rollback]+ H -->|> 24h| J[Partial Rollback + Data Merge]++ F --> K[Monitor]+ I --> K+ J --> K+ G --> K+```++## 14.7 Environment Migration++### Development → Staging++```yaml+# environments/staging.yml+migration:+ source: development+ target: staging++ steps:+ - name: Export sessions (anonymized)+ command: |+ npm run cli -- export-sessions \+ --anonymize \+ --output /tmp/sessions-staging.json++ - name: Reset database+ command: |+ npm run migration:fresh++ - name: Import test sessions+ command: |+ npm run cli -- import-sessions /tmp/sessions-staging.json++ - name: Configure staging webhooks+ command: |+ npm run cli -- set-webhook \+ --url https://staging-webhook.example.com/openwa \+ --events message,status++ - name: Set staging limits+ command: |+ npm run cli -- set-limits \+ --max-sessions 10 \+ --rate-limit 100/min+```++### Staging → Production++```yaml+# environments/production.yml+migration:+ source: staging+ target: production++ pre_checks:+ - name: Staging tests passed+ command: npm run test:e2e -- --tag staging+ required: true++ - name: Performance benchmarks+ command: npm run benchmark+ threshold: 'p99 < 500ms'++ - name: Security scan+ command: npm audit --production+ required: true++ steps:+ - name: Blue-green deployment+ type: blue-green+ config:+ health_check: /health+ switch_after: 60s+ rollback_on_error: true++ - name: Gradual traffic shift+ type: canary+ config:+ initial_percentage: 10+ increment: 10+ interval: 5m+ success_threshold: 99%+```++## 14.8 Data Export/Import++### Full Export++```typescript+// scripts/full-export.ts++interface ExportOptions {+ outputDir: string;+ includeMedia: boolean;+ includeLogs: boolean;+ compress: boolean;+}++async function fullExport(options: ExportOptions): Promise<void> {+ const fs = require('fs-extra');+ const archiver = require('archiver');++ const exportDir = path.join(options.outputDir, `export-${Date.now()}`);+ await fs.ensureDir(exportDir);++ // 1. Export database tables+ console.log('📊 Exporting database...');+ const tables = ['sessions', 'messages', 'contacts', 'webhooks', 'api_keys'];++ for (const table of tables) {+ const data = await db.query(`SELECT * FROM ${table}`);+ await fs.writeJson(path.join(exportDir, `${table}.json`), data, { spaces: 2 });+ }++ // 2. Export auth sessions+ console.log('🔐 Exporting auth sessions...');+ await fs.copy('./data/.wwebjs_auth', path.join(exportDir, 'auth'));++ // 3. Export media (optional)+ if (options.includeMedia) {+ console.log('📁 Exporting media files...');+ await fs.copy('./data/media', path.join(exportDir, 'media'));+ }++ // 4. Export logs (optional)+ if (options.includeLogs) {+ console.log('📝 Exporting logs...');+ await fs.copy('./logs', path.join(exportDir, 'logs'));+ }++ // 5. Export configuration (sanitized)+ console.log('⚙️ Exporting configuration...');+ const config = {+ version: process.env.npm_package_version,+ exportedAt: new Date().toISOString(),+ settings: {+ DATABASE_ADAPTER: process.env.DATABASE_ADAPTER,+ STORAGE_ADAPTER: process.env.STORAGE_ADAPTER,+ ENGINE_TYPE: process.env.ENGINE_TYPE,+ },+ };+ await fs.writeJson(path.join(exportDir, 'config.json'), config, { spaces: 2 });++ // 6. Compress (optional)+ if (options.compress) {+ console.log('🗜️ Compressing export...');+ const output = fs.createWriteStream(`${exportDir}.tar.gz`);+ const archive = archiver('tar', { gzip: true });++ archive.pipe(output);+ archive.directory(exportDir, false);+ await archive.finalize();++ await fs.remove(exportDir);+ console.log(`✅ Export complete: ${exportDir}.tar.gz`);+ } else {+ console.log(`✅ Export complete: ${exportDir}`);+ }+}+```++### Full Import++```typescript+// scripts/full-import.ts++interface ImportOptions {+ inputPath: string;+ mergeStrategy: 'replace' | 'merge' | 'skip-existing';+ dryRun: boolean;+}++async function fullImport(options: ImportOptions): Promise<void> {+ const fs = require('fs-extra');+ const tar = require('tar');++ let importDir = options.inputPath;++ // Extract if compressed+ if (options.inputPath.endsWith('.tar.gz')) {+ importDir = options.inputPath.replace('.tar.gz', '-extracted');+ await tar.extract({+ file: options.inputPath,+ cwd: importDir,+ });+ }++ // Validate export+ const configPath = path.join(importDir, 'config.json');+ if (!(await fs.pathExists(configPath))) {+ throw new Error('Invalid export: config.json not found');+ }++ const exportConfig = await fs.readJson(configPath);+ console.log(`📦 Importing from v${exportConfig.version}`);+ console.log(`📅 Exported at: ${exportConfig.exportedAt}`);++ if (options.dryRun) {+ console.log('🔍 DRY RUN - No changes will be made');+ }++ // Import order matters (foreign keys)+ const importOrder = ['sessions', 'api_keys', 'webhooks', 'contacts', 'messages'];++ for (const table of importOrder) {+ const dataPath = path.join(importDir, `${table}.json`);+ if (!(await fs.pathExists(dataPath))) continue;++ const data = await fs.readJson(dataPath);+ console.log(`📥 Importing ${table}: ${data.length} records`);++ if (!options.dryRun) {+ await importTable(table, data, options.mergeStrategy);+ }+ }++ // Import auth sessions+ const authPath = path.join(importDir, 'auth');+ if (await fs.pathExists(authPath)) {+ console.log('🔐 Importing auth sessions...');+ if (!options.dryRun) {+ await fs.copy(authPath, './data/.wwebjs_auth', {+ overwrite: options.mergeStrategy === 'replace',+ });+ }+ }++ console.log('✅ Import complete');+}+```++## 14.9 Troubleshooting Migration Issues++### Common Issues++| Issue | Cause | Solution |+| ------------------------ | ---------------------- | ---------------------------- |+| Session not reconnecting | Auth data corrupted | Re-scan QR code |+| Foreign key errors | Wrong import order | Use provided import order |+| Duplicate key errors | Existing data conflict | Use merge strategy |+| Permission denied | File ownership | `chown -R 1000:1000 ./data` |+| Out of memory | Large export | Increase Docker memory limit |++### Debug Commands++```bash+# Check database integrity+sqlite3 ./data/openwa.db "PRAGMA integrity_check;"++# Verify auth session files+ls -la ./data/.wwebjs_auth/session-*/++# Check file permissions+stat ./data/openwa.db+stat ./data/.wwebjs_auth++# Verify PostgreSQL connection+psql $DATABASE_URL -c "SELECT version();"++# Check migration status+npm run migration:status++# Force re-run specific migration+npm run migration:run -- --name CreateApiKeysTable+```++---++<div align="center">++[← 13 - Horizontal Scaling Guide](./13-horizontal-scaling.md) · [Documentation Index](./README.md) · [Next: 15 - Project Roadmap →](./15-project-roadmap.md)++</div>diff --git a/docs/15-project-roadmap.md b/docs/15-project-roadmap.mdnew file mode 100644index 000000000..2410bcc40--- /dev/null+++ b/docs/15-project-roadmap.md@@ -0,0 +1,612 @@+# 15 - Project Roadmap++## 15.1 Release Strategy++```mermaid+timeline+ title OpenWA Release Timeline++ section v0.0.1 - MVP+ Month 1-3 : Foundation & Engine+ : Basic API+ : Single session+ : Docker ready++ section v0.0.2 - Production Ready+ Month 4-6 : Multi-session support+ : Web Dashboard+ : Security & Queue+ : PostgreSQL++ section v0.1.0 - Initial Stable Release+ Month 7-9 : Full feature parity+ : Groups & Channels+ : Community tools+ : Stable release++ section v0.2.0 - Developer Tools+ Q2 2026 : JavaScript/Node.js SDK+ : Python SDK+ : Docs Site++ section v0.3.0 - Observability+ Q3 2026 : Prometheus Metrics+ : Grafana Dashboard++ section v1.0.0 - Enterprise+ Q4 2026 : Baileys Engine+ : Kubernetes Operator+```++### Release Summary++| Version | Focus | Status |+| ------- | --------------------------- | ----------- |+| v0.0.1 | MVP - Basic API | ✅ Released |+| v0.0.2 | Production Ready | ✅ Released |+| v0.1.0 | Initial Stable Release | ✅ Released |+| v0.2.0 | SDK & Developer Tools | 📋 Planned |+| v0.3.0 | Performance & Observability | 📋 Planned |+| v1.0.0 | Enterprise Ready | 📋 Planned |++### Risk Buffer++Each phase includes a 2–3 week buffer for:++- Bug fixing and stabilization+- WhatsApp protocol changes+- Community feedback integration+- Documentation updates++### Prerequisites & Resources++| Requirement | Details |+| ------------------ | --------------------------------------------------------- |+| **Development** | 1-2 full-time developers (or equivalent part-time) |+| **Environment** | Node.js 20 LTS, Docker, Git |+| **Testing** | WhatsApp test accounts (2-3 numbers) |+| **Infrastructure** | VPS for staging (2GB RAM minimum) |+| **Accounts** | GitHub organization, npm registry access, Docker Hub/GHCR |++## 15.2 Version Numbering++```+MAJOR.MINOR.PATCH++MAJOR: Breaking changes+MINOR: New features (backward compatible)+PATCH: Bug fixes++Examples:+0.0.1 - Initial MVP+0.0.2 - Production Ready (Multi-session, Dashboard)+0.1.0 - Initial Stable Release (Full features)+0.1.1 - Bug fix for QR timeout+0.2.0 - SDK & Developer Tools+1.0.0 - Enterprise Ready+2.0.0 - Breaking API changes+```++## 15.3 Phase 1: MVP (Month 1-3)++### Goals++- Working single-session API+- Basic send/receive functionality+- Docker deployment ready+- Stable WhatsApp connection++### Milestones++```mermaid+gantt+ title Phase 1 - MVP (12 weeks)+ dateFormat X+ axisFormat Week %W++ section Foundation (Week 1-2)+ Project setup :done, p1-1, 0, 5d+ Database schema :done, p1-2, after p1-1, 3d+ Basic NestJS structure :done, p1-3, after p1-2, 4d++ section WhatsApp Engine (Week 3-5)+ Engine abstraction layer :p1-4, after p1-3, 3d+ whatsapp-web.js wrapper :p1-5, after p1-4, 7d+ Connection management :p1-6, after p1-5, 4d+ QR code handling :p1-7, after p1-6, 3d++ section Session (Week 6-7)+ Session entity & CRUD :p1-8, after p1-7, 4d+ Session persistence :p1-9, after p1-8, 4d+ Auto-reconnect logic :p1-10, after p1-9, 3d++ section Messaging (Week 8-9)+ Send text message :p1-11, after p1-10, 3d+ Send image :p1-12, after p1-11, 2d+ Send video/audio :p1-13, after p1-12, 3d+ Send document :p1-14, after p1-13, 2d++ section Webhook (Week 10)+ Receive messages event :p1-15, after p1-14, 2d+ Webhook delivery :p1-16, after p1-15, 3d+ Retry mechanism :p1-17, after p1-16, 2d++ section Infrastructure (Week 10-11)+ Docker setup :p1-18, after p1-3, 3d+ CI/CD pipeline :p1-18b, after p1-18, 3d+ Swagger documentation :p1-19, after p1-17, 2d+ Health endpoints :p1-20, after p1-19, 1d+ Basic logging :p1-21, after p1-20, 2d++ section Stabilization (Week 12)+ Integration testing :p1-22, after p1-21, 3d+ Bug fixes :p1-23, after p1-22, 3d+ Documentation :p1-24, after p1-23, 2d+ v0.0.1 Release :milestone, p1-25, after p1-24, 0d+```++### Complexity Notes++```mermaid+flowchart TB+ subgraph HighRisk["⚠️ High Complexity Areas"]+ WW[whatsapp-web.js Integration]+ RC[Reconnection Logic]+ QR[QR Code Lifecycle]+ end++ subgraph MediumRisk["⚡ Medium Complexity"]+ WH[Webhook Reliability]+ MD[Media Handling]+ end++ subgraph LowRisk["✅ Low Complexity"]+ CRUD[Basic CRUD APIs]+ DOC[Documentation]+ DOCKER[Docker Setup]+ end+```++| Area | Complexity | Time Buffer |+| --------------------------- | ---------- | ----------- |+| whatsapp-web.js integration | High | +1 week |+| Connection stability | High | +1 week |+| Media handling | Medium | +3 days |+| Webhook delivery | Medium | +3 days |++### v0.0.1 Features++> **Note:** Phase 1 release - MVP with core API functionality.++#### Core API & Session Management++| Feature | Priority | Status |+| ------------------ | -------- | ------ |+| Create session | P0 | ✅ |+| Delete session | P0 | ✅ |+| Get session status | P0 | ✅ |+| Generate QR code | P0 | ✅ |+| Session reconnect | P1 | ✅ |++#### Basic Messaging++| Feature | Priority | Status |+| ----------------- | -------- | ------ |+| Send text message | P0 | ✅ |+| Send image | P0 | ✅ |+| Send video | P1 | ✅ |+| Send audio | P1 | ✅ |+| Send document | P1 | ✅ |+| Receive messages | P0 | ✅ |++#### Basic Webhooks++| Feature | Priority | Status |+| ---------------- | -------- | ------ |+| Webhook delivery | P0 | ✅ |+| Webhook retry | P0 | ✅ |++#### Infrastructure++| Feature | Priority | Status |+| -------------- | -------- | ------ |+| SQLite storage | P0 | ✅ |+| Docker support | P0 | ✅ |+| Health check | P1 | ✅ |+| Swagger docs | P0 | ✅ |++### Deliverables++```+v0.0.1 Release Package:+├── Docker image (ghcr.io/rmyndharis/openwa:0.0.1)+├── docker-compose.yml+├── Basic API documentation (Swagger)+├── README with quick start+├── Single session example+└── CI/CD workflows (GitHub Actions)+ ├── Build & test pipeline+ └── Docker image build+```++## 15.4 Phase 2: Production Ready (Month 4-6)++### Goals++- Multi-session support+- Web dashboard+- Production-grade security+- Database scalability++### Milestones++```mermaid+gantt+ title Phase 2 - Production Ready (12 weeks)+ dateFormat X+ axisFormat Week %W++ section Multi-session (Week 1-3)+ Session manager redesign :p2-1, 0, 5d+ Memory management :p2-2, after p2-1, 4d+ Concurrent sessions :p2-3, after p2-2, 4d+ Session isolation :p2-4, after p2-3, 3d+ Resource quotas :p2-5, after p2-4, 3d++ section Database (Week 4-5)+ PostgreSQL adapter :p2-6, 0, 4d+ Migration system :p2-7, after p2-6, 3d+ Connection pooling :p2-8, after p2-7, 2d+ Table partitioning :p2-9, after p2-8, 3d++ section Security (Week 5-7)+ API key system :p2-10, after p2-5, 4d+ Permission model :p2-11, after p2-10, 3d+ Rate limiting :p2-12, after p2-11, 3d+ IP whitelisting :p2-13, after p2-12, 2d+ Audit logging :p2-14, after p2-13, 3d++ section Queue System (Week 6-7)+ Redis integration :p2-15, after p2-9, 3d+ Bull queue setup :p2-16, after p2-15, 3d+ Webhook queue :p2-17, after p2-16, 2d+ Message queue :p2-18, after p2-17, 2d++ section Dashboard (Week 8-10)+ React + shadcn/ui setup :p2-19, after p2-18, 3d+ Authentication UI :p2-20, after p2-19, 3d+ Session management :p2-21, after p2-20, 4d+ QR code display :p2-22, after p2-21, 2d+ Webhook management :p2-23, after p2-22, 4d+ Logs viewer :p2-24, after p2-23, 3d+ Test message sender :p2-25, after p2-24, 2d++ section Stabilization (Week 11-12)+ Load testing :p2-26, after p2-25, 3d+ Security audit :p2-27, after p2-26, 3d+ Performance tuning :p2-28, after p2-27, 3d+ v0.0.2 Release :milestone, p2-29, after p2-28, 0d+```++### v0.0.2 Features++> **Note:** Phase 2 release - Production Ready with multi-session, dashboard, and security.++#### Multi-Session & Database++| Feature | Priority | Status |+| ------------------ | -------- | ------ |+| Multi-session | P0 | ✅ |+| Session isolation | P0 | ✅ |+| Proxy per session | P1 | ✅ |+| PostgreSQL support | P0 | ✅ |+| Redis cache | P1 | ✅ |+| Job queue (Bull) | P1 | ✅ |+| Connection pooling | P1 | ✅ |++#### Security & Auth++| Feature | Priority | Status |+| ---------------------- | -------- | ------ |+| API key authentication | P0 | ✅ |+| Rate limiting | P0 | ✅ |+| Permission system | P1 | ✅ |+| IP whitelisting | P2 | ✅ |+| Audit logging | P2 | ✅ |++#### Dashboard++| Feature | Priority | Status |+| --------------------- | -------- | ------ |+| Web dashboard | P0 | ✅ |+| Session management UI | P0 | ✅ |+| QR code display | P0 | ✅ |+| Webhook management UI | P1 | ✅ |+| Logs viewer | P1 | ✅ |+| Test message sender | P2 | ✅ |++### Deliverables++```+v0.0.2 Release Package:+├── Docker image (ghcr.io/rmyndharis/openwa:0.0.2)+├── docker-compose.yml (with PostgreSQL & Redis)+├── Web Dashboard+├── API authentication (API keys)+├── Enhanced API documentation+├── Multi-session examples+└── Production deployment guide+```++## 15.5 Phase 3: Advanced Features (Month 7-9)++### Goals++- Complete feature parity with WAHA Plus+- Stable v0.1.0 release+- Community adoption++### Milestones++```mermaid+gantt+ title Phase 3 - Advanced Features (12 weeks)+ dateFormat X+ axisFormat Week %W++ section Groups (Week 1-2)+ Get groups list :p3-1, 0, 2d+ Group info & members :p3-2, after p3-1, 2d+ Create group :p3-3, after p3-2, 2d+ Manage participants :p3-4, after p3-3, 3d+ Group settings :p3-5, after p3-4, 2d++ section Channels (Week 3-4)+ Channel list :p3-6, 0, 2d+ Channel messages :p3-7, after p3-6, 3d+ Create channel :p3-8, after p3-7, 2d++ section Advanced Messages (Week 5-6)+ Send location :p3-9, after p3-5, 1d+ Send contact :p3-10, after p3-9, 1d+ Send sticker :p3-11, after p3-10, 2d+ Message reactions :p3-12, after p3-11, 1d+ Reply to message :p3-13, after p3-12, 1d+ Forward message :p3-14, after p3-13, 1d++ section Scaling (Week 7-8)+ Horizontal scaling docs :p3-15, after p3-8, 3d+ Session affinity :p3-16, after p3-15, 2d+ Load testing :p3-17, after p3-16, 2d++ section Community (Week 9-10)+ n8n community node :p3-18, after p3-17, 3d+ Example projects :p3-19, after p3-18, 2d+ Video tutorials :p3-20, after p3-19, 3d++ section Release (Week 11-12)+ Security audit :p3-21, after p3-20, 3d+ Performance tuning :p3-22, after p3-21, 2d+ v0.1.0 Release :milestone, p3-23, after p3-22, 0d+```++### v0.1.0 Features++> **Note:** Phase 3 release - Initial Stable Release with full feature parity.++#### Advanced Messaging++| Feature | Priority | Status |+| ----------------- | -------- | ------ |+| Send location | P1 | ✅ |+| Send contact | P1 | ✅ |+| Send sticker | P2 | ✅ |+| Message reactions | P2 | ✅ |+| Reply to message | P1 | ✅ |+| Forward message | P1 | ✅ |+| Message history | P2 | ✅ |++#### Groups, Channels & Contacts++| Feature | Priority | Status |+| ------------------- | -------- | ------ |+| Groups API (full) | P0 | ✅ |+| Channels/Newsletter | P1 | ✅ |+| Labels management | P2 | ✅ |+| Contact list API | P1 | ✅ |++#### Scaling & Infrastructure++| Feature | Priority | Status |+| ------------------ | -------- | ------ |+| Horizontal scaling | P2 | ✅ |+| Session affinity | P2 | ✅ |+| Security audit | P0 | ✅ |++#### Community & Tooling++| Feature | Priority | Status |+| --------------- | -------- | ------------------ |+| n8n integration | P1 | ✅ (separate repo) |+| CI/CD pipeline | P0 | ✅ |++### Deliverables++```+v0.1.0 Release Package:+├── Docker image (ghcr.io/rmyndharis/openwa:0.1.0)+├── docker-compose.yml (production ready)+├── Full-featured Web Dashboard+├── Complete API documentation (Swagger)+├── README with comprehensive guide+├── Integration examples+│ ├── n8n community node+│ └── Basic automation examples+└── CI/CD workflows (GitHub Actions)+ ├── Build & test pipeline+ ├── Docker image build & push+ └── Release automation+```++## 15.6 Future Roadmap (v0.2.0+)++> **Note:** Version 0.1.0 is the initial stable release including all features from Phases 1-3.++```mermaid+flowchart LR+ subgraph Phase1["Phase 1"]+ V001[v0.0.1 - MVP<br/>Basic API & Single Session]+ end++ subgraph Phase2["Phase 2"]+ V002[v0.0.2 - Production Ready<br/>Multi-session & Dashboard]+ end++ subgraph Current["✅ Current Release"]+ V010[v0.1.0 - Initial Stable Release<br/>All Core Features]+ end++ subgraph v0.x["v0.x Series - Enhancements"]+ V020[v0.2.0 - SDK & Developer Tools]+ V030[v0.3.0 - Performance & Observability]+ end++ subgraph v1.x["v1.x Series - Enterprise"]+ V10[v1.0.0 - Enterprise Ready]+ V11[v1.1.0 - Multi-engine Support]+ end++ Phase1 --> Phase2 --> Current --> v0.x --> v1.x+```++### v0.2.0 - SDK & Developer Tools++| Feature | Priority | Description |+| ---------------------- | -------- | ------------------------------- |+| JavaScript/Node.js SDK | P1 | Official client library |+| Python SDK | P2 | Python client library |+| Docs Site | P1 | Documentation website |+| Postman Collection | P1 | Ready-to-use API collection |+| Video Tutorials | P2 | Getting started video series |+| Example Projects | P1 | Real-world integration examples |++### v0.3.0 - Performance & Observability++| Feature | Priority | Description |+| ---------------------- | -------- | -------------------------------- |+| Prometheus Metrics | P1 | /metrics endpoint for monitoring |+| Grafana Dashboard | P2 | Pre-built monitoring dashboard |+| OpenTelemetry Tracing | P2 | Distributed tracing support |+| Performance Benchmarks | P1 | Documented performance metrics |+| Memory Optimization | P1 | Reduced memory per session |++### v1.0.0 - Enterprise Ready++| Feature | Priority | Description |+| ------------------- | -------- | ------------------------------ |+| Baileys Engine | P2 | Alternative lightweight engine |+| Kubernetes Operator | P3 | Native K8s deployment |+| Multi-tenant | P3 | Enterprise SaaS features |+| Encryption at rest | P2 | Full data encryption |+| Audit compliance | P2 | SOC2, GDPR compliance |+| WhatsApp Pay | P3 | Payment links integration |++## 15.7 Release Checklist++### Pre-Release++```markdown+## Pre-Release Checklist++### Code Quality++- [ ] All tests passing+- [ ] Code coverage meeting target (v0.1.0: minimal, future: > 80%)+- [ ] No critical linter warnings+- [ ] Security scan passed+- [ ] Dependency audit clean++### Documentation++- [ ] API docs updated+- [ ] CHANGELOG updated+- [ ] README updated+- [ ] Migration guide (if breaking)++### Testing++- [ ] Manual QA completed+- [ ] Performance benchmarks+- [ ] Load testing (if applicable)+- [ ] Rollback tested++### Infrastructure++- [ ] Docker image builds+- [ ] Docker Compose tested+- [ ] Environment variables documented+```++### Release Process++```mermaid+flowchart TB+ A[Feature Complete] --> B[Create Release Branch]+ B --> C[Version Bump]+ C --> D[Update CHANGELOG]+ D --> E[Final Testing]+ E --> F{Tests Pass?}+ F -->|No| G[Fix Issues]+ G --> E+ F -->|Yes| H[Create PR to main]+ H --> I[Code Review]+ I --> J[Merge to main]+ J --> K[Create Git Tag]+ K --> L[Build & Push Docker]+ L --> M[Create GitHub Release]+ M --> N[Announce Release]+```++## 15.8 Success Metrics++### Phase 1 Success Criteria++| Metric | Target | Type |+| -------------------------- | --------- | -------- |+| Core API endpoints working | 100% | Internal |+| Docker deployment works | ✅ | Internal |+| Single session stable | 24+ hours | Internal |+| Message delivery rate | > 95% | Internal |+| API response time | < 500ms | Internal |+| CI/CD pipeline operational | ✅ | Internal |++### Phase 2 Success Criteria++| Metric | Target | Actual | Type |+| --------------------- | ------------ | ----------------- | -------- |+| Multi-session support | 10+ sessions | ✅ Achieved | Internal |+| Dashboard functional | All features | ✅ Achieved | Internal |+| PostgreSQL stable | ✅ | ✅ Achieved | Internal |+| Webhook delivery rate | > 99% | ✅ Achieved | Internal |+| Test coverage | > 70% | ⚠️ ~5% (deferred) | Internal |+| GitHub stars | 100+ | 📋 Pending | External |++### Phase 3 Success Criteria++| Metric | Target | Actual | Type |+| ----------------------------- | ------- | ----------------- | -------- |+| Feature parity with WAHA Plus | 90%+ | ✅ Achieved | Internal |+| API response time (p95) | < 200ms | ✅ Achieved | Internal |+| Test coverage | > 80% | ⚠️ ~5% (deferred) | Internal |+| Documentation coverage | 100% | ✅ 95%+ | Internal |+| Production users | 50+ | 📋 Pending | External |+| GitHub stars | 500+ | 📋 Pending | External |+| Community contributors | 5+ | 📋 Pending | External |++---++<div align="center">++[← 14 - Migration Guide](./14-migration-guide.md) · [Documentation Index](./README.md) · [Next: 16 - Risk Management →](./16-risk-management.md)++</div>diff --git a/docs/16-risk-management.md b/docs/16-risk-management.mdnew file mode 100644index 000000000..0d02a5213--- /dev/null+++ b/docs/16-risk-management.md@@ -0,0 +1,740 @@+# 16 - Risk Management++## 16.1 Risk Overview++```mermaid+quadrantChart+ title Risk Assessment Matrix+ x-axis Low Impact --> High Impact+ y-axis Low Probability --> High Probability++ quadrant-1 Monitor+ quadrant-2 Critical+ quadrant-3 Low Priority+ quadrant-4 Mitigate++ WhatsApp Protocol Change: [0.8, 0.7]+ Account Ban: [0.6, 0.5]+ Security Breach: [0.9, 0.3]+ Maintainer Burnout: [0.5, 0.4]+ Dependency Issues: [0.4, 0.6]+ Legal Issues: [0.8, 0.2]+```++## 16.2 Risk Register++### R001: WhatsApp Protocol Changes++| Attribute | Value |+|-----------|-------|+| **ID** | R001 |+| **Category** | Technical |+| **Probability** | High (70%) |+| **Impact** | High |+| **Risk Level** | Critical |++**Description:**+WhatsApp can change their Web protocol at any time, which can cause the `whatsapp-web.js` library to stop working.++**Indicators:**+- Spike in `whatsapp-web.js` issues+- Sudden increase in error rates+- Authentication failures++**Mitigation Strategies:**++```mermaid+flowchart TB+ R[Risk: Protocol Change] --> M1[Monitor whatsapp-web.js repo]+ R --> M2[Implement abstraction layer]+ R --> M3[Prepare alternative engines]+ R --> M4[Quick response plan]++ M1 --> A1[Watch releases & issues]+ M2 --> A2[Engine interface pattern]+ M3 --> A3[Baileys as backup]+ M4 --> A4[< 24h patch capability]+```++**Action Items:**+1. Subscribe to `whatsapp-web.js` releases+2. Design the engine abstraction layer+3. Document fallback procedures+4. Maintain relationships with library maintainers++---++### R002: User Account Banned++| Attribute | Value |+|-----------|-------|+| **ID** | R002 |+| **Category** | Operational |+| **Probability** | Medium (50%) |+| **Impact** | Medium |+| **Risk Level** | Medium |++**Description:**+WhatsApp users can be banned for using unofficial APIs or behavior detected as spam.++**Indicators:**+- User reports of banned accounts+- Sudden disconnections+- QR code fails for specific numbers++**Mitigation Strategies:**++```mermaid+flowchart TB+ R[Risk: Account Ban] --> M1[Anti-ban best practices]+ R --> M2[User education]+ R --> M3[Built-in safeguards]+ R --> M4[Clear disclaimers]++ M1 --> A1[Rate limiting defaults]+ M2 --> A2[Documentation & warnings]+ M3 --> A3[Human-like delays]+ M4 --> A4[Terms of service]+```++**Built-in Safeguards:**++```typescript+// Default rate limits to prevent ban+const DEFAULT_SAFEGUARDS = {+ // Message sending+ minDelayBetweenMessages: 3000, // 3 seconds minimum+ maxMessagesPerMinute: 20,+ maxMessagesPerHour: 200,++ // Session behavior+ enableTypingIndicator: true,+ randomizeDelays: true,++ // Warnings+ warnOnBulkSend: true,+ warnOnNewNumberSpam: true,+};+```++**User Guidelines Document:**++```markdown+## Anti-Ban Best Practices++### DO ✅+- Warm up new numbers (normal usage for 1-2 weeks)+- Use realistic delays between messages+- Personalize messages (avoid identical content)+- Respond to incoming messages+- Use residential proxies if needed++### DON'T ❌+- Send bulk messages to unknown numbers+- Use identical message templates+- Send >100 messages/day on new numbers+- Ignore replies (one-way communication)+- Use datacenter IPs without proxy+```++---++### R003: Security Breach++| Attribute | Value |+|-----------|-------|+| **ID** | R003 |+| **Category** | Security |+| **Probability** | Low (30%) |+| **Impact** | Critical |+| **Risk Level** | High |++**Description:**+Security vulnerabilities may lead to unauthorized access to sessions, data, or infrastructure.++**Potential Vectors:**+- API key leakage+- SQL injection+- Insecure session storage+- Dependency vulnerabilities++**Mitigation Strategies:**++```mermaid+flowchart TB+ R[Risk: Security Breach] --> M1[Secure development]+ R --> M2[Regular audits]+ R --> M3[Dependency scanning]+ R --> M4[Incident response plan]++ M1 --> A1[Input validation, encryption]+ M2 --> A2[Quarterly security review]+ M3 --> A3[Automated npm audit]+ M4 --> A4[Documented procedures]+```++**Security Checklist:**++```markdown+## Security Review Checklist++### Code Security+- [ ] Input validation on all endpoints+- [ ] Parameterized database queries+- [ ] API key hashing (never plain storage)+- [ ] Sensitive data encryption+- [ ] No secrets in codebase++### Infrastructure Security+- [ ] HTTPS enforced+- [ ] Security headers configured+- [ ] Rate limiting enabled+- [ ] Firewall rules reviewed+- [ ] Access logs enabled++### Dependency Security+- [ ] npm audit clean+- [ ] Snyk scan passed+- [ ] Dependencies up to date+- [ ] No known vulnerabilities+```++**Incident Response Plan:**++```mermaid+flowchart TB+ D[Detect Incident] --> A[Assess Severity]+ A --> |Critical| C1[Immediate Response]+ A --> |High| C2[4-hour Response]+ A --> |Medium| C3[24-hour Response]++ C1 --> R1[Isolate affected systems]+ R1 --> R2[Patch vulnerability]+ R2 --> R3[Notify affected users]+ R3 --> R4[Post-mortem]+```++---++### R004: Maintainer Burnout++| Attribute | Value |+|-----------|-------|+| **ID** | R004 |+| **Category** | Organizational |+| **Probability** | Medium (40%) |+| **Impact** | Medium |+| **Risk Level** | Medium |++**Description:**+An open-source project can stagnate if maintainers burn out or lack time.++**Indicators:**+- Increasing response time to issues+- PR review delays+- Reduced commit frequency+- Maintainer communication gaps++**Mitigation Strategies:**++```mermaid+flowchart TB+ R[Risk: Maintainer Burnout] --> M1[Build community]+ R --> M2[Documentation]+ R --> M3[Automation]+ R --> M4[Contributor onboarding]++ M1 --> A1[Active Discord/forum]+ M2 --> A2[Comprehensive docs]+ M3 --> A3[CI/CD automation]+ M4 --> A4[Contributing guide]+```++**Sustainability Measures:**++1. **Comprehensive Documentation**+ - Anyone can understand the codebase+ - Clear architecture decisions+ - Troubleshooting guides++2. **Automation**+ - Automated testing+ - Automated releases+ - Issue/PR templates++3. **Community Building**+ - Recognize contributors+ - Good first issues+ - Mentorship program++4. **Multiple Maintainers**+ - Bus factor > 1+ - Clear ownership areas+ - Succession planning++---++### R005: Dependency Vulnerabilities++| Attribute | Value |+|-----------|-------|+| **ID** | R005 |+| **Category** | Technical |+| **Probability** | High (60%) |+| **Impact** | Medium |+| **Risk Level** | Medium |++**Description:**+Dependencies (`whatsapp-web.js`, Puppeteer, NestJS, etc.) may have vulnerabilities or breaking changes.++**Mitigation Strategies:**++```yaml+# .github/workflows/security.yml+name: Security Scan++on:+ schedule:+ - cron: '0 0 * * *' # Daily+ push:+ branches: [main]++jobs:+ audit:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4++ - name: npm audit+ run: npm audit --audit-level=high++ - name: Snyk scan+ uses: snyk/actions/node@master+ env:+ SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}+```++**Dependency Management Policy:**++| Action | Frequency |+|--------|-----------|+| npm audit | Daily (automated) |+| Snyk scan | Daily (automated) |+| Minor updates | Weekly |+| Major updates | Monthly (with testing) |+| Security patches | Immediate |++---++### R006: Legal/Compliance Issues++| Attribute | Value |+|-----------|-------|+| **ID** | R006 |+| **Category** | Legal |+| **Probability** | Low (20%) |+| **Impact** | Critical |+| **Risk Level** | Medium |++**Description:**+WhatsApp/Meta may take legal action against unofficial APIs, or users may misuse the system for illegal activities.++**Mitigation Strategies:**++1. **Clear Disclaimers**++```markdown+## Disclaimer++This project is not affiliated with, authorized, maintained,+sponsored or endorsed by WhatsApp or any of its affiliates.++This is an independent and unofficial software. Use at your own risk.++By using this software, you agree that:+1. You will not use it for spam or illegal activities+2. You are responsible for compliance with local laws+3. The maintainers are not liable for any misuse+```++2. **Terms of Service for Users**+3. **No support for spam/illegal use cases**+4. **Built-in anti-abuse measures**++---++## 16.3 Risk Monitoring++### Monitoring Dashboard++```mermaid+flowchart TB+ subgraph Metrics["Risk Indicators"]+ M1[GitHub Issues Trend]+ M2[Error Rate]+ M3[Security Alerts]+ M4[Dependency Status]+ M5[Community Activity]+ end++ subgraph Thresholds["Alert Thresholds"]+ T1[Issues > 50 open]+ T2[Error > 5%]+ T3[Any critical CVE]+ T4[Outdated > 30 days]+ T5[No PR > 14 days]+ end++ Metrics --> Thresholds --> Alert[Alert & Review]+```++### Weekly Risk Review++```markdown+## Weekly Risk Review Template++### Date: YYYY-MM-DD++### Technical Risks+- [ ] whatsapp-web.js status: ___+- [ ] Error rate trend: ___+- [ ] Security scan results: ___+- [ ] Dependency updates needed: ___++### Operational Risks+- [ ] User ban reports: ___+- [ ] Support ticket volume: ___+- [ ] Performance issues: ___++### Community Health+- [ ] Open issues: ___+- [ ] Open PRs: ___+- [ ] New contributors: ___+- [ ] Response time (avg): ___++### Actions Needed+1. ___+2. ___+3. ___+```++## 16.4 Contingency Plans++### Plan A: WhatsApp Protocol Change++```mermaid+flowchart TB+ T[Trigger: Protocol Change] --> A1[Assess Impact]+ A1 --> |Minor| M1[Wait for library update]+ A1 --> |Major| M2[Activate contingency]++ M2 --> C1[Notify users]+ C1 --> C2[Switch to maintenance mode]+ C2 --> C3[Evaluate alternatives]+ C3 --> |Baileys viable| C4[Implement Baileys engine]+ C3 --> |No alternatives| C5[Project pause/EOL]+```++### Plan B: Critical Security Vulnerability++```+Timeline: < 24 hours response++Hour 0-1:+- Assess severity+- Disable affected features if needed+- Notify critical users++Hour 1-4:+- Develop patch+- Test patch+- Prepare release++Hour 4-8:+- Deploy patch+- Notify all users+- Monitor for issues++Hour 8-24:+- Post-mortem+- Update procedures+- Additional hardening+```++### Plan C: Project Handover++```markdown+## Project Handover Checklist++### Documentation+- [ ] Architecture documented+- [ ] All decisions logged+- [ ] Deployment procedures+- [ ] Credentials inventory++### Access+- [ ] GitHub owner transfer+- [ ] npm publish rights+- [ ] Domain ownership+- [ ] Cloud accounts++### Knowledge Transfer+- [ ] Codebase walkthrough+- [ ] Known issues list+- [ ] Roadmap handover+- [ ] Community introduction+```++## 16.5 Additional Risk Mitigations++### R007: Rate Limiting & WhatsApp Throttling++| Attribute | Value |+|-----------|-------|+| **ID** | R007 |+| **Category** | Operational |+| **Probability** | High (70%) |+| **Impact** | Medium |+| **Risk Level** | Medium |++**Description:**+WhatsApp has undocumented internal rate limits. Sending too many messages can trigger temporary blocks or permanent bans.++**Built-in Safeguards:**++```typescript+// Anti-ban configuration defaults+const RATE_LIMIT_CONFIG = {+ // Per session limits+ messagesPerMinute: 20,+ messagesPerHour: 200,+ messagesPerDay: 1000,++ // Delays+ minDelayBetweenMessages: 3000, // 3 seconds+ maxDelayBetweenMessages: 5000, // 5 seconds+ delayAfterMedia: 5000, // 5 seconds after media++ // Bulk messaging+ bulkBatchSize: 50,+ bulkDelayBetweenBatches: 60000, // 1 minute++ // New number warmup+ newNumberDailyLimit: 50,+ newNumberWarmupDays: 14,+};+```++**Monitoring Metrics:**++| Metric | Warning Threshold | Critical Threshold |+|--------|-------------------|--------------------|+| Messages per minute | > 15 | > 25 |+| Failed sends | > 5% | > 15% |+| Connection drops | > 2/hour | > 5/hour |+| QR re-auth requests | > 1/day | > 3/day |++---++### R008: Data Loss++| Attribute | Value |+|-----------|-------|+| **ID** | R008 |+| **Category** | Technical |+| **Probability** | Low (20%) |+| **Impact** | High |+| **Risk Level** | Medium |++**Mitigation Strategy:**++```mermaid+flowchart TB+ subgraph Prevention["Prevention"]+ DB[Database Replication]+ BACKUP[Automated Backups]+ SESSION[Session State Persistence]+ end++ subgraph Detection["Detection"]+ HEALTH[Health Checks]+ ALERT[Alerting System]+ end++ subgraph Recovery["Recovery"]+ RESTORE[Point-in-time Restore]+ RECONNECT[Auto Reconnect]+ end++ Prevention --> Detection --> Recovery+```++**Backup Schedule:**++| Data Type | Frequency | Retention | Storage |+|-----------|-----------|-----------|---------|+| Database (full) | Daily 02:00 | 30 days | S3/GCS |+| Database (incremental) | Every 6 hours | 7 days | S3/GCS |+| Session auth state | On change | Indefinite | Database |+| Configuration | On change | Indefinite | Git |++---++## 16.6 Escalation Procedures++### Severity Levels++| Level | Description | Response Time | Notification |+|-------|-------------|---------------|--------------|+| **P1 - Critical** | System down, data breach | < 15 minutes | Phone + Slack |+| **P2 - High** | Major feature broken | < 1 hour | Slack + Email |+| **P3 - Medium** | Feature degraded | < 4 hours | Slack |+| **P4 - Low** | Minor issue | < 24 hours | GitHub Issue |++### Escalation Flow++```mermaid+flowchart TB+ DETECT[Issue Detected] --> ASSESS[Assess Severity]++ ASSESS -->|P1| P1[Immediate Response]+ ASSESS -->|P2| P2[High Priority]+ ASSESS -->|P3| P3[Medium Priority]+ ASSESS -->|P4| P4[Low Priority]++ P1 --> NOTIFY1[Page On-call]+ P1 --> WAR[Start War Room]+ P1 --> STATUS1[Update Status Page]++ P2 --> NOTIFY2[Slack Alert]+ P2 --> ASSIGN[Assign Owner]++ P3 --> TICKET[Create Ticket]+ P3 --> SCHEDULE[Schedule Fix]++ P4 --> ISSUE[GitHub Issue]+ P4 --> BACKLOG[Add to Backlog]+```++### On-Call Rotation++```yaml+# Example PagerDuty/Opsgenie configuration+schedule:+ name: "OpenWA On-Call"+ rotation:+ - week: 1+ primary: "developer-a"+ secondary: "developer-b"+ - week: 2+ primary: "developer-b"+ secondary: "developer-a"++escalation:+ - level: 1+ wait: 5m+ target: primary+ - level: 2+ wait: 10m+ target: secondary+ - level: 3+ wait: 15m+ target: all-team+```++---++## 16.7 Risk Dashboard++### Key Risk Indicators (KRI)++```mermaid+flowchart LR+ subgraph Technical["Technical KRIs"]+ T1[Error Rate < 1%]+ T2[Uptime > 99.5%]+ T3[Response Time < 500ms]+ end++ subgraph Security["Security KRIs"]+ S1[Failed Auth < 100/day]+ S2[Blocked IPs < 50/day]+ S3[CVE Count = 0]+ end++ subgraph Operational["Operational KRIs"]+ O1[Session Success > 95%]+ O2[Webhook Delivery > 99%]+ O3[User Complaints < 5/week]+ end+```++### Weekly Risk Report Template++```markdown+## Weekly Risk Report - Week XX++### Summary+- Overall Risk Status: 🟢 Green / 🟡 Yellow / 🔴 Red+- New Risks Identified: X+- Risks Mitigated: X+- Active Incidents: X++### KRI Status++| KRI | Target | Actual | Status |+|-----|--------|--------|--------|+| Error Rate | < 1% | X.XX% | 🟢/🟡/🔴 |+| Uptime | > 99.5% | XX.XX% | 🟢/🟡/🔴 |+| Response Time | < 500ms | XXXms | 🟢/🟡/🔴 |++### Top Risks This Week++1. **Risk Name**+ - Status: Monitoring/Mitigating/Resolved+ - Action: [Description]++### Dependencies Update++| Dependency | Current | Latest | CVEs | Action |+|------------|---------|--------|------|--------|+| whatsapp-web.js | X.X.X | X.X.X | 0 | OK |+| puppeteer | X.X.X | X.X.X | 0 | OK |++### Action Items+- [ ] Action 1+- [ ] Action 2+```++---++## 16.8 Risk Summary++| ID | Risk | Probability | Impact | Level | Status |+|----|------|-------------|--------|-------|--------|+| R001 | Protocol Changes | High | High | 🔴 Critical | Monitoring |+| R002 | Account Ban | Medium | Medium | 🟡 Medium | Mitigated |+| R003 | Security Breach | Low | Critical | 🟡 Medium | Mitigated |+| R004 | Maintainer Burnout | Medium | Medium | 🟡 Medium | Planning |+| R005 | Dependency Issues | High | Medium | 🟡 Medium | Automated |+| R006 | Legal Issues | Low | Critical | 🟡 Medium | Mitigated |+| R007 | Rate Limiting | High | Medium | 🟡 Medium | Mitigated |+| R008 | Data Loss | Low | High | 🟡 Medium | Mitigated |++### Risk Trend++```mermaid+xychart-beta+ title "Risk Trend Over Time"+ x-axis [Jan, Feb, Mar, Apr, May, Jun]+ y-axis "Risk Score" 0 --> 100+ bar [65, 55, 45, 40, 35, 30]+ line [65, 55, 45, 40, 35, 30]+```+---++<div align="center">++[← 15 - Project Roadmap](./15-project-roadmap.md) · [Documentation Index](./README.md) · [Next: 17 - Dashboard Design →](./17-dashboard-design.md)++</div>diff --git a/docs/17-dashboard-design.md b/docs/17-dashboard-design.mdnew file mode 100644index 000000000..4a242e95e--- /dev/null+++ b/docs/17-dashboard-design.md@@ -0,0 +1,1059 @@+# 17 - Dashboard Design++## 17.1 Overview++The dashboard is a web-based management interface for OpenWA that lets users manage sessions, webhooks, and monitor activity without using the API directly.++### Tech Stack++```mermaid+flowchart LR+ subgraph Frontend+ REACT[React 18]+ VITE[Vite 5]+ TS[TypeScript]+ TW[Tailwind CSS]+ SHADCN[shadcn/ui]+ LUCIDE[Lucide Icons]+ end++ subgraph State+ TANSTACK[TanStack Query]+ ZUSTAND[Zustand]+ end++ subgraph Backend+ API[OpenWA API]+ WS[WebSocket]+ end++ Frontend --> State+ State --> Backend+```++### Design Principles++1. **Minimalist** - Clean, uncluttered interface+2. **Responsive** - Works on desktop and mobile+3. **Real-time** - Live updates via WebSocket+4. **Accessible** - WCAG 2.1 AA compliant+5. **Dark mode** - Support for light/dark themes++## 17.2 Information Architecture++```mermaid+flowchart TB+ subgraph Dashboard+ HOME[Dashboard Home]+ SESSIONS[Sessions]+ WEBHOOKS[Webhooks]+ APIKEYS[API Keys]+ LOGS[Logs]+ SETTINGS[Settings]+ end++ HOME --> |Quick Actions| SESSIONS+ HOME --> |View Stats| LOGS++ subgraph Sessions Pages+ LIST[Session List]+ DETAIL[Session Detail]+ QR[QR Scanner]+ CHAT[Test Chat]+ end++ SESSIONS --> LIST+ LIST --> DETAIL+ DETAIL --> QR+ DETAIL --> CHAT++ subgraph Webhooks Pages+ WH_LIST[Webhook List]+ WH_DETAIL[Webhook Detail]+ WH_LOGS[Webhook Logs]+ end++ WEBHOOKS --> WH_LIST+ WH_LIST --> WH_DETAIL+ WH_DETAIL --> WH_LOGS+```++### Navigation Structure++```+/ → Dashboard Home+/sessions → Session List+/sessions/:id → Session Detail+/sessions/:id/chat → Test Chat Interface+/webhooks → Webhook List+/webhooks/:id → Webhook Detail+/api-keys → API Keys Management+/logs → Activity Logs+/settings → Settings+/settings/profile → Profile Settings+/settings/appearance → Theme Settings+```++## 17.3 Wireframes++### Dashboard Home++```+┌─────────────────────────────────────────────────────────────────────┐+│ 🔵 OpenWA 🔍 Search 👤 Admin ☀️ │+├─────────────────────────────────────────────────────────────────────┤+│ │+│ ┌─────────────┬─────────────┬─────────────┬─────────────┐ │+│ │ 📱 5 │ ✅ 4 │ 📨 1,234 │ 🔗 3 │ │+│ │ Sessions │ Connected │ Messages │ Webhooks │ │+│ │ │ │ (Today) │ Active │ │+│ └─────────────┴─────────────┴─────────────┴─────────────┘ │+│ │+│ ┌──────────────────────────────────┐ ┌────────────────────────┐ │+│ │ Sessions Overview │ │ Recent Activity │ │+│ │ ┌──────┬──────┬──────┬──────┐ │ │ │ │+│ │ │ 🟢 │ 🟢 │ 🟢 │ 🟡 │ │ │ 10:30 Message sent │ │+│ │ │ CS-1 │ CS-2 │ Sales│ Supp │ │ │ 10:28 Webhook called │ │+│ │ │ 123 │ 456 │ 789 │ - │ │ │ 10:25 Session online │ │+│ │ └──────┴──────┴──────┴──────┘ │ │ 10:20 Message recv │ │+│ │ │ │ 10:15 QR scanned │ │+│ │ [+ New Session] │ │ │ │+│ └──────────────────────────────────┘ │ [View All →] │ │+│ └────────────────────────┘ │+│ │+│ ┌──────────────────────────────────────────────────────────────┐ │+│ │ Message Volume (Last 7 Days) │ │+│ │ ┌────────────────────────────────────────────────────────┐ │ │+│ │ │ ▓▓ │ │ │+│ │ │ ▓▓ ▓▓ ▓▓ │ │ │+│ │ │ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ │ │ │+│ │ │ ▓▓▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ │ │ │+│ │ │ Mon Tue Wed Thu Fri Sat Sun │ │ │+│ │ └────────────────────────────────────────────────────────┘ │ │+│ └──────────────────────────────────────────────────────────────┘ │+│ │+└─────────────────────────────────────────────────────────────────────┘+```++### Session List++```+┌─────────────────────────────────────────────────────────────────────┐+│ ← Sessions [+ New Session] │+├─────────────────────────────────────────────────────────────────────┤+│ │+│ 🔍 Search sessions... Filter: [All ▾] [Status ▾] │+│ │+│ ┌───────────────────────────────────────────────────────────────┐ │+│ │ ● Customer Support 1 🟢 Connected │ │+│ │ 📱 +62 812-3456-789 │ │+│ │ 📨 1,234 messages | Last active: 2 min ago │ │+│ │ ─────────────────────────────────────────────────────────── │ │+│ │ [📷 QR] [💬 Test Chat] [⚙️ Settings] [🗑️ Delete] │ │+│ └───────────────────────────────────────────────────────────────┘ │+│ │+│ ┌───────────────────────────────────────────────────────────────┐ │+│ │ ● Sales Bot 🟢 Connected │ │+│ │ 📱 +62 821-9876-543 │ │+│ │ 📨 567 messages | Last active: 5 min ago │ │+│ │ ─────────────────────────────────────────────────────────── │ │+│ │ [📷 QR] [💬 Test Chat] [⚙️ Settings] [🗑️ Delete] │ │+│ └───────────────────────────────────────────────────────────────┘ │+│ │+│ ┌───────────────────────────────────────────────────────────────┐ │+│ │ ○ Support Backup 🟡 Disconnected │ │+│ │ 📱 Not connected │ │+│ │ 📨 0 messages | Never active │ │+│ │ ─────────────────────────────────────────────────────────── │ │+│ │ [📷 Scan QR] [⚙️ Settings] [🗑️ Delete] │ │+│ └───────────────────────────────────────────────────────────────┘ │+│ │+│ ──────────────────────────────────────────────────────────────── │+│ Showing 3 of 3 sessions [◀] 1 [▶] │+│ │+└─────────────────────────────────────────────────────────────────────┘+```++### Session Detail++```+┌─────────────────────────────────────────────────────────────────────┐+│ ← Sessions / Customer Support 1 🟢 Connected │+├─────────────────────────────────────────────────────────────────────┤+│ │+│ ┌─────────────────────────────────────────────────────────────┐ │+│ │ ┌─────────┐ │ │+│ │ │ 👤 │ Customer Support 1 │ │+│ │ │ Avatar │ +62 812-3456-789 │ │+│ │ │ │ Status: 🟢 Connected │ │+│ │ └─────────┘ Platform: Android │ │+│ │ │ │+│ │ [Restart Session] [Logout] [Delete] │ │+│ └─────────────────────────────────────────────────────────────┘ │+│ │+│ ┌─────────────────────┬─────────────────────┐ │+│ │ 📊 Statistics │ ⚙️ Configuration │ │+│ ├─────────────────────┼─────────────────────┤ │+│ │ │ │ │+│ │ Messages Sent │ Auto Reconnect │ │+│ │ ████████░░ 1,234 │ [✓] Enabled │ │+│ │ │ │ │+│ │ Messages Received │ Webhook URL │ │+│ │ ██████████ 2,567 │ https://... │ │+│ │ │ │ │+│ │ Webhook Calls │ Proxy │ │+│ │ ███████░░░ 890 │ None │ │+│ │ │ │ │+│ │ Uptime │ Created │ │+│ │ 99.9% (30 days) │ 2026-01-15 │ │+│ │ │ │ │+│ └─────────────────────┴─────────────────────┘ │+│ │+│ ┌─────────────────────────────────────────────────────────────┐ │+│ │ Recent Messages [View All →] │ │+│ │ ───────────────────────────────────────────────────────── │ │+│ │ → +62 821... | Hello, how can I help? | 10:30 ✓✓ │ │+│ │ ← +62 821... | I need product info | 10:28 │ │+│ │ → +62 821... | Sure! Here's our catalog | 10:25 ✓✓ │ │+│ │ ← +62 813... | Thanks for your help! | 10:20 │ │+│ └─────────────────────────────────────────────────────────────┘ │+│ │+│ [💬 Open Test Chat] │+│ │+└─────────────────────────────────────────────────────────────────────┘+```++### QR Code Scanner++```+┌─────────────────────────────────────────────────────────────────────┐+│ Scan QR Code │+├─────────────────────────────────────────────────────────────────────┤+│ │+│ ┌─────────────────────────┐ │+│ │ │ │+│ │ ████████████████████ │ │+│ │ ██ ████ │ │+│ │ ██ ██████████ ████ │ │+│ │ ██ ██ ██ ████ │ │+│ │ ██ ██ ██ ████ │ │+│ │ ██ ██ ██ ████ │ │+│ │ ██ ██████████ ████ │ │+│ │ ██ ████ │ │+│ │ ████████████████████ │ │+│ │ │ │+│ └─────────────────────────┘ │+│ │+│ Expires in: 0:45 │+│ │+│ ────────────────────────────────────────────────────── │+│ │+│ 1. Open WhatsApp on your phone │+│ 2. Tap Menu ⋮ or Settings ⚙ │+│ 3. Tap Linked Devices │+│ 4. Tap Link a Device │+│ 5. Point your phone at this screen │+│ │+│ ────────────────────────────────────────────────────── │+│ │+│ [Refresh QR] [Cancel] │+│ │+└─────────────────────────────────────────────────────────────────────┘+```++### Test Chat Interface++```+┌─────────────────────────────────────────────────────────────────────┐+│ ← Test Chat Session: Customer Support │+├─────────────────────────────────────────────────────────────────────┤+│ │+│ ┌──────────────────────┐ ┌────────────────────────────────────┐ │+│ │ Contacts │ │ +62 821-9876-543 │ │+│ │ ────────────────── │ │ John Doe │ │+│ │ │ ├────────────────────────────────────┤ │+│ │ 🔍 Search... │ │ │ │+│ │ │ │ ┌──────────────────────────────┐ │ │+│ │ ┌────────────────┐ │ │ │ Hello! How can I help you? │ │ │+│ │ │ 👤 John Doe │ │ │ │ 10:30 ✓✓ │ │ │+│ │ │ Last: Hi! │ │ │ └──────────────────────────────┘ │ │+│ │ └────────────────┘ │ │ │ │+│ │ │ │ ┌─────────────────────────┐ │ │+│ │ ┌────────────────┐ │ │ │ I need help with my │ │ │+│ │ │ 👤 Jane Smith │ │ │ │ order #12345 │ │ │+│ │ │ Last: OK │ │ │ │ 10:31 │ │ │+│ │ └────────────────┘ │ │ └─────────────────────────┘ │ │+│ │ │ │ │ │+│ │ ┌────────────────┐ │ │ ┌──────────────────────────────┐ │ │+│ │ │ 👤 Bob Wilson │ │ │ │ Sure! Let me check that │ │ │+│ │ │ Last: Thx │ │ │ │ for you. One moment... │ │ │+│ │ └────────────────┘ │ │ │ 10:32 ✓✓ │ │ │+│ │ │ │ └──────────────────────────────┘ │ │+│ │ │ │ │ │+│ │ ────────────────── │ ├────────────────────────────────────┤ │+│ │ [+ New Chat] │ │ 📎 [ ] 📤 │ │+│ └──────────────────────┘ │ Type a message... │ │+│ └────────────────────────────────────┘ │+│ │+└─────────────────────────────────────────────────────────────────────┘+```++### Webhook Management++```+┌─────────────────────────────────────────────────────────────────────┐+│ ← Webhooks [+ New Webhook] │+├─────────────────────────────────────────────────────────────────────┤+│ │+│ ┌───────────────────────────────────────────────────────────────┐ │+│ │ 🔗 Main Webhook ✅ Active │ │+│ │ https://api.example.com/webhook/openwa │ │+│ │ Events: message.received, message.ack, session.status │ │+│ │ Sessions: All │ │+│ │ ──────────────────────────────────────────────────────────── │ │+│ │ Success Rate: 99.8% | Avg Latency: 125ms | Last: 2 min ago │ │+│ │ [Test] [View Logs] [Edit] [Disable] │ │+│ └───────────────────────────────────────────────────────────────┘ │+│ │+│ ┌───────────────────────────────────────────────────────────────┐ │+│ │ 🔗 Analytics Webhook ✅ Active │ │+│ │ https://analytics.example.com/track │ │+│ │ Events: message.received │ │+│ │ Sessions: cs-1, sales │ │+│ │ ──────────────────────────────────────────────────────────── │ │+│ │ Success Rate: 100% | Avg Latency: 89ms | Last: 5 min ago │ │+│ │ [Test] [View Logs] [Edit] [Disable] │ │+│ └───────────────────────────────────────────────────────────────┘ │+│ │+│ ┌───────────────────────────────────────────────────────────────┐ │+│ │ 🔗 Backup Webhook ⏸️ Disabled │ │+│ │ https://backup.example.com/wa │ │+│ │ Events: message.received, message.ack │ │+│ │ Sessions: All │ │+│ │ ──────────────────────────────────────────────────────────── │ │+│ │ [Enable] [Edit] [Delete] │ │+│ └───────────────────────────────────────────────────────────────┘ │+│ │+└─────────────────────────────────────────────────────────────────────┘+```++## 17.4 Component Library++### Using shadcn/ui++```bash+# Initialize shadcn/ui+npx shadcn-ui@latest init++# Add components+npx shadcn-ui@latest add button+npx shadcn-ui@latest add card+npx shadcn-ui@latest add dialog+npx shadcn-ui@latest add dropdown-menu+npx shadcn-ui@latest add input+npx shadcn-ui@latest add table+npx shadcn-ui@latest add tabs+npx shadcn-ui@latest add toast+npx shadcn-ui@latest add avatar+npx shadcn-ui@latest add badge+npx shadcn-ui@latest add skeleton+```++### Custom Components++```typescript+// components/ui/status-badge.tsx++import { Badge } from '@/components/ui/badge';+import { cn } from '@/lib/utils';++type SessionStatus = 'CONNECTED' | 'DISCONNECTED' | 'INITIALIZING' | 'SCAN_QR';++interface StatusBadgeProps {+ status: SessionStatus;+ className?: string;+}++const statusConfig: Record<SessionStatus, { label: string; variant: string; dot: string }> = {+ CONNECTED: {+ label: 'Connected',+ variant: 'success',+ dot: 'bg-green-500',+ },+ DISCONNECTED: {+ label: 'Disconnected',+ variant: 'destructive',+ dot: 'bg-red-500',+ },+ INITIALIZING: {+ label: 'Initializing',+ variant: 'warning',+ dot: 'bg-yellow-500',+ },+ SCAN_QR: {+ label: 'Scan QR',+ variant: 'secondary',+ dot: 'bg-blue-500 animate-pulse',+ },+};++export function StatusBadge({ status, className }: StatusBadgeProps) {+ const config = statusConfig[status];++ return (+ <Badge variant={config.variant as any} className={cn('gap-1.5', className)}>+ <span className={cn('h-2 w-2 rounded-full', config.dot)} />+ {config.label}+ </Badge>+ );+}+```++```typescript+// components/ui/session-card.tsx++import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card';+import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';+import { Button } from '@/components/ui/button';+import { StatusBadge } from '@/components/ui/status-badge';+import { MessageSquare, QrCode, Settings, Trash2 } from 'lucide-react';+import { Session } from '@/types';+import { formatDistanceToNow } from 'date-fns';++interface SessionCardProps {+ session: Session;+ onQr: () => void;+ onChat: () => void;+ onSettings: () => void;+ onDelete: () => void;+}++export function SessionCard({+ session,+ onQr,+ onChat,+ onSettings,+ onDelete,+}: SessionCardProps) {+ return (+ <Card>+ <CardHeader className="flex flex-row items-center gap-4">+ <Avatar className="h-12 w-12">+ <AvatarImage src={session.profilePicture} />+ <AvatarFallback>+ {session.name.slice(0, 2).toUpperCase()}+ </AvatarFallback>+ </Avatar>+ <div className="flex-1">+ <div className="flex items-center justify-between">+ <h3 className="font-semibold">{session.name}</h3>+ <StatusBadge status={session.status} />+ </div>+ <p className="text-sm text-muted-foreground">+ {session.phoneNumber || 'Not connected'}+ </p>+ </div>+ </CardHeader>++ <CardContent>+ <div className="flex justify-between text-sm text-muted-foreground">+ <span>{session.stats?.messagesSent || 0} messages</span>+ <span>+ {session.lastSeen+ ? `Active ${formatDistanceToNow(new Date(session.lastSeen))} ago`+ : 'Never active'}+ </span>+ </div>+ </CardContent>++ <CardFooter className="gap-2">+ {session.status === 'CONNECTED' ? (+ <>+ <Button variant="outline" size="sm" onClick={onChat}>+ <MessageSquare className="mr-2 h-4 w-4" />+ Chat+ </Button>+ </>+ ) : (+ <Button variant="outline" size="sm" onClick={onQr}>+ <QrCode className="mr-2 h-4 w-4" />+ Scan QR+ </Button>+ )}+ <Button variant="ghost" size="sm" onClick={onSettings}>+ <Settings className="h-4 w-4" />+ </Button>+ <Button variant="ghost" size="sm" onClick={onDelete}>+ <Trash2 className="h-4 w-4 text-destructive" />+ </Button>+ </CardFooter>+ </Card>+ );+}+```++```typescript+// components/ui/qr-code-display.tsx++import { useEffect, useState } from 'react';+import { Card, CardContent } from '@/components/ui/card';+import { Button } from '@/components/ui/button';+import { Skeleton } from '@/components/ui/skeleton';+import { RefreshCw } from 'lucide-react';+import QRCode from 'qrcode';++interface QrCodeDisplayProps {+ qrData: string | null;+ expiresAt: string | null;+ onRefresh: () => void;+ isLoading: boolean;+}++export function QrCodeDisplay({+ qrData,+ expiresAt,+ onRefresh,+ isLoading,+}: QrCodeDisplayProps) {+ const [qrImage, setQrImage] = useState<string | null>(null);+ const [countdown, setCountdown] = useState<number>(0);++ useEffect(() => {+ if (qrData) {+ QRCode.toDataURL(qrData, {+ width: 256,+ margin: 2,+ color: {+ dark: '#000000',+ light: '#ffffff',+ },+ }).then(setQrImage);+ }+ }, [qrData]);++ useEffect(() => {+ if (expiresAt) {+ const interval = setInterval(() => {+ const remaining = Math.max(+ 0,+ Math.floor((new Date(expiresAt).getTime() - Date.now()) / 1000)+ );+ setCountdown(remaining);++ if (remaining === 0) {+ clearInterval(interval);+ }+ }, 1000);++ return () => clearInterval(interval);+ }+ }, [expiresAt]);++ return (+ <Card className="w-fit mx-auto">+ <CardContent className="pt-6 text-center">+ {isLoading ? (+ <Skeleton className="h-64 w-64 mx-auto" />+ ) : qrImage ? (+ <>+ <img+ src={qrImage}+ alt="QR Code"+ className="mx-auto rounded-lg"+ width={256}+ height={256}+ />+ <p className="mt-4 text-sm text-muted-foreground">+ Expires in: {Math.floor(countdown / 60)}:+ {(countdown % 60).toString().padStart(2, '0')}+ </p>+ </>+ ) : (+ <div className="h-64 w-64 flex items-center justify-center bg-muted rounded-lg">+ <p className="text-muted-foreground">QR Code expired</p>+ </div>+ )}++ <Button+ variant="outline"+ className="mt-4"+ onClick={onRefresh}+ disabled={isLoading}+ >+ <RefreshCw className={`mr-2 h-4 w-4 ${isLoading ? 'animate-spin' : ''}`} />+ Refresh QR+ </Button>+ </CardContent>+ </Card>+ );+}+```++## 17.5 State Management++### Zustand Store++```typescript+// stores/session-store.ts++import { create } from 'zustand';+import { Session } from '@/types';++interface SessionState {+ sessions: Session[];+ selectedSession: Session | null;+ isLoading: boolean;+ error: string | null;++ // Actions+ setSessions: (sessions: Session[]) => void;+ addSession: (session: Session) => void;+ updateSession: (id: string, updates: Partial<Session>) => void;+ removeSession: (id: string) => void;+ selectSession: (session: Session | null) => void;+ setLoading: (loading: boolean) => void;+ setError: (error: string | null) => void;+}++export const useSessionStore = create<SessionState>((set) => ({+ sessions: [],+ selectedSession: null,+ isLoading: false,+ error: null,++ setSessions: (sessions) => set({ sessions }),++ addSession: (session) =>+ set((state) => ({+ sessions: [...state.sessions, session],+ })),++ updateSession: (id, updates) =>+ set((state) => ({+ sessions: state.sessions.map((s) =>+ s.id === id ? { ...s, ...updates } : s+ ),+ selectedSession:+ state.selectedSession?.id === id+ ? { ...state.selectedSession, ...updates }+ : state.selectedSession,+ })),++ removeSession: (id) =>+ set((state) => ({+ sessions: state.sessions.filter((s) => s.id !== id),+ selectedSession:+ state.selectedSession?.id === id ? null : state.selectedSession,+ })),++ selectSession: (session) => set({ selectedSession: session }),++ setLoading: (isLoading) => set({ isLoading }),++ setError: (error) => set({ error }),+}));+```++### TanStack Query Hooks++```typescript+// hooks/use-sessions.ts++import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';+import { api } from '@/lib/api';+import { Session, CreateSessionInput } from '@/types';+import { useSessionStore } from '@/stores/session-store';++export function useSessions() {+ const { setSessions, setError } = useSessionStore();++ return useQuery({+ queryKey: ['sessions'],+ queryFn: async () => {+ const response = await api.get<{ data: Session[] }>('/api/sessions');+ return response.data.data;+ },+ onSuccess: (data) => {+ setSessions(data);+ },+ onError: (error: Error) => {+ setError(error.message);+ },+ });+}++export function useSession(id: string) {+ return useQuery({+ queryKey: ['sessions', id],+ queryFn: async () => {+ const response = await api.get<{ data: Session }>(`/api/sessions/${id}`);+ return response.data.data;+ },+ enabled: !!id,+ });+}++export function useCreateSession() {+ const queryClient = useQueryClient();+ const { addSession } = useSessionStore();++ return useMutation({+ mutationFn: async (input: CreateSessionInput) => {+ const response = await api.post<{ data: Session }>('/api/sessions', input);+ return response.data.data;+ },+ onSuccess: (data) => {+ addSession(data);+ queryClient.invalidateQueries({ queryKey: ['sessions'] });+ },+ });+}++export function useDeleteSession() {+ const queryClient = useQueryClient();+ const { removeSession } = useSessionStore();++ return useMutation({+ mutationFn: async (id: string) => {+ await api.delete(`/api/sessions/${id}`);+ return id;+ },+ onSuccess: (id) => {+ removeSession(id);+ queryClient.invalidateQueries({ queryKey: ['sessions'] });+ },+ });+}++export function useSessionQr(id: string) {+ return useQuery({+ queryKey: ['sessions', id, 'qr'],+ queryFn: async () => {+ const response = await api.get<{ data: { qr: string; expiresAt: string } }>(+ `/api/sessions/${id}/qr`+ );+ return response.data.data;+ },+ enabled: !!id,+ refetchInterval: 30000, // Refresh every 30 seconds+ });+}+```++## 17.6 WebSocket Integration++```typescript+// lib/websocket.ts++import { useEffect, useRef, useCallback } from 'react';+import { useSessionStore } from '@/stores/session-store';++type EventType =+ | 'session.status'+ | 'session.qr'+ | 'message.received'+ | 'message.ack'+ | 'session.authenticated'+ | 'session.disconnected';++interface WebSocketMessage {+ event: EventType;+ sessionId: string;+ data: any;+}++export function useWebSocket(apiKey: string) {+ const ws = useRef<WebSocket | null>(null);+ const { updateSession } = useSessionStore();++ const connect = useCallback(() => {+ const wsUrl = `${import.meta.env.VITE_WS_URL || 'ws://localhost:2785'}/ws?apiKey=${apiKey}`;+ ws.current = new WebSocket(wsUrl);++ ws.current.onopen = () => {+ console.log('WebSocket connected');+ };++ ws.current.onmessage = (event) => {+ const message: WebSocketMessage = JSON.parse(event.data);++ switch (message.event) {+ case 'session.status':+ updateSession(message.sessionId, {+ status: message.data.status,+ });+ break;++ case 'session.authenticated':+ updateSession(message.sessionId, {+ status: 'CONNECTED',+ phoneNumber: message.data.phoneNumber,+ profileName: message.data.profileName,+ });+ break;++ case 'session.disconnected':+ updateSession(message.sessionId, {+ status: 'DISCONNECTED',+ });+ break;++ case 'session.qr':+ // Handle QR update via query invalidation+ break;++ default:+ console.log('Unknown event:', message.event);+ }+ };++ ws.current.onclose = () => {+ console.log('WebSocket disconnected, reconnecting...');+ setTimeout(connect, 3000);+ };++ ws.current.onerror = (error) => {+ console.error('WebSocket error:', error);+ };+ }, [apiKey, updateSession]);++ useEffect(() => {+ connect();++ return () => {+ ws.current?.close();+ };+ }, [connect]);++ const send = useCallback((event: string, data: any) => {+ if (ws.current?.readyState === WebSocket.OPEN) {+ ws.current.send(JSON.stringify({ event, data }));+ }+ }, []);++ return { send };+}+```++## 17.7 Theme Configuration++```typescript+// lib/theme.ts++export const themes = {+ light: {+ background: '0 0% 100%',+ foreground: '222.2 84% 4.9%',+ card: '0 0% 100%',+ 'card-foreground': '222.2 84% 4.9%',+ primary: '222.2 47.4% 11.2%',+ 'primary-foreground': '210 40% 98%',+ secondary: '210 40% 96.1%',+ 'secondary-foreground': '222.2 47.4% 11.2%',+ muted: '210 40% 96.1%',+ 'muted-foreground': '215.4 16.3% 46.9%',+ accent: '210 40% 96.1%',+ 'accent-foreground': '222.2 47.4% 11.2%',+ destructive: '0 84.2% 60.2%',+ 'destructive-foreground': '210 40% 98%',+ border: '214.3 31.8% 91.4%',+ input: '214.3 31.8% 91.4%',+ ring: '222.2 84% 4.9%',+ },+ dark: {+ background: '222.2 84% 4.9%',+ foreground: '210 40% 98%',+ card: '222.2 84% 4.9%',+ 'card-foreground': '210 40% 98%',+ primary: '210 40% 98%',+ 'primary-foreground': '222.2 47.4% 11.2%',+ secondary: '217.2 32.6% 17.5%',+ 'secondary-foreground': '210 40% 98%',+ muted: '217.2 32.6% 17.5%',+ 'muted-foreground': '215 20.2% 65.1%',+ accent: '217.2 32.6% 17.5%',+ 'accent-foreground': '210 40% 98%',+ destructive: '0 62.8% 30.6%',+ 'destructive-foreground': '210 40% 98%',+ border: '217.2 32.6% 17.5%',+ input: '217.2 32.6% 17.5%',+ ring: '212.7 26.8% 83.9%',+ },+};++// Theme provider component+// components/theme-provider.tsx++import { createContext, useContext, useEffect, useState } from 'react';++type Theme = 'light' | 'dark' | 'system';++interface ThemeContextType {+ theme: Theme;+ setTheme: (theme: Theme) => void;+}++const ThemeContext = createContext<ThemeContextType | undefined>(undefined);++export function ThemeProvider({ children }: { children: React.ReactNode }) {+ const [theme, setTheme] = useState<Theme>(() => {+ const stored = localStorage.getItem('theme') as Theme;+ return stored || 'system';+ });++ useEffect(() => {+ const root = document.documentElement;++ root.classList.remove('light', 'dark');++ if (theme === 'system') {+ const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches+ ? 'dark'+ : 'light';+ root.classList.add(systemTheme);+ } else {+ root.classList.add(theme);+ }++ localStorage.setItem('theme', theme);+ }, [theme]);++ return (+ <ThemeContext.Provider value={{ theme, setTheme }}>+ {children}+ </ThemeContext.Provider>+ );+}++export function useTheme() {+ const context = useContext(ThemeContext);+ if (!context) {+ throw new Error('useTheme must be used within a ThemeProvider');+ }+ return context;+}+```++## 17.8 Build & Deployment++### Vite Configuration++```typescript+// vite.config.ts++import { defineConfig } from 'vite';+import react from '@vitejs/plugin-react';+import path from 'path';++export default defineConfig({+ plugins: [react()],+ resolve: {+ alias: {+ '@': path.resolve(__dirname, './src'),+ },+ },+ server: {+ port: 2886,+ proxy: {+ '/api': {+ target: 'http://localhost:2785',+ changeOrigin: true,+ },+ '/ws': {+ target: 'ws://localhost:2785',+ ws: true,+ },+ },+ },+ build: {+ outDir: 'dist',+ sourcemap: true,+ rollupOptions: {+ output: {+ manualChunks: {+ vendor: ['react', 'react-dom', 'react-router-dom'],+ ui: ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu'],+ },+ },+ },+ },+});+```++### Docker Build++```dockerfile+# dashboard/Dockerfile++# Build stage+FROM node:20-alpine AS builder++WORKDIR /app++COPY package*.json ./+RUN npm ci++COPY . .+RUN npm run build++# Production stage+FROM nginx:alpine++COPY --from=builder /app/dist /usr/share/nginx/html+COPY nginx.conf /etc/nginx/conf.d/default.conf++EXPOSE 80++CMD ["nginx", "-g", "daemon off;"]+```++```nginx+# dashboard/nginx.conf++server {+ listen 80;+ server_name _;+ root /usr/share/nginx/html;+ index index.html;++ # Gzip compression+ gzip on;+ gzip_types text/plain text/css application/json application/javascript;++ # SPA routing+ location / {+ try_files $uri $uri/ /index.html;+ }++ # API proxy (if needed)+ location /api {+ proxy_pass http://openwa:2785;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection 'upgrade';+ proxy_set_header Host $host;+ proxy_cache_bypass $http_upgrade;+ }++ # WebSocket proxy+ location /ws {+ proxy_pass http://openwa:2785;+ proxy_http_version 1.1;+ proxy_set_header Upgrade $http_upgrade;+ proxy_set_header Connection "upgrade";+ }++ # Cache static assets+ location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {+ expires 1y;+ add_header Cache-Control "public, immutable";+ }+}+```+---++<div align="center">++[← 16 - Risk Management](./16-risk-management.md) · [Documentation Index](./README.md) · [Next: 18 - SDK Design →](./18-sdk-design.md)++</div>diff --git a/docs/18-sdk-design.md b/docs/18-sdk-design.mdnew file mode 100644index 000000000..2b663a082--- /dev/null+++ b/docs/18-sdk-design.md@@ -0,0 +1,1541 @@+# 18 - SDK Design++## 18.1 Overview++OpenWA provides official SDKs for multiple programming languages to simplify API integration. This document describes the SDK design and specifications.++### Supported Languages++```mermaid+flowchart TB+ subgraph Tier1["Tier 1 - Official SDKs"]+ TS[TypeScript/JavaScript]+ PY[Python]+ PHP[PHP]+ end++ subgraph Tier2["Tier 2 - Community SDKs"]+ GO[Go]+ RUBY[Ruby]+ CSHARP[C#/.NET]+ JAVA[Java/Kotlin]+ end++ subgraph Tier3["Tier 3 - Integrations"]+ N8N[n8n Node]+ MAKE[Make/Integromat]+ ZAP[Zapier]+ end+```++### Design Principles++1. **Idiomatic** - Follow each language's conventions+2. **Type-safe** - Full type definitions for IDE support+3. **Async-first** - Native async/await support+4. **Minimal dependencies** - Only required dependencies+5. **Consistent** - Consistent API across languages+6. **Well-documented** - Inline docs and examples++## 18.2 TypeScript/JavaScript SDK++### Installation++```bash+# npm+npm install @openwa/sdk++# yarn+yarn add @openwa/sdk++# pnpm+pnpm add @openwa/sdk+```++### Quick Start++```typescript+import { OpenWA } from '@openwa/sdk';++const client = new OpenWA({+ baseUrl: 'http://localhost:2785',+ apiKey: 'your-api-key',+});++// Create session+const session = await client.sessions.create({+ id: 'my-session',+ name: 'My WhatsApp',+});++// Wait for QR code+client.on('session.qr', ({ sessionId, qr }) => {+ if (sessionId !== 'my-session') return;+ console.log('Scan this QR:', qr);+});++// Wait for session ready+client.on('session.status', async ({ sessionId, status }) => {+ if (sessionId !== 'my-session' || status !== 'ready') return;++ // Send message+ const message = await client.messages.send('my-session', {+ phone: '[email protected]',+ type: 'text',+ body: 'Hello from SDK!',+ });++ console.log('Message sent:', message.id);+});+```++### SDK Architecture++```typescript+// src/index.ts++export interface OpenWAConfig {+ baseUrl: string;+ apiKey: string;+ timeout?: number;+ retries?: number;+ debug?: boolean;+}++export class OpenWA extends EventEmitter {+ private config: OpenWAConfig;+ private http: HttpClient;+ private ws: WebSocketClient;++ // Resource managers+ public sessions: SessionsResource;+ public messages: MessagesResource;+ public contacts: ContactsResource;+ public groups: GroupsResource;+ public webhooks: WebhooksResource;+ public apiKeys: ApiKeysResource;++ constructor(config: OpenWAConfig) {+ super();+ this.config = this.validateConfig(config);+ this.http = new HttpClient(this.config);+ this.ws = new WebSocketClient(this.config);++ // Initialize resources+ this.sessions = new SessionsResource(this.http);+ this.messages = new MessagesResource(this.http);+ this.contacts = new ContactsResource(this.http);+ this.groups = new GroupsResource(this.http);+ this.webhooks = new WebhooksResource(this.http);+ this.apiKeys = new ApiKeysResource(this.http);++ // Setup WebSocket events+ this.setupWebSocket();+ }++ private setupWebSocket(): void {+ this.ws.on('message', (event) => {+ this.emit(event.type, event.data);+ });+ }++ // Utility methods+ async health(): Promise<HealthResponse> {+ return this.http.get('/health');+ }++ async healthDetailed(): Promise<DetailedHealthResponse> {+ return this.http.get('/health/detailed');+ }+}+```++### Resource Classes++```typescript+// src/resources/sessions.ts++export interface Session {+ id: string;+ name: string;+ status: SessionStatus;+ phoneNumber?: string;+ profileName?: string;+ profilePicture?: string;+ createdAt: string;+ lastSeen?: string;+}++export type SessionStatus =+ | 'INITIALIZING'+ | 'SCAN_QR'+ | 'CONNECTING'+ | 'CONNECTED'+ | 'DISCONNECTED'+ | 'FAILED';++export interface CreateSessionInput {+ id?: string;+ name?: string;+ config?: {+ autoReconnect?: boolean;+ webhookUrl?: string;+ proxy?: string;+ };+}++export class SessionsResource {+ constructor(private http: HttpClient) {}++ async list(params?: ListParams): Promise<PaginatedResponse<Session>> {+ return this.http.get('/api/sessions', { params });+ }++ async create(input: CreateSessionInput): Promise<Session> {+ return this.http.post('/api/sessions', input);+ }++ async get(id: string): Promise<Session> {+ return this.http.get(`/api/sessions/${id}`);+ }++ async delete(id: string, keepAuth = false): Promise<void> {+ return this.http.delete(`/api/sessions/${id}`, {+ params: { keepAuth },+ });+ }++ async getQr(id: string, format: 'base64' | 'raw' = 'base64'): Promise<QrResponse> {+ return this.http.get(`/api/sessions/${id}/qr`, {+ params: { format },+ });+ }++ async restart(id: string): Promise<Session> {+ return this.http.post(`/api/sessions/${id}/restart`);+ }++ async logout(id: string): Promise<void> {+ return this.http.post(`/api/sessions/${id}/logout`);+ }+}+```++```typescript+// src/resources/messages.ts++export type MessageType =+ | 'text'+ | 'image'+ | 'video'+ | 'audio'+ | 'document'+ | 'location'+ | 'contact'+ | 'sticker'+ | 'buttons'+ | 'list';++export interface Message {+ id: string;+ from: string;+ to: string;+ type: MessageType;+ body?: string;+ caption?: string;+ timestamp: string;+ status: MessageStatus;+ isFromMe: boolean;+ hasMedia: boolean;+ media?: MediaInfo;+}++export interface SendMessageInput {+ phone: string;+ type: MessageType;+ body?: string;+ caption?: string;+ media?: MediaInput;+ location?: LocationInput;+ contact?: ContactInput;+ buttons?: ButtonInput[];+ sections?: ListSection[];+ options?: MessageOptions;+}++export interface MediaInput {+ url?: string;+ base64?: string;+ mimetype?: string;+ filename?: string;+}++export class MessagesResource {+ constructor(private http: HttpClient) {}++ async send(sessionId: string, input: SendMessageInput): Promise<Message> {+ return this.http.post(`/api/sessions/${sessionId}/messages`, input);+ }++ async sendFile(+ sessionId: string,+ phone: string,+ file: File | Buffer | ReadStream,+ options?: SendFileOptions+ ): Promise<Message> {+ const formData = new FormData();+ formData.append('phone', phone);+ formData.append('type', options?.type || 'document');+ formData.append('media', file);++ if (options?.caption) {+ formData.append('caption', options.caption);+ }++ return this.http.post(`/api/sessions/${sessionId}/messages`, formData, {+ headers: { 'Content-Type': 'multipart/form-data' },+ });+ }++ async list(+ sessionId: string,+ phone: string,+ params?: MessageListParams+ ): Promise<PaginatedResponse<Message>> {+ return this.http.get(`/api/sessions/${sessionId}/messages`, {+ params: { phone, ...params },+ });+ }++ async get(sessionId: string, messageId: string): Promise<Message> {+ return this.http.get(`/api/sessions/${sessionId}/messages/${messageId}`);+ }++ async delete(+ sessionId: string,+ messageId: string,+ forEveryone = true+ ): Promise<void> {+ return this.http.delete(`/api/sessions/${sessionId}/messages/${messageId}`, {+ params: { forEveryone },+ });+ }++ async react(+ sessionId: string,+ messageId: string,+ emoji: string+ ): Promise<void> {+ return this.http.post(+ `/api/sessions/${sessionId}/messages/${messageId}/react`,+ { emoji }+ );+ }+}+```++### Helper Functions++```typescript+// src/helpers/index.ts++/**+ * Format phone number to WhatsApp JID format+ */+export function formatPhone(phone: string): string {+ // Remove non-numeric characters+ let cleaned = phone.replace(/\D/g, '');++ // Remove leading zeros+ cleaned = cleaned.replace(/^0+/, '');++ // Add country code if needed (assuming Indonesian)+ if (!cleaned.startsWith('62') && cleaned.length <= 12) {+ cleaned = '62' + cleaned;+ }++ return `${cleaned}@c.us`;+}++/**+ * Format group ID to WhatsApp JID format+ */+export function formatGroup(groupId: string): string {+ if (groupId.endsWith('@g.us')) {+ return groupId;+ }+ return `${groupId}@g.us`;+}++/**+ * Check if JID is a group+ */+export function isGroup(jid: string): boolean {+ return jid.endsWith('@g.us');+}++/**+ * Extract phone number from JID+ */+export function extractPhone(jid: string): string {+ return jid.replace(/@[cgs]\.us$/, '');+}++/**+ * Create message builder+ */+export function message(phone: string): MessageBuilder {+ return new MessageBuilder(phone);+}++export class MessageBuilder {+ private input: Partial<SendMessageInput>;++ constructor(phone: string) {+ this.input = { phone: formatPhone(phone) };+ }++ text(body: string): this {+ this.input.type = 'text';+ this.input.body = body;+ return this;+ }++ image(url: string, caption?: string): this {+ this.input.type = 'image';+ this.input.media = { url };+ this.input.caption = caption;+ return this;+ }++ document(url: string, filename: string, caption?: string): this {+ this.input.type = 'document';+ this.input.media = { url, filename };+ this.input.caption = caption;+ return this;+ }++ location(lat: number, lng: number, name?: string): this {+ this.input.type = 'location';+ this.input.location = { latitude: lat, longitude: lng, name };+ return this;+ }++ replyTo(messageId: string): this {+ this.input.options = { ...this.input.options, quotedMessageId: messageId };+ return this;+ }++ build(): SendMessageInput {+ if (!this.input.type) {+ throw new Error('Message type not specified');+ }+ return this.input as SendMessageInput;+ }+}+```++### Event Handling++```typescript+// src/events/index.ts++export interface OpenWAEvents {+ // Session events+ 'session.status': (data: SessionStatusEvent) => void;+ 'session.qr': (data: SessionQrEvent) => void;+ 'session.authenticated': (data: SessionAuthenticatedEvent) => void;+ 'session.disconnected': (data: SessionDisconnectedEvent) => void;++ // Message events+ 'message.received': (data: MessageEvent) => void;+ 'message.sent': (data: MessageEvent) => void;+ 'message.ack': (data: MessageAckEvent) => void;+ 'message.revoked': (data: MessageRevokedEvent) => void;++ // Group events+ 'group.join': (data: GroupJoinEvent) => void;+ 'group.leave': (data: GroupLeaveEvent) => void;+ 'group.update': (data: GroupUpdateEvent) => void;++ // Contact events+ 'contact.update': (data: ContactUpdateEvent) => void;+ 'presence.update': (data: PresenceUpdateEvent) => void;+}++export interface MessageEvent {+ sessionId: string;+ message: Message;+}++export interface MessageAckEvent {+ sessionId: string;+ messageId: string;+ ack: 'error' | 'pending' | 'server' | 'device' | 'read' | 'played';+}++// Usage with typed events+const client = new OpenWA({ ... });++client.on('message.received', ({ sessionId, message }) => {+ console.log(`[${sessionId}] New message from ${message.from}: ${message.body}`);+});++client.on('message.ack', ({ messageId, ack }) => {+ console.log(`Message ${messageId} status: ${ack}`);+});+```++### Error Handling++```typescript+// src/errors/index.ts++export class OpenWAError extends Error {+ constructor(+ message: string,+ public code: string,+ public status: number,+ public details?: unknown+ ) {+ super(message);+ this.name = 'OpenWAError';+ }+}++export class ValidationError extends OpenWAError {+ constructor(message: string, details?: unknown) {+ super(message, 'VALIDATION_ERROR', 400, details);+ this.name = 'ValidationError';+ }+}++export class AuthenticationError extends OpenWAError {+ constructor(message = 'Invalid API key') {+ super(message, 'AUTHENTICATION_ERROR', 401);+ this.name = 'AuthenticationError';+ }+}++export class SessionNotFoundError extends OpenWAError {+ constructor(sessionId: string) {+ super(`Session '${sessionId}' not found`, 'SESSION_NOT_FOUND', 404);+ this.name = 'SessionNotFoundError';+ }+}++export class RateLimitError extends OpenWAError {+ constructor(+ public retryAfter: number+ ) {+ super(+ `Rate limited. Retry after ${retryAfter}ms`,+ 'RATE_LIMIT_EXCEEDED',+ 429+ );+ this.name = 'RateLimitError';+ }+}++// Error handling example+try {+ await client.messages.send('session-1', {+ phone: '[email protected]',+ type: 'text',+ body: 'Hello!',+ });+} catch (error) {+ if (error instanceof RateLimitError) {+ console.log(`Rate limited, retry in ${error.retryAfter}ms`);+ await sleep(error.retryAfter);+ // Retry+ } else if (error instanceof SessionNotFoundError) {+ console.log('Session not found, creating new session...');+ await client.sessions.create({ id: 'session-1' });+ } else {+ throw error;+ }+}+```++## 18.3 Python SDK++### Installation++```bash+pip install openwa-sdk+```++### Quick Start++```python+from openwa import OpenWA+import asyncio++async def main():+ client = OpenWA(+ base_url="http://localhost:2785",+ api_key="your-api-key"+ )++ # Create session+ session = await client.sessions.create(+ id="my-session",+ name="My WhatsApp"+ )++ # Send message+ message = await client.messages.send(+ session_id="my-session",+ phone="[email protected]",+ type="text",+ body="Hello from Python!"+ )++ print(f"Message sent: {message.id}")++asyncio.run(main())+```++### SDK Structure++```python+# openwa/__init__.py++from typing import Optional, List, Dict, Any+from dataclasses import dataclass+from enum import Enum+import aiohttp++class SessionStatus(Enum):+ INITIALIZING = "INITIALIZING"+ SCAN_QR = "SCAN_QR"+ CONNECTING = "CONNECTING"+ CONNECTED = "CONNECTED"+ DISCONNECTED = "DISCONNECTED"+ FAILED = "FAILED"++@dataclass+class Session:+ id: str+ name: str+ status: SessionStatus+ phone_number: Optional[str] = None+ profile_name: Optional[str] = None+ created_at: Optional[str] = None++@dataclass+class Message:+ id: str+ from_: str+ to: str+ type: str+ body: Optional[str] = None+ timestamp: Optional[str] = None+ status: Optional[str] = None+ is_from_me: bool = False++class OpenWA:+ def __init__(+ self,+ base_url: str,+ api_key: str,+ timeout: int = 30+ ):+ self.base_url = base_url.rstrip('/')+ self.api_key = api_key+ self.timeout = timeout++ self.sessions = SessionsResource(self)+ self.messages = MessagesResource(self)+ self.contacts = ContactsResource(self)+ self.groups = GroupsResource(self)+ self.webhooks = WebhooksResource(self)++ async def _request(+ self,+ method: str,+ path: str,+ **kwargs+ ) -> Dict[str, Any]:+ headers = {+ "X-API-Key": self.api_key,+ "Content-Type": "application/json"+ }++ async with aiohttp.ClientSession() as session:+ async with session.request(+ method,+ f"{self.base_url}{path}",+ headers=headers,+ timeout=aiohttp.ClientTimeout(total=self.timeout),+ **kwargs+ ) as response:+ data = await response.json()++ if not response.ok:+ raise OpenWAError(+ message=data.get("error", {}).get("message", "Unknown error"),+ code=data.get("error", {}).get("code", "UNKNOWN"),+ status=response.status+ )++ return data.get("data", data)++ async def health(self) -> Dict[str, Any]:+ return await self._request("GET", "/health")+++class SessionsResource:+ def __init__(self, client: OpenWA):+ self.client = client++ async def list(+ self,+ status: Optional[str] = None,+ limit: int = 20,+ offset: int = 0+ ) -> List[Session]:+ params = {"limit": limit, "offset": offset}+ if status:+ params["status"] = status++ data = await self.client._request(+ "GET",+ "/api/sessions",+ params=params+ )+ return [Session(**s) for s in data]++ async def create(+ self,+ id: Optional[str] = None,+ name: Optional[str] = None,+ **config+ ) -> Session:+ body = {}+ if id:+ body["id"] = id+ if name:+ body["name"] = name+ if config:+ body["config"] = config++ data = await self.client._request(+ "POST",+ "/api/sessions",+ json=body+ )+ return Session(**data)++ async def get(self, id: str) -> Session:+ data = await self.client._request("GET", f"/api/sessions/{id}")+ return Session(**data)++ async def delete(self, id: str, keep_auth: bool = False) -> None:+ await self.client._request(+ "DELETE",+ f"/api/sessions/{id}",+ params={"keepAuth": keep_auth}+ )++ async def get_qr(self, id: str, format: str = "base64") -> Dict[str, str]:+ return await self.client._request(+ "GET",+ f"/api/sessions/{id}/qr",+ params={"format": format}+ )+++class MessagesResource:+ def __init__(self, client: OpenWA):+ self.client = client++ async def send(+ self,+ session_id: str,+ phone: str,+ type: str,+ body: Optional[str] = None,+ media: Optional[Dict] = None,+ caption: Optional[str] = None,+ **kwargs+ ) -> Message:+ payload = {+ "phone": phone,+ "type": type,+ }+ if body:+ payload["body"] = body+ if media:+ payload["media"] = media+ if caption:+ payload["caption"] = caption+ payload.update(kwargs)++ data = await self.client._request(+ "POST",+ f"/api/sessions/{session_id}/messages",+ json=payload+ )+ return Message(**data)++ async def send_text(+ self,+ session_id: str,+ phone: str,+ text: str+ ) -> Message:+ return await self.send(session_id, phone, "text", body=text)++ async def send_image(+ self,+ session_id: str,+ phone: str,+ url: str,+ caption: Optional[str] = None+ ) -> Message:+ return await self.send(+ session_id,+ phone,+ "image",+ media={"url": url},+ caption=caption+ )+++class OpenWAError(Exception):+ def __init__(self, message: str, code: str, status: int):+ super().__init__(message)+ self.code = code+ self.status = status+```++### Sync Wrapper++```python+# openwa/sync.py++from .async_client import OpenWA as AsyncOpenWA+import asyncio++class OpenWASync:+ """Synchronous wrapper for OpenWA client"""++ def __init__(self, **kwargs):+ self._async_client = AsyncOpenWA(**kwargs)+ self._loop = asyncio.new_event_loop()++ def _run(self, coro):+ return self._loop.run_until_complete(coro)++ @property+ def sessions(self):+ return SessionsResourceSync(self._async_client.sessions, self._run)++ @property+ def messages(self):+ return MessagesResourceSync(self._async_client.messages, self._run)++ def health(self):+ return self._run(self._async_client.health())+++class SessionsResourceSync:+ def __init__(self, async_resource, run):+ self._async = async_resource+ self._run = run++ def list(self, **kwargs):+ return self._run(self._async.list(**kwargs))++ def create(self, **kwargs):+ return self._run(self._async.create(**kwargs))++ def get(self, id):+ return self._run(self._async.get(id))++ def delete(self, id, **kwargs):+ return self._run(self._async.delete(id, **kwargs))+++# Usage+from openwa.sync import OpenWASync++client = OpenWASync(base_url="http://localhost:2785", api_key="your-key")+sessions = client.sessions.list()+```++## 18.4 PHP SDK++### Installation++```bash+composer require openwa/sdk+```++### Quick Start++```php+<?php++use OpenWA\Client;+use OpenWA\Resources\Messages;++$client = new Client([+ 'baseUrl' => 'http://localhost:2785',+ 'apiKey' => 'your-api-key',+]);++// Create session+$session = $client->sessions->create([+ 'id' => 'my-session',+ 'name' => 'My WhatsApp',+]);++// Send message+$message = $client->messages->send('my-session', [+ 'phone' => '[email protected]',+ 'type' => 'text',+ 'body' => 'Hello from PHP!',+]);++echo "Message sent: " . $message->id;+```++### SDK Structure++```php+<?php+// src/Client.php++namespace OpenWA;++use GuzzleHttp\Client as HttpClient;+use OpenWA\Resources\Sessions;+use OpenWA\Resources\Messages;+use OpenWA\Resources\Contacts;+use OpenWA\Resources\Groups;+use OpenWA\Resources\Webhooks;+use OpenWA\Exceptions\OpenWAException;++class Client+{+ private HttpClient $http;+ private array $config;++ public Sessions $sessions;+ public Messages $messages;+ public Contacts $contacts;+ public Groups $groups;+ public Webhooks $webhooks;++ public function __construct(array $config)+ {+ $this->config = array_merge([+ 'timeout' => 30,+ ], $config);++ $this->http = new HttpClient([+ 'base_uri' => rtrim($this->config['baseUrl'], '/'),+ 'timeout' => $this->config['timeout'],+ 'headers' => [+ 'X-API-Key' => $this->config['apiKey'],+ 'Content-Type' => 'application/json',+ 'Accept' => 'application/json',+ ],+ ]);++ $this->sessions = new Sessions($this);+ $this->messages = new Messages($this);+ $this->contacts = new Contacts($this);+ $this->groups = new Groups($this);+ $this->webhooks = new Webhooks($this);+ }++ public function request(string $method, string $path, array $options = []): array+ {+ try {+ $response = $this->http->request($method, $path, $options);+ $data = json_decode($response->getBody()->getContents(), true);++ if (!isset($data['success']) || !$data['success']) {+ throw new OpenWAException(+ $data['error']['message'] ?? 'Unknown error',+ $data['error']['code'] ?? 'UNKNOWN',+ $response->getStatusCode()+ );+ }++ return $data['data'] ?? [];+ } catch (\GuzzleHttp\Exception\RequestException $e) {+ $response = $e->getResponse();+ $data = json_decode($response->getBody()->getContents(), true);++ throw new OpenWAException(+ $data['error']['message'] ?? $e->getMessage(),+ $data['error']['code'] ?? 'REQUEST_ERROR',+ $response ? $response->getStatusCode() : 0+ );+ }+ }++ public function health(): array+ {+ return $this->request('GET', '/health');+ }+}+```++```php+<?php+// src/Resources/Sessions.php++namespace OpenWA\Resources;++use OpenWA\Client;+use OpenWA\Models\Session;++class Sessions+{+ private Client $client;++ public function __construct(Client $client)+ {+ $this->client = $client;+ }++ public function list(array $params = []): array+ {+ $data = $this->client->request('GET', '/api/sessions', [+ 'query' => $params,+ ]);++ return array_map(fn($s) => new Session($s), $data);+ }++ public function create(array $input): Session+ {+ $data = $this->client->request('POST', '/api/sessions', [+ 'json' => $input,+ ]);++ return new Session($data);+ }++ public function get(string $id): Session+ {+ $data = $this->client->request('GET', "/api/sessions/{$id}");+ return new Session($data);+ }++ public function delete(string $id, bool $keepAuth = false): void+ {+ $this->client->request('DELETE', "/api/sessions/{$id}", [+ 'query' => ['keepAuth' => $keepAuth],+ ]);+ }++ public function getQr(string $id, string $format = 'base64'): array+ {+ return $this->client->request('GET', "/api/sessions/{$id}/qr", [+ 'query' => ['format' => $format],+ ]);+ }++ public function restart(string $id): Session+ {+ $data = $this->client->request('POST', "/api/sessions/{$id}/restart");+ return new Session($data);+ }++ public function logout(string $id): void+ {+ $this->client->request('POST', "/api/sessions/{$id}/logout");+ }+}+```++```php+<?php+// src/Resources/Messages.php++namespace OpenWA\Resources;++use OpenWA\Client;+use OpenWA\Models\Message;++class Messages+{+ private Client $client;++ public function __construct(Client $client)+ {+ $this->client = $client;+ }++ public function send(string $sessionId, array $input): Message+ {+ $data = $this->client->request(+ 'POST',+ "/api/sessions/{$sessionId}/messages",+ ['json' => $input]+ );++ return new Message($data);+ }++ public function sendText(string $sessionId, string $phone, string $text): Message+ {+ return $this->send($sessionId, [+ 'phone' => $phone,+ 'type' => 'text',+ 'body' => $text,+ ]);+ }++ public function sendImage(+ string $sessionId,+ string $phone,+ string $url,+ ?string $caption = null+ ): Message {+ return $this->send($sessionId, [+ 'phone' => $phone,+ 'type' => 'image',+ 'media' => ['url' => $url],+ 'caption' => $caption,+ ]);+ }++ public function sendDocument(+ string $sessionId,+ string $phone,+ string $url,+ string $filename,+ ?string $caption = null+ ): Message {+ return $this->send($sessionId, [+ 'phone' => $phone,+ 'type' => 'document',+ 'media' => ['url' => $url, 'filename' => $filename],+ 'caption' => $caption,+ ]);+ }++ public function list(string $sessionId, string $phone, array $params = []): array+ {+ $data = $this->client->request(+ 'GET',+ "/api/sessions/{$sessionId}/messages",+ ['query' => array_merge(['phone' => $phone], $params)]+ );++ return array_map(fn($m) => new Message($m), $data);+ }++ public function delete(string $sessionId, string $messageId, bool $forEveryone = true): void+ {+ $this->client->request(+ 'DELETE',+ "/api/sessions/{$sessionId}/messages/{$messageId}",+ ['query' => ['forEveryone' => $forEveryone]]+ );+ }+}+```++## 18.5 n8n Community Node++### Installation++```bash+npm install n8n-nodes-openwa+```++### Node Configuration++```typescript+// nodes/OpenWA/OpenWA.node.ts++import {+ IExecuteFunctions,+ INodeExecutionData,+ INodeType,+ INodeTypeDescription,+} from 'n8n-workflow';++export class OpenWA implements INodeType {+ description: INodeTypeDescription = {+ displayName: 'OpenWA',+ name: 'openWA',+ icon: 'file:openwa.svg',+ group: ['transform'],+ version: 1,+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',+ description: 'Send WhatsApp messages via OpenWA',+ defaults: {+ name: 'OpenWA',+ },+ inputs: ['main'],+ outputs: ['main'],+ credentials: [+ {+ name: 'openWAApi',+ required: true,+ },+ ],+ properties: [+ // Resource+ {+ displayName: 'Resource',+ name: 'resource',+ type: 'options',+ noDataExpression: true,+ options: [+ { name: 'Message', value: 'message' },+ { name: 'Session', value: 'session' },+ { name: 'Contact', value: 'contact' },+ { name: 'Group', value: 'group' },+ ],+ default: 'message',+ },++ // Message Operations+ {+ displayName: 'Operation',+ name: 'operation',+ type: 'options',+ noDataExpression: true,+ displayOptions: {+ show: { resource: ['message'] },+ },+ options: [+ { name: 'Send Text', value: 'sendText' },+ { name: 'Send Image', value: 'sendImage' },+ { name: 'Send Document', value: 'sendDocument' },+ { name: 'Send Location', value: 'sendLocation' },+ ],+ default: 'sendText',+ },++ // Session ID+ {+ displayName: 'Session ID',+ name: 'sessionId',+ type: 'string',+ default: 'default',+ required: true,+ description: 'The session ID to use',+ },++ // Phone Number+ {+ displayName: 'Phone Number',+ name: 'phone',+ type: 'string',+ default: '',+ required: true,+ displayOptions: {+ show: {+ resource: ['message'],+ },+ },+ description: 'Phone number (e.g., 628123456789)',+ },++ // Message Text+ {+ displayName: 'Message',+ name: 'message',+ type: 'string',+ typeOptions: {+ rows: 4,+ },+ default: '',+ displayOptions: {+ show: {+ resource: ['message'],+ operation: ['sendText'],+ },+ },+ description: 'The message text to send',+ },++ // Image URL+ {+ displayName: 'Image URL',+ name: 'imageUrl',+ type: 'string',+ default: '',+ displayOptions: {+ show: {+ resource: ['message'],+ operation: ['sendImage'],+ },+ },+ description: 'URL of the image to send',+ },++ // Caption+ {+ displayName: 'Caption',+ name: 'caption',+ type: 'string',+ default: '',+ displayOptions: {+ show: {+ resource: ['message'],+ operation: ['sendImage', 'sendDocument'],+ },+ },+ description: 'Caption for the media',+ },+ ],+ };++ async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {+ const items = this.getInputData();+ const returnData: INodeExecutionData[] = [];+ const credentials = await this.getCredentials('openWAApi');++ const baseUrl = credentials.baseUrl as string;+ const apiKey = credentials.apiKey as string;++ for (let i = 0; i < items.length; i++) {+ const resource = this.getNodeParameter('resource', i) as string;+ const operation = this.getNodeParameter('operation', i) as string;+ const sessionId = this.getNodeParameter('sessionId', i) as string;++ let response;++ if (resource === 'message') {+ const phone = this.getNodeParameter('phone', i) as string;+ const formattedPhone = this.formatPhone(phone);++ if (operation === 'sendText') {+ const message = this.getNodeParameter('message', i) as string;++ response = await this.helpers.request({+ method: 'POST',+ url: `${baseUrl}/api/sessions/${sessionId}/messages`,+ headers: { 'X-API-Key': apiKey },+ body: {+ phone: formattedPhone,+ type: 'text',+ body: message,+ },+ json: true,+ });+ } else if (operation === 'sendImage') {+ const imageUrl = this.getNodeParameter('imageUrl', i) as string;+ const caption = this.getNodeParameter('caption', i) as string;++ response = await this.helpers.request({+ method: 'POST',+ url: `${baseUrl}/api/sessions/${sessionId}/messages`,+ headers: { 'X-API-Key': apiKey },+ body: {+ phone: formattedPhone,+ type: 'image',+ media: { url: imageUrl },+ caption,+ },+ json: true,+ });+ }+ }++ returnData.push({ json: response.data });+ }++ return [returnData];+ }++ private formatPhone(phone: string): string {+ let cleaned = phone.replace(/\D/g, '');+ if (!cleaned.endsWith('@c.us')) {+ cleaned = `${cleaned}@c.us`;+ }+ return cleaned;+ }+}+```++### Trigger Node++```typescript+// nodes/OpenWA/OpenWATrigger.node.ts++import {+ IHookFunctions,+ IWebhookFunctions,+ INodeType,+ INodeTypeDescription,+ IWebhookResponseData,+} from 'n8n-workflow';++export class OpenWATrigger implements INodeType {+ description: INodeTypeDescription = {+ displayName: 'OpenWA Trigger',+ name: 'openWATrigger',+ icon: 'file:openwa.svg',+ group: ['trigger'],+ version: 1,+ description: 'Starts workflow on OpenWA events',+ defaults: {+ name: 'OpenWA Trigger',+ },+ inputs: [],+ outputs: ['main'],+ credentials: [+ {+ name: 'openWAApi',+ required: true,+ },+ ],+ webhooks: [+ {+ name: 'default',+ httpMethod: 'POST',+ responseMode: 'onReceived',+ path: 'webhook',+ },+ ],+ properties: [+ {+ displayName: 'Events',+ name: 'events',+ type: 'multiOptions',+ options: [+ { name: 'Message Received', value: 'message.received' },+ { name: 'Message Acknowledged', value: 'message.ack' },+ { name: 'Session Status Change', value: 'session.status' },+ { name: 'QR Code Received', value: 'session.qr' },+ ],+ default: ['message.received'],+ required: true,+ },+ {+ displayName: 'Session Filter',+ name: 'sessionFilter',+ type: 'string',+ default: '',+ description: 'Only trigger for specific session (leave empty for all)',+ },+ ],+ };++ webhookMethods = {+ default: {+ async checkExists(this: IHookFunctions): Promise<boolean> {+ // Check if webhook already exists in OpenWA+ const webhookUrl = this.getNodeWebhookUrl('default');+ const credentials = await this.getCredentials('openWAApi');++ const sessionId = this.getNodeParameter('sessionFilter') as string;+ const response = await this.helpers.request({+ method: 'GET',+ url: `${credentials.baseUrl}/api/sessions/${sessionId}/webhooks`,+ headers: { 'X-API-Key': credentials.apiKey as string },+ json: true,+ });++ return response.data.some((w: any) => w.url === webhookUrl);+ },++ async create(this: IHookFunctions): Promise<boolean> {+ const webhookUrl = this.getNodeWebhookUrl('default');+ const events = this.getNodeParameter('events') as string[];+ const credentials = await this.getCredentials('openWAApi');++ const sessionId = this.getNodeParameter('sessionFilter') as string;+ await this.helpers.request({+ method: 'POST',+ url: `${credentials.baseUrl}/api/sessions/${sessionId}/webhooks`,+ headers: { 'X-API-Key': credentials.apiKey as string },+ body: {+ url: webhookUrl,+ events,+ },+ json: true,+ });++ return true;+ },++ async delete(this: IHookFunctions): Promise<boolean> {+ const webhookUrl = this.getNodeWebhookUrl('default');+ const credentials = await this.getCredentials('openWAApi');++ // Find and delete the webhook+ const sessionId = this.getNodeParameter('sessionFilter') as string;+ const response = await this.helpers.request({+ method: 'GET',+ url: `${credentials.baseUrl}/api/sessions/${sessionId}/webhooks`,+ headers: { 'X-API-Key': credentials.apiKey as string },+ json: true,+ });++ const webhook = response.data.find((w: any) => w.url === webhookUrl);+ if (webhook) {+ await this.helpers.request({+ method: 'DELETE',+ url: `${credentials.baseUrl}/api/sessions/${sessionId}/webhooks/${webhook.id}`,+ headers: { 'X-API-Key': credentials.apiKey as string },+ json: true,+ });+ }++ return true;+ },+ },+ };++ async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {+ const body = this.getBodyData() as any;++ return {+ workflowData: [+ this.helpers.returnJsonArray(body),+ ],+ };+ }+}+```++## 18.6 SDK Release & Versioning++### Version Strategy++SDK versions follow API versions:++```+API v1.0.0 → SDK v1.0.x+API v1.1.0 → SDK v1.1.x+API v2.0.0 → SDK v2.0.x (breaking changes)+```++### Release Checklist++```markdown+## SDK Release Checklist++- [ ] Update version number in package.json/setup.py/composer.json+- [ ] Update CHANGELOG+- [ ] Run all tests+- [ ] Generate/update API types from OpenAPI spec+- [ ] Update documentation+- [ ] Build distribution packages+- [ ] Test installation in clean environment+- [ ] Publish to package registry+- [ ] Tag release in Git+- [ ] Update examples repository+```+---++<div align="center">++[← 17 - Dashboard Design](./17-dashboard-design.md) · [Documentation Index](./README.md) · [Next: 19 - Plugin Architecture →](./19-plugin-architecture.md)++</div>diff --git a/docs/19-plugin-architecture.md b/docs/19-plugin-architecture.mdnew file mode 100644index 000000000..c61e1a5fe--- /dev/null+++ b/docs/19-plugin-architecture.md@@ -0,0 +1,1123 @@+# 19 - Plugin Architecture++## Implementation Status++> **Current Status: ⚠️ Partially Implemented**+>+> The core plugin infrastructure is functional. Advanced features are planned for future releases.++| Component | Status | Location |+|-----------|--------|----------|+| **HookManager** | ✅ Implemented | `src/core/hooks/hook-manager.service.ts` |+| **PluginLoaderService** | ✅ Implemented | `src/core/plugins/plugin-loader.service.ts` |+| **PluginStorageService** | ✅ Implemented | `src/core/plugins/plugin-storage.service.ts` |+| **Manifest loading** | ✅ Implemented | Loads from `plugins/` directory |+| **Plugin lifecycle** | ✅ Implemented | load, enable, disable, unload |+| **Dashboard UI** | ✅ Implemented | `dashboard/src/pages/Plugins.tsx` |+| **REST API** | ✅ Implemented | `src/modules/plugins/plugins.controller.ts` |++| Component | Status | Notes |+|-----------|--------|-------|+| **@openwa/plugin-sdk** | 🔜 Planned | NPM package not yet published |+| **Sandboxed execution** | 🔜 Planned | vm2 isolation not implemented |+| **Permission enforcement** | ⚠️ Partial | Defined in manifest, not enforced |+| **Built-in plugins** | 🔜 Planned | Auto-reply, Translation examples |+| **Plugin marketplace** | 🔜 Planned | Install from npm/github |++---++## 19.1 Overview++The plugin architecture enables OpenWA extensibility without modifying the core codebase. Plugins can add new features, integrate with external services, or customize behavior.++### Design Goals++```mermaid+flowchart TB+ subgraph Goals+ ISO[Isolation]+ EXT[Extensibility]+ SAFE[Safety]+ PERF[Performance]+ end++ subgraph Implementation+ ISO --> SANDBOX[Sandboxed Execution]+ EXT --> HOOKS[Hook System]+ SAFE --> PERM[Permission Model]+ PERF --> LAZY[Lazy Loading]+ end+```++1. **Isolation** - Plugins cannot compromise the core system+2. **Extensibility** - Easy to add new features+3. **Safety** - Permission-based access control+4. **Performance** - Lazy loading, minimal overhead++## 19.2 Plugin Types++### Type Categories++```mermaid+flowchart LR+ subgraph PluginTypes[Plugin Types]+ MSG[Message Handlers]+ WH[Webhook Transformers]+ AUTH[Auth Providers]+ STORE[Storage Providers]+ INT[Integrations]+ end++ MSG --> |Process| INCOMING[Incoming Messages]+ MSG --> |Transform| OUTGOING[Outgoing Messages]+ WH --> |Filter/Transform| WEBHOOK[Webhook Payloads]+ AUTH --> |Custom| AUTHFLOW[Auth Flow]+ STORE --> |Alternative| STORAGE[Storage Backends]+ INT --> |External| SERVICES[External Services]+```++| Type | Description | Examples |+|------|-------------|----------|+| Message Handler | Process incoming/outgoing messages | Auto-reply, Translation |+| Webhook Transformer | Transform webhook payloads | Add metadata, Filter events |+| Auth Provider | Custom authentication | OAuth, LDAP |+| Storage Provider | Alternative storage backends | Google Drive, Dropbox |+| Integration | External service integration | CRM, Analytics, n8n |++## 19.3 Plugin Structure++### Directory Structure++```+plugins/+├── my-plugin/+│ ├── package.json # Plugin metadata+│ ├── index.ts # Entry point+│ ├── manifest.json # Permissions & config+│ ├── src/+│ │ ├── handlers/ # Message handlers+│ │ ├── hooks/ # Hook implementations+│ │ └── utils/ # Utilities+│ ├── config/+│ │ └── default.json # Default config+│ └── README.md # Documentation+```++### Manifest File++```json+{+ "name": "my-awesome-plugin",+ "version": "1.0.0",+ "description": "An awesome plugin for OpenWA",+ "author": "Your Name",+ "license": "MIT",++ "main": "dist/index.js",+ "types": "dist/index.d.ts",++ "openwa": {+ "minVersion": "0.2.0",+ "maxVersion": "2.0.0"+ },++ "permissions": [+ "messages:read",+ "messages:write",+ "contacts:read",+ "storage:read",+ "storage:write",+ "http:outbound"+ ],++ "hooks": [+ "message:received",+ "message:sending",+ "session:connected",+ "webhook:before"+ ],++ "config": {+ "schema": {+ "type": "object",+ "properties": {+ "enabled": {+ "type": "boolean",+ "default": true+ },+ "apiKey": {+ "type": "string",+ "secret": true+ },+ "options": {+ "type": "object",+ "properties": {+ "autoReply": { "type": "boolean", "default": false },+ "language": { "type": "string", "default": "id" }+ }+ }+ }+ }+ }+}+```++### Plugin Entry Point++```typescript+// plugins/my-plugin/index.ts++import { OpenWAPlugin, PluginContext, MessageEvent, HookResult } from '@openwa/plugin-sdk';++export interface MyPluginConfig {+ enabled: boolean;+ apiKey: string;+ options: {+ autoReply: boolean;+ language: string;+ };+}++export default class MyAwesomePlugin implements OpenWAPlugin<MyPluginConfig> {+ name = 'my-awesome-plugin';+ version = '1.0.0';++ private ctx!: PluginContext;+ private config!: MyPluginConfig;++ /**+ * Called when plugin is loaded+ */+ async onLoad(ctx: PluginContext, config: MyPluginConfig): Promise<void> {+ this.ctx = ctx;+ this.config = config;++ ctx.logger.info('Plugin loaded', { version: this.version });++ // Register message handler+ ctx.hooks.on('message:received', this.handleIncomingMessage.bind(this));++ // Register API routes (optional)+ ctx.router.get('/my-plugin/status', this.getStatus.bind(this));+ ctx.router.post('/my-plugin/action', this.doAction.bind(this));+ }++ /**+ * Called when plugin is unloaded+ */+ async onUnload(): Promise<void> {+ this.ctx.logger.info('Plugin unloading');+ // Cleanup resources+ }++ /**+ * Handle incoming message+ */+ async handleIncomingMessage(event: MessageEvent): Promise<HookResult> {+ if (!this.config.enabled) {+ return { continue: true };+ }++ const { message, session } = event;++ // Example: Auto-reply to specific keyword+ if (this.config.options.autoReply && message.body?.toLowerCase() === 'help') {+ await this.ctx.api.messages.send(session.id, {+ phone: message.from,+ type: 'text',+ body: 'How can I help you?',+ });++ // Stop processing (don't trigger webhook)+ return { continue: false };+ }++ // Continue to next handler/webhook+ return { continue: true };+ }++ /**+ * Custom API endpoint+ */+ async getStatus(req: Request, res: Response): Promise<void> {+ res.json({+ plugin: this.name,+ version: this.version,+ enabled: this.config.enabled,+ stats: await this.getStats(),+ });+ }++ async doAction(req: Request, res: Response): Promise<void> {+ // Perform action+ res.json({ success: true });+ }++ private async getStats(): Promise<object> {+ // Get plugin stats from storage+ return this.ctx.storage.get('stats') || {};+ }+}+```++## 19.4 Plugin SDK++### Core Interfaces++```typescript+// @openwa/plugin-sdk/types.ts++export interface OpenWAPlugin<TConfig = any> {+ name: string;+ version: string;++ onLoad(ctx: PluginContext, config: TConfig): Promise<void>;+ onUnload(): Promise<void>;+}++export interface PluginContext {+ // Logging+ logger: Logger;++ // Hook registration+ hooks: HookRegistry;++ // API access (permission-based)+ api: PluginAPI;++ // Plugin storage+ storage: PluginStorage;++ // HTTP router for custom endpoints+ router: PluginRouter;++ // Configuration+ config: ConfigService;++ // Event emitter+ events: EventEmitter;+}++export interface Logger {+ debug(message: string, meta?: object): void;+ info(message: string, meta?: object): void;+ warn(message: string, meta?: object): void;+ error(message: string, meta?: object): void;+}++export interface HookRegistry {+ on(event: HookEvent, handler: HookHandler): void;+ off(event: HookEvent, handler: HookHandler): void;+ once(event: HookEvent, handler: HookHandler): void;+}++export type HookEvent =+ | 'message:received'+ | 'message:sending'+ | 'message:sent'+ | 'message:failed'+ | 'session:created'+ | 'session:connected'+ | 'session:disconnected'+ | 'session:deleted'+ | 'webhook:before'+ | 'webhook:after'+ | 'webhook:error';++export type HookHandler<T = any> = (event: T) => Promise<HookResult>;++export interface HookResult {+ continue: boolean; // Whether to continue to next handler+ modified?: any; // Modified event data+ error?: Error; // Error to stop processing+}+```++### Plugin API++```typescript+// @openwa/plugin-sdk/api.ts++export interface PluginAPI {+ // Sessions (requires: sessions:read/write)+ sessions: {+ list(): Promise<Session[]>;+ get(id: string): Promise<Session>;+ getStatus(id: string): Promise<SessionStatus>;+ };++ // Messages (requires: messages:read/write)+ messages: {+ send(sessionId: string, input: SendMessageInput): Promise<Message>;+ get(sessionId: string, messageId: string): Promise<Message>;+ list(sessionId: string, phone: string): Promise<Message[]>;+ };++ // Contacts (requires: contacts:read/write)+ contacts: {+ list(sessionId: string): Promise<Contact[]>;+ get(sessionId: string, phone: string): Promise<Contact>;+ exists(sessionId: string, phone: string): Promise<boolean>;+ };++ // Groups (requires: groups:read/write)+ groups: {+ list(sessionId: string): Promise<Group[]>;+ get(sessionId: string, groupId: string): Promise<Group>;+ getParticipants(sessionId: string, groupId: string): Promise<Participant[]>;+ };++ // HTTP (requires: http:outbound)+ http: {+ get(url: string, options?: HttpOptions): Promise<HttpResponse>;+ post(url: string, body: any, options?: HttpOptions): Promise<HttpResponse>;+ put(url: string, body: any, options?: HttpOptions): Promise<HttpResponse>;+ delete(url: string, options?: HttpOptions): Promise<HttpResponse>;+ };+}+```++### Plugin Storage++```typescript+// @openwa/plugin-sdk/storage.ts++export interface PluginStorage {+ // Key-value storage (scoped to plugin)+ get<T = any>(key: string): Promise<T | null>;+ set<T = any>(key: string, value: T, ttl?: number): Promise<void>;+ delete(key: string): Promise<void>;+ has(key: string): Promise<boolean>;++ // List operations+ keys(pattern?: string): Promise<string[]>;+ clear(): Promise<void>;++ // Atomic operations+ increment(key: string, by?: number): Promise<number>;+ decrement(key: string, by?: number): Promise<number>;+}+```++## 19.5 Hook System++### Hook Lifecycle++```mermaid+sequenceDiagram+ participant Core as OpenWA Core+ participant HM as Hook Manager+ participant P1 as Plugin 1+ participant P2 as Plugin 2+ participant WH as Webhook++ Core->>HM: Message Received+ HM->>P1: message:received+ P1->>HM: {continue: true, modified: msg}+ HM->>P2: message:received (modified)+ P2->>HM: {continue: true}+ HM->>Core: Continue processing+ Core->>WH: Deliver webhook+```++### Hook Implementation++```typescript+// src/core/hooks/hook-manager.ts++export class HookManager {+ private hooks: Map<HookEvent, HookHandler[]> = new Map();+ private pluginHooks: Map<string, Map<HookEvent, HookHandler[]>> = new Map();++ /**+ * Register hook handler for a plugin+ */+ register(pluginId: string, event: HookEvent, handler: HookHandler): void {+ // Get plugin's hooks map+ if (!this.pluginHooks.has(pluginId)) {+ this.pluginHooks.set(pluginId, new Map());+ }++ const pluginMap = this.pluginHooks.get(pluginId)!;+ if (!pluginMap.has(event)) {+ pluginMap.set(event, []);+ }++ pluginMap.get(event)!.push(handler);++ // Add to global hooks+ if (!this.hooks.has(event)) {+ this.hooks.set(event, []);+ }+ this.hooks.get(event)!.push(handler);+ }++ /**+ * Unregister all hooks for a plugin+ */+ unregisterPlugin(pluginId: string): void {+ const pluginMap = this.pluginHooks.get(pluginId);+ if (!pluginMap) return;++ // Remove from global hooks+ for (const [event, handlers] of pluginMap.entries()) {+ const globalHandlers = this.hooks.get(event);+ if (globalHandlers) {+ const filtered = globalHandlers.filter(h => !handlers.includes(h));+ this.hooks.set(event, filtered);+ }+ }++ this.pluginHooks.delete(pluginId);+ }++ /**+ * Execute hooks for an event+ */+ async execute<T>(event: HookEvent, data: T): Promise<HookExecutionResult<T>> {+ const handlers = this.hooks.get(event) || [];+ let currentData = data;+ let shouldContinue = true;++ for (const handler of handlers) {+ try {+ const result = await handler(currentData);++ if (result.modified) {+ currentData = result.modified;+ }++ if (!result.continue) {+ shouldContinue = false;+ break;+ }++ if (result.error) {+ throw result.error;+ }+ } catch (error) {+ // Log error but continue to next handler+ console.error(`Hook handler error for ${event}:`, error);+ }+ }++ return {+ data: currentData,+ shouldContinue,+ handlersExecuted: handlers.length,+ };+ }+}++export interface HookExecutionResult<T> {+ data: T;+ shouldContinue: boolean;+ handlersExecuted: number;+}+```++## 19.6 Plugin Loader++```typescript+// src/core/plugins/plugin-loader.ts++import { OpenWAPlugin, PluginContext, PluginManifest } from './types';+import { HookManager } from '../hooks/hook-manager';+import { PluginSandbox } from './plugin-sandbox';+import { PluginStorageImpl } from './plugin-storage';+import { PluginAPIImpl } from './plugin-api';++export class PluginLoader {+ private plugins: Map<string, LoadedPlugin> = new Map();+ private hookManager: HookManager;++ constructor(+ private pluginDir: string,+ hookManager: HookManager,+ ) {+ this.hookManager = hookManager;+ }++ /**+ * Discover and load all plugins+ */+ async loadAll(): Promise<void> {+ const pluginDirs = await this.discoverPlugins();++ for (const dir of pluginDirs) {+ try {+ await this.load(dir);+ } catch (error) {+ console.error(`Failed to load plugin from ${dir}:`, error);+ }+ }+ }++ /**+ * Load a single plugin+ */+ async load(pluginPath: string): Promise<void> {+ // 1. Read manifest+ const manifest = await this.readManifest(pluginPath);++ // 2. Validate manifest+ this.validateManifest(manifest);++ // 3. Check version compatibility+ this.checkVersionCompatibility(manifest);++ // 4. Check permissions+ await this.checkPermissions(manifest);++ // 5. Load plugin module+ const PluginClass = await this.loadModule(pluginPath, manifest);++ // 6. Create plugin instance+ const plugin = new PluginClass();++ // 7. Create plugin context+ const ctx = this.createContext(manifest);++ // 8. Load configuration+ const config = await this.loadConfig(manifest);++ // 9. Initialize plugin+ await plugin.onLoad(ctx, config);++ // 10. Store loaded plugin+ this.plugins.set(manifest.name, {+ instance: plugin,+ manifest,+ context: ctx,+ config,+ });++ console.log(`Plugin loaded: ${manifest.name}@${manifest.version}`);+ }++ /**+ * Unload a plugin+ */+ async unload(pluginName: string): Promise<void> {+ const loaded = this.plugins.get(pluginName);+ if (!loaded) return;++ // Call plugin cleanup+ await loaded.instance.onUnload();++ // Unregister hooks+ this.hookManager.unregisterPlugin(pluginName);++ // Remove from loaded plugins+ this.plugins.delete(pluginName);++ console.log(`Plugin unloaded: ${pluginName}`);+ }++ /**+ * Reload a plugin+ */+ async reload(pluginName: string): Promise<void> {+ const loaded = this.plugins.get(pluginName);+ if (!loaded) {+ throw new Error(`Plugin ${pluginName} not loaded`);+ }++ const pluginPath = loaded.manifest._path;+ await this.unload(pluginName);+ await this.load(pluginPath);+ }++ /**+ * Create plugin context with permissions+ */+ private createContext(manifest: PluginManifest): PluginContext {+ const permissions = new Set(manifest.permissions);++ return {+ logger: this.createLogger(manifest.name),+ hooks: this.createHookRegistry(manifest.name),+ api: new PluginAPIImpl(permissions),+ storage: new PluginStorageImpl(manifest.name),+ router: this.createRouter(manifest.name),+ config: this.createConfigService(manifest),+ events: this.createEventEmitter(manifest.name),+ };+ }++ private createHookRegistry(pluginId: string) {+ return {+ on: (event: HookEvent, handler: HookHandler) => {+ this.hookManager.register(pluginId, event, handler);+ },+ off: (event: HookEvent, handler: HookHandler) => {+ // Implementation+ },+ once: (event: HookEvent, handler: HookHandler) => {+ // Implementation+ },+ };+ }++ private async discoverPlugins(): Promise<string[]> {+ const fs = require('fs').promises;+ const path = require('path');++ const entries = await fs.readdir(this.pluginDir, { withFileTypes: true });+ const dirs = entries+ .filter((e: any) => e.isDirectory())+ .map((e: any) => path.join(this.pluginDir, e.name));++ return dirs.filter(async (dir: string) => {+ try {+ await fs.access(path.join(dir, 'manifest.json'));+ return true;+ } catch {+ return false;+ }+ });+ }++ // ... other helper methods+}++interface LoadedPlugin {+ instance: OpenWAPlugin;+ manifest: PluginManifest;+ context: PluginContext;+ config: any;+}+```++## 19.7 Built-in Plugins++### Auto-Reply Plugin++```typescript+// plugins/auto-reply/index.ts++import { OpenWAPlugin, PluginContext, MessageEvent } from '@openwa/plugin-sdk';++interface AutoReplyConfig {+ enabled: boolean;+ rules: AutoReplyRule[];+ defaultReply?: string;+}++interface AutoReplyRule {+ trigger: string | RegExp;+ reply: string;+ caseSensitive?: boolean;+ matchType: 'exact' | 'contains' | 'regex' | 'startsWith';+}++export default class AutoReplyPlugin implements OpenWAPlugin<AutoReplyConfig> {+ name = 'auto-reply';+ version = '1.0.0';++ private ctx!: PluginContext;+ private config!: AutoReplyConfig;+ private compiledRules: CompiledRule[] = [];++ async onLoad(ctx: PluginContext, config: AutoReplyConfig): Promise<void> {+ this.ctx = ctx;+ this.config = config;++ // Compile rules for faster matching+ this.compiledRules = this.compileRules(config.rules);++ // Register hook+ ctx.hooks.on('message:received', this.handleMessage.bind(this));++ ctx.logger.info('Auto-reply plugin loaded', {+ rulesCount: this.compiledRules.length,+ });+ }++ async onUnload(): Promise<void> {+ this.ctx.logger.info('Auto-reply plugin unloaded');+ }++ private compileRules(rules: AutoReplyRule[]): CompiledRule[] {+ return rules.map(rule => ({+ ...rule,+ matcher: this.createMatcher(rule),+ }));+ }++ private createMatcher(rule: AutoReplyRule): (text: string) => boolean {+ const trigger = rule.caseSensitive ? rule.trigger : String(rule.trigger).toLowerCase();++ switch (rule.matchType) {+ case 'exact':+ return (text) => text === trigger;+ case 'contains':+ return (text) => text.includes(trigger as string);+ case 'startsWith':+ return (text) => text.startsWith(trigger as string);+ case 'regex':+ const regex = new RegExp(trigger as string, rule.caseSensitive ? '' : 'i');+ return (text) => regex.test(text);+ default:+ return () => false;+ }+ }++ async handleMessage(event: MessageEvent): Promise<HookResult> {+ if (!this.config.enabled) {+ return { continue: true };+ }++ const { message, session } = event;+ const text = this.config.rules[0]?.caseSensitive+ ? message.body || ''+ : (message.body || '').toLowerCase();++ // Find matching rule+ const matchedRule = this.compiledRules.find(rule => rule.matcher(text));++ if (matchedRule) {+ await this.sendReply(session.id, message.from, matchedRule.reply);++ // Track stats+ await this.ctx.storage.increment('stats:replies');++ return { continue: true }; // Still trigger webhook+ }++ // Default reply if configured+ if (this.config.defaultReply) {+ await this.sendReply(session.id, message.from, this.config.defaultReply);+ }++ return { continue: true };+ }++ private async sendReply(sessionId: string, to: string, reply: string): Promise<void> {+ await this.ctx.api.messages.send(sessionId, {+ phone: to,+ type: 'text',+ body: reply,+ });+ }+}++interface CompiledRule extends AutoReplyRule {+ matcher: (text: string) => boolean;+}+```++### Translation Plugin++```typescript+// plugins/translation/index.ts++import { OpenWAPlugin, PluginContext, MessageEvent } from '@openwa/plugin-sdk';++interface TranslationConfig {+ enabled: boolean;+ provider: 'google' | 'deepl' | 'libre';+ apiKey?: string;+ sourceLanguage: 'auto' | string;+ targetLanguage: string;+ translateIncoming: boolean;+ translateOutgoing: boolean;+}++export default class TranslationPlugin implements OpenWAPlugin<TranslationConfig> {+ name = 'translation';+ version = '1.0.0';++ private ctx!: PluginContext;+ private config!: TranslationConfig;++ async onLoad(ctx: PluginContext, config: TranslationConfig): Promise<void> {+ this.ctx = ctx;+ this.config = config;++ if (config.translateIncoming) {+ ctx.hooks.on('message:received', this.translateIncoming.bind(this));+ }++ if (config.translateOutgoing) {+ ctx.hooks.on('message:sending', this.translateOutgoing.bind(this));+ }+ }++ async onUnload(): Promise<void> {}++ async translateIncoming(event: MessageEvent): Promise<HookResult> {+ if (!this.config.enabled || !event.message.body) {+ return { continue: true };+ }++ try {+ const translated = await this.translate(+ event.message.body,+ this.config.sourceLanguage,+ this.config.targetLanguage+ );++ // Add translation to message metadata+ const modified = {+ ...event,+ message: {+ ...event.message,+ metadata: {+ ...event.message.metadata,+ originalText: event.message.body,+ translatedText: translated,+ translatedFrom: this.config.sourceLanguage,+ translatedTo: this.config.targetLanguage,+ },+ },+ };++ return { continue: true, modified };+ } catch (error) {+ this.ctx.logger.error('Translation failed', { error });+ return { continue: true };+ }+ }++ async translateOutgoing(event: MessageEvent): Promise<HookResult> {+ // Similar implementation for outgoing messages+ return { continue: true };+ }++ private async translate(+ text: string,+ from: string,+ to: string+ ): Promise<string> {+ switch (this.config.provider) {+ case 'google':+ return this.translateWithGoogle(text, from, to);+ case 'deepl':+ return this.translateWithDeepL(text, from, to);+ case 'libre':+ return this.translateWithLibre(text, from, to);+ default:+ throw new Error(`Unknown provider: ${this.config.provider}`);+ }+ }++ private async translateWithGoogle(+ text: string,+ from: string,+ to: string+ ): Promise<string> {+ const response = await this.ctx.api.http.post(+ 'https://translation.googleapis.com/language/translate/v2',+ {+ q: text,+ source: from === 'auto' ? undefined : from,+ target: to,+ key: this.config.apiKey,+ }+ );++ return response.data.translations[0].translatedText;+ }++ // ... other provider implementations+}+```++## 19.8 Plugin Management API++### REST Endpoints++```typescript+// src/api/plugins/plugins.controller.ts++@Controller('api/plugins')+@UseGuards(ApiKeyGuard)+export class PluginsController {+ constructor(private pluginService: PluginService) {}++ @Get()+ async listPlugins(): Promise<PluginInfo[]> {+ return this.pluginService.listAll();+ }++ @Get(':id')+ async getPlugin(@Param('id') id: string): Promise<PluginInfo> {+ return this.pluginService.get(id);+ }++ @Post(':id/enable')+ async enablePlugin(@Param('id') id: string): Promise<void> {+ await this.pluginService.enable(id);+ }++ @Post(':id/disable')+ async disablePlugin(@Param('id') id: string): Promise<void> {+ await this.pluginService.disable(id);+ }++ @Post(':id/reload')+ async reloadPlugin(@Param('id') id: string): Promise<void> {+ await this.pluginService.reload(id);+ }++ @Get(':id/config')+ async getPluginConfig(@Param('id') id: string): Promise<any> {+ return this.pluginService.getConfig(id);+ }++ @Put(':id/config')+ async updatePluginConfig(+ @Param('id') id: string,+ @Body() config: any+ ): Promise<void> {+ await this.pluginService.updateConfig(id, config);+ }++ @Post('install')+ async installPlugin(@Body() input: InstallPluginInput): Promise<PluginInfo> {+ return this.pluginService.install(input);+ }++ @Delete(':id')+ async uninstallPlugin(@Param('id') id: string): Promise<void> {+ await this.pluginService.uninstall(id);+ }+}++interface PluginInfo {+ id: string;+ name: string;+ version: string;+ description: string;+ author: string;+ enabled: boolean;+ permissions: string[];+ config: any;+}++interface InstallPluginInput {+ source: 'npm' | 'github' | 'local';+ package: string; // npm package name, github repo, or local path+}+```++## 19.9 Plugin Security++### Permission Model++```typescript+// src/core/plugins/permissions.ts++export const PERMISSIONS = {+ // Sessions+ 'sessions:read': 'Read session information',+ 'sessions:write': 'Create/delete sessions',++ // Messages+ 'messages:read': 'Read messages',+ 'messages:write': 'Send messages',++ // Contacts+ 'contacts:read': 'Read contacts',+ 'contacts:write': 'Block/unblock contacts',++ // Groups+ 'groups:read': 'Read group information',+ 'groups:write': 'Manage groups',++ // Storage+ 'storage:read': 'Read plugin storage',+ 'storage:write': 'Write to plugin storage',++ // HTTP+ 'http:outbound': 'Make outbound HTTP requests',++ // System+ 'system:info': 'Read system information',+ 'system:config': 'Read/write system config',+} as const;++export type Permission = keyof typeof PERMISSIONS;++export class PermissionChecker {+ constructor(private allowedPermissions: Set<Permission>) {}++ check(required: Permission): boolean {+ return this.allowedPermissions.has(required);+ }++ require(required: Permission): void {+ if (!this.check(required)) {+ throw new PermissionDeniedError(required);+ }+ }+}++export class PermissionDeniedError extends Error {+ constructor(permission: Permission) {+ super(`Permission denied: ${permission}`);+ this.name = 'PermissionDeniedError';+ }+}+```++### Sandboxed Execution++```typescript+// src/core/plugins/sandbox.ts++import { VM } from 'vm2';++export class PluginSandbox {+ private vm: VM;++ constructor(permissions: Set<Permission>) {+ this.vm = new VM({+ timeout: 10000, // 10 second timeout+ sandbox: {+ // Only expose allowed APIs+ console: this.createSafeConsole(),+ setTimeout: this.createSafeTimeout(),+ setInterval: this.createSafeInterval(),+ // ... other safe APIs+ },+ eval: false,+ wasm: false,+ });+ }++ async execute(code: string, context: object): Promise<any> {+ return this.vm.run(code);+ }++ private createSafeConsole() {+ return {+ log: (...args: any[]) => console.log('[Plugin]', ...args),+ error: (...args: any[]) => console.error('[Plugin]', ...args),+ warn: (...args: any[]) => console.warn('[Plugin]', ...args),+ };+ }++ private createSafeTimeout() {+ return (fn: Function, ms: number) => {+ if (ms > 30000) ms = 30000; // Max 30 seconds+ return setTimeout(fn, ms);+ };+ }++ private createSafeInterval() {+ return (fn: Function, ms: number) => {+ if (ms < 1000) ms = 1000; // Min 1 second+ return setInterval(fn, ms);+ };+ }+}+```+---++<div align="center">++[← 18 - SDK Design](./18-sdk-design.md) · [Documentation Index](./README.md) · [Next: 20 - Community Guidelines →](./20-community-guidelines.md)++</div>diff --git a/docs/20-community-guidelines.md b/docs/20-community-guidelines.mdnew file mode 100644index 000000000..f2ff37e3d--- /dev/null+++ b/docs/20-community-guidelines.md@@ -0,0 +1,465 @@+# 20 - Community Guidelines++## 20.1 Code of Conduct++### Our Pledge++OpenWA is committed to providing a welcoming and inclusive environment for everyone. We pledge to make participation in our project and community a harassment-free experience for all, regardless of:++- Age, body size, disability, ethnicity, sex characteristics+- Gender identity and expression+- Level of experience, education, socio-economic status+- Nationality, personal appearance, race, religion+- Sexual identity and orientation++### Our Standards++**Examples of behavior that contributes to a positive environment:**++- Using welcoming and inclusive language+- Being respectful of differing viewpoints and experiences+- Gracefully accepting constructive criticism+- Focusing on what is best for the community+- Showing empathy towards other community members++**Examples of unacceptable behavior:**++- Trolling, insulting/derogatory comments, and personal or political attacks+- Public or private harassment+- Publishing others' private information without explicit permission+- Spam, excessive self-promotion, or off-topic content+- Any conduct which could reasonably be considered inappropriate in a professional setting++### Enforcement++Project maintainers are responsible for clarifying the standards and will take appropriate and fair corrective action in response to any unacceptable behavior.++Project maintainers have the right to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that do not align with this Code of Conduct.++## 20.2 Contributing Guidelines++### Getting Started++```mermaid+flowchart LR+ A[Fork Repo] --> B[Clone Local]+ B --> C[Create Branch]+ C --> D[Make Changes]+ D --> E[Test]+ E --> F[Commit]+ F --> G[Push]+ G --> H[Create PR]+```++### Development Setup++```bash+# 1. Fork the repository on GitHub++# 2. Clone your fork+git clone https://github.com/YOUR_USERNAME/openwa.git+cd openwa++# 3. Add upstream remote+git remote add upstream https://github.com/rmyndharis/OpenWA.git++# 4. Install dependencies+npm install++# 5. Copy environment file+cp .env.example .env++# 6. Start development+npm run dev+```++### Branch Naming++```+feature/ - New features+bugfix/ - Bug fixes+hotfix/ - Critical production fixes+docs/ - Documentation changes+refactor/ - Code refactoring+test/ - Test additions/modifications++Examples:+- feature/add-group-management+- bugfix/fix-qr-timeout+- docs/update-api-reference+- refactor/session-manager+```++### Commit Messages++We follow [Conventional Commits](https://www.conventionalcommits.org/):++```+<type>(<scope>): <description>++[optional body]++[optional footer(s)]+```++**Types:**+- `feat`: A new feature+- `fix`: A bug fix+- `docs`: Documentation only changes+- `style`: Changes that don't affect code meaning (formatting, etc.)+- `refactor`: Code change that neither fixes a bug nor adds a feature+- `perf`: Performance improvement+- `test`: Adding missing tests+- `chore`: Changes to build process or auxiliary tools++**Examples:**++```+feat(sessions): add support for multiple proxy configurations++fix(webhook): resolve timeout issue on slow connections++docs(api): update message endpoint documentation++refactor(database): migrate to TypeORM repository pattern+```++### Pull Request Process++1. **Before submitting:**+ - Ensure tests pass: `npm test`+ - Lint your code: `npm run lint`+ - Update documentation if needed+ - Rebase on latest `main`++2. **PR Description Template:**++```markdown+## Description+Brief description of changes++## Type of Change+- [ ] Bug fix (non-breaking change which fixes an issue)+- [ ] New feature (non-breaking change which adds functionality)+- [ ] Breaking change (fix or feature that causes existing functionality to change)+- [ ] Documentation update++## Testing+Describe how you tested your changes++## Checklist+- [ ] My code follows the project's style guidelines+- [ ] I have performed a self-review of my code+- [ ] I have commented my code, particularly in hard-to-understand areas+- [ ] I have made corresponding changes to the documentation+- [ ] My changes generate no new warnings+- [ ] I have added tests that prove my fix is effective or feature works+- [ ] New and existing unit tests pass locally with my changes+```++3. **Review Process:**+ - At least one maintainer approval required+ - All CI checks must pass+ - Address all review comments+ - Squash commits if requested++### Code Style++**TypeScript:**++```typescript+// Use explicit types+function sendMessage(sessionId: string, phone: string, text: string): Promise<Message> {+ // ...+}++// Use interfaces for complex types+interface SendMessageOptions {+ quotedMessageId?: string;+ mentions?: string[];+}++// Document public APIs+/**+ * Sends a text message to the specified phone number+ * @param sessionId - The session to use for sending+ * @param phone - Phone number in format [email protected]+ * @param text - Message text content+ * @returns Promise resolving to the sent message+ */+async function sendTextMessage(+ sessionId: string,+ phone: string,+ text: string+): Promise<Message> {+ // ...+}+```++**Naming Conventions:**++| Type | Convention | Example |+|------|------------|---------|+| Classes | PascalCase | `SessionManager` |+| Interfaces | PascalCase with I prefix (optional) | `Session` or `ISession` |+| Functions | camelCase | `sendMessage` |+| Variables | camelCase | `sessionCount` |+| Constants | UPPER_SNAKE_CASE | `MAX_SESSIONS` |+| Files | kebab-case | `session-manager.ts` |++## 20.3 Issue Guidelines++### Bug Reports++Use the bug report template:++```markdown+## Bug Description+Clear and concise description of the bug++## Environment+- OpenWA Version:+- Node.js Version:+- OS:+- Docker Version (if applicable):+- Database: SQLite / PostgreSQL++## Steps to Reproduce+1. Go to '...'+2. Click on '....'+3. Scroll down to '....'+4. See error++## Expected Behavior+What you expected to happen++## Actual Behavior+What actually happened++## Screenshots/Logs+If applicable, add screenshots or logs++## Additional Context+Any other relevant information+```++### Feature Requests++Use the feature request template:++```markdown+## Feature Description+Clear description of the feature you'd like++## Use Case+Why do you need this feature? What problem does it solve?++## Proposed Solution+If you have a solution in mind, describe it here++## Alternatives Considered+Other solutions you've considered++## Additional Context+Any other relevant information, mockups, or examples+```++### Issue Labels++| Label | Description |+|-------|-------------|+| `bug` | Something isn't working |+| `enhancement` | New feature or request |+| `documentation` | Improvements to docs |+| `good first issue` | Good for newcomers |+| `help wanted` | Extra attention needed |+| `question` | Further information requested |+| `wontfix` | This will not be worked on |+| `duplicate` | This issue already exists |+| `priority:high` | High priority issue |+| `priority:low` | Low priority issue |++## 20.4 Community Channels++### GitHub Discussions++Primary community forum for:+- Questions and answers+- Feature discussions+- Show and tell+- General discussions++Categories:+- **Announcements**: Official announcements from maintainers+- **Q&A**: Questions about using OpenWA+- **Ideas**: Feature suggestions and brainstorming+- **Show and Tell**: Share your projects using OpenWA+- **General**: General discussion++### Discord Server (Optional)++Real-time chat for:+- Quick questions+- Community support+- Development discussions++Channels:+- `#general` - General discussion+- `#support` - Help with OpenWA+- `#development` - Development discussions+- `#showcase` - Share your projects+- `#off-topic` - Non-OpenWA discussions++### Support Priority++1. **GitHub Issues** - Bug reports and feature requests+2. **GitHub Discussions** - Questions and general discussion+3. **Discord** - Quick questions and community chat++## 20.5 Governance++### Decision Making++```mermaid+flowchart TB+ A[Proposal] --> B{Type?}+ B -->|Minor| C[Maintainer Decision]+ B -->|Major| D[RFC Process]++ D --> E[Community Discussion]+ E --> F[Voting Period]+ F --> G{Consensus?}+ G -->|Yes| H[Implement]+ G -->|No| I[Revise or Reject]++ C --> H+```++### RFC Process (Request for Comments)++For major changes:++1. **Create RFC** - Submit RFC in `rfcs/` directory+2. **Discussion** - Community discusses for 2 weeks+3. **Voting** - Maintainers vote+4. **Decision** - Accept, revise, or reject+5. **Implementation** - If accepted, implement++RFC Template:++```markdown+# RFC: [Title]++## Summary+One paragraph explanation++## Motivation+Why are we doing this?++## Detailed Design+Technical details of the implementation++## Drawbacks+Why should we NOT do this?++## Alternatives+What other designs have been considered?++## Unresolved Questions+What related issues are out of scope?+```++### Maintainer Roles++| Role | Responsibilities |+|------|------------------|+| **Owner** | Final decision authority, project direction |+| **Maintainer** | Code review, merge PRs, triage issues |+| **Committer** | Merge own PRs after approval |+| **Contributor** | Submit PRs, report issues |++### Becoming a Maintainer++Maintainer status is earned through:+- Consistent quality contributions+- Helpful community participation+- Understanding of project goals+- Positive collaboration++Process:+1. Nominated by existing maintainer+2. Discussion among maintainers+3. Unanimous approval required++## 20.6 Recognition++### Contributors++All contributors are recognized in:+- `CONTRIBUTORS.md` file+- Release notes+- README acknowledgments++### Contribution Types++We value all contributions:+- Code contributions+- Documentation improvements+- Bug reports+- Feature suggestions+- Community support+- Translations+- Design contributions++### Acknowledgment++```markdown+## Contributors++Thanks to all the people who have contributed to OpenWA!++<!-- ALL-CONTRIBUTORS-LIST:START -->+<!-- ALL-CONTRIBUTORS-LIST:END -->++This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.+```++## 20.7 Security Policy++### Reporting Vulnerabilities++**DO NOT** report security vulnerabilities through public GitHub issues.++Instead:+1. Email: [email protected]+2. Use GitHub Security Advisories (private)++Include:+- Type of vulnerability+- Full paths of affected files+- Step-by-step instructions to reproduce+- Proof-of-concept or exploit code+- Impact assessment++### Response Timeline++| Severity | Initial Response | Resolution Target |+|----------|------------------|-------------------|+| Critical | 24 hours | 7 days |+| High | 48 hours | 14 days |+| Medium | 7 days | 30 days |+| Low | 14 days | 90 days |++### Disclosure Policy++- We will acknowledge receipt within 48 hours+- We will confirm the vulnerability and work on a fix+- We will notify you when the fix is released+- We will credit you in the security advisory (unless you prefer anonymity)+---++<div align="center">++[← 19 - Plugin Architecture](./19-plugin-architecture.md) · [Documentation Index](./README.md) · [Next: 21 - Glossary →](./21-glossary.md)++</div>diff --git a/docs/21-glossary.md b/docs/21-glossary.mdnew file mode 100644index 000000000..e0fe71986--- /dev/null+++ b/docs/21-glossary.md@@ -0,0 +1,301 @@+# 21 - Glossary++## A++### ACK (Acknowledgement)+Delivery acknowledgment status. WhatsApp ACK levels:+- `error` (-1): Failed to send+- `pending` (0): Pending+- `server` (1): Sent to WhatsApp server+- `device` (2): Delivered to recipient device+- `read` (3): Read by recipient+- `played` (4): Media played (audio/video)++### Adapter+An interface implementation that provides a specific capability. In OpenWA, adapters are used for:+- **Database Adapter**: SQLite, PostgreSQL+- **Storage Adapter**: Local, S3+- **Cache Adapter**: Memory, Redis+- **Engine Adapter**: whatsapp-web.js, Baileys (future)++### API Key+Authentication token to access the OpenWA API. Sent via the `X-API-Key` header.++### Auth State+WhatsApp Web session authentication data stored in the `.wwebjs_auth/` folder. Includes cookies, session storage, and Chrome profile data.++## B++### Baileys+An alternative Node.js library for WhatsApp Web that uses WebSocket directly without a browser. Lighter but easier to detect.++### Broadcast+Sending the same message to multiple recipients. On WhatsApp, this differs from the native "Broadcast List" feature.++### Bull+A Redis-based Node.js job queue library. Used for:+- Message queue (delayed sends)+- Webhook delivery queue (retry mechanism)+- Background tasks++## C++### Chat ID+Unique identifier for a WhatsApp chat:+- Individual: `[email protected]`+- Group: `[email protected]`+- Status: `status@broadcast`++### Chrome/Chromium+Browser used by Puppeteer to run WhatsApp Web. OpenWA uses headless Chromium.++### Compose+Docker Compose - a tool to define and run multi-container Docker applications.++## D++### Dashboard+Web interface to manage OpenWA without using the API directly. Built with React + shadcn/ui.++### Dead Letter Queue (DLQ)+Queue that stores messages that failed after all retry attempts. Used for debugging and manual retry.++### Docker+Containerization platform for packaging and deploying applications. OpenWA is distributed as a Docker image.++## E++### Engine+Component that handles communication with WhatsApp Web. The primary engine used is `whatsapp-web.js`.++### Event+A system-emitted occurrence, for example:+- `message.received`: New incoming message+- `message.ack`: Message status changed+- `session.status`: Session status changed+- `session.qr`: New QR code generated++## F++### Factory Pattern+Design pattern used to create adapter instances based on configuration. Example: `DatabaseAdapterFactory.create()`.++## G++### Group ID+Unique identifier for a WhatsApp group. Format: `[email protected]`.++### GHCR+GitHub Container Registry - registry for storing Docker images. The OpenWA image is available at `ghcr.io/rmyndharis/openwa`.++## H++### Headless+Browser mode that runs without a GUI. Puppeteer runs Chrome in headless mode.++### Health Check+Endpoint to check system health. `/health` is public for basic status, `/health/detailed` requires an API key for full status.++### Hook+An extension point that allows plugins to intercept and modify processing flows.++## I++### In-Memory+Data stored in RAM. Fast but non-persistent. Used for cache in minimal deployments.++## J++### JID (Jabber ID)+Identifier format in the XMPP protocol used by WhatsApp. Same as Chat ID.++### Job Queue+Queueing system for asynchronous task processing. Used for webhook delivery and message scheduling.++## L++### Linked Device+WhatsApp feature that allows up to 4 additional devices to be linked to one account without requiring an active phone connection.++### Lucide+Icon library used in the dashboard. A fork of Feather Icons with more icons.++## M++### Message Queue+Queue for asynchronous message delivery. Prevents rate limiting and ensures message ordering.++### Middleware+Function executed before a request handler in NestJS. Used for logging, authentication, etc.++### MinIO+Object storage server compatible with the S3 API. Can be used as a self-hosted alternative to S3.++### Multi-session+Ability to run multiple WhatsApp sessions within a single OpenWA instance.++## N++### NestJS+Node.js framework for building server-side applications. The OpenWA backend is built with NestJS.++### Node.js+JavaScript runtime used to run OpenWA. Supported version: Node.js 20 LTS.++## O++### ORM (Object-Relational Mapping)+Library that maps objects in code to database tables. OpenWA uses TypeORM.++### OpenWA+Open-source WhatsApp API gateway. This project.++## P++### Payload+Data sent in an HTTP request body or webhook delivery.++### Plugin+Extension that can be added to OpenWA to add functionality without modifying the core codebase.++### PostgreSQL+Relational database recommended for production deployments with multiple sessions.++### Puppeteer+Node.js library for controlling Chrome/Chromium. Used by whatsapp-web.js.++### Push Name+Display name shown in a user's WhatsApp profile.++## Q++### QR Code+Code that must be scanned in WhatsApp on a phone to connect a new session.++### Queue+Queue for processing tasks sequentially and asynchronously.++## R++### Rate Limiting+Limiting request volume over time to prevent abuse and WhatsApp bans.++### Redis+In-memory data store used for:+- Caching+- Message queue (with Bull)+- Session storage+- Real-time pub/sub++### REST API+Architectural style for APIs used by OpenWA. Uses HTTP methods (GET, POST, PUT, DELETE).++### Retry+Mechanism to retry failed operations, e.g., webhook delivery.++## S++### S3 (Simple Storage Service)+AWS object storage service. OpenWA supports S3-compatible storage for media files.++### Session+An instance of a WhatsApp Web connection. One phone number = one session.++### SQLite+Embedded database used as the default for minimal deployments.++### shadcn/ui+Component library for React used in the dashboard. Built on top of Radix UI.++### Strategy Pattern+Design pattern that allows selecting an algorithm/implementation at runtime. Used for pluggable adapters.++### Swagger+API documentation tool. OpenWA provides Swagger UI at `/api/docs`.++## T++### Tailwind CSS+Utility-first CSS framework used in the dashboard.++### TanStack Query+Library for data fetching and caching in React. Previously known as React Query.++### TypeORM+ORM for TypeScript/JavaScript that supports multiple databases.++### TypeScript+Typed superset of JavaScript used for OpenWA development.++## V++### Vite+Build tool and dev server for frontend. Used for the dashboard.++### Volume (Docker)+Persistent storage for Docker containers. OpenWA data is stored in volumes.++## W++### WAHA+WhatsApp HTTP API - a similar project that inspired OpenWA. OpenWA is built as an open-source alternative.++### WAL (Write-Ahead Logging)+SQLite journaling mode that improves concurrency. Recommended for production.++### Webhook+HTTP callback to send events to external systems when messages or other events occur.++### WebSocket+Protocol for real-time bidirectional communication. Used for:+- Dashboard real-time updates+- WhatsApp Web protocol (internal)++### whatsapp-web.js+Primary Node.js library used by OpenWA to interact with WhatsApp Web. Uses Puppeteer to control the browser.++## Z++### Zustand+State management library for React used in the dashboard.++---++## Abbreviations++| Abbr | Full Form |+|------|-----------|+| API | Application Programming Interface |+| CRUD | Create, Read, Update, Delete |+| DI | Dependency Injection |+| DLQ | Dead Letter Queue |+| DTO | Data Transfer Object |+| GHCR | GitHub Container Registry |+| HA | High Availability |+| HTTP | HyperText Transfer Protocol |+| JID | Jabber ID |+| JWT | JSON Web Token |+| LTS | Long Term Support |+| MVP | Minimum Viable Product |+| ORM | Object-Relational Mapping |+| QR | Quick Response |+| RAM | Random Access Memory |+| REST | Representational State Transfer |+| S3 | Simple Storage Service |+| SDK | Software Development Kit |+| SOP | Standard Operating Procedure |+| SQL | Structured Query Language |+| SSL | Secure Sockets Layer |+| TLS | Transport Layer Security |+| TTL | Time To Live |+| UI | User Interface |+| URL | Uniform Resource Locator |+| WAL | Write-Ahead Logging |+| WS | WebSocket |+---++<div align="center">++[← 20 - Community Guidelines](./20-community-guidelines.md) · [Documentation Index](./README.md)++</div>diff --git a/docs/22-n8n-integration.md b/docs/22-n8n-integration.mdnew file mode 100644index 000000000..f87fbd86c--- /dev/null+++ b/docs/22-n8n-integration.md@@ -0,0 +1,279 @@+# 22 - n8n Integration++## Overview++OpenWA provides official n8n community nodes for integrating WhatsApp automation into n8n workflows. This enables users to build powerful automations combining WhatsApp messaging with hundreds of other services available in n8n.++**Repository:** https://github.com/rmyndharis/OpenWA-n8n+**npm Package:** `n8n-nodes-openwa`++## Architecture++```+┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐+│ n8n Workflow │────▶│ OpenWA Node │────▶│ OpenWA API │+│ │ │ (credentials) │ │ (your server) │+└─────────────────┘ └─────────────────┘ └─────────────────┘+ │+ ▼+┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐+│ n8n Workflow │◀────│ OpenWA Trigger │◀────│ Webhook POST │+│ (triggered) │ │ (listens) │ │ from OpenWA │+└─────────────────┘ └─────────────────┘ └─────────────────┘+```++## Installation++### Via n8n Community Nodes (Recommended)++1. Go to **Settings > Community Nodes**+2. Select **Install**+3. Enter `n8n-nodes-openwa`+4. Agree to the risks and install+5. Restart n8n++### Manual Installation++```bash+cd ~/.n8n/nodes+npm install n8n-nodes-openwa+```++## Nodes++### OpenWA Node++Execute operations on your OpenWA server.++#### Credentials Setup++| Field | Description | Example |+|-------|-------------|---------|+| Server URL | OpenWA server URL (without /api) | `https://wa.example.com` |+| API Key | API key from OpenWA dashboard | `owa_xxxxxxxx...` |++#### Resources & Operations++| Resource | Operation | Description | Endpoint |+|----------|-----------|-------------|----------|+| Session | Get Status | Get session status | `GET /api/sessions/:id` |+| Session | List All | List all sessions | `GET /api/sessions` |+| Message | Send Text | Send text message | `POST /api/sessions/:id/messages/send-text` |+| Message | Send Image | Send image (URL/Base64) | `POST /api/sessions/:id/messages/send-image` |+| Message | Send Document | Send file/document | `POST /api/sessions/:id/messages/send-document` |+| Message | Send Location | Send location pin | `POST /api/sessions/:id/messages/send-location` |+| Contact | Check Exists | Check if number on WhatsApp | `GET /api/sessions/:id/contacts/check/:number` |+| Contact | Get Info | Get contact information | `GET /api/sessions/:id/contacts/:contactId` |+| Webhook | Create | Create a webhook | `POST /api/sessions/:id/webhooks` |+| Webhook | Delete | Delete a webhook | `DELETE /api/sessions/:id/webhooks/:webhookId` |++### OpenWA Trigger Node++Start workflows when WhatsApp events occur.++#### Supported Events++| Event | Description | Use Case |+|-------|-------------|----------|+| `message.received` | New incoming message | Auto-reply, lead capture |+| `message.sent` | Message sent successfully | Delivery confirmation |+| `session.connected` | Session authenticated | Startup notifications |+| `session.disconnected` | Session lost connection | Alert monitoring |+| `session.qr_ready` | QR code generated | Reconnection alerts |++#### How It Works++1. When workflow is activated, the trigger creates a webhook in OpenWA+2. OpenWA sends events to n8n's webhook URL+3. When workflow is deactivated, the webhook is automatically deleted++#### Output Data Format++```json+{+ "event": "message.received",+ "timestamp": "2024-01-15T10:30:00Z",+ "sessionId": "default",+ "data": {+ "messageId": "3EB0F5A2B4C...",+ "chatId": "[email protected]",+ "from": "[email protected]",+ "body": "Hello!",+ "type": "text",+ "timestamp": 1705312200+ }+}+```++## Example Workflows++### 1. Auto-Reply Bot++Automatically reply to incoming messages with a welcome message.++```+[OpenWA Trigger] → [IF: Check keyword] → [OpenWA: Send Text]+ │+ └── Events: message.received+```++**Configuration:**+- Trigger: `message.received`+- IF Node: Check if `{{$json.data.body}}` contains "hello"+- OpenWA: Send Text with welcome message++### 2. Lead Collection to Google Sheets++Capture incoming messages and save to Google Sheets.++```+[OpenWA Trigger] → [Google Sheets: Append] → [OpenWA: Send Text]+ │ │+ │ └── Save: name, phone, message+ └── Events: message.received+```++### 3. Session Monitoring++Get notified on Slack when WhatsApp session disconnects.++```+[OpenWA Trigger] → [Slack: Send Message]+ │+ └── Events: session.disconnected+```++**Slack Message:**+```+⚠️ WhatsApp session "{{$json.sessionId}}" disconnected!+Time: {{$json.timestamp}}+Please check and reconnect.+```++### 4. Order Notification++Send WhatsApp notification when new order is received.++```+[Webhook: New Order] → [OpenWA: Send Text]+ │+ └── "Thank you for your order #{{$json.orderId}}"+```++### 5. Scheduled Reminders++Send daily reminders to a list of contacts.++```+[Schedule Trigger] → [Google Sheets: Get Rows] → [Loop] → [OpenWA: Send Text]+ │ │ │+ └── Daily 9AM └── Get contacts └── Send reminder+```++## Best Practices++### 1. Error Handling++Always add error handling in your workflows:++```+[OpenWA Node] → [IF: Check success] → [Continue...]+ │+ └── [Error Handler]+```++### 2. Rate Limiting++WhatsApp has rate limits. Add delays between messages:++```+[Loop Over Items] → [Wait: 2 seconds] → [OpenWA: Send Text]+```++### 3. Message Formatting++Use WhatsApp formatting in your messages:+- Bold: `*text*`+- Italic: `_text_`+- Strikethrough: `~text~`+- Monospace: ``` `text` ```++### 4. Phone Number Format++Always use the correct format for chat IDs:+- Personal: `[email protected]`+- Group: `[email protected]`++## Troubleshooting++### Credential Test Failed++1. Verify OpenWA server is running+2. Check API key is correct+3. Ensure server URL doesn't have trailing slash+4. Verify network connectivity between n8n and OpenWA++### Trigger Not Receiving Events++1. Check webhook was created in OpenWA dashboard+2. Verify n8n webhook URL is accessible from OpenWA server+3. Check firewall/proxy settings+4. Ensure session is connected and active++### Message Not Sending++1. Verify session status is "READY"+2. Check chat ID format is correct+3. Ensure recipient number exists on WhatsApp+4. Check message content isn't empty++## Development++### Building from Source++```bash+git clone https://github.com/rmyndharis/OpenWA-n8n.git+cd OpenWA-n8n+npm install+npm run build+```++### Local Development++```bash+# Watch mode+npm run dev++# Link to local n8n+cd ~/.n8n/nodes+npm link /path/to/OpenWA-n8n+```++### Testing++Test your changes with a local n8n instance:++```bash+# Start n8n+n8n start++# Or with Docker+docker run -it --rm \+ -p 5678:5678 \+ -v ~/.n8n:/home/node/.n8n \+ n8nio/n8n+```++## Related Documentation++- [OpenWA API Specification](./06-api-specification.md)+- [Webhook System](./03-system-architecture.md#webhooks)+- [n8n Documentation](https://docs.n8n.io/)++---++<div align="center">++[← 21 - Glossary](./21-glossary.md) · [Documentation Index](./README.md)++</div>diff --git a/docs/README.md b/docs/README.mdnew file mode 100644index 000000000..b33ad089e--- /dev/null+++ b/docs/README.md@@ -0,0 +1,221 @@+<p align="center">+ <img src="logo/openwa_logo.webp" alt="OpenWA Logo" width="200"/>+</p>++<h1 align="center">OpenWA Documentation</h1>+<p align="center">+ <strong>Open Source WhatsApp API Gateway</strong>+</p>++<p align="center">+ <a href="#features-current">Features</a> •+ <a href="#quick-start">Quick Start</a> •+ <a href="#documentation-map">Docs</a> •+ <a href="#api-example">API</a> •+ <a href="#contributing">Contributing</a>+</p>++<p align="center">+ <img src="https://img.shields.io/badge/version-0.1.0-blue.svg" alt="Version"/>+ <img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"/>+ <img src="https://img.shields.io/badge/node-20_LTS-brightgreen.svg" alt="Node"/>+ <img src="https://img.shields.io/badge/NestJS-11.x-red.svg" alt="NestJS"/>+ <img src="https://img.shields.io/badge/docker-ready-blue.svg" alt="Docker"/>+ <img src="https://img.shields.io/badge/TypeScript-5.x-3178C6.svg" alt="TypeScript"/>+</p>++---++## Documentation Map++**Full Index (by number)**++| No | Document | Description |+| --- | ---------------------------------------------------------------- | ------------------------------------------------- |+| 01 | [Project Overview](./01-project-overview.md) | Vision, goals, scope, current status |+| 02 | [Requirements Specification](./02-requirements-specification.md) | Functional and non-functional requirements |+| 03 | [System Architecture](./03-system-architecture.md) | Architecture, modules, and runtime flows |+| 04 | [Security Design](./04-security-design.md) | Auth, rate limiting, and security controls |+| 05 | [Database Design](./05-database-design.md) | Entities and storage considerations |+| 06 | [API Specification](./06-api-specification.md) | REST API and WebSocket protocol |+| 07 | [API Collection](./07-api-collection.md) | Example requests and Postman import tips |+| 08 | [Development Guidelines](./08-development-guidelines.md) | Coding standards and workflow |+| 09 | [Testing Strategy](./09-testing-strategy.md) | Test types and tooling |+| 10 | [DevOps & Infrastructure](./10-devops-infrastructure.md) | Docker, deployment, and environment configuration |+| 11 | [Operational Runbooks](./11-operational-runbooks.md) | Incident, maintenance, and backup runbooks |+| 12 | [Troubleshooting FAQ](./12-troubleshooting-faq.md) | Common issues and fixes |+| 13 | [Horizontal Scaling](./13-horizontal-scaling.md) | Multi-node deployment guidance |+| 14 | [Migration Guide](./14-migration-guide.md) | Upgrade and data migration guidance |+| 15 | [Project Roadmap](./15-project-roadmap.md) | Near-term and long-term roadmap |+| 16 | [Risk Management](./16-risk-management.md) | Risks and mitigations |+| 17 | [Dashboard Design](./17-dashboard-design.md) | Dashboard UX overview |+| 18 | [SDK Design](./18-sdk-design.md) | SDK plans and conventions |+| 19 | [Plugin Architecture](./19-plugin-architecture.md) | Extensibility concepts |+| 20 | [Community Guidelines](./20-community-guidelines.md) | Contribution and governance |+| 21 | [Glossary](./21-glossary.md) | Terms and definitions |+| 22 | [n8n Integration](./22-n8n-integration.md) | n8n community nodes for OpenWA |++## Quick Start++### Option A: Minimal Setup (SQLite, no Docker services)++```bash+# Clone repository+git clone https://github.com/rmyndharis/OpenWA.git+cd OpenWA++# Install & configure+npm install+cp .env.minimal .env++# Create data directories+mkdir -p data/sessions data/media++# Run+npm run start:dev+```++Access:++- API: `http://localhost:2785/api`+- Swagger: `http://localhost:2785/api/docs`+- Health: `http://localhost:2785/api/health`++### Option B: Docker (Traefik + API + Dashboard)++```bash+# Clone repository+git clone https://github.com/rmyndharis/OpenWA.git+cd OpenWA++# Start services+docker compose up -d+```++Access:++- Dashboard: `http://localhost:2886`+- API: `http://localhost:2785/api`+- Swagger: `http://localhost:2785/api/docs`+- Traefik (optional): `http://localhost:2886/api`++### API Key++OpenWA seeds a default API key on first run and writes it to:++- `data/.api-key` (development)++You can also create new keys via the API (see [API Specification](./06-api-specification.md)).++## API Example++```bash+# Create a session+curl -X POST http://localhost:2785/api/sessions \+ -H "X-API-Key: your-api-key" \+ -H "Content-Type: application/json" \+ -d '{"name": "my-bot"}'++# Start the session+curl -X POST http://localhost:2785/api/sessions/{sessionId}/start \+ -H "X-API-Key: your-api-key"++# Get QR code (base64)+curl http://localhost:2785/api/sessions/{sessionId}/qr \+ -H "X-API-Key: your-api-key"++# Send a message+curl -X POST http://localhost:2785/api/sessions/{sessionId}/messages/send-text \+ -H "X-API-Key: your-api-key" \+ -H "Content-Type: application/json" \+ -d '{"chatId": "[email protected]", "text": "Hello from OpenWA!"}'+```++## WebSocket Example (Socket.IO)++```javascript+import { io } from 'socket.io-client';++const socket = io('http://localhost:2785/events', {+ extraHeaders: { 'X-API-Key': 'your-api-key' },+ transports: ['websocket'],+});++socket.on('connect', () => {+ socket.emit('message', {+ type: 'subscribe',+ sessionId: 'sess_abc123',+ events: ['message.received', 'session.status'],+ requestId: 'req_001',+ });+});++socket.on('message', msg => {+ if (msg.type === 'event') {+ console.log('Event:', msg.payload.event, msg.payload.data);+ }+});+```++## Features (Current)++| Feature | Status |+| ------------------------------- | ----------------------------- |+| REST API for WhatsApp | Ready |+| WebSocket Events (Socket.IO) | Ready |+| Multi-session Support | Ready |+| Web Dashboard | Ready |+| Docker + Traefik Deployment | Ready |+| Webhooks with HMAC Signature | Ready |+| SQLite / PostgreSQL Storage | Ready |+| API Key Authentication & Roles | Ready |+| CIDR IP Whitelisting | Ready |+| Rate Limiting | Ready |+| Audit Logging | Ready |+| Groups / Contacts / Labels API | Ready |+| Channels / Status / Catalog API | Experimental (engine-limited) |+| Queue-based Webhook Retries | Optional (QUEUE_ENABLED=true) |++## Tech Stack++| Layer | Technology |+| --------- | ----------------------------- |+| Runtime | Node.js 20 LTS |+| Framework | NestJS 11.x |+| Language | TypeScript 5.x |+| WA Engine | whatsapp-web.js |+| WebSocket | Socket.IO |+| Database | SQLite (default) / PostgreSQL |+| ORM | TypeORM |+| Container | Docker + Docker Compose |+| Dashboard | React + Vite + TanStack Query |++## Project Structure++```+OpenWA/+├── src/ # Backend source code+├── dashboard/ # Frontend dashboard+├── docker-compose.yml # Traefik + API + Dashboard+├── docker-compose.dev.yml # Dev-only compose+├── docs/ # Project documentation+└── data/ # Local runtime data (sessions, media, api key)+```++## Contributing++See [Development Guidelines](./08-development-guidelines.md) for coding standards and workflow.++## License++MIT License.++---++<div align="center">++**Start Reading: [01 - Project Overview](./01-project-overview.md)**++_OpenWA Documentation · Last updated: 2026-02-05_++</div>diff --git a/docs/logo/openwa.svg b/docs/logo/openwa.svgnew file mode 100644index 000000000..408772705--- /dev/null+++ b/docs/logo/openwa.svg@@ -0,0 +1,278 @@+<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 1024 1022">+<g transform="translate(0,1022) scale(0.1,-0.1)"+fill="#4ade80" stroke="none">+<path d="M4765 10140 c-77 -4 -171 -13 -210 -19 -38 -6 -92 -11 -118 -11 -65+0 -390 -62 -512 -97 -27 -8 -75 -21 -105 -28 -152 -37 -311 -84 -325 -96 -5+-5 -17 -9 -27 -9 -9 0 -37 -9 -60 -19 -24 -10 -70 -29 -103 -41 -61 -22 -128+-51 -178 -76 -16 -8 -34 -14 -40 -14 -21 0 -473 -232 -502 -258 -6 -5 -15 -11+-20 -13 -29 -12 -253 -154 -282 -179 -7 -5 -17 -10 -22 -10 -6 0 -14 -6 -18+-13 -4 -6 -33 -28 -63 -48 -30 -20 -102 -74 -160 -120 -114 -91 -111 -88 -185+-155 -27 -25 -70 -62 -95 -82 -45 -37 -309 -299 -365 -362 -16 -19 -54 -64+-84 -100 -29 -36 -56 -67 -60 -70 -17 -13 -131 -160 -131 -169 0 -5 -6 -14+-13 -18 -12 -7 -73 -88 -102 -135 -5 -9 -25 -37 -42 -62 -18 -26 -33 -49 -33+-52 0 -5 -52 -87 -61 -94 -3 -3 -8 -12 -12 -20 -4 -8 -18 -33 -32 -55 -14 -22+-32 -55 -41 -74 -8 -18 -27 -52 -42 -75 -14 -22 -49 -86 -77 -141 -29 -55 -57+-109 -62 -120 -20 -36 -152 -354 -183 -440 -12 -33 -26 -71 -32 -85 -34 -84+-99 -309 -133 -460 -7 -30 -20 -84 -28 -120 -29 -117 -50 -224 -57 -285 -4+-33 -15 -112 -23 -175 -24 -167 -47 -494 -47 -648 0 -114 7 -229 34 -548 2+-29 11 -92 20 -140 8 -49 19 -118 25 -154 27 -180 155 -679 202 -785 5 -11 24+-58 43 -105 18 -47 46 -114 61 -150 15 -36 36 -87 47 -115 11 -27 28 -68 38+-90 59 -133 66 -185 36 -299 -13 -50 -28 -102 -34 -116 -16 -40 -62 -188 -62+-201 0 -6 -6 -25 -14 -42 -19 -46 -96 -282 -96 -298 -1 -8 -9 -32 -20 -54 -11+-22 -19 -49 -20 -61 0 -11 -4 -24 -9 -30 -5 -5 -19 -43 -31 -84 -11 -41 -27+-95 -35 -120 -7 -25 -22 -74 -33 -110 -22 -72 -36 -112 -64 -182 -10 -26 -18+-55 -18 -66 0 -11 -7 -37 -16 -57 -58 -139 -57 -449 2 -583 110 -252 223 -388+399 -482 33 -17 64 -36 70 -41 5 -5 16 -9 25 -9 8 0 28 -7 44 -15 16 -9 46+-20 65 -24 20 -5 63 -16 96 -25 40 -11 101 -16 186 -16 108 0 142 4 240 30 63+16 134 35 159 41 76 20 183 50 225 64 22 7 76 23 120 35 44 12 103 30 130 40+28 10 88 28 135 40 47 12 108 30 135 40 28 9 73 23 100 30 28 7 73 19 100 27+28 8 79 23 115 33 36 10 79 22 95 28 75 26 165 51 227 62 78 14 182 1 245 -31+20 -10 44 -19 53 -19 9 0 25 -7 37 -15 11 -8 56 -26 99 -40 44 -14 93 -32 111+-40 17 -8 35 -15 40 -15 6 0 24 -7 41 -15 17 -9 52 -22 79 -29 26 -8 107 -32+178 -55 120 -38 204 -59 435 -111 152 -33 251 -51 334 -60 44 -5 140 -16 211+-24 180 -21 741 -21 920 0 72 8 173 19 225 24 53 5 109 14 125 20 16 6 63 15+104 20 42 6 99 16 126 24 28 8 95 24 150 36 55 13 117 29 138 36 20 8 46 14+56 14 10 0 40 9 67 19 27 11 94 33 149 51 55 17 104 36 110 41 5 5 19 9 32 9+13 0 31 4 41 10 27 16 134 60 144 60 15 0 277 127 503 244 53 27 108 60 141+83 11 9 47 30 79 47 38 21 213 135 231 151 6 6 22 17 34 25 36 24 94 68 111+85 9 8 21 15 27 15 5 0 12 4 14 8 2 4 30 28 63 54 57 43 72 56 155 132 19 17+55 48 80 68 50 40 179 167 310 304 105 111 126 135 265 309 119 150 167 215+248 339 6 10 21 31 33 45 19 24 99 156 138 226 9 17 28 48 41 70 14 22 37 65+52 95 16 30 30 57 33 60 11 10 140 288 140 301 0 6 6 23 14 37 8 15 27 59 41+97 32 86 47 125 74 192 12 28 21 58 21 66 0 8 9 36 19 63 10 27 27 78 36 114+10 36 26 92 36 125 10 33 27 103 38 155 11 52 28 129 37 170 9 41 20 102 24+135 4 33 14 105 23 160 57 355 57 1015 0 1345 -8 47 -19 119 -24 160 -5 41+-14 86 -19 100 -5 14 -13 52 -18 85 -5 33 -17 92 -27 130 -9 39 -26 106 -37+150 -45 176 -108 372 -149 463 -10 23 -19 48 -19 55 -1 6 -9 30 -20 52 -11 22+-20 47 -20 55 0 8 -7 24 -15 34 -8 11 -15 26 -15 33 0 8 -29 75 -65 148 -36+74 -65 139 -65 144 0 5 -3 11 -7 13 -5 2 -20 28 -36 58 -31 64 -29 60 -143+250 -81 135 -148 242 -167 265 -10 12 -92 128 -143 203 -21 30 -43 56 -51 59+-7 3 -13 11 -13 19 0 7 -6 17 -12 21 -7 4 -42 44 -78 88 -104 128 -303 333+-478 494 -106 96 -351 294 -432 348 -30 20 -57 39 -60 42 -3 3 -12 11 -21 16+-9 6 -36 23 -60 40 -56 38 -69 46 -110 69 -19 10 -36 22 -39 25 -5 6 -27 19+-80 48 -14 8 -45 27 -70 43 -25 16 -88 51 -140 78 -52 26 -104 53 -115 60 -22+12 -184 87 -230 106 -16 7 -51 23 -76 35 -25 11 -52 21 -60 21 -8 0 -22 7 -31+14 -10 7 -57 25 -105 41 -49 15 -97 31 -108 36 -30 13 -160 54 -245 77 -318+86 -550 130 -816 157 -188 19 -719 27 -929 15z m922 -240 c256 -35 497 -79+628 -115 204 -57 305 -88 377 -116 26 -11 53 -19 60 -19 8 0 33 -9 56 -20 22+-11 45 -20 51 -20 17 0 259 -109 395 -177 139 -70 156 -79 231 -124 28 -16 62+-34 78 -40 15 -6 27 -15 27 -20 0 -5 5 -9 10 -9 6 0 37 -17 68 -38 133 -89+290 -199 337 -234 28 -21 61 -46 73 -55 13 -10 31 -25 40 -33 10 -9 55 -47+102 -85 127 -105 321 -291 429 -412 219 -243 276 -314 398 -493 21 -30 41 -56+45 -58 5 -2 8 -7 8 -12 0 -4 26 -48 58 -96 33 -49 72 -111 88 -137 16 -27 39+-65 51 -85 46 -76 263 -523 263 -542 0 -5 9 -24 20 -42 11 -18 20 -39 20 -46+0 -8 6 -28 14 -45 8 -18 24 -63 36 -102 13 -38 31 -89 41 -113 11 -23 19 -51+19 -61 0 -10 7 -35 15 -56 9 -20 20 -55 25 -78 5 -23 21 -85 35 -137 60 -217+106 -512 131 -828 25 -313 11 -709 -33 -997 -9 -55 -19 -125 -24 -155 -4 -30+-17 -95 -28 -145 -11 -49 -27 -124 -36 -165 -19 -91 -37 -154 -82 -285 -19+-55 -38 -113 -43 -130 -12 -41 -84 -241 -105 -290 -14 -34 -116 -248 -159+-335 -14 -27 -34 -67 -48 -90 -4 -8 -14 -26 -21 -40 -7 -14 -36 -65 -65 -113+-28 -48 -52 -92 -52 -97 0 -6 -4 -10 -8 -10 -5 0 -19 -19 -33 -41 -13 -23 -31+-51 -39 -64 -8 -12 -42 -62 -74 -111 -32 -49 -63 -90 -67 -92 -5 -2 -9 -10 -9+-17 0 -8 -6 -18 -13 -22 -7 -4 -39 -42 -69 -84 -31 -42 -67 -87 -81 -100 -13+-13 -46 -51 -73 -84 -112 -137 -307 -332 -479 -480 -44 -38 -87 -76 -95 -84+-8 -8 -51 -41 -95 -74 -44 -32 -81 -63 -83 -68 -2 -5 -8 -9 -14 -9 -11 0 -91+-60 -96 -72 -2 -5 -10 -8 -17 -8 -8 0 -18 -6 -22 -12 -10 -16 -69 -58 -81 -58+-5 0 -16 -7 -23 -16 -7 -9 -22 -20 -34 -25 -11 -5 -40 -23 -65 -39 -25 -16+-58 -36 -75 -44 -16 -8 -57 -30 -90 -49 -190 -108 -308 -169 -390 -202 -38+-16 -74 -32 -80 -37 -5 -4 -15 -8 -23 -8 -14 0 -57 -18 -145 -61 -22 -11 -43+-19 -48 -19 -5 0 -48 -15 -97 -33 -110 -42 -189 -67 -422 -131 -133 -36 -374+-81 -595 -111 -359 -49 -963 -37 -1295 26 -30 6 -91 17 -135 24 -128 22 -365+80 -398 97 -10 5 -39 13 -65 18 -44 8 -159 43 -192 59 -8 4 -49 18 -90 31 -41+12 -100 34 -130 47 -30 14 -68 31 -85 38 -16 7 -48 21 -70 30 -122 53 -195 67+-350 67 -127 0 -160 -3 -214 -21 -35 -11 -71 -21 -80 -21 -9 0 -43 -9 -76 -20+-33 -10 -91 -28 -130 -40 -38 -11 -99 -29 -135 -39 -36 -11 -92 -27 -125 -36+-33 -9 -83 -25 -110 -36 -28 -10 -58 -19 -66 -19 -9 0 -34 -7 -55 -16 -37 -16+-81 -29 -204 -59 -50 -13 -166 -45 -280 -79 -25 -7 -79 -23 -121 -34 -41 -12+-88 -26 -103 -32 -15 -5 -82 -10 -149 -10 -103 0 -134 4 -202 26 -129 41 -219+96 -315 193 -80 81 -107 122 -153 231 -56 134 -51 332 13 495 4 11 24 74 45+140 21 66 53 167 73 225 19 58 39 121 43 140 8 35 44 147 59 185 5 11 18 54+31 95 12 41 28 89 35 105 7 17 18 53 24 80 6 27 15 54 20 60 4 5 11 28 15 50+4 22 16 58 25 80 10 22 23 60 30 85 6 25 18 70 26 100 46 165 46 249 1 406+-12 44 -28 82 -92 219 -27 58 -57 130 -65 155 -5 14 -18 50 -30 80 -30 78 -80+227 -80 241 0 6 -6 25 -14 42 -13 29 -32 94 -73 247 -15 59 -34 160 -53 280+-6 41 -18 109 -26 150 -68 356 -71 923 -7 1320 8 52 19 124 24 160 11 85 33+188 70 335 17 66 34 136 39 155 4 19 13 49 19 65 6 17 38 113 72 215 33 102+69 205 81 230 11 25 26 59 33 75 8 17 34 74 59 128 25 54 46 100 46 102 0 11+107 216 146 282 10 17 35 57 54 89 19 32 42 71 51 86 9 15 22 35 29 43 7 8 20+28 29 44 38 67 100 158 161 236 36 46 75 96 87 112 12 15 30 37 40 48 10 11+43 49 73 85 95 112 111 130 271 290 85 86 196 189 245 230 49 41 94 80 99 86+10 11 75 60 201 152 166 122 224 162 232 162 5 0 17 9 27 20 10 11 23 20 29+20 6 0 43 21 81 45 39 25 88 54 110 65 22 11 58 31 80 44 22 14 78 44 125 66+97 48 107 53 135 67 37 19 110 51 165 73 30 12 69 28 85 35 17 6 46 19 65 27+19 8 76 27 125 42 50 16 112 37 139 47 27 11 55 19 64 19 8 0 40 9 71 19 203+69 703 158 971 172 244 13 731 2 897 -21z"/>+<path d="M4880 9440 c-144 -10 -352 -30 -370 -35 -8 -3 -60 -11 -115 -20 -169+-26 -258 -43 -304 -59 -24 -9 -51 -16 -60 -16 -17 0 -121 -30 -206 -60 -27+-10 -86 -28 -130 -40 -44 -12 -84 -26 -90 -30 -5 -4 -34 -15 -62 -24 -29 -10+-53 -22 -53 -27 0 -5 -9 -9 -20 -9 -11 0 -41 -10 -67 -21 -45 -20 -56 -25+-100 -48 -10 -5 -74 -36 -143 -70 -141 -69 -180 -91 -357 -200 -48 -30 -109+-70 -135 -90 -26 -20 -71 -52 -99 -71 -28 -19 -58 -42 -68 -50 -9 -9 -34 -28+-56 -43 -22 -14 -58 -43 -80 -63 -22 -19 -65 -56 -95 -82 -120 -101 -420 -412+-501 -517 -13 -16 -26 -32 -29 -35 -32 -29 -260 -352 -260 -369 0 -5 -4 -11+-9 -13 -11 -4 -45 -60 -67 -110 -9 -21 -20 -38 -25 -38 -5 0 -9 -9 -9 -20 0+-11 -4 -20 -9 -20 -5 0 -54 -91 -109 -202 -124 -251 -163 -342 -213 -503 -12+-38 -25 -77 -29 -85 -4 -9 -11 -31 -14 -50 -4 -19 -16 -57 -26 -85 -17 -47+-35 -114 -76 -275 -9 -36 -20 -99 -25 -140 -5 -41 -14 -88 -19 -105 -5 -16+-14 -73 -20 -125 -6 -52 -15 -126 -20 -165 -5 -38 -10 -229 -10 -424 -1 -367+2 -413 51 -706 30 -181 95 -453 129 -539 5 -11 27 -79 50 -149 38 -119 50+-152 85 -232 46 -103 75 -175 75 -184 0 -6 5 -11 10 -11 6 0 10 -6 10 -12 0+-7 6 -25 14 -39 7 -14 26 -66 42 -115 28 -86 28 -95 29 -304 l0 -215 -58 -180+c-32 -99 -68 -209 -79 -245 -21 -67 -42 -129 -72 -215 -10 -27 -22 -63 -26+-80 -25 -91 -72 -246 -85 -285 -9 -25 -28 -81 -42 -125 -14 -44 -33 -102 -43+-130 -65 -184 -90 -275 -90 -328 0 -72 29 -134 78 -167 33 -22 50 -25 144 -28+91 -3 113 -1 153 17 26 12 57 21 68 21 11 0 45 9 76 19 31 11 90 29 131 41 41+11 104 29 140 40 36 10 92 26 125 35 33 9 80 24 105 33 25 8 61 19 80 23 19 4+55 14 80 22 25 8 79 24 120 36 133 38 203 59 320 95 243 74 271 79 452 78 91+0 181 -4 200 -10 18 -5 68 -18 111 -27 42 -10 80 -21 83 -26 3 -5 12 -9 20 -9+15 0 64 -20 149 -60 73 -34 134 -60 143 -60 4 0 27 -9 50 -20 22 -11 46 -20+52 -20 6 0 59 -15 118 -34 283 -89 553 -156 632 -156 19 0 73 -7 120 -15 155+-26 569 -39 836 -26 131 6 273 18 314 26 41 8 93 14 115 14 37 1 95 12 305 62+160 38 440 122 493 150 22 10 45 19 53 19 8 0 31 9 51 20 21 11 43 20 50 20 6+0 51 18 100 41 48 22 102 46 118 54 44 19 155 75 195 98 19 11 46 27 60 34 14+8 39 23 55 33 17 11 44 26 60 35 17 8 50 28 75 45 25 16 52 33 60 37 8 3 17 9+20 13 3 3 39 28 80 55 76 50 298 221 336 259 11 12 47 44 79 71 104 89 216+198 303 295 46 52 99 111 116 130 42 46 163 202 207 265 19 28 36 52 39 55 3+3 10 12 15 21 6 10 25 38 43 63 17 26 32 51 32 56 0 4 4 10 8 12 9 4 102 143+102 152 0 4 26 53 58 109 57 99 73 131 126 250 14 31 37 81 50 110 32 72 86+214 86 227 0 5 4 18 9 28 5 9 19 49 30 87 95 326 100 421 22 493 -46 42 -60+48 -146 56 -79 8 -138 30 -173 65 -41 41 -102 177 -152 341 -13 41 -29 95 -37+120 -8 25 -20 71 -27 103 l-13 58 32 13 c17 8 43 17 56 21 41 12 119 48 119+55 0 4 12 12 26 19 48 22 194 142 226 187 17 24 34 44 38 44 4 0 17 24 31 53+13 28 26 54 30 57 3 3 14 28 23 55 10 28 21 57 26 66 12 23 38 173 45 259 3+41 1 109 -4 150 -25 186 -32 228 -45 270 -7 25 -19 65 -27 90 -7 25 -16 49+-21 54 -4 6 -8 19 -8 30 0 30 -94 295 -147 416 -66 149 -106 231 -163 335 -18+33 -48 88 -66 122 -19 34 -44 77 -56 96 -13 19 -39 60 -58 92 -19 32 -42 65+-50 74 -18 20 -100 140 -100 146 0 6 -159 206 -175 220 -6 6 -31 35 -55 65+-57 71 -325 339 -415 415 -38 32 -76 65 -84 73 -52 51 -427 317 -521 369 -52+29 -83 46 -167 95 -120 68 -360 177 -548 248 -33 13 -69 26 -80 30 -37 14+-189 59 -330 98 -184 51 -425 94 -630 113 -338 30 -499 34 -725 19z m575 -230+c132 -11 260 -25 285 -30 25 -5 74 -14 110 -19 178 -27 536 -122 648 -172 23+-10 48 -19 55 -19 6 -1 30 -9 52 -20 22 -11 45 -19 50 -20 6 0 30 -10 55 -21+25 -12 59 -28 75 -35 106 -45 304 -147 395 -203 19 -11 49 -28 67 -36 17 -8+34 -19 38 -24 3 -5 29 -24 58 -41 45 -27 72 -45 171 -112 14 -10 177 -137 237+-186 101 -81 332 -308 434 -427 107 -124 119 -137 135 -155 15 -17 26 -32 61+-87 12 -18 25 -33 30 -33 5 0 9 -5 9 -12 0 -6 8 -21 19 -32 43 -48 227 -334+254 -396 4 -8 18 -33 32 -55 40 -65 155 -302 155 -318 0 -9 4 -18 9 -21 5 -3+12 -18 15 -32 4 -14 15 -45 25 -68 22 -51 42 -104 110 -296 7 -19 17 -55 23+-80 6 -25 14 -50 19 -55 4 -6 13 -40 19 -75 5 -36 15 -83 20 -105 5 -22 12+-80 16 -130 5 -86 -2 -142 -34 -268 -13 -49 -71 -163 -94 -184 -10 -9 -18 -20+-18 -24 0 -14 -111 -116 -150 -138 -78 -44 -154 -81 -166 -81 -7 0 -15 15 -18+33 -2 17 -14 88 -25 157 -12 69 -21 135 -21 146 0 12 -9 68 -20 125 -10 57+-29 158 -40 224 -36 199 -57 250 -122 291 -28 18 -52 24 -95 24 -109 0 -171+-61 -267 -265 -16 -33 -33 -68 -38 -78 -13 -27 -87 -234 -98 -276 -5 -20 -24+-81 -43 -136 -19 -55 -39 -120 -46 -145 -7 -25 -19 -70 -28 -100 -8 -30 -21+-80 -28 -110 -25 -109 -47 -196 -61 -245 -7 -27 -25 -99 -38 -160 -75 -338+-83 -430 -44 -472 18 -19 32 -23 78 -23 42 0 61 5 72 18 15 18 52 154 63 232+4 25 10 59 15 75 5 17 14 62 19 100 11 80 39 200 54 232 8 18 12 20 21 9 14+-17 210 -172 234 -185 23 -12 132 -101 233 -190 126 -110 230 -203 253 -227+36 -36 124 -93 168 -110 65 -24 140 -44 166 -44 13 0 33 -5 44 -11 17 -9 19+-17 14 -50 -11 -69 -76 -265 -136 -414 -40 -97 -48 -116 -75 -180 -19 -46+-115 -235 -141 -280 -13 -22 -28 -49 -34 -60 -5 -11 -21 -38 -35 -60 -13 -22+-32 -53 -41 -69 -9 -16 -20 -34 -25 -40 -5 -6 -38 -55 -74 -109 -70 -106 -172+-243 -228 -308 -117 -136 -170 -192 -287 -309 -147 -147 -226 -220 -240 -220+-5 0 -13 -6 -17 -14 -4 -8 -39 -38 -78 -67 -38 -29 -75 -58 -81 -64 -6 -5 -20+-16 -30 -23 -11 -7 -41 -28 -69 -48 -61 -44 -244 -164 -250 -164 -2 0 -21 -12+-42 -26 -21 -14 -103 -57 -183 -95 -80 -38 -153 -74 -162 -79 -35 -20 -54 -29+-136 -64 -46 -20 -88 -36 -93 -36 -5 0 -28 -9 -52 -19 -99 -45 -439 -149 -542+-166 -22 -4 -78 -15 -125 -25 -258 -56 -378 -70 -690 -77 -245 -5 -522 12+-666 41 -38 8 -125 24 -194 36 -115 20 -179 36 -316 75 -28 8 -57 15 -66 15+-8 0 -33 9 -56 20 -22 11 -48 20 -58 20 -9 0 -30 7 -47 15 -31 14 -83 33 -162+60 -39 13 -86 31 -197 76 -102 41 -184 68 -273 91 -79 20 -114 23 -290 23+-156 0 -218 -4 -280 -18 -44 -10 -100 -22 -125 -28 -39 -8 -92 -23 -290 -83+-25 -7 -79 -24 -120 -36 -41 -12 -100 -30 -130 -40 -30 -10 -90 -27 -132 -39+-184 -50 -236 -64 -278 -77 -25 -7 -79 -23 -120 -34 -41 -12 -103 -30 -136+-41 -34 -10 -68 -19 -75 -19 -8 0 -27 -7 -43 -15 -16 -8 -47 -18 -69 -22 l-40+-6 7 39 c7 36 26 100 66 219 42 122 90 275 90 285 0 5 8 29 19 53 10 23 28 78+41 122 12 44 30 103 39 130 10 28 35 104 56 170 21 66 46 144 57 173 10 29 18+60 18 70 0 9 9 39 19 67 62 162 88 394 66 588 -8 62 -20 132 -28 157 -8 25+-18 62 -22 84 -6 35 -14 58 -50 141 -8 17 -25 59 -40 95 -15 36 -32 79 -39 95+-48 110 -96 235 -96 246 0 5 -9 28 -19 52 -19 43 -91 291 -91 316 0 7 -8 43+-19 79 -32 113 -60 274 -86 487 -23 187 -20 616 5 829 31 258 95 577 158 781+19 63 24 75 71 192 12 28 21 57 21 62 0 6 8 30 19 54 10 23 26 62 35 87 25 64+47 112 101 220 69 137 89 175 98 178 4 2 7 11 7 20 0 10 9 28 20 42 11 14 20+28 20 32 0 6 21 40 61 98 23 35 115 175 125 192 6 10 18 26 27 36 10 10 17 24+17 30 0 7 4 12 9 12 4 0 27 27 51 61 41 59 65 88 113 139 13 14 44 49 68 79+79 98 435 441 457 441 4 0 15 8 24 18 24 26 69 62 111 90 20 13 37 29 37 33 0+5 4 9 9 9 8 0 118 70 146 92 18 15 86 58 91 58 3 0 13 8 24 18 10 9 40 28 66+42 27 14 84 45 129 70 70 40 244 127 300 150 127 53 175 74 202 86 17 8 38 14+47 14 8 0 35 9 58 19 92 40 342 111 533 150 210 42 286 54 475 71 261 23 399+23 685 0z m2880 -3287 c3 -27 13 -82 22 -123 9 -41 22 -124 29 -185 18 -152+33 -247 51 -334 9 -40 16 -90 17 -109 l1 -36 -80 -18 c-44 -9 -105 -17 -135+-18 -30 -1 -95 -7 -144 -14 -106 -15 -109 -12 -79 78 11 34 31 97 43 141 12+44 31 102 41 129 11 27 19 55 19 62 0 8 4 22 10 32 5 9 24 60 40 112 60 185+125 327 152 329 4 1 10 -20 13 -46z m173 -1008 c7 -14 15 -45 18 -68 3 -23 13+-60 21 -82 8 -22 21 -66 28 -98 11 -53 10 -56 -5 -42 -9 8 -20 15 -25 15 -4 0+-13 6 -19 14 -6 8 -60 53 -121 100 -176 136 -178 138 -163 147 7 5 40 9 73 10+33 0 80 6 105 13 66 20 76 18 88 -9z"/>+<path d="M1945 6207 c-85 -33 -207 -141 -268 -237 -65 -102 -65 -102 -90 -155+-102 -216 -136 -368 -144 -637 -7 -252 5 -357 70 -586 9 -29 35 -88 59 -130+43 -76 143 -192 166 -192 7 0 12 -4 12 -9 0 -5 16 -15 35 -22 19 -7 35 -16 35+-19 0 -20 95 -35 220 -35 l135 1 80 39 c60 29 96 55 145 106 91 95 120 133+136 182 4 9 10 17 15 17 5 0 9 9 9 20 0 11 5 20 10 20 6 0 10 6 10 13 0 6 9+30 19 52 24 49 44 103 65 175 19 63 66 325 66 368 0 16 6 34 13 39 15 13 148+56 153 50 8 -8 23 -154 24 -225 0 -53 -5 -84 -20 -114 -11 -23 -20 -46 -20+-51 0 -5 -6 -23 -14 -40 -36 -78 -65 -161 -118 -332 -12 -38 -30 -94 -40 -123+-10 -29 -18 -63 -18 -76 0 -13 -6 -46 -14 -72 -29 -101 -48 -196 -56 -281 -5+-49 -14 -126 -21 -173 -13 -96 -7 -314 11 -370 21 -67 54 -125 82 -148 57 -48+169 -61 233 -28 31 16 75 58 75 73 0 6 5 13 11 15 5 2 14 19 19 38 5 19 16 60+24 90 22 83 54 281 67 415 6 66 13 335 15 598 2 263 6 488 10 500 29 94 161+255 245 297 74 38 140 7 185 -88 26 -54 28 -64 28 -202 0 -108 -5 -162 -18+-210 -39 -138 -104 -240 -181 -281 -18 -10 -63 -23 -99 -30 -104 -18 -142 -72+-117 -166 9 -34 18 -44 51 -57 167 -67 524 -9 735 119 67 40 66 40 89 9 20+-28 65 -74 101 -103 9 -7 48 -24 87 -37 126 -43 255 -27 387 48 62 36 181 144+212 194 11 19 25 34 30 34 5 0 9 -51 9 -112 1 -130 6 -142 72 -159 39 -11 51+-10 81 4 38 18 43 31 67 182 27 165 102 448 141 528 11 22 19 43 19 49 0 11+89 191 99 198 3 3 11 14 17 25 14 26 74 67 92 63 29 -6 54 -54 59 -114 3 -35+-4 -133 -17 -239 -16 -123 -23 -237 -24 -360 -1 -170 0 -183 23 -228 42 -87+104 -128 201 -135 124 -9 234 79 335 270 33 64 34 64 68 -35 42 -118 123 -216+195 -236 161 -45 260 35 332 269 13 41 31 100 41 130 9 30 27 98 38 150 11 52+31 140 43 195 l22 100 18 -90 c9 -49 17 -108 18 -130 0 -22 5 -60 11 -85 6+-25 16 -76 24 -115 23 -119 41 -177 79 -258 68 -142 144 -190 280 -173 47 6+62 14 100 49 77 74 192 358 241 602 9 44 25 119 36 167 10 48 19 97 19 110 0+13 9 79 20 148 48 306 67 793 34 862 -24 52 -90 73 -147 47 -44 -20 -48 -37+-53 -287 -2 -130 -9 -273 -14 -317 -5 -44 -14 -125 -20 -180 -13 -124 -36+-272 -60 -390 -11 -49 -24 -112 -29 -140 -24 -116 -42 -189 -56 -216 -8 -15+-15 -34 -15 -40 0 -24 -52 -144 -77 -177 -24 -31 -26 -32 -43 -17 -19 17 -52+108 -70 189 -5 22 -16 68 -24 101 -31 126 -46 201 -46 228 0 16 -9 88 -19 160+-19 127 -46 339 -61 478 -14 135 -97 202 -190 154 -37 -19 -70 -82 -70 -132 0+-21 -9 -83 -19 -138 -11 -55 -29 -156 -41 -225 -11 -69 -27 -156 -35 -195 -8+-38 -17 -90 -21 -115 -3 -25 -15 -76 -26 -115 -11 -38 -26 -95 -35 -125 -38+-137 -79 -236 -108 -260 -27 -22 -45 10 -98 175 -20 61 -46 150 -58 200 -21+85 -21 91 -6 135 9 25 19 65 23 90 3 25 14 79 24 120 10 41 21 98 24 125 4 28+11 79 16 115 54 366 48 624 -17 745 -57 105 -228 135 -312 54 -88 -83 -124+-268 -102 -519 26 -307 46 -461 78 -610 27 -123 28 -199 3 -272 -25 -71 -44+-116 -71 -170 -11 -20 -19 -44 -19 -52 0 -9 -4 -16 -9 -16 -5 0 -16 -15 -24+-32 -18 -39 -74 -98 -92 -98 -25 0 -46 40 -55 100 -6 43 -4 103 6 194 43 389+43 560 1 644 -24 47 -68 102 -82 102 -4 0 -18 9 -32 20 -21 16 -41 20 -100 20+-62 0 -82 -4 -121 -27 -50 -28 -101 -76 -143 -133 -26 -36 -119 -218 -119+-235 0 -6 -7 -19 -15 -29 -13 -17 -14 0 -8 141 l6 160 -33 31 c-36 35 -66 40+-108 18 -56 -29 -59 -39 -67 -211 -9 -210 -39 -342 -102 -454 -14 -25 -31 -55+-37 -66 -27 -49 -89 -135 -122 -169 -50 -52 -103 -83 -173 -102 -53 -15 -66+-16 -103 -4 -44 14 -118 80 -118 104 0 8 17 26 38 42 20 15 96 86 168 158 100+101 140 149 173 209 81 146 103 298 60 409 -23 61 -39 82 -94 123 -36 27 -49+30 -128 34 -108 4 -180 -19 -250 -81 -44 -37 -137 -164 -137 -185 0 -5 -9 -28+-20 -51 -11 -22 -20 -47 -20 -54 0 -7 -10 -42 -22 -78 -19 -57 -22 -90 -23+-258 l-2 -193 -34 -22 c-19 -12 -43 -28 -54 -34 -31 -20 -138 -70 -162 -77+-13 -3 -33 -9 -45 -12 l-21 -6 23 38 c119 198 169 412 141 609 -28 199 -104+319 -239 381 -69 31 -186 33 -247 4 -22 -11 -44 -19 -49 -20 -9 0 -96 -70+-140 -113 -34 -33 -35 -32 -60 64 -31 116 -103 155 -203 110 -26 -12 -67 -31+-91 -42 -24 -11 -47 -17 -51 -14 -5 2 -11 46 -14 97 -3 51 -15 133 -27 181+-21 87 -77 225 -102 251 -7 7 -20 24 -28 36 -20 30 -119 105 -150 115 -14 4+-31 12 -38 18 -8 6 -53 13 -100 15 -71 3 -97 0 -139 -17 l-52 -20 -6 29 c-13+59 -73 83 -140 57z m4197 -268 c11 -69 10 -282 -2 -414 -7 -66 -13 -121 -15+-123 -8 -8 -35 280 -35 368 0 89 21 221 34 217 6 -2 14 -24 18 -48z m-3807 -5+c89 -37 150 -174 176 -395 15 -131 12 -144 -39 -135 -156 25 -265 95 -328 211+-24 44 -28 62 -28 140 0 78 3 96 23 128 44 71 108 88 196 51z m-420 -26 c-4+-13 -10 -71 -12 -131 -5 -123 8 -181 64 -283 91 -167 260 -272 462 -288 40 -4+77 -8 80 -11 11 -6 -14 -180 -39 -270 -41 -154 -59 -200 -122 -314 -39 -69+-70 -107 -145 -171 -34 -29 -112 -53 -173 -54 -56 -1 -74 4 -129 34 -53 29+-72 46 -107 100 -52 80 -67 118 -99 234 -52 195 -55 533 -5 706 10 36 22 82+26 103 3 20 10 40 15 43 5 3 9 15 9 27 0 12 9 36 20 52 11 17 20 38 20 48 0 9+3 17 8 17 4 0 14 15 21 32 23 51 91 147 105 148 4 0 5 -10 1 -22z m2540 -642+c28 -23 30 -28 28 -89 -1 -47 -9 -79 -26 -114 -38 -74 -143 -208 -211 -268+l-61 -55 -8 28 c-19 65 35 296 92 392 39 65 109 130 140 130 9 0 29 -11 46+-24z m-1534 -1326 c-5 -102 -17 -225 -26 -275 -19 -107 -56 -229 -69 -230 -40+-1 -40 375 -1 575 26 130 57 262 79 337 l21 72 3 -147 c1 -81 -2 -230 -7 -332z"/>+</g>+</svg>diff --git a/docs/logo/openwa_logo.png b/docs/logo/openwa_logo.pngnew file mode 100644index 000000000..e650c6855Binary files /dev/null and b/docs/logo/openwa_logo.png differdiff --git a/docs/logo/openwa_logo.psd b/docs/logo/openwa_logo.psdnew file mode 100644index 000000000..d8f80b1f1Binary files /dev/null and b/docs/logo/openwa_logo.psd differdiff --git a/docs/logo/openwa_logo.webp b/docs/logo/openwa_logo.webpnew file mode 100644index 000000000..2fcab7f78Binary files /dev/null and b/docs/logo/openwa_logo.webp differdiff --git a/eslint.config.mjs b/eslint.config.mjsnew file mode 100644index 000000000..4e9f8271c--- /dev/null+++ b/eslint.config.mjs@@ -0,0 +1,35 @@+// @ts-check+import eslint from '@eslint/js';+import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';+import globals from 'globals';+import tseslint from 'typescript-eslint';++export default tseslint.config(+ {+ ignores: ['eslint.config.mjs'],+ },+ eslint.configs.recommended,+ ...tseslint.configs.recommendedTypeChecked,+ eslintPluginPrettierRecommended,+ {+ languageOptions: {+ globals: {+ ...globals.node,+ ...globals.jest,+ },+ sourceType: 'commonjs',+ parserOptions: {+ projectService: true,+ tsconfigRootDir: import.meta.dirname,+ },+ },+ },+ {+ rules: {+ '@typescript-eslint/no-explicit-any': 'off',+ '@typescript-eslint/no-floating-promises': 'warn',+ '@typescript-eslint/no-unsafe-argument': 'warn',+ "prettier/prettier": ["error", { endOfLine: "auto" }],+ },+ },+);diff --git a/nest-cli.json b/nest-cli.jsonnew file mode 100644index 000000000..f9aa683b1--- /dev/null+++ b/nest-cli.json@@ -0,0 +1,8 @@+{+ "$schema": "https://json.schemastore.org/nest-cli",+ "collection": "@nestjs/schematics",+ "sourceRoot": "src",+ "compilerOptions": {+ "deleteOutDir": true+ }+}diff --git a/package-lock.json b/package-lock.jsonnew file mode 100644index 000000000..d68a055a3--- /dev/null+++ b/package-lock.json@@ -0,0 +1,16999 @@+{+ "name": "openwa",+ "version": "0.2.1",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "openwa",+ "version": "0.2.1",+ "hasInstallScript": true,+ "license": "MIT",+ "dependencies": {+ "@aws-sdk/client-s3": "^3.983.0",+ "@bull-board/api": "^6.16.4",+ "@bull-board/express": "^6.16.4",+ "@bull-board/nestjs": "^6.16.4",+ "@nestjs-modules/ioredis": "^2.0.2",+ "@nestjs/bullmq": "^11.0.4",+ "@nestjs/common": "^11.0.1",+ "@nestjs/config": "^4.0.2",+ "@nestjs/core": "^11.0.1",+ "@nestjs/platform-express": "^11.0.1",+ "@nestjs/platform-socket.io": "^11.1.12",+ "@nestjs/swagger": "^11.2.5",+ "@nestjs/throttler": "^6.5.0",+ "@nestjs/typeorm": "^11.0.0",+ "archiver": "^7.0.1",+ "bullmq": "^5.67.2",+ "class-transformer": "^0.5.1",+ "class-validator": "^0.14.1",+ "dockerode": "^4.0.9",+ "helmet": "^8.0.0",+ "ioredis": "^5.9.2",+ "pg": "^8.18.0",+ "qrcode": "^1.5.4",+ "reflect-metadata": "^0.2.2",+ "rxjs": "^7.8.1",+ "socket.io": "^4.8.3",+ "sqlite3": "^5.1.7",+ "tar-stream": "^3.1.7",+ "typeorm": "^0.3.20",+ "uuid": "^11.0.5",+ "whatsapp-web.js": "^1.26.1-alpha.3"+ },+ "devDependencies": {+ "@eslint/eslintrc": "^3.2.0",+ "@eslint/js": "^9.18.0",+ "@nestjs/cli": "^11.0.0",+ "@nestjs/schematics": "^11.0.0",+ "@nestjs/testing": "^11.0.1",+ "@types/archiver": "^7.0.0",+ "@types/dockerode": "^4.0.1",+ "@types/express": "^5.0.0",+ "@types/jest": "^30.0.0",+ "@types/node": "^22.10.7",+ "@types/qrcode": "^1.5.5",+ "@types/supertest": "^6.0.2",+ "@types/tar-stream": "^3.1.4",+ "@types/uuid": "^10.0.0",+ "concurrently": "^9.2.1",+ "eslint": "^9.18.0",+ "eslint-config-prettier": "^10.0.1",+ "eslint-plugin-prettier": "^5.2.2",+ "globals": "^16.0.0",+ "jest": "^30.0.0",+ "prettier": "^3.4.2",+ "source-map-support": "^0.5.21",+ "supertest": "^7.0.0",+ "ts-jest": "^29.2.5",+ "ts-loader": "^9.5.2",+ "ts-node": "^10.9.2",+ "tsconfig-paths": "^4.2.0",+ "typescript": "^5.7.3",+ "typescript-eslint": "^8.20.0"+ }+ },+ "node_modules/@angular-devkit/core": {+ "version": "19.2.19",+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-19.2.19.tgz",+ "integrity": "sha512-JbLL+4IMLMBgjLZlnPG4lYDfz4zGrJ/s6Aoon321NJKuw1Kb1k5KpFu9dUY0BqLIe8xPQ2UJBpI+xXdK5MXMHQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ajv": "8.17.1",+ "ajv-formats": "3.0.1",+ "jsonc-parser": "3.3.1",+ "picomatch": "4.0.2",+ "rxjs": "7.8.1",+ "source-map": "0.7.4"+ },+ "engines": {+ "node": "^18.19.1 || ^20.11.1 || >=22.0.0",+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",+ "yarn": ">= 1.13.0"+ },+ "peerDependencies": {+ "chokidar": "^4.0.0"+ },+ "peerDependenciesMeta": {+ "chokidar": {+ "optional": true+ }+ }+ },+ "node_modules/@angular-devkit/core/node_modules/ajv": {+ "version": "8.17.1",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/@angular-devkit/core/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@angular-devkit/core/node_modules/rxjs": {+ "version": "7.8.1",+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",+ "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.1.0"+ }+ },+ "node_modules/@angular-devkit/schematics": {+ "version": "19.2.19",+ "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-19.2.19.tgz",+ "integrity": "sha512-J4Jarr0SohdrHcb40gTL4wGPCQ952IMWF1G/MSAQfBAPvA9ZKApYhpxcY7PmehVePve+ujpus1dGsJ7dPxz8Kg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@angular-devkit/core": "19.2.19",+ "jsonc-parser": "3.3.1",+ "magic-string": "0.30.17",+ "ora": "5.4.1",+ "rxjs": "7.8.1"+ },+ "engines": {+ "node": "^18.19.1 || ^20.11.1 || >=22.0.0",+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",+ "yarn": ">= 1.13.0"+ }+ },+ "node_modules/@angular-devkit/schematics-cli": {+ "version": "19.2.19",+ "resolved": "https://registry.npmjs.org/@angular-devkit/schematics-cli/-/schematics-cli-19.2.19.tgz",+ "integrity": "sha512-7q9UY6HK6sccL9F3cqGRUwKhM7b/XfD2YcVaZ2WD7VMaRlRm85v6mRjSrfKIAwxcQU0UK27kMc79NIIqaHjzxA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@angular-devkit/core": "19.2.19",+ "@angular-devkit/schematics": "19.2.19",+ "@inquirer/prompts": "7.3.2",+ "ansi-colors": "4.1.3",+ "symbol-observable": "4.0.0",+ "yargs-parser": "21.1.1"+ },+ "bin": {+ "schematics": "bin/schematics.js"+ },+ "engines": {+ "node": "^18.19.1 || ^20.11.1 || >=22.0.0",+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",+ "yarn": ">= 1.13.0"+ }+ },+ "node_modules/@angular-devkit/schematics-cli/node_modules/@inquirer/prompts": {+ "version": "7.3.2",+ "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.3.2.tgz",+ "integrity": "sha512-G1ytyOoHh5BphmEBxSwALin3n1KGNYB6yImbICcRQdzXfOGbuJ9Jske/Of5Sebk339NSGGNfUshnzK8YWkTPsQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/checkbox": "^4.1.2",+ "@inquirer/confirm": "^5.1.6",+ "@inquirer/editor": "^4.2.7",+ "@inquirer/expand": "^4.0.9",+ "@inquirer/input": "^4.1.6",+ "@inquirer/number": "^3.0.9",+ "@inquirer/password": "^4.0.9",+ "@inquirer/rawlist": "^4.0.9",+ "@inquirer/search": "^3.0.9",+ "@inquirer/select": "^4.0.9"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@angular-devkit/schematics/node_modules/rxjs": {+ "version": "7.8.1",+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",+ "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.1.0"+ }+ },+ "node_modules/@aws-crypto/crc32": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz",+ "integrity": "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/util": "^5.2.0",+ "@aws-sdk/types": "^3.222.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=16.0.0"+ }+ },+ "node_modules/@aws-crypto/crc32c": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@aws-crypto/crc32c/-/crc32c-5.2.0.tgz",+ "integrity": "sha512-+iWb8qaHLYKrNvGRbiYRHSdKRWhto5XlZUEBwDjYNf+ly5SVYG6zEoYIdxvf5R3zyeP16w4PLBn3rH1xc74Rag==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/util": "^5.2.0",+ "@aws-sdk/types": "^3.222.0",+ "tslib": "^2.6.2"+ }+ },+ "node_modules/@aws-crypto/sha1-browser": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha1-browser/-/sha1-browser-5.2.0.tgz",+ "integrity": "sha512-OH6lveCFfcDjX4dbAvCFSYUjJZjDr/3XJ3xHtjn3Oj5b9RjojQo8npoLeA/bNwkOkrSQ0wgrHzXk4tDRxGKJeg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/supports-web-crypto": "^5.2.0",+ "@aws-crypto/util": "^5.2.0",+ "@aws-sdk/types": "^3.222.0",+ "@aws-sdk/util-locate-window": "^3.0.0",+ "@smithy/util-utf8": "^2.0.0",+ "tslib": "^2.6.2"+ }+ },+ "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/is-array-buffer": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz",+ "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-buffer-from": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz",+ "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/is-array-buffer": "^2.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz",+ "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/util-buffer-from": "^2.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-crypto/sha256-browser": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz",+ "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/sha256-js": "^5.2.0",+ "@aws-crypto/supports-web-crypto": "^5.2.0",+ "@aws-crypto/util": "^5.2.0",+ "@aws-sdk/types": "^3.222.0",+ "@aws-sdk/util-locate-window": "^3.0.0",+ "@smithy/util-utf8": "^2.0.0",+ "tslib": "^2.6.2"+ }+ },+ "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/is-array-buffer": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz",+ "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz",+ "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/is-array-buffer": "^2.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz",+ "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/util-buffer-from": "^2.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-crypto/sha256-js": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz",+ "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/util": "^5.2.0",+ "@aws-sdk/types": "^3.222.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=16.0.0"+ }+ },+ "node_modules/@aws-crypto/supports-web-crypto": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz",+ "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ }+ },+ "node_modules/@aws-crypto/util": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz",+ "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.222.0",+ "@smithy/util-utf8": "^2.0.0",+ "tslib": "^2.6.2"+ }+ },+ "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz",+ "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz",+ "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/is-array-buffer": "^2.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz",+ "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/util-buffer-from": "^2.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@aws-sdk/client-s3": {+ "version": "3.983.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.983.0.tgz",+ "integrity": "sha512-V40PT2irPh3lj+Z95tZI6batVrjaTrWEOXRNVBuoZSgpM3Ak1jiE9ZXwVLkMcbb9/GH4xVpB3EsGM7gbxmgFLQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/sha1-browser": "5.2.0",+ "@aws-crypto/sha256-browser": "5.2.0",+ "@aws-crypto/sha256-js": "5.2.0",+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/credential-provider-node": "^3.972.5",+ "@aws-sdk/middleware-bucket-endpoint": "^3.972.3",+ "@aws-sdk/middleware-expect-continue": "^3.972.3",+ "@aws-sdk/middleware-flexible-checksums": "^3.972.4",+ "@aws-sdk/middleware-host-header": "^3.972.3",+ "@aws-sdk/middleware-location-constraint": "^3.972.3",+ "@aws-sdk/middleware-logger": "^3.972.3",+ "@aws-sdk/middleware-recursion-detection": "^3.972.3",+ "@aws-sdk/middleware-sdk-s3": "^3.972.6",+ "@aws-sdk/middleware-ssec": "^3.972.3",+ "@aws-sdk/middleware-user-agent": "^3.972.6",+ "@aws-sdk/region-config-resolver": "^3.972.3",+ "@aws-sdk/signature-v4-multi-region": "3.983.0",+ "@aws-sdk/types": "^3.973.1",+ "@aws-sdk/util-endpoints": "3.983.0",+ "@aws-sdk/util-user-agent-browser": "^3.972.3",+ "@aws-sdk/util-user-agent-node": "^3.972.4",+ "@smithy/config-resolver": "^4.4.6",+ "@smithy/core": "^3.22.0",+ "@smithy/eventstream-serde-browser": "^4.2.8",+ "@smithy/eventstream-serde-config-resolver": "^4.3.8",+ "@smithy/eventstream-serde-node": "^4.2.8",+ "@smithy/fetch-http-handler": "^5.3.9",+ "@smithy/hash-blob-browser": "^4.2.9",+ "@smithy/hash-node": "^4.2.8",+ "@smithy/hash-stream-node": "^4.2.8",+ "@smithy/invalid-dependency": "^4.2.8",+ "@smithy/md5-js": "^4.2.8",+ "@smithy/middleware-content-length": "^4.2.8",+ "@smithy/middleware-endpoint": "^4.4.12",+ "@smithy/middleware-retry": "^4.4.29",+ "@smithy/middleware-serde": "^4.2.9",+ "@smithy/middleware-stack": "^4.2.8",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/node-http-handler": "^4.4.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/smithy-client": "^4.11.1",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "@smithy/util-base64": "^4.3.0",+ "@smithy/util-body-length-browser": "^4.2.0",+ "@smithy/util-body-length-node": "^4.2.1",+ "@smithy/util-defaults-mode-browser": "^4.3.28",+ "@smithy/util-defaults-mode-node": "^4.2.31",+ "@smithy/util-endpoints": "^3.2.8",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-retry": "^4.2.8",+ "@smithy/util-stream": "^4.5.10",+ "@smithy/util-utf8": "^4.2.0",+ "@smithy/util-waiter": "^4.2.8",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/client-sso": {+ "version": "3.982.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.982.0.tgz",+ "integrity": "sha512-qJrIiivmvujdGqJ0ldSUvhN3k3N7GtPesoOI1BSt0fNXovVnMz4C/JmnkhZihU7hJhDvxJaBROLYTU+lpild4w==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/sha256-browser": "5.2.0",+ "@aws-crypto/sha256-js": "5.2.0",+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/middleware-host-header": "^3.972.3",+ "@aws-sdk/middleware-logger": "^3.972.3",+ "@aws-sdk/middleware-recursion-detection": "^3.972.3",+ "@aws-sdk/middleware-user-agent": "^3.972.6",+ "@aws-sdk/region-config-resolver": "^3.972.3",+ "@aws-sdk/types": "^3.973.1",+ "@aws-sdk/util-endpoints": "3.982.0",+ "@aws-sdk/util-user-agent-browser": "^3.972.3",+ "@aws-sdk/util-user-agent-node": "^3.972.4",+ "@smithy/config-resolver": "^4.4.6",+ "@smithy/core": "^3.22.0",+ "@smithy/fetch-http-handler": "^5.3.9",+ "@smithy/hash-node": "^4.2.8",+ "@smithy/invalid-dependency": "^4.2.8",+ "@smithy/middleware-content-length": "^4.2.8",+ "@smithy/middleware-endpoint": "^4.4.12",+ "@smithy/middleware-retry": "^4.4.29",+ "@smithy/middleware-serde": "^4.2.9",+ "@smithy/middleware-stack": "^4.2.8",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/node-http-handler": "^4.4.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/smithy-client": "^4.11.1",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "@smithy/util-base64": "^4.3.0",+ "@smithy/util-body-length-browser": "^4.2.0",+ "@smithy/util-body-length-node": "^4.2.1",+ "@smithy/util-defaults-mode-browser": "^4.3.28",+ "@smithy/util-defaults-mode-node": "^4.2.31",+ "@smithy/util-endpoints": "^3.2.8",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-retry": "^4.2.8",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints": {+ "version": "3.982.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.982.0.tgz",+ "integrity": "sha512-M27u8FJP7O0Of9hMWX5dipp//8iglmV9jr7R8SR8RveU+Z50/8TqH68Tu6wUWBGMfXjzbVwn1INIAO5lZrlxXQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "@smithy/util-endpoints": "^3.2.8",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/core": {+ "version": "3.973.6",+ "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.973.6.tgz",+ "integrity": "sha512-pz4ZOw3BLG0NdF25HoB9ymSYyPbMiIjwQJ2aROXRhAzt+b+EOxStfFv8s5iZyP6Kiw7aYhyWxj5G3NhmkoOTKw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@aws-sdk/xml-builder": "^3.972.4",+ "@smithy/core": "^3.22.0",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/signature-v4": "^5.3.8",+ "@smithy/smithy-client": "^4.11.1",+ "@smithy/types": "^4.12.0",+ "@smithy/util-base64": "^4.3.0",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/crc64-nvme": {+ "version": "3.972.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/crc64-nvme/-/crc64-nvme-3.972.0.tgz",+ "integrity": "sha512-ThlLhTqX68jvoIVv+pryOdb5coP1cX1/MaTbB9xkGDCbWbsqQcLqzPxuSoW1DCnAAIacmXCWpzUNOB9pv+xXQw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-env": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.4.tgz",+ "integrity": "sha512-/8dnc7+XNMmViEom2xsNdArQxQPSgy4Z/lm6qaFPTrMFesT1bV3PsBhb19n09nmxHdrtQskYmViddUIjUQElXg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-http": {+ "version": "3.972.6",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.6.tgz",+ "integrity": "sha512-5ERWqRljiZv44AIdvIRQ3k+EAV0Sq2WeJHvXuK7gL7bovSxOf8Al7MLH7Eh3rdovH4KHFnlIty7J71mzvQBl5Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/fetch-http-handler": "^5.3.9",+ "@smithy/node-http-handler": "^4.4.8",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/smithy-client": "^4.11.1",+ "@smithy/types": "^4.12.0",+ "@smithy/util-stream": "^4.5.10",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-ini": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.972.4.tgz",+ "integrity": "sha512-eRUg+3HaUKuXWn/lEMirdiA5HOKmEl8hEHVuszIDt2MMBUKgVX5XNGmb3XmbgU17h6DZ+RtjbxQpjhz3SbTjZg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/credential-provider-env": "^3.972.4",+ "@aws-sdk/credential-provider-http": "^3.972.6",+ "@aws-sdk/credential-provider-login": "^3.972.4",+ "@aws-sdk/credential-provider-process": "^3.972.4",+ "@aws-sdk/credential-provider-sso": "^3.972.4",+ "@aws-sdk/credential-provider-web-identity": "^3.972.4",+ "@aws-sdk/nested-clients": "3.982.0",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/credential-provider-imds": "^4.2.8",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-login": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.4.tgz",+ "integrity": "sha512-nLGjXuvWWDlQAp505xIONI7Gam0vw2p7Qu3P6on/W2q7rjJXtYjtpHbcsaOjJ/pAju3eTvEQuSuRedcRHVQIAQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/nested-clients": "3.982.0",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-node": {+ "version": "3.972.5",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.5.tgz",+ "integrity": "sha512-VWXKgSISQCI2GKN3zakTNHSiZ0+mux7v6YHmmbLQp/o3fvYUQJmKGcLZZzg2GFA+tGGBStplra9VFNf/WwxpYg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/credential-provider-env": "^3.972.4",+ "@aws-sdk/credential-provider-http": "^3.972.6",+ "@aws-sdk/credential-provider-ini": "^3.972.4",+ "@aws-sdk/credential-provider-process": "^3.972.4",+ "@aws-sdk/credential-provider-sso": "^3.972.4",+ "@aws-sdk/credential-provider-web-identity": "^3.972.4",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/credential-provider-imds": "^4.2.8",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-process": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.4.tgz",+ "integrity": "sha512-TCZpWUnBQN1YPk6grvd5x419OfXjHvhj5Oj44GYb84dOVChpg/+2VoEj+YVA4F4E/6huQPNnX7UYbTtxJqgihw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-sso": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.972.4.tgz",+ "integrity": "sha512-wzsGwv9mKlwJ3vHLyembBvGE/5nPUIwRR2I51B1cBV4Cb4ql9nIIfpmHzm050XYTY5fqTOKJQnhLj7zj89VG8g==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/client-sso": "3.982.0",+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/token-providers": "3.982.0",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/credential-provider-web-identity": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.4.tgz",+ "integrity": "sha512-hIzw2XzrG8jzsUSEatehmpkd5rWzASg5IHUfA+m01k/RtvfAML7ZJVVohuKdhAYx+wV2AThLiQJVzqn7F0khrw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/nested-clients": "3.982.0",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-bucket-endpoint": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.972.3.tgz",+ "integrity": "sha512-fmbgWYirF67YF1GfD7cg5N6HHQ96EyRNx/rDIrTF277/zTWVuPI2qS/ZHgofwR1NZPe/NWvoppflQY01LrbVLg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@aws-sdk/util-arn-parser": "^3.972.2",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "@smithy/util-config-provider": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-expect-continue": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.972.3.tgz",+ "integrity": "sha512-4msC33RZsXQpUKR5QR4HnvBSNCPLGHmB55oDiROqqgyOc+TOfVu2xgi5goA7ms6MdZLeEh2905UfWMnMMF4mRg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-flexible-checksums": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.972.4.tgz",+ "integrity": "sha512-xOxsUkF3O3BtIe3tf54OpPo94eZepjFm3z0Dd2TZKbsPxMiRTFXurC04wJ58o/wPW9YHVO9VqZik3MfoPfrKlw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/crc32": "5.2.0",+ "@aws-crypto/crc32c": "5.2.0",+ "@aws-crypto/util": "5.2.0",+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/crc64-nvme": "3.972.0",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/is-array-buffer": "^4.2.0",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-stream": "^4.5.10",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-host-header": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.972.3.tgz",+ "integrity": "sha512-aknPTb2M+G3s+0qLCx4Li/qGZH8IIYjugHMv15JTYMe6mgZO8VBpYgeGYsNMGCqCZOcWzuf900jFBG5bopfzmA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-location-constraint": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.972.3.tgz",+ "integrity": "sha512-nIg64CVrsXp67vbK0U1/Is8rik3huS3QkRHn2DRDx4NldrEFMgdkZGI/+cZMKD9k4YOS110Dfu21KZLHrFA/1g==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-logger": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.972.3.tgz",+ "integrity": "sha512-Ftg09xNNRqaz9QNzlfdQWfpqMCJbsQdnZVJP55jfhbKi1+FTWxGuvfPoBhDHIovqWKjqbuiew3HuhxbJ0+OjgA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-recursion-detection": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.972.3.tgz",+ "integrity": "sha512-PY57QhzNuXHnwbJgbWYTrqIDHYSeOlhfYERTAuc16LKZpTZRJUjzBFokp9hF7u1fuGeE3D70ERXzdbMBOqQz7Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@aws/lambda-invoke-store": "^0.2.2",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-sdk-s3": {+ "version": "3.972.6",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.972.6.tgz",+ "integrity": "sha512-Xq7wM6kbgJN1UO++8dvH/efPb1nTwWqFCpZCR7RCLOETP7xAUAhVo7JmsCnML5Di/iC4Oo5VrJ4QmkYcMZniLw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/types": "^3.973.1",+ "@aws-sdk/util-arn-parser": "^3.972.2",+ "@smithy/core": "^3.22.0",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/signature-v4": "^5.3.8",+ "@smithy/smithy-client": "^4.11.1",+ "@smithy/types": "^4.12.0",+ "@smithy/util-config-provider": "^4.2.0",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-stream": "^4.5.10",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-ssec": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.972.3.tgz",+ "integrity": "sha512-dU6kDuULN3o3jEHcjm0c4zWJlY1zWVkjG9NPe9qxYLLpcbdj5kRYBS2DdWYD+1B9f910DezRuws7xDEqKkHQIg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-user-agent": {+ "version": "3.972.6",+ "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.972.6.tgz",+ "integrity": "sha512-TehLN8W/kivl0U9HcS+keryElEWORROpghDXZBLfnb40DXM7hx/i+7OOjkogXQOF3QtUraJVRkHQ07bPhrWKlw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/types": "^3.973.1",+ "@aws-sdk/util-endpoints": "3.982.0",+ "@smithy/core": "^3.22.0",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/middleware-user-agent/node_modules/@aws-sdk/util-endpoints": {+ "version": "3.982.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.982.0.tgz",+ "integrity": "sha512-M27u8FJP7O0Of9hMWX5dipp//8iglmV9jr7R8SR8RveU+Z50/8TqH68Tu6wUWBGMfXjzbVwn1INIAO5lZrlxXQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "@smithy/util-endpoints": "^3.2.8",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/nested-clients": {+ "version": "3.982.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.982.0.tgz",+ "integrity": "sha512-VVkaH27digrJfdVrT64rjkllvOp4oRiZuuJvrylLXAKl18ujToJR7AqpDldL/LS63RVne3QWIpkygIymxFtliQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/sha256-browser": "5.2.0",+ "@aws-crypto/sha256-js": "5.2.0",+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/middleware-host-header": "^3.972.3",+ "@aws-sdk/middleware-logger": "^3.972.3",+ "@aws-sdk/middleware-recursion-detection": "^3.972.3",+ "@aws-sdk/middleware-user-agent": "^3.972.6",+ "@aws-sdk/region-config-resolver": "^3.972.3",+ "@aws-sdk/types": "^3.973.1",+ "@aws-sdk/util-endpoints": "3.982.0",+ "@aws-sdk/util-user-agent-browser": "^3.972.3",+ "@aws-sdk/util-user-agent-node": "^3.972.4",+ "@smithy/config-resolver": "^4.4.6",+ "@smithy/core": "^3.22.0",+ "@smithy/fetch-http-handler": "^5.3.9",+ "@smithy/hash-node": "^4.2.8",+ "@smithy/invalid-dependency": "^4.2.8",+ "@smithy/middleware-content-length": "^4.2.8",+ "@smithy/middleware-endpoint": "^4.4.12",+ "@smithy/middleware-retry": "^4.4.29",+ "@smithy/middleware-serde": "^4.2.9",+ "@smithy/middleware-stack": "^4.2.8",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/node-http-handler": "^4.4.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/smithy-client": "^4.11.1",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "@smithy/util-base64": "^4.3.0",+ "@smithy/util-body-length-browser": "^4.2.0",+ "@smithy/util-body-length-node": "^4.2.1",+ "@smithy/util-defaults-mode-browser": "^4.3.28",+ "@smithy/util-defaults-mode-node": "^4.2.31",+ "@smithy/util-endpoints": "^3.2.8",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-retry": "^4.2.8",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-endpoints": {+ "version": "3.982.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.982.0.tgz",+ "integrity": "sha512-M27u8FJP7O0Of9hMWX5dipp//8iglmV9jr7R8SR8RveU+Z50/8TqH68Tu6wUWBGMfXjzbVwn1INIAO5lZrlxXQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "@smithy/util-endpoints": "^3.2.8",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/region-config-resolver": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.972.3.tgz",+ "integrity": "sha512-v4J8qYAWfOMcZ4MJUyatntOicTzEMaU7j3OpkRCGGFSL2NgXQ5VbxauIyORA+pxdKZ0qQG2tCQjQjZDlXEC3Ow==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/config-resolver": "^4.4.6",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/signature-v4-multi-region": {+ "version": "3.983.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.983.0.tgz",+ "integrity": "sha512-11FCcxI/WKRufKDdPgKPXtrhjDArhkOPb4mf66rICZUnPHlD8Cb7cjZZS/eFC+iuwoHBosrxo0hYsvK3s7DxGw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/middleware-sdk-s3": "^3.972.6",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/signature-v4": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/token-providers": {+ "version": "3.982.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.982.0.tgz",+ "integrity": "sha512-v3M0KYp2TVHYHNBT7jHD9lLTWAdS9CaWJ2jboRKt0WAB65bA7iUEpR+k4VqKYtpQN4+8kKSc4w+K6kUNZkHKQw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/core": "^3.973.6",+ "@aws-sdk/nested-clients": "3.982.0",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/types": {+ "version": "3.973.1",+ "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.1.tgz",+ "integrity": "sha512-DwHBiMNOB468JiX6+i34c+THsKHErYUdNQ3HexeXZvVn4zouLjgaS4FejiGSi2HyBuzuyHg7SuOPmjSvoU9NRg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/util-arn-parser": {+ "version": "3.972.2",+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.972.2.tgz",+ "integrity": "sha512-VkykWbqMjlSgBFDyrY3nOSqupMc6ivXuGmvci6Q3NnLq5kC+mKQe2QBZ4nrWRE/jqOxeFP2uYzLtwncYYcvQDg==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/util-endpoints": {+ "version": "3.983.0",+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.983.0.tgz",+ "integrity": "sha512-t/VbL2X3gvDEjC4gdySOeFFOZGQEBKwa23pRHeB7hBLBZ119BB/2OEFtTFWKyp3bnMQgxpeVeGS7/hxk6wpKJw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "@smithy/util-endpoints": "^3.2.8",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/util-locate-window": {+ "version": "3.965.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.965.4.tgz",+ "integrity": "sha512-H1onv5SkgPBK2P6JR2MjGgbOnttoNzSPIRoeZTNPZYyaplwGg50zS3amXvXqF0/qfXpWEC9rLWU564QTB9bSog==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws-sdk/util-user-agent-browser": {+ "version": "3.972.3",+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.972.3.tgz",+ "integrity": "sha512-JurOwkRUcXD/5MTDBcqdyQ9eVedtAsZgw5rBwktsPTN7QtPiS2Ld1jkJepNgYoCufz1Wcut9iup7GJDoIHp8Fw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/types": "^3.973.1",+ "@smithy/types": "^4.12.0",+ "bowser": "^2.11.0",+ "tslib": "^2.6.2"+ }+ },+ "node_modules/@aws-sdk/util-user-agent-node": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.972.4.tgz",+ "integrity": "sha512-3WFCBLiM8QiHDfosQq3Py+lIMgWlFWwFQliUHUqwEiRqLnKyhgbU3AKa7AWJF7lW2Oc/2kFNY4MlAYVnVc0i8A==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-sdk/middleware-user-agent": "^3.972.6",+ "@aws-sdk/types": "^3.973.1",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ },+ "peerDependencies": {+ "aws-crt": ">=1.0.0"+ },+ "peerDependenciesMeta": {+ "aws-crt": {+ "optional": true+ }+ }+ },+ "node_modules/@aws-sdk/xml-builder": {+ "version": "3.972.4",+ "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.4.tgz",+ "integrity": "sha512-0zJ05ANfYqI6+rGqj8samZBFod0dPPousBjLEqg8WdxSgbMAkRgLyn81lP215Do0rFJ/17LIXwr7q0yK24mP6Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "fast-xml-parser": "5.3.4",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=20.0.0"+ }+ },+ "node_modules/@aws/lambda-invoke-store": {+ "version": "0.2.3",+ "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.2.3.tgz",+ "integrity": "sha512-oLvsaPMTBejkkmHhjf09xTgk71mOqyr/409NKhRIL08If7AhVfUsJhVsx386uJaqNd42v9kWamQ9lFbkoC2dYw==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@babel/code-frame": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",+ "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==",+ "license": "MIT",+ "dependencies": {+ "@babel/helper-validator-identifier": "^7.28.5",+ "js-tokens": "^4.0.0",+ "picocolors": "^1.1.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/compat-data": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz",+ "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/core": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",+ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@babel/code-frame": "^7.29.0",+ "@babel/generator": "^7.29.0",+ "@babel/helper-compilation-targets": "^7.28.6",+ "@babel/helper-module-transforms": "^7.28.6",+ "@babel/helpers": "^7.28.6",+ "@babel/parser": "^7.29.0",+ "@babel/template": "^7.28.6",+ "@babel/traverse": "^7.29.0",+ "@babel/types": "^7.29.0",+ "@jridgewell/remapping": "^2.3.5",+ "convert-source-map": "^2.0.0",+ "debug": "^4.1.0",+ "gensync": "^1.0.0-beta.2",+ "json5": "^2.2.3",+ "semver": "^6.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/babel"+ }+ },+ "node_modules/@babel/core/node_modules/semver": {+ "version": "6.3.1",+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ }+ },+ "node_modules/@babel/generator": {+ "version": "7.29.1",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz",+ "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.29.0",+ "@babel/types": "^7.29.0",+ "@jridgewell/gen-mapping": "^0.3.12",+ "@jridgewell/trace-mapping": "^0.3.28",+ "jsesc": "^3.0.2"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-compilation-targets": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz",+ "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/compat-data": "^7.28.6",+ "@babel/helper-validator-option": "^7.27.1",+ "browserslist": "^4.24.0",+ "lru-cache": "^5.1.1",+ "semver": "^6.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-compilation-targets/node_modules/semver": {+ "version": "6.3.1",+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ }+ },+ "node_modules/@babel/helper-globals": {+ "version": "7.28.0",+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",+ "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-module-imports": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz",+ "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/traverse": "^7.28.6",+ "@babel/types": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-module-transforms": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz",+ "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-module-imports": "^7.28.6",+ "@babel/helper-validator-identifier": "^7.28.5",+ "@babel/traverse": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0"+ }+ },+ "node_modules/@babel/helper-plugin-utils": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz",+ "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-string-parser": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",+ "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-validator-identifier": {+ "version": "7.28.5",+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",+ "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helper-validator-option": {+ "version": "7.27.1",+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",+ "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/helpers": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz",+ "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/template": "^7.28.6",+ "@babel/types": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/parser": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz",+ "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.29.0"+ },+ "bin": {+ "parser": "bin/babel-parser.js"+ },+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@babel/plugin-syntax-async-generators": {+ "version": "7.8.4",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz",+ "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.8.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-bigint": {+ "version": "7.8.3",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz",+ "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.8.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-class-properties": {+ "version": "7.12.13",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz",+ "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.12.13"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-class-static-block": {+ "version": "7.14.5",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz",+ "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.14.5"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-import-attributes": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz",+ "integrity": "sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-import-meta": {+ "version": "7.10.4",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz",+ "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.10.4"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-json-strings": {+ "version": "7.8.3",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz",+ "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.8.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-jsx": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz",+ "integrity": "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-logical-assignment-operators": {+ "version": "7.10.4",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz",+ "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.10.4"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": {+ "version": "7.8.3",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz",+ "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.8.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-numeric-separator": {+ "version": "7.10.4",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz",+ "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.10.4"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-object-rest-spread": {+ "version": "7.8.3",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz",+ "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.8.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-optional-catch-binding": {+ "version": "7.8.3",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz",+ "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.8.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-optional-chaining": {+ "version": "7.8.3",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz",+ "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.8.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-private-property-in-object": {+ "version": "7.14.5",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz",+ "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.14.5"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-top-level-await": {+ "version": "7.14.5",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz",+ "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.14.5"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/plugin-syntax-typescript": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz",+ "integrity": "sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0-0"+ }+ },+ "node_modules/@babel/template": {+ "version": "7.28.6",+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz",+ "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.28.6",+ "@babel/parser": "^7.28.6",+ "@babel/types": "^7.28.6"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/traverse": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz",+ "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.29.0",+ "@babel/generator": "^7.29.0",+ "@babel/helper-globals": "^7.28.0",+ "@babel/parser": "^7.29.0",+ "@babel/template": "^7.28.6",+ "@babel/types": "^7.29.0",+ "debug": "^4.3.1"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@babel/types": {+ "version": "7.29.0",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",+ "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/helper-string-parser": "^7.27.1",+ "@babel/helper-validator-identifier": "^7.28.5"+ },+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/@balena/dockerignore": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz",+ "integrity": "sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q==",+ "license": "Apache-2.0"+ },+ "node_modules/@bcoe/v8-coverage": {+ "version": "0.2.3",+ "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",+ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@borewit/text-codec": {+ "version": "0.2.1",+ "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.1.tgz",+ "integrity": "sha512-k7vvKPbf7J2fZ5klGRD9AeKfUvojuZIQ3BT5u7Jfv+puwXkUBUT5PVyMDfJZpy30CBDXGMgw7fguK/lpOMBvgw==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/Borewit"+ }+ },+ "node_modules/@bull-board/api": {+ "version": "6.16.4",+ "resolved": "https://registry.npmjs.org/@bull-board/api/-/api-6.16.4.tgz",+ "integrity": "sha512-fn4O+QbA3mRj0rEE41mvwbvtiiv0UYgnxQ9ErWb9n74EwIC/yZbiyxQ+Gh/ehU9u7B0PuaNyR0IOG/h3DGo1Mg==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "redis-info": "^3.1.0"+ },+ "peerDependencies": {+ "@bull-board/ui": "6.16.4"+ }+ },+ "node_modules/@bull-board/express": {+ "version": "6.16.4",+ "resolved": "https://registry.npmjs.org/@bull-board/express/-/express-6.16.4.tgz",+ "integrity": "sha512-znKZGrqBtHh3iU73TvJherEY1OforQ10hcLMGer1ktRTD+5BxyLedIlhdZIxJsn+ComQQcmEySbqJSF2b78UOA==",+ "license": "MIT",+ "dependencies": {+ "@bull-board/api": "6.16.4",+ "@bull-board/ui": "6.16.4",+ "ejs": "^3.1.10",+ "express": "^5.2.0"+ }+ },+ "node_modules/@bull-board/nestjs": {+ "version": "6.16.4",+ "resolved": "https://registry.npmjs.org/@bull-board/nestjs/-/nestjs-6.16.4.tgz",+ "integrity": "sha512-up+2aO7Eka4WBVx/Bu3hJ8YSx+eqPKMpcio2PpVPgVIJaofwDMibH1Q1eeBz6fFZrcO5loYk9FBqyQ+ZFp66Cw==",+ "license": "MIT",+ "peerDependencies": {+ "@bull-board/api": "^6.16.4",+ "@nestjs/bull-shared": "^10.0.0 || ^11.0.0",+ "@nestjs/common": "^9.0.0 || ^10.0.0 || ^11.0.0",+ "@nestjs/core": "^9.0.0 || ^10.0.0 || ^11.0.0",+ "reflect-metadata": "^0.1.13 || ^0.2.0",+ "rxjs": "^7.8.1"+ }+ },+ "node_modules/@bull-board/ui": {+ "version": "6.16.4",+ "resolved": "https://registry.npmjs.org/@bull-board/ui/-/ui-6.16.4.tgz",+ "integrity": "sha512-5Yv+4g0rDvBBq2RxaUewSEwD8ywvqCX6lKlzPM5Aaf0+4cxGoENQRZNcBaAIKX4+fAzAbdVB4VGP4NUgtx5LVg==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@bull-board/api": "6.16.4"+ }+ },+ "node_modules/@colors/colors": {+ "version": "1.5.0",+ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",+ "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=0.1.90"+ }+ },+ "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==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/trace-mapping": "0.3.9"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@cspotcode/source-map-support/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==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.0.3",+ "@jridgewell/sourcemap-codec": "^1.4.10"+ }+ },+ "node_modules/@emnapi/core": {+ "version": "1.8.1",+ "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.8.1.tgz",+ "integrity": "sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/wasi-threads": "1.1.0",+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@emnapi/runtime": {+ "version": "1.8.1",+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz",+ "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@emnapi/wasi-threads": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz",+ "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@eslint-community/eslint-utils": {+ "version": "4.9.1",+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",+ "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "eslint-visitor-keys": "^3.4.3"+ },+ "engines": {+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ },+ "peerDependencies": {+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"+ }+ },+ "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {+ "version": "3.4.3",+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/@eslint-community/regexpp": {+ "version": "4.12.2",+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",+ "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"+ }+ },+ "node_modules/@eslint/config-array": {+ "version": "0.21.1",+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz",+ "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@eslint/object-schema": "^2.1.7",+ "debug": "^4.3.1",+ "minimatch": "^3.1.2"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@eslint/config-helpers": {+ "version": "0.4.2",+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@eslint/core": "^0.17.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@eslint/core": {+ "version": "0.17.0",+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@types/json-schema": "^7.0.15"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@eslint/eslintrc": {+ "version": "3.3.3",+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz",+ "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ajv": "^6.12.4",+ "debug": "^4.3.2",+ "espree": "^10.0.1",+ "globals": "^14.0.0",+ "ignore": "^5.2.0",+ "import-fresh": "^3.2.1",+ "js-yaml": "^4.1.1",+ "minimatch": "^3.1.2",+ "strip-json-comments": "^3.1.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/@eslint/eslintrc/node_modules/globals": {+ "version": "14.0.0",+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/@eslint/js": {+ "version": "9.39.2",+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz",+ "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://eslint.org/donate"+ }+ },+ "node_modules/@eslint/object-schema": {+ "version": "2.1.7",+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@eslint/plugin-kit": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@eslint/core": "^0.17.0",+ "levn": "^0.4.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },+ "node_modules/@gar/promisify": {+ "version": "1.1.3",+ "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz",+ "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/@grpc/grpc-js": {+ "version": "1.14.3",+ "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.3.tgz",+ "integrity": "sha512-Iq8QQQ/7X3Sac15oB6p0FmUg/klxQvXLeileoqrTRGJYLV+/9tubbr9ipz0GKHjmXVsgFPo/+W+2cA8eNcR+XA==",+ "license": "Apache-2.0",+ "peer": true,+ "dependencies": {+ "@grpc/proto-loader": "^0.8.0",+ "@js-sdsl/ordered-map": "^4.4.2"+ },+ "engines": {+ "node": ">=12.10.0"+ }+ },+ "node_modules/@grpc/grpc-js/node_modules/@grpc/proto-loader": {+ "version": "0.8.0",+ "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.0.tgz",+ "integrity": "sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "lodash.camelcase": "^4.3.0",+ "long": "^5.0.0",+ "protobufjs": "^7.5.3",+ "yargs": "^17.7.2"+ },+ "bin": {+ "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/@grpc/proto-loader": {+ "version": "0.7.15",+ "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.15.tgz",+ "integrity": "sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ==",+ "license": "Apache-2.0",+ "peer": true,+ "dependencies": {+ "lodash.camelcase": "^4.3.0",+ "long": "^5.0.0",+ "protobufjs": "^7.2.5",+ "yargs": "^17.7.2"+ },+ "bin": {+ "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/@humanfs/core": {+ "version": "0.19.1",+ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",+ "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=18.18.0"+ }+ },+ "node_modules/@humanfs/node": {+ "version": "0.16.7",+ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz",+ "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@humanfs/core": "^0.19.1",+ "@humanwhocodes/retry": "^0.4.0"+ },+ "engines": {+ "node": ">=18.18.0"+ }+ },+ "node_modules/@humanwhocodes/module-importer": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=12.22"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/nzakas"+ }+ },+ "node_modules/@humanwhocodes/retry": {+ "version": "0.4.3",+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",+ "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=18.18"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/nzakas"+ }+ },+ "node_modules/@inquirer/ansi": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-1.0.2.tgz",+ "integrity": "sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@inquirer/checkbox": {+ "version": "4.3.2",+ "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.3.2.tgz",+ "integrity": "sha512-VXukHf0RR1doGe6Sm4F0Em7SWYLTHSsbGfJdS9Ja2bX5/D5uwVOEjr07cncLROdBvmnvCATYEWlHqYmXv2IlQA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/ansi": "^1.0.2",+ "@inquirer/core": "^10.3.2",+ "@inquirer/figures": "^1.0.15",+ "@inquirer/type": "^3.0.10",+ "yoctocolors-cjs": "^2.1.3"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/confirm": {+ "version": "5.1.21",+ "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.21.tgz",+ "integrity": "sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/core": "^10.3.2",+ "@inquirer/type": "^3.0.10"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/core": {+ "version": "10.3.2",+ "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.3.2.tgz",+ "integrity": "sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/ansi": "^1.0.2",+ "@inquirer/figures": "^1.0.15",+ "@inquirer/type": "^3.0.10",+ "cli-width": "^4.1.0",+ "mute-stream": "^2.0.0",+ "signal-exit": "^4.1.0",+ "wrap-ansi": "^6.2.0",+ "yoctocolors-cjs": "^2.1.3"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/editor": {+ "version": "4.2.23",+ "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.23.tgz",+ "integrity": "sha512-aLSROkEwirotxZ1pBaP8tugXRFCxW94gwrQLxXfrZsKkfjOYC1aRvAZuhpJOb5cu4IBTJdsCigUlf2iCOu4ZDQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/core": "^10.3.2",+ "@inquirer/external-editor": "^1.0.3",+ "@inquirer/type": "^3.0.10"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/expand": {+ "version": "4.0.23",+ "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.23.tgz",+ "integrity": "sha512-nRzdOyFYnpeYTTR2qFwEVmIWypzdAx/sIkCMeTNTcflFOovfqUk+HcFhQQVBftAh9gmGrpFj6QcGEqrDMDOiew==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/core": "^10.3.2",+ "@inquirer/type": "^3.0.10",+ "yoctocolors-cjs": "^2.1.3"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/external-editor": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.3.tgz",+ "integrity": "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "chardet": "^2.1.1",+ "iconv-lite": "^0.7.0"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/figures": {+ "version": "1.0.15",+ "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.15.tgz",+ "integrity": "sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@inquirer/input": {+ "version": "4.3.1",+ "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.3.1.tgz",+ "integrity": "sha512-kN0pAM4yPrLjJ1XJBjDxyfDduXOuQHrBB8aLDMueuwUGn+vNpF7Gq7TvyVxx8u4SHlFFj4trmj+a2cbpG4Jn1g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/core": "^10.3.2",+ "@inquirer/type": "^3.0.10"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/number": {+ "version": "3.0.23",+ "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.23.tgz",+ "integrity": "sha512-5Smv0OK7K0KUzUfYUXDXQc9jrf8OHo4ktlEayFlelCjwMXz0299Y8OrI+lj7i4gCBY15UObk76q0QtxjzFcFcg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/core": "^10.3.2",+ "@inquirer/type": "^3.0.10"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/password": {+ "version": "4.0.23",+ "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.23.tgz",+ "integrity": "sha512-zREJHjhT5vJBMZX/IUbyI9zVtVfOLiTO66MrF/3GFZYZ7T4YILW5MSkEYHceSii/KtRk+4i3RE7E1CUXA2jHcA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/ansi": "^1.0.2",+ "@inquirer/core": "^10.3.2",+ "@inquirer/type": "^3.0.10"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/prompts": {+ "version": "7.10.1",+ "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.10.1.tgz",+ "integrity": "sha512-Dx/y9bCQcXLI5ooQ5KyvA4FTgeo2jYj/7plWfV5Ak5wDPKQZgudKez2ixyfz7tKXzcJciTxqLeK7R9HItwiByg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/checkbox": "^4.3.2",+ "@inquirer/confirm": "^5.1.21",+ "@inquirer/editor": "^4.2.23",+ "@inquirer/expand": "^4.0.23",+ "@inquirer/input": "^4.3.1",+ "@inquirer/number": "^3.0.23",+ "@inquirer/password": "^4.0.23",+ "@inquirer/rawlist": "^4.1.11",+ "@inquirer/search": "^3.2.2",+ "@inquirer/select": "^4.4.2"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/rawlist": {+ "version": "4.1.11",+ "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.1.11.tgz",+ "integrity": "sha512-+LLQB8XGr3I5LZN/GuAHo+GpDJegQwuPARLChlMICNdwW7OwV2izlCSCxN6cqpL0sMXmbKbFcItJgdQq5EBXTw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/core": "^10.3.2",+ "@inquirer/type": "^3.0.10",+ "yoctocolors-cjs": "^2.1.3"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/search": {+ "version": "3.2.2",+ "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.2.2.tgz",+ "integrity": "sha512-p2bvRfENXCZdWF/U2BXvnSI9h+tuA8iNqtUKb9UWbmLYCRQxd8WkvwWvYn+3NgYaNwdUkHytJMGG4MMLucI1kA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/core": "^10.3.2",+ "@inquirer/figures": "^1.0.15",+ "@inquirer/type": "^3.0.10",+ "yoctocolors-cjs": "^2.1.3"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/select": {+ "version": "4.4.2",+ "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.4.2.tgz",+ "integrity": "sha512-l4xMuJo55MAe+N7Qr4rX90vypFwCajSakx59qe/tMaC1aEHWLyw68wF4o0A4SLAY4E0nd+Vt+EyskeDIqu1M6w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@inquirer/ansi": "^1.0.2",+ "@inquirer/core": "^10.3.2",+ "@inquirer/figures": "^1.0.15",+ "@inquirer/type": "^3.0.10",+ "yoctocolors-cjs": "^2.1.3"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@inquirer/type": {+ "version": "3.0.10",+ "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.10.tgz",+ "integrity": "sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/node": ">=18"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/@ioredis/commands": {+ "version": "1.5.0",+ "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.5.0.tgz",+ "integrity": "sha512-eUgLqrMf8nJkZxT24JvVRrQya1vZkQh8BBeYNwGDqa5I0VUi8ACx7uFvAaLxintokpTenkK6DASvo/bvNbBGow==",+ "license": "MIT"+ },+ "node_modules/@isaacs/balanced-match": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz",+ "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "20 || >=22"+ }+ },+ "node_modules/@isaacs/brace-expansion": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz",+ "integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@isaacs/balanced-match": "^4.0.1"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },+ "node_modules/@isaacs/cliui": {+ "version": "8.0.2",+ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",+ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",+ "license": "ISC",+ "dependencies": {+ "string-width": "^5.1.2",+ "string-width-cjs": "npm:string-width@^4.2.0",+ "strip-ansi": "^7.0.1",+ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",+ "wrap-ansi": "^8.1.0",+ "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@isaacs/cliui/node_modules/ansi-regex": {+ "version": "6.2.2",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"+ }+ },+ "node_modules/@isaacs/cliui/node_modules/ansi-styles": {+ "version": "6.2.3",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/@isaacs/cliui/node_modules/emoji-regex": {+ "version": "9.2.2",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",+ "license": "MIT"+ },+ "node_modules/@isaacs/cliui/node_modules/string-width": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",+ "license": "MIT",+ "dependencies": {+ "eastasianwidth": "^0.2.0",+ "emoji-regex": "^9.2.2",+ "strip-ansi": "^7.0.1"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/@isaacs/cliui/node_modules/strip-ansi": {+ "version": "7.1.2",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",+ "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^6.0.1"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"+ }+ },+ "node_modules/@isaacs/cliui/node_modules/wrap-ansi": {+ "version": "8.1.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",+ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^6.1.0",+ "string-width": "^5.0.1",+ "strip-ansi": "^7.0.1"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/@istanbuljs/load-nyc-config": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",+ "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "camelcase": "^5.3.1",+ "find-up": "^4.1.0",+ "get-package-type": "^0.1.0",+ "js-yaml": "^3.13.1",+ "resolve-from": "^5.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": {+ "version": "1.0.10",+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "sprintf-js": "~1.0.2"+ }+ },+ "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "locate-path": "^5.0.0",+ "path-exists": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": {+ "version": "3.14.2",+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz",+ "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "argparse": "^1.0.7",+ "esprima": "^4.0.0"+ },+ "bin": {+ "js-yaml": "bin/js-yaml.js"+ }+ },+ "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-locate": "^4.1.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-try": "^2.0.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-limit": "^2.2.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",+ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/@istanbuljs/schema": {+ "version": "0.1.3",+ "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",+ "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/@jest/console": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.2.0.tgz",+ "integrity": "sha512-+O1ifRjkvYIkBqASKWgLxrpEhQAAE7hY77ALLUufSk5717KfOShg6IbqLmdsLMPdUiFvA2kTs0R7YZy+l0IzZQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "chalk": "^4.1.2",+ "jest-message-util": "30.2.0",+ "jest-util": "30.2.0",+ "slash": "^3.0.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/core": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.2.0.tgz",+ "integrity": "sha512-03W6IhuhjqTlpzh/ojut/pDB2LPRygyWX8ExpgHtQA8H/3K7+1vKmcINx5UzeOX1se6YEsBsOHQ1CRzf3fOwTQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/console": "30.2.0",+ "@jest/pattern": "30.0.1",+ "@jest/reporters": "30.2.0",+ "@jest/test-result": "30.2.0",+ "@jest/transform": "30.2.0",+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "ansi-escapes": "^4.3.2",+ "chalk": "^4.1.2",+ "ci-info": "^4.2.0",+ "exit-x": "^0.2.2",+ "graceful-fs": "^4.2.11",+ "jest-changed-files": "30.2.0",+ "jest-config": "30.2.0",+ "jest-haste-map": "30.2.0",+ "jest-message-util": "30.2.0",+ "jest-regex-util": "30.0.1",+ "jest-resolve": "30.2.0",+ "jest-resolve-dependencies": "30.2.0",+ "jest-runner": "30.2.0",+ "jest-runtime": "30.2.0",+ "jest-snapshot": "30.2.0",+ "jest-util": "30.2.0",+ "jest-validate": "30.2.0",+ "jest-watcher": "30.2.0",+ "micromatch": "^4.0.8",+ "pretty-format": "30.2.0",+ "slash": "^3.0.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "peerDependencies": {+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"+ },+ "peerDependenciesMeta": {+ "node-notifier": {+ "optional": true+ }+ }+ },+ "node_modules/@jest/diff-sequences": {+ "version": "30.0.1",+ "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.0.1.tgz",+ "integrity": "sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/environment": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.2.0.tgz",+ "integrity": "sha512-/QPTL7OBJQ5ac09UDRa3EQes4gt1FTEG/8jZ/4v5IVzx+Cv7dLxlVIvfvSVRiiX2drWyXeBjkMSR8hvOWSog5g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/fake-timers": "30.2.0",+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "jest-mock": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/expect": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.2.0.tgz",+ "integrity": "sha512-V9yxQK5erfzx99Sf+7LbhBwNWEZ9eZay8qQ9+JSC0TrMR1pMDHLMY+BnVPacWU6Jamrh252/IKo4F1Xn/zfiqA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "expect": "30.2.0",+ "jest-snapshot": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/expect-utils": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.2.0.tgz",+ "integrity": "sha512-1JnRfhqpD8HGpOmQp180Fo9Zt69zNtC+9lR+kT7NVL05tNXIi+QC8Csz7lfidMoVLPD3FnOtcmp0CEFnxExGEA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/get-type": "30.1.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/fake-timers": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.2.0.tgz",+ "integrity": "sha512-HI3tRLjRxAbBy0VO8dqqm7Hb2mIa8d5bg/NJkyQcOk7V118ObQML8RC5luTF/Zsg4474a+gDvhce7eTnP4GhYw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/types": "30.2.0",+ "@sinonjs/fake-timers": "^13.0.0",+ "@types/node": "*",+ "jest-message-util": "30.2.0",+ "jest-mock": "30.2.0",+ "jest-util": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/get-type": {+ "version": "30.1.0",+ "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz",+ "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/globals": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.2.0.tgz",+ "integrity": "sha512-b63wmnKPaK+6ZZfpYhz9K61oybvbI1aMcIs80++JI1O1rR1vaxHUCNqo3ITu6NU0d4V34yZFoHMn/uoKr/Rwfw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/environment": "30.2.0",+ "@jest/expect": "30.2.0",+ "@jest/types": "30.2.0",+ "jest-mock": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/pattern": {+ "version": "30.0.1",+ "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.0.1.tgz",+ "integrity": "sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*",+ "jest-regex-util": "30.0.1"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/reporters": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.2.0.tgz",+ "integrity": "sha512-DRyW6baWPqKMa9CzeiBjHwjd8XeAyco2Vt8XbcLFjiwCOEKOvy82GJ8QQnJE9ofsxCMPjH4MfH8fCWIHHDKpAQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@bcoe/v8-coverage": "^0.2.3",+ "@jest/console": "30.2.0",+ "@jest/test-result": "30.2.0",+ "@jest/transform": "30.2.0",+ "@jest/types": "30.2.0",+ "@jridgewell/trace-mapping": "^0.3.25",+ "@types/node": "*",+ "chalk": "^4.1.2",+ "collect-v8-coverage": "^1.0.2",+ "exit-x": "^0.2.2",+ "glob": "^10.3.10",+ "graceful-fs": "^4.2.11",+ "istanbul-lib-coverage": "^3.0.0",+ "istanbul-lib-instrument": "^6.0.0",+ "istanbul-lib-report": "^3.0.0",+ "istanbul-lib-source-maps": "^5.0.0",+ "istanbul-reports": "^3.1.3",+ "jest-message-util": "30.2.0",+ "jest-util": "30.2.0",+ "jest-worker": "30.2.0",+ "slash": "^3.0.0",+ "string-length": "^4.0.2",+ "v8-to-istanbul": "^9.0.1"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "peerDependencies": {+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"+ },+ "peerDependenciesMeta": {+ "node-notifier": {+ "optional": true+ }+ }+ },+ "node_modules/@jest/reporters/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/@jest/reporters/node_modules/glob": {+ "version": "10.5.0",+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",+ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "foreground-child": "^3.1.0",+ "jackspeak": "^3.1.2",+ "minimatch": "^9.0.4",+ "minipass": "^7.1.2",+ "package-json-from-dist": "^1.0.0",+ "path-scurry": "^1.11.1"+ },+ "bin": {+ "glob": "dist/esm/bin.mjs"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/@jest/reporters/node_modules/lru-cache": {+ "version": "10.4.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/@jest/reporters/node_modules/minimatch": {+ "version": "9.0.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/@jest/reporters/node_modules/path-scurry": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "lru-cache": "^10.2.0",+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"+ },+ "engines": {+ "node": ">=16 || 14 >=14.18"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/@jest/schemas": {+ "version": "30.0.5",+ "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz",+ "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@sinclair/typebox": "^0.34.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/snapshot-utils": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.2.0.tgz",+ "integrity": "sha512-0aVxM3RH6DaiLcjj/b0KrIBZhSX1373Xci4l3cW5xiUWPctZ59zQ7jj4rqcJQ/Z8JuN/4wX3FpJSa3RssVvCug==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/types": "30.2.0",+ "chalk": "^4.1.2",+ "graceful-fs": "^4.2.11",+ "natural-compare": "^1.4.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/source-map": {+ "version": "30.0.1",+ "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.0.1.tgz",+ "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/trace-mapping": "^0.3.25",+ "callsites": "^3.1.0",+ "graceful-fs": "^4.2.11"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/test-result": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.2.0.tgz",+ "integrity": "sha512-RF+Z+0CCHkARz5HT9mcQCBulb1wgCP3FBvl9VFokMX27acKphwyQsNuWH3c+ojd1LeWBLoTYoxF0zm6S/66mjg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/console": "30.2.0",+ "@jest/types": "30.2.0",+ "@types/istanbul-lib-coverage": "^2.0.6",+ "collect-v8-coverage": "^1.0.2"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/test-sequencer": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.2.0.tgz",+ "integrity": "sha512-wXKgU/lk8fKXMu/l5Hog1R61bL4q5GCdT6OJvdAFz1P+QrpoFuLU68eoKuVc4RbrTtNnTL5FByhWdLgOPSph+Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/test-result": "30.2.0",+ "graceful-fs": "^4.2.11",+ "jest-haste-map": "30.2.0",+ "slash": "^3.0.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/transform": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.2.0.tgz",+ "integrity": "sha512-XsauDV82o5qXbhalKxD7p4TZYYdwcaEXC77PPD2HixEFF+6YGppjrAAQurTl2ECWcEomHBMMNS9AH3kcCFx8jA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/core": "^7.27.4",+ "@jest/types": "30.2.0",+ "@jridgewell/trace-mapping": "^0.3.25",+ "babel-plugin-istanbul": "^7.0.1",+ "chalk": "^4.1.2",+ "convert-source-map": "^2.0.0",+ "fast-json-stable-stringify": "^2.1.0",+ "graceful-fs": "^4.2.11",+ "jest-haste-map": "30.2.0",+ "jest-regex-util": "30.0.1",+ "jest-util": "30.2.0",+ "micromatch": "^4.0.8",+ "pirates": "^4.0.7",+ "slash": "^3.0.0",+ "write-file-atomic": "^5.0.1"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jest/types": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.2.0.tgz",+ "integrity": "sha512-H9xg1/sfVvyfU7o3zMfBEjQ1gcsdeTMgqHoYdN79tuLqfTtuu7WckRA1R5whDwOzxaZAeMKTYWqP+WCAi0CHsg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/pattern": "30.0.1",+ "@jest/schemas": "30.0.5",+ "@types/istanbul-lib-coverage": "^2.0.6",+ "@types/istanbul-reports": "^3.0.4",+ "@types/node": "*",+ "@types/yargs": "^17.0.33",+ "chalk": "^4.1.2"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/@jridgewell/gen-mapping": {+ "version": "0.3.13",+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.0",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/remapping": {+ "version": "2.3.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/gen-mapping": "^0.3.5",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "devOptional": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/source-map": {+ "version": "0.3.11",+ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz",+ "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/gen-mapping": "^0.3.5",+ "@jridgewell/trace-mapping": "^0.3.25"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.5.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.31",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.1.0",+ "@jridgewell/sourcemap-codec": "^1.4.14"+ }+ },+ "node_modules/@js-sdsl/ordered-map": {+ "version": "4.4.2",+ "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz",+ "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==",+ "license": "MIT",+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/js-sdsl"+ }+ },+ "node_modules/@lukeed/csprng": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz",+ "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/@microsoft/tsdoc": {+ "version": "0.16.0",+ "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.16.0.tgz",+ "integrity": "sha512-xgAyonlVVS+q7Vc7qLW0UrJU7rSFcETRWsqdXZtjzRU8dF+6CkozTK4V4y1LwOX7j8r/vHphjDeMeGI4tNGeGA==",+ "license": "MIT"+ },+ "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz",+ "integrity": "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==",+ "cpu": [+ "arm64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz",+ "integrity": "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==",+ "cpu": [+ "x64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz",+ "integrity": "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==",+ "cpu": [+ "arm"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz",+ "integrity": "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==",+ "cpu": [+ "arm64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz",+ "integrity": "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==",+ "cpu": [+ "x64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz",+ "integrity": "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==",+ "cpu": [+ "x64"+ ],+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@napi-rs/wasm-runtime": {+ "version": "0.2.12",+ "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz",+ "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/core": "^1.4.3",+ "@emnapi/runtime": "^1.4.3",+ "@tybys/wasm-util": "^0.10.0"+ }+ },+ "node_modules/@nestjs-modules/ioredis": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/@nestjs-modules/ioredis/-/ioredis-2.0.2.tgz",+ "integrity": "sha512-8pzSvT8R3XP6p8ZzQmEN8OnY0yWrJ/elFhwQK+PID2zf1SLBkAZ18bDcx3SKQ2atledt0gd9kBeP5xT4MlyS7Q==",+ "license": "MIT",+ "optionalDependencies": {+ "@nestjs/terminus": "10.2.0"+ },+ "peerDependencies": {+ "@nestjs/common": ">=6.7.0",+ "@nestjs/core": ">=6.7.0",+ "ioredis": ">=5.0.0"+ }+ },+ "node_modules/@nestjs-modules/ioredis/node_modules/@nestjs/terminus": {+ "version": "10.2.0",+ "resolved": "https://registry.npmjs.org/@nestjs/terminus/-/terminus-10.2.0.tgz",+ "integrity": "sha512-zPs98xvJ4ogEimRQOz8eU90mb7z+W/kd/mL4peOgrJ/VqER+ibN2Cboj65uJZW3XuNhpOqaeYOJte86InJd44A==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "boxen": "5.1.2",+ "check-disk-space": "3.4.0"+ },+ "peerDependencies": {+ "@grpc/grpc-js": "*",+ "@grpc/proto-loader": "*",+ "@mikro-orm/core": "*",+ "@mikro-orm/nestjs": "*",+ "@nestjs/axios": "^1.0.0 || ^2.0.0 || ^3.0.0",+ "@nestjs/common": "^9.0.0 || ^10.0.0",+ "@nestjs/core": "^9.0.0 || ^10.0.0",+ "@nestjs/microservices": "^9.0.0 || ^10.0.0",+ "@nestjs/mongoose": "^9.0.0 || ^10.0.0",+ "@nestjs/sequelize": "^9.0.0 || ^10.0.0",+ "@nestjs/typeorm": "^9.0.0 || ^10.0.0",+ "@prisma/client": "*",+ "mongoose": "*",+ "reflect-metadata": "0.1.x",+ "rxjs": "7.x",+ "sequelize": "*",+ "typeorm": "*"+ },+ "peerDependenciesMeta": {+ "@grpc/grpc-js": {+ "optional": true+ },+ "@grpc/proto-loader": {+ "optional": true+ },+ "@mikro-orm/core": {+ "optional": true+ },+ "@mikro-orm/nestjs": {+ "optional": true+ },+ "@nestjs/axios": {+ "optional": true+ },+ "@nestjs/microservices": {+ "optional": true+ },+ "@nestjs/mongoose": {+ "optional": true+ },+ "@nestjs/sequelize": {+ "optional": true+ },+ "@nestjs/typeorm": {+ "optional": true+ },+ "@prisma/client": {+ "optional": true+ },+ "mongoose": {+ "optional": true+ },+ "sequelize": {+ "optional": true+ },+ "typeorm": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs-modules/ioredis/node_modules/@nestjs/typeorm": {+ "version": "10.0.2",+ "resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-10.0.2.tgz",+ "integrity": "sha512-H738bJyydK4SQkRCTeh1aFBxoO1E9xdL/HaLGThwrqN95os5mEyAtK7BLADOS+vldP4jDZ2VQPLj4epWwRqCeQ==",+ "license": "MIT",+ "optional": true,+ "peer": true,+ "dependencies": {+ "uuid": "9.0.1"+ },+ "peerDependencies": {+ "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0",+ "@nestjs/core": "^8.0.0 || ^9.0.0 || ^10.0.0",+ "reflect-metadata": "^0.1.13 || ^0.2.0",+ "rxjs": "^7.2.0",+ "typeorm": "^0.3.0"+ }+ },+ "node_modules/@nestjs-modules/ioredis/node_modules/reflect-metadata": {+ "version": "0.1.14",+ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz",+ "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==",+ "license": "Apache-2.0",+ "optional": true,+ "peer": true+ },+ "node_modules/@nestjs-modules/ioredis/node_modules/uuid": {+ "version": "9.0.1",+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",+ "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",+ "funding": [+ "https://github.com/sponsors/broofa",+ "https://github.com/sponsors/ctavan"+ ],+ "license": "MIT",+ "optional": true,+ "bin": {+ "uuid": "dist/bin/uuid"+ }+ },+ "node_modules/@nestjs/bull-shared": {+ "version": "11.0.4",+ "resolved": "https://registry.npmjs.org/@nestjs/bull-shared/-/bull-shared-11.0.4.tgz",+ "integrity": "sha512-VBJcDHSAzxQnpcDfA0kt9MTGUD1XZzfByV70su0W0eDCQ9aqIEBlzWRW21tv9FG9dIut22ysgDidshdjlnczLw==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "tslib": "2.8.1"+ },+ "peerDependencies": {+ "@nestjs/common": "^10.0.0 || ^11.0.0",+ "@nestjs/core": "^10.0.0 || ^11.0.0"+ }+ },+ "node_modules/@nestjs/bullmq": {+ "version": "11.0.4",+ "resolved": "https://registry.npmjs.org/@nestjs/bullmq/-/bullmq-11.0.4.tgz",+ "integrity": "sha512-wBzK9raAVG0/6NTMdvLGM4/FQ1lsB35/pYS8L6a0SDgkTiLpd7mAjQ8R692oMx5s7IjvgntaZOuTUrKYLNfIkA==",+ "license": "MIT",+ "dependencies": {+ "@nestjs/bull-shared": "^11.0.4",+ "tslib": "2.8.1"+ },+ "peerDependencies": {+ "@nestjs/common": "^10.0.0 || ^11.0.0",+ "@nestjs/core": "^10.0.0 || ^11.0.0",+ "bullmq": "^3.0.0 || ^4.0.0 || ^5.0.0"+ }+ },+ "node_modules/@nestjs/cli": {+ "version": "11.0.16",+ "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-11.0.16.tgz",+ "integrity": "sha512-P0H+Vcjki6P5160E5QnMt3Q0X5FTg4PZkP99Ig4lm/4JWqfw32j3EXv3YBTJ2DmxLwOQ/IS9F7dzKpMAgzKTGg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@angular-devkit/core": "19.2.19",+ "@angular-devkit/schematics": "19.2.19",+ "@angular-devkit/schematics-cli": "19.2.19",+ "@inquirer/prompts": "7.10.1",+ "@nestjs/schematics": "^11.0.1",+ "ansis": "4.2.0",+ "chokidar": "4.0.3",+ "cli-table3": "0.6.5",+ "commander": "4.1.1",+ "fork-ts-checker-webpack-plugin": "9.1.0",+ "glob": "13.0.0",+ "node-emoji": "1.11.0",+ "ora": "5.4.1",+ "tsconfig-paths": "4.2.0",+ "tsconfig-paths-webpack-plugin": "4.2.0",+ "typescript": "5.9.3",+ "webpack": "5.104.1",+ "webpack-node-externals": "3.0.0"+ },+ "bin": {+ "nest": "bin/nest.js"+ },+ "engines": {+ "node": ">= 20.11"+ },+ "peerDependencies": {+ "@swc/cli": "^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0",+ "@swc/core": "^1.3.62"+ },+ "peerDependenciesMeta": {+ "@swc/cli": {+ "optional": true+ },+ "@swc/core": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/cli/node_modules/ajv": {+ "version": "8.17.1",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/@nestjs/cli/node_modules/ajv-formats": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",+ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependenciesMeta": {+ "ajv": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/cli/node_modules/ajv-keywords": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz",+ "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-deep-equal": "^3.1.3"+ },+ "peerDependencies": {+ "ajv": "^8.8.2"+ }+ },+ "node_modules/@nestjs/cli/node_modules/eslint-scope": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "esrecurse": "^4.3.0",+ "estraverse": "^4.1.1"+ },+ "engines": {+ "node": ">=8.0.0"+ }+ },+ "node_modules/@nestjs/cli/node_modules/estraverse": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",+ "dev": true,+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=4.0"+ }+ },+ "node_modules/@nestjs/cli/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@nestjs/cli/node_modules/mime-db": {+ "version": "1.52.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/@nestjs/cli/node_modules/mime-types": {+ "version": "2.1.35",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "mime-db": "1.52.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/@nestjs/cli/node_modules/schema-utils": {+ "version": "4.3.3",+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz",+ "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/json-schema": "^7.0.9",+ "ajv": "^8.9.0",+ "ajv-formats": "^2.1.1",+ "ajv-keywords": "^5.1.0"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },+ "node_modules/@nestjs/cli/node_modules/webpack": {+ "version": "5.104.1",+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.104.1.tgz",+ "integrity": "sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/eslint-scope": "^3.7.7",+ "@types/estree": "^1.0.8",+ "@types/json-schema": "^7.0.15",+ "@webassemblyjs/ast": "^1.14.1",+ "@webassemblyjs/wasm-edit": "^1.14.1",+ "@webassemblyjs/wasm-parser": "^1.14.1",+ "acorn": "^8.15.0",+ "acorn-import-phases": "^1.0.3",+ "browserslist": "^4.28.1",+ "chrome-trace-event": "^1.0.2",+ "enhanced-resolve": "^5.17.4",+ "es-module-lexer": "^2.0.0",+ "eslint-scope": "5.1.1",+ "events": "^3.2.0",+ "glob-to-regexp": "^0.4.1",+ "graceful-fs": "^4.2.11",+ "json-parse-even-better-errors": "^2.3.1",+ "loader-runner": "^4.3.1",+ "mime-types": "^2.1.27",+ "neo-async": "^2.6.2",+ "schema-utils": "^4.3.3",+ "tapable": "^2.3.0",+ "terser-webpack-plugin": "^5.3.16",+ "watchpack": "^2.4.4",+ "webpack-sources": "^3.3.3"+ },+ "bin": {+ "webpack": "bin/webpack.js"+ },+ "engines": {+ "node": ">=10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ },+ "peerDependenciesMeta": {+ "webpack-cli": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/common": {+ "version": "11.1.13",+ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.13.tgz",+ "integrity": "sha512-ieqWtipT+VlyDWLz5Rvz0f3E5rXcVAnaAi+D53DEHLjc1kmFxCgZ62qVfTX2vwkywwqNkTNXvBgGR72hYqV//Q==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "file-type": "21.3.0",+ "iterare": "1.2.1",+ "load-esm": "1.0.3",+ "tslib": "2.8.1",+ "uid": "2.0.2"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/nest"+ },+ "peerDependencies": {+ "class-transformer": ">=0.4.1",+ "class-validator": ">=0.13.2",+ "reflect-metadata": "^0.1.12 || ^0.2.0",+ "rxjs": "^7.1.0"+ },+ "peerDependenciesMeta": {+ "class-transformer": {+ "optional": true+ },+ "class-validator": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/config": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/@nestjs/config/-/config-4.0.3.tgz",+ "integrity": "sha512-FQ3M3Ohqfl+nHAn5tp7++wUQw0f2nAk+SFKe8EpNRnIifPqvfJP6JQxPKtFLMOHbyer4X646prFG4zSRYEssQQ==",+ "license": "MIT",+ "dependencies": {+ "dotenv": "17.2.3",+ "dotenv-expand": "12.0.3",+ "lodash": "4.17.23"+ },+ "peerDependencies": {+ "@nestjs/common": "^10.0.0 || ^11.0.0",+ "rxjs": "^7.1.0"+ }+ },+ "node_modules/@nestjs/core": {+ "version": "11.1.13",+ "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.13.tgz",+ "integrity": "sha512-Tq9EIKiC30EBL8hLK93tNqaToy0hzbuVGYt29V8NhkVJUsDzlmiVf6c3hSPtzx2krIUVbTgQ2KFeaxr72rEyzQ==",+ "hasInstallScript": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@nuxt/opencollective": "0.4.1",+ "fast-safe-stringify": "2.1.1",+ "iterare": "1.2.1",+ "path-to-regexp": "8.3.0",+ "tslib": "2.8.1",+ "uid": "2.0.2"+ },+ "engines": {+ "node": ">= 20"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/nest"+ },+ "peerDependencies": {+ "@nestjs/common": "^11.0.0",+ "@nestjs/microservices": "^11.0.0",+ "@nestjs/platform-express": "^11.0.0",+ "@nestjs/websockets": "^11.0.0",+ "reflect-metadata": "^0.1.12 || ^0.2.0",+ "rxjs": "^7.1.0"+ },+ "peerDependenciesMeta": {+ "@nestjs/microservices": {+ "optional": true+ },+ "@nestjs/platform-express": {+ "optional": true+ },+ "@nestjs/websockets": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/mapped-types": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.1.0.tgz",+ "integrity": "sha512-W+n+rM69XsFdwORF11UqJahn4J3xi4g/ZEOlJNL6KoW5ygWSmBB2p0S2BZ4FQeS/NDH72e6xIcu35SfJnE8bXw==",+ "license": "MIT",+ "peerDependencies": {+ "@nestjs/common": "^10.0.0 || ^11.0.0",+ "class-transformer": "^0.4.0 || ^0.5.0",+ "class-validator": "^0.13.0 || ^0.14.0",+ "reflect-metadata": "^0.1.12 || ^0.2.0"+ },+ "peerDependenciesMeta": {+ "class-transformer": {+ "optional": true+ },+ "class-validator": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/platform-express": {+ "version": "11.1.13",+ "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.1.13.tgz",+ "integrity": "sha512-LYmi43BrAs1n74kLCUfXcHag7s1CmGETcFbf9IVyA/KWXAuAH95G3wEaZZiyabOLFNwq4ifnRGnIwUwW7cz3+w==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "cors": "2.8.6",+ "express": "5.2.1",+ "multer": "2.0.2",+ "path-to-regexp": "8.3.0",+ "tslib": "2.8.1"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/nest"+ },+ "peerDependencies": {+ "@nestjs/common": "^11.0.0",+ "@nestjs/core": "^11.0.0"+ }+ },+ "node_modules/@nestjs/platform-socket.io": {+ "version": "11.1.13",+ "resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-11.1.13.tgz",+ "integrity": "sha512-04Rh16IopZzHRXt0ZjFASqt9oNFV/0m0NsYe4kVOSaTEoef3cH7cTFpNpHsfNHcc4QpYL963XE8SvIRcZs5L8A==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "socket.io": "4.8.3",+ "tslib": "2.8.1"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/nest"+ },+ "peerDependencies": {+ "@nestjs/common": "^11.0.0",+ "@nestjs/websockets": "^11.0.0",+ "rxjs": "^7.1.0"+ }+ },+ "node_modules/@nestjs/schematics": {+ "version": "11.0.9",+ "resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-11.0.9.tgz",+ "integrity": "sha512-0NfPbPlEaGwIT8/TCThxLzrlz3yzDNkfRNpbL7FiplKq3w4qXpJg0JYwqgMEJnLQZm3L/L/5XjoyfJHUO3qX9g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@angular-devkit/core": "19.2.17",+ "@angular-devkit/schematics": "19.2.17",+ "comment-json": "4.4.1",+ "jsonc-parser": "3.3.1",+ "pluralize": "8.0.0"+ },+ "peerDependencies": {+ "typescript": ">=4.8.2"+ }+ },+ "node_modules/@nestjs/schematics/node_modules/@angular-devkit/core": {+ "version": "19.2.17",+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-19.2.17.tgz",+ "integrity": "sha512-Ah008x2RJkd0F+NLKqIpA34/vUGwjlprRCkvddjDopAWRzYn6xCkz1Tqwuhn0nR1Dy47wTLKYD999TYl5ONOAQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ajv": "8.17.1",+ "ajv-formats": "3.0.1",+ "jsonc-parser": "3.3.1",+ "picomatch": "4.0.2",+ "rxjs": "7.8.1",+ "source-map": "0.7.4"+ },+ "engines": {+ "node": "^18.19.1 || ^20.11.1 || >=22.0.0",+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",+ "yarn": ">= 1.13.0"+ },+ "peerDependencies": {+ "chokidar": "^4.0.0"+ },+ "peerDependenciesMeta": {+ "chokidar": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/schematics/node_modules/@angular-devkit/schematics": {+ "version": "19.2.17",+ "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-19.2.17.tgz",+ "integrity": "sha512-ADfbaBsrG8mBF6Mfs+crKA/2ykB8AJI50Cv9tKmZfwcUcyAdmTr+vVvhsBCfvUAEokigSsgqgpYxfkJVxhJYeg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@angular-devkit/core": "19.2.17",+ "jsonc-parser": "3.3.1",+ "magic-string": "0.30.17",+ "ora": "5.4.1",+ "rxjs": "7.8.1"+ },+ "engines": {+ "node": "^18.19.1 || ^20.11.1 || >=22.0.0",+ "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",+ "yarn": ">= 1.13.0"+ }+ },+ "node_modules/@nestjs/schematics/node_modules/ajv": {+ "version": "8.17.1",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/@nestjs/schematics/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@nestjs/schematics/node_modules/rxjs": {+ "version": "7.8.1",+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",+ "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.1.0"+ }+ },+ "node_modules/@nestjs/swagger": {+ "version": "11.2.6",+ "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-11.2.6.tgz",+ "integrity": "sha512-oiXOxMQqDFyv1AKAqFzSo6JPvMEs4uA36Eyz/s2aloZLxUjcLfUMELSLSNQunr61xCPTpwEOShfmO7NIufKXdA==",+ "license": "MIT",+ "dependencies": {+ "@microsoft/tsdoc": "0.16.0",+ "@nestjs/mapped-types": "2.1.0",+ "js-yaml": "4.1.1",+ "lodash": "4.17.23",+ "path-to-regexp": "8.3.0",+ "swagger-ui-dist": "5.31.0"+ },+ "peerDependencies": {+ "@fastify/static": "^8.0.0 || ^9.0.0",+ "@nestjs/common": "^11.0.1",+ "@nestjs/core": "^11.0.1",+ "class-transformer": "*",+ "class-validator": "*",+ "reflect-metadata": "^0.1.12 || ^0.2.0"+ },+ "peerDependenciesMeta": {+ "@fastify/static": {+ "optional": true+ },+ "class-transformer": {+ "optional": true+ },+ "class-validator": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/testing": {+ "version": "11.1.13",+ "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-11.1.13.tgz",+ "integrity": "sha512-bOWP8nLEZAOEEX8jAZGBCc1yU0+nv4g2ipc+QEzkVUe3eEEUKHKaeGafJ3GtDuGavlZKfkXEqflZuICdavu5dQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "tslib": "2.8.1"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/nest"+ },+ "peerDependencies": {+ "@nestjs/common": "^11.0.0",+ "@nestjs/core": "^11.0.0",+ "@nestjs/microservices": "^11.0.0",+ "@nestjs/platform-express": "^11.0.0"+ },+ "peerDependenciesMeta": {+ "@nestjs/microservices": {+ "optional": true+ },+ "@nestjs/platform-express": {+ "optional": true+ }+ }+ },+ "node_modules/@nestjs/throttler": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/@nestjs/throttler/-/throttler-6.5.0.tgz",+ "integrity": "sha512-9j0ZRfH0QE1qyrj9JjIRDz5gQLPqq9yVC2nHsrosDVAfI5HHw08/aUAWx9DZLSdQf4HDkmhTTEGLrRFHENvchQ==",+ "license": "MIT",+ "peerDependencies": {+ "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0",+ "@nestjs/core": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0",+ "reflect-metadata": "^0.1.13 || ^0.2.0"+ }+ },+ "node_modules/@nestjs/typeorm": {+ "version": "11.0.0",+ "resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-11.0.0.tgz",+ "integrity": "sha512-SOeUQl70Lb2OfhGkvnh4KXWlsd+zA08RuuQgT7kKbzivngxzSo1Oc7Usu5VxCxACQC9wc2l9esOHILSJeK7rJA==",+ "license": "MIT",+ "peerDependencies": {+ "@nestjs/common": "^10.0.0 || ^11.0.0",+ "@nestjs/core": "^10.0.0 || ^11.0.0",+ "reflect-metadata": "^0.1.13 || ^0.2.0",+ "rxjs": "^7.2.0",+ "typeorm": "^0.3.0"+ }+ },+ "node_modules/@nestjs/websockets": {+ "version": "11.1.13",+ "resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-11.1.13.tgz",+ "integrity": "sha512-8r8EadqBkrTYtH2uog42HfIb5fcP5a3iXymH/ityd9bO/gDson5Q1qbtCQRjuU++6NY12YYteKRu4eP/iErbLw==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "iterare": "1.2.1",+ "object-hash": "3.0.0",+ "tslib": "2.8.1"+ },+ "peerDependencies": {+ "@nestjs/common": "^11.0.0",+ "@nestjs/core": "^11.0.0",+ "@nestjs/platform-socket.io": "^11.0.0",+ "reflect-metadata": "^0.1.12 || ^0.2.0",+ "rxjs": "^7.1.0"+ },+ "peerDependenciesMeta": {+ "@nestjs/platform-socket.io": {+ "optional": true+ }+ }+ },+ "node_modules/@noble/hashes": {+ "version": "1.8.0",+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^14.21.3 || >=16"+ },+ "funding": {+ "url": "https://paulmillr.com/funding/"+ }+ },+ "node_modules/@npmcli/fs": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz",+ "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "@gar/promisify": "^1.0.1",+ "semver": "^7.3.5"+ }+ },+ "node_modules/@npmcli/move-file": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz",+ "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==",+ "deprecated": "This functionality has been moved to @npmcli/fs",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "mkdirp": "^1.0.4",+ "rimraf": "^3.0.2"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/@npmcli/move-file/node_modules/mkdirp": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",+ "license": "MIT",+ "optional": true,+ "bin": {+ "mkdirp": "bin/cmd.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/@nuxt/opencollective": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz",+ "integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==",+ "license": "MIT",+ "dependencies": {+ "consola": "^3.2.3"+ },+ "bin": {+ "opencollective": "bin/opencollective.js"+ },+ "engines": {+ "node": "^14.18.0 || >=16.10.0",+ "npm": ">=5.10.0"+ }+ },+ "node_modules/@paralleldrive/cuid2": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz",+ "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@noble/hashes": "^1.1.5"+ }+ },+ "node_modules/@pedroslopez/moduleraid": {+ "version": "5.0.2",+ "resolved": "https://registry.npmjs.org/@pedroslopez/moduleraid/-/moduleraid-5.0.2.tgz",+ "integrity": "sha512-wtnBAETBVYZ9GvcbgdswRVSLkFkYAGv1KzwBBTeRXvGT9sb9cPllOgFFWXCn9PyARQ0H+Ijz6mmoRrGateUDxQ==",+ "license": "MIT"+ },+ "node_modules/@pkgjs/parseargs": {+ "version": "0.11.0",+ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",+ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=14"+ }+ },+ "node_modules/@pkgr/core": {+ "version": "0.2.9",+ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz",+ "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^12.20.0 || ^14.18.0 || >=16.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/pkgr"+ }+ },+ "node_modules/@protobufjs/aspromise": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/base64": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/codegen": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",+ "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/eventemitter": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",+ "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/fetch": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",+ "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.1",+ "@protobufjs/inquire": "^1.1.0"+ }+ },+ "node_modules/@protobufjs/float": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/inquire": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",+ "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/path": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/pool": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/utf8": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",+ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@puppeteer/browsers": {+ "version": "2.11.2",+ "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.11.2.tgz",+ "integrity": "sha512-GBY0+2lI9fDrjgb5dFL9+enKXqyOPok9PXg/69NVkjW3bikbK9RQrNrI3qccQXmDNN7ln4j/yL89Qgvj/tfqrw==",+ "license": "Apache-2.0",+ "dependencies": {+ "debug": "^4.4.3",+ "extract-zip": "^2.0.1",+ "progress": "^2.0.3",+ "proxy-agent": "^6.5.0",+ "semver": "^7.7.3",+ "tar-fs": "^3.1.1",+ "yargs": "^17.7.2"+ },+ "bin": {+ "browsers": "lib/cjs/main-cli.js"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/tar-fs": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz",+ "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==",+ "license": "MIT",+ "dependencies": {+ "pump": "^3.0.0",+ "tar-stream": "^3.1.5"+ },+ "optionalDependencies": {+ "bare-fs": "^4.0.1",+ "bare-path": "^3.0.0"+ }+ },+ "node_modules/@scarf/scarf": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.4.0.tgz",+ "integrity": "sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ==",+ "hasInstallScript": true,+ "license": "Apache-2.0"+ },+ "node_modules/@sinclair/typebox": {+ "version": "0.34.48",+ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.48.tgz",+ "integrity": "sha512-kKJTNuK3AQOrgjjotVxMrCn1sUJwM76wMszfq1kdU4uYVJjvEWuFQ6HgvLt4Xz3fSmZlTOxJ/Ie13KnIcWQXFA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@sinonjs/commons": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz",+ "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "type-detect": "4.0.8"+ }+ },+ "node_modules/@sinonjs/fake-timers": {+ "version": "13.0.5",+ "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz",+ "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@sinonjs/commons": "^3.0.1"+ }+ },+ "node_modules/@smithy/abort-controller": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.8.tgz",+ "integrity": "sha512-peuVfkYHAmS5ybKxWcfraK7WBBP0J+rkfUcbHJJKQ4ir3UAUNQI+Y4Vt/PqSzGqgloJ5O1dk7+WzNL8wcCSXbw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/chunked-blob-reader": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.2.0.tgz",+ "integrity": "sha512-WmU0TnhEAJLWvfSeMxBNe5xtbselEO8+4wG0NtZeL8oR21WgH1xiO37El+/Y+H/Ie4SCwBy3MxYWmOYaGgZueA==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/chunked-blob-reader-native": {+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.2.1.tgz",+ "integrity": "sha512-lX9Ay+6LisTfpLid2zZtIhSEjHMZoAR5hHCR4H7tBz/Zkfr5ea8RcQ7Tk4mi0P76p4cN+Btz16Ffno7YHpKXnQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/util-base64": "^4.3.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/config-resolver": {+ "version": "4.4.6",+ "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.6.tgz",+ "integrity": "sha512-qJpzYC64kaj3S0fueiu3kXm8xPrR3PcXDPEgnaNMRn0EjNSZFoFjvbUp0YUDsRhN1CB90EnHJtbxWKevnH99UQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/types": "^4.12.0",+ "@smithy/util-config-provider": "^4.2.0",+ "@smithy/util-endpoints": "^3.2.8",+ "@smithy/util-middleware": "^4.2.8",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/core": {+ "version": "3.22.1",+ "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.22.1.tgz",+ "integrity": "sha512-x3ie6Crr58MWrm4viHqqy2Du2rHYZjwu8BekasrQx4ca+Y24dzVAwq3yErdqIbc2G3I0kLQA13PQ+/rde+u65g==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/middleware-serde": "^4.2.9",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "@smithy/util-base64": "^4.3.0",+ "@smithy/util-body-length-browser": "^4.2.0",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-stream": "^4.5.11",+ "@smithy/util-utf8": "^4.2.0",+ "@smithy/uuid": "^1.1.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/credential-provider-imds": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.8.tgz",+ "integrity": "sha512-FNT0xHS1c/CPN8upqbMFP83+ul5YgdisfCfkZ86Jh2NSmnqw/AJ6x5pEogVCTVvSm7j9MopRU89bmDelxuDMYw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/eventstream-codec": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.2.8.tgz",+ "integrity": "sha512-jS/O5Q14UsufqoGhov7dHLOPCzkYJl9QDzusI2Psh4wyYx/izhzvX9P4D69aTxcdfVhEPhjK+wYyn/PzLjKbbw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@aws-crypto/crc32": "5.2.0",+ "@smithy/types": "^4.12.0",+ "@smithy/util-hex-encoding": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/eventstream-serde-browser": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.2.8.tgz",+ "integrity": "sha512-MTfQT/CRQz5g24ayXdjg53V0mhucZth4PESoA5IhvaWVDTOQLfo8qI9vzqHcPsdd2v6sqfTYqF5L/l+pea5Uyw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/eventstream-serde-universal": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/eventstream-serde-config-resolver": {+ "version": "4.3.8",+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.3.8.tgz",+ "integrity": "sha512-ah12+luBiDGzBruhu3efNy1IlbwSEdNiw8fOZksoKoWW1ZHvO/04MQsdnws/9Aj+5b0YXSSN2JXKy/ClIsW8MQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/eventstream-serde-node": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.2.8.tgz",+ "integrity": "sha512-cYpCpp29z6EJHa5T9WL0KAlq3SOKUQkcgSoeRfRVwjGgSFl7Uh32eYGt7IDYCX20skiEdRffyDpvF2efEZPC0A==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/eventstream-serde-universal": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/eventstream-serde-universal": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.2.8.tgz",+ "integrity": "sha512-iJ6YNJd0bntJYnX6s52NC4WFYcZeKrPUr1Kmmr5AwZcwCSzVpS7oavAmxMR7pMq7V+D1G4s9F5NJK0xwOsKAlQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/eventstream-codec": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/fetch-http-handler": {+ "version": "5.3.9",+ "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.9.tgz",+ "integrity": "sha512-I4UhmcTYXBrct03rwzQX1Y/iqQlzVQaPxWjCjula++5EmWq9YGBrx6bbGqluGc1f0XEfhSkiY4jhLgbsJUMKRA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/querystring-builder": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "@smithy/util-base64": "^4.3.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/hash-blob-browser": {+ "version": "4.2.9",+ "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.2.9.tgz",+ "integrity": "sha512-m80d/iicI7DlBDxyQP6Th7BW/ejDGiF0bgI754+tiwK0lgMkcaIBgvwwVc7OFbY4eUzpGtnig52MhPAEJ7iNYg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/chunked-blob-reader": "^5.2.0",+ "@smithy/chunked-blob-reader-native": "^4.2.1",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/hash-node": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.8.tgz",+ "integrity": "sha512-7ZIlPbmaDGxVoxErDZnuFG18WekhbA/g2/i97wGj+wUBeS6pcUeAym8u4BXh/75RXWhgIJhyC11hBzig6MljwA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "@smithy/util-buffer-from": "^4.2.0",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/hash-stream-node": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.2.8.tgz",+ "integrity": "sha512-v0FLTXgHrTeheYZFGhR+ehX5qUm4IQsjAiL9qehad2cyjMWcN2QG6/4mSwbSgEQzI7jwfoXj7z4fxZUx/Mhj2w==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/invalid-dependency": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.8.tgz",+ "integrity": "sha512-N9iozRybwAQ2dn9Fot9kI6/w9vos2oTXLhtK7ovGqwZjlOcxu6XhPlpLpC+INsxktqHinn5gS2DXDjDF2kG5sQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/is-array-buffer": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz",+ "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/md5-js": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.2.8.tgz",+ "integrity": "sha512-oGMaLj4tVZzLi3itBa9TCswgMBr7k9b+qKYowQ6x1rTyTuO1IU2YHdHUa+891OsOH+wCsH7aTPRsTJO3RMQmjQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/middleware-content-length": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.8.tgz",+ "integrity": "sha512-RO0jeoaYAB1qBRhfVyq0pMgBoUK34YEJxVxyjOWYZiOKOq2yMZ4MnVXMZCUDenpozHue207+9P5ilTV1zeda0A==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/middleware-endpoint": {+ "version": "4.4.13",+ "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.4.13.tgz",+ "integrity": "sha512-x6vn0PjYmGdNuKh/juUJJewZh7MoQ46jYaJ2mvekF4EesMuFfrl4LaW/k97Zjf8PTCPQmPgMvwewg7eNoH9n5w==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/core": "^3.22.1",+ "@smithy/middleware-serde": "^4.2.9",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "@smithy/url-parser": "^4.2.8",+ "@smithy/util-middleware": "^4.2.8",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/middleware-retry": {+ "version": "4.4.30",+ "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.30.tgz",+ "integrity": "sha512-CBGyFvN0f8hlnqKH/jckRDz78Snrp345+PVk8Ux7pnkUCW97Iinse59lY78hBt04h1GZ6hjBN94BRwZy1xC8Bg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/service-error-classification": "^4.2.8",+ "@smithy/smithy-client": "^4.11.2",+ "@smithy/types": "^4.12.0",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-retry": "^4.2.8",+ "@smithy/uuid": "^1.1.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/middleware-serde": {+ "version": "4.2.9",+ "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.9.tgz",+ "integrity": "sha512-eMNiej0u/snzDvlqRGSN3Vl0ESn3838+nKyVfF2FKNXFbi4SERYT6PR392D39iczngbqqGG0Jl1DlCnp7tBbXQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/middleware-stack": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.8.tgz",+ "integrity": "sha512-w6LCfOviTYQjBctOKSwy6A8FIkQy7ICvglrZFl6Bw4FmcQ1Z420fUtIhxaUZZshRe0VCq4kvDiPiXrPZAe8oRA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/node-config-provider": {+ "version": "4.3.8",+ "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.8.tgz",+ "integrity": "sha512-aFP1ai4lrbVlWjfpAfRSL8KFcnJQYfTl5QxLJXY32vghJrDuFyPZ6LtUL+JEGYiFRG1PfPLHLoxj107ulncLIg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/property-provider": "^4.2.8",+ "@smithy/shared-ini-file-loader": "^4.4.3",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/node-http-handler": {+ "version": "4.4.9",+ "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.9.tgz",+ "integrity": "sha512-KX5Wml5mF+luxm1szW4QDz32e3NObgJ4Fyw+irhph4I/2geXwUy4jkIMUs5ZPGflRBeR6BUkC2wqIab4Llgm3w==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/abort-controller": "^4.2.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/querystring-builder": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/property-provider": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.8.tgz",+ "integrity": "sha512-EtCTbyIveCKeOXDSWSdze3k612yCPq1YbXsbqX3UHhkOSW8zKsM9NOJG5gTIya0vbY2DIaieG8pKo1rITHYL0w==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/protocol-http": {+ "version": "5.3.8",+ "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.8.tgz",+ "integrity": "sha512-QNINVDhxpZ5QnP3aviNHQFlRogQZDfYlCkQT+7tJnErPQbDhysondEjhikuANxgMsZrkGeiAxXy4jguEGsDrWQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/querystring-builder": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.8.tgz",+ "integrity": "sha512-Xr83r31+DrE8CP3MqPgMJl+pQlLLmOfiEUnoyAlGzzJIrEsbKsPy1hqH0qySaQm4oWrCBlUqRt+idEgunKB+iw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "@smithy/util-uri-escape": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/querystring-parser": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.8.tgz",+ "integrity": "sha512-vUurovluVy50CUlazOiXkPq40KGvGWSdmusa3130MwrR1UNnNgKAlj58wlOe61XSHRpUfIIh6cE0zZ8mzKaDPA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/service-error-classification": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.8.tgz",+ "integrity": "sha512-mZ5xddodpJhEt3RkCjbmUQuXUOaPNTkbMGR0bcS8FE0bJDLMZlhmpgrvPNCYglVw5rsYTpSnv19womw9WWXKQQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/shared-ini-file-loader": {+ "version": "4.4.3",+ "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.3.tgz",+ "integrity": "sha512-DfQjxXQnzC5UbCUPeC3Ie8u+rIWZTvuDPAGU/BxzrOGhRvgUanaP68kDZA+jaT3ZI+djOf+4dERGlm9mWfFDrg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/signature-v4": {+ "version": "5.3.8",+ "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.8.tgz",+ "integrity": "sha512-6A4vdGj7qKNRF16UIcO8HhHjKW27thsxYci+5r/uVRkdcBEkOEiY8OMPuydLX4QHSrJqGHPJzPRwwVTqbLZJhg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/is-array-buffer": "^4.2.0",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "@smithy/util-hex-encoding": "^4.2.0",+ "@smithy/util-middleware": "^4.2.8",+ "@smithy/util-uri-escape": "^4.2.0",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/smithy-client": {+ "version": "4.11.2",+ "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.11.2.tgz",+ "integrity": "sha512-SCkGmFak/xC1n7hKRsUr6wOnBTJ3L22Qd4e8H1fQIuKTAjntwgU8lrdMe7uHdiT2mJAOWA/60qaW9tiMu69n1A==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/core": "^3.22.1",+ "@smithy/middleware-endpoint": "^4.4.13",+ "@smithy/middleware-stack": "^4.2.8",+ "@smithy/protocol-http": "^5.3.8",+ "@smithy/types": "^4.12.0",+ "@smithy/util-stream": "^4.5.11",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/types": {+ "version": "4.12.0",+ "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.12.0.tgz",+ "integrity": "sha512-9YcuJVTOBDjg9LWo23Qp0lTQ3D7fQsQtwle0jVfpbUHy9qBwCEgKuVH4FqFB3VYu0nwdHKiEMA+oXz7oV8X1kw==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/url-parser": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.8.tgz",+ "integrity": "sha512-NQho9U68TGMEU639YkXnVMV3GEFFULmmaWdlu1E9qzyIePOHsoSnagTGSDv1Zi8DCNN6btxOSdgmy5E/hsZwhA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/querystring-parser": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-base64": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.0.tgz",+ "integrity": "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/util-buffer-from": "^4.2.0",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-body-length-browser": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz",+ "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-body-length-node": {+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.1.tgz",+ "integrity": "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-buffer-from": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz",+ "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/is-array-buffer": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-config-provider": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz",+ "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-defaults-mode-browser": {+ "version": "4.3.29",+ "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.29.tgz",+ "integrity": "sha512-nIGy3DNRmOjaYaaKcQDzmWsro9uxlaqUOhZDHQed9MW/GmkBZPtnU70Pu1+GT9IBmUXwRdDuiyaeiy9Xtpn3+Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/property-provider": "^4.2.8",+ "@smithy/smithy-client": "^4.11.2",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-defaults-mode-node": {+ "version": "4.2.32",+ "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.32.tgz",+ "integrity": "sha512-7dtFff6pu5fsjqrVve0YMhrnzJtccCWDacNKOkiZjJ++fmjGExmmSu341x+WU6Oc1IccL7lDuaUj7SfrHpWc5Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/config-resolver": "^4.4.6",+ "@smithy/credential-provider-imds": "^4.2.8",+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/property-provider": "^4.2.8",+ "@smithy/smithy-client": "^4.11.2",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-endpoints": {+ "version": "3.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.8.tgz",+ "integrity": "sha512-8JaVTn3pBDkhZgHQ8R0epwWt+BqPSLCjdjXXusK1onwJlRuN69fbvSK66aIKKO7SwVFM6x2J2ox5X8pOaWcUEw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/node-config-provider": "^4.3.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-hex-encoding": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz",+ "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-middleware": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.8.tgz",+ "integrity": "sha512-PMqfeJxLcNPMDgvPbbLl/2Vpin+luxqTGPpW3NAQVLbRrFRzTa4rNAASYeIGjRV9Ytuhzny39SpyU04EQreF+A==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-retry": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.8.tgz",+ "integrity": "sha512-CfJqwvoRY0kTGe5AkQokpURNCT1u/MkRzMTASWMPPo2hNSnKtF1D45dQl3DE2LKLr4m+PW9mCeBMJr5mCAVThg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/service-error-classification": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-stream": {+ "version": "4.5.11",+ "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.11.tgz",+ "integrity": "sha512-lKmZ0S/3Qj2OF5H1+VzvDLb6kRxGzZHq6f3rAsoSu5cTLGsn3v3VQBA8czkNNXlLjoFEtVu3OQT2jEeOtOE2CA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/fetch-http-handler": "^5.3.9",+ "@smithy/node-http-handler": "^4.4.9",+ "@smithy/types": "^4.12.0",+ "@smithy/util-base64": "^4.3.0",+ "@smithy/util-buffer-from": "^4.2.0",+ "@smithy/util-hex-encoding": "^4.2.0",+ "@smithy/util-utf8": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-uri-escape": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz",+ "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-utf8": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz",+ "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/util-buffer-from": "^4.2.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/util-waiter": {+ "version": "4.2.8",+ "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.2.8.tgz",+ "integrity": "sha512-n+lahlMWk+aejGuax7DPWtqav8HYnWxQwR+LCG2BgCUmaGcTe9qZCFsmw8TMg9iG75HOwhrJCX9TCJRLH+Yzqg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@smithy/abort-controller": "^4.2.8",+ "@smithy/types": "^4.12.0",+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@smithy/uuid": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz",+ "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==",+ "license": "Apache-2.0",+ "dependencies": {+ "tslib": "^2.6.2"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@socket.io/component-emitter": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz",+ "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==",+ "license": "MIT"+ },+ "node_modules/@sqltools/formatter": {+ "version": "1.2.5",+ "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz",+ "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==",+ "license": "MIT"+ },+ "node_modules/@tokenizer/inflate": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.4.1.tgz",+ "integrity": "sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==",+ "license": "MIT",+ "dependencies": {+ "debug": "^4.4.3",+ "token-types": "^6.1.1"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/Borewit"+ }+ },+ "node_modules/@tokenizer/token": {+ "version": "0.3.0",+ "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz",+ "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==",+ "license": "MIT"+ },+ "node_modules/@tootallnate/once": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",+ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/@tootallnate/quickjs-emscripten": {+ "version": "0.23.0",+ "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz",+ "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==",+ "license": "MIT"+ },+ "node_modules/@tsconfig/node10": {+ "version": "1.0.12",+ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz",+ "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/@tsconfig/node12": {+ "version": "1.0.11",+ "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",+ "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/@tsconfig/node14": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",+ "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/@tsconfig/node16": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",+ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/@tybys/wasm-util": {+ "version": "0.10.1",+ "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",+ "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@types/archiver": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/@types/archiver/-/archiver-7.0.0.tgz",+ "integrity": "sha512-/3vwGwx9n+mCQdYZ2IKGGHEFL30I96UgBlk8EtRDDFQ9uxM1l4O5Ci6r00EMAkiDaTqD9DQ6nVrWRICnBPtzzg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/readdir-glob": "*"+ }+ },+ "node_modules/@types/babel__core": {+ "version": "7.20.5",+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",+ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.20.7",+ "@babel/types": "^7.20.7",+ "@types/babel__generator": "*",+ "@types/babel__template": "*",+ "@types/babel__traverse": "*"+ }+ },+ "node_modules/@types/babel__generator": {+ "version": "7.27.0",+ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz",+ "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.0.0"+ }+ },+ "node_modules/@types/babel__template": {+ "version": "7.4.4",+ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",+ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/parser": "^7.1.0",+ "@babel/types": "^7.0.0"+ }+ },+ "node_modules/@types/babel__traverse": {+ "version": "7.28.0",+ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz",+ "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/types": "^7.28.2"+ }+ },+ "node_modules/@types/body-parser": {+ "version": "1.19.6",+ "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz",+ "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/connect": "*",+ "@types/node": "*"+ }+ },+ "node_modules/@types/connect": {+ "version": "3.4.38",+ "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",+ "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/cookiejar": {+ "version": "2.1.5",+ "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.5.tgz",+ "integrity": "sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/cors": {+ "version": "2.8.19",+ "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz",+ "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==",+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/docker-modem": {+ "version": "3.0.6",+ "resolved": "https://registry.npmjs.org/@types/docker-modem/-/docker-modem-3.0.6.tgz",+ "integrity": "sha512-yKpAGEuKRSS8wwx0joknWxsmLha78wNMe9R2S3UNsVOkZded8UqOrV8KoeDXoXsjndxwyF3eIhyClGbO1SEhEg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*",+ "@types/ssh2": "*"+ }+ },+ "node_modules/@types/dockerode": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/@types/dockerode/-/dockerode-4.0.1.tgz",+ "integrity": "sha512-cmUpB+dPN955PxBEuXE3f6lKO1hHiIGYJA46IVF3BJpNsZGvtBDcRnlrHYHtOH/B6vtDOyl2kZ2ShAu3mgc27Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/docker-modem": "*",+ "@types/node": "*",+ "@types/ssh2": "*"+ }+ },+ "node_modules/@types/eslint": {+ "version": "9.6.1",+ "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz",+ "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@types/estree": "*",+ "@types/json-schema": "*"+ }+ },+ "node_modules/@types/eslint-scope": {+ "version": "3.7.7",+ "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz",+ "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/eslint": "*",+ "@types/estree": "*"+ }+ },+ "node_modules/@types/estree": {+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/express": {+ "version": "5.0.6",+ "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.6.tgz",+ "integrity": "sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/body-parser": "*",+ "@types/express-serve-static-core": "^5.0.0",+ "@types/serve-static": "^2"+ }+ },+ "node_modules/@types/express-serve-static-core": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.1.1.tgz",+ "integrity": "sha512-v4zIMr/cX7/d2BpAEX3KNKL/JrT1s43s96lLvvdTmza1oEvDudCqK9aF/djc/SWgy8Yh0h30TZx5VpzqFCxk5A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*",+ "@types/qs": "*",+ "@types/range-parser": "*",+ "@types/send": "*"+ }+ },+ "node_modules/@types/http-errors": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz",+ "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/istanbul-lib-coverage": {+ "version": "2.0.6",+ "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",+ "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/istanbul-lib-report": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz",+ "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/istanbul-lib-coverage": "*"+ }+ },+ "node_modules/@types/istanbul-reports": {+ "version": "3.0.4",+ "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz",+ "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/istanbul-lib-report": "*"+ }+ },+ "node_modules/@types/jest": {+ "version": "30.0.0",+ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-30.0.0.tgz",+ "integrity": "sha512-XTYugzhuwqWjws0CVz8QpM36+T+Dz5mTEBKhNs/esGLnCIlGdRy+Dq78NRjd7ls7r8BC8ZRMOrKlkO1hU0JOwA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "expect": "^30.0.0",+ "pretty-format": "^30.0.0"+ }+ },+ "node_modules/@types/json-schema": {+ "version": "7.0.15",+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",+ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/methods": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/@types/methods/-/methods-1.1.4.tgz",+ "integrity": "sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/node": {+ "version": "22.19.8",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.8.tgz",+ "integrity": "sha512-ebO/Yl+EAvVe8DnMfi+iaAyIqYdK0q/q0y0rw82INWEKJOBe6b/P3YWE8NW7oOlF/nXFNrHwhARrN/hdgDkraA==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "undici-types": "~6.21.0"+ }+ },+ "node_modules/@types/qrcode": {+ "version": "1.5.6",+ "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.6.tgz",+ "integrity": "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/qs": {+ "version": "6.14.0",+ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz",+ "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/range-parser": {+ "version": "1.2.7",+ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",+ "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/readdir-glob": {+ "version": "1.1.5",+ "resolved": "https://registry.npmjs.org/@types/readdir-glob/-/readdir-glob-1.1.5.tgz",+ "integrity": "sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/send": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.1.tgz",+ "integrity": "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/serve-static": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-2.2.0.tgz",+ "integrity": "sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/http-errors": "*",+ "@types/node": "*"+ }+ },+ "node_modules/@types/ssh2": {+ "version": "1.15.5",+ "resolved": "https://registry.npmjs.org/@types/ssh2/-/ssh2-1.15.5.tgz",+ "integrity": "sha512-N1ASjp/nXH3ovBHddRJpli4ozpk6UdDYIX4RJWFa9L1YKnzdhTlVmiGHm4DZnj/jLbqZpes4aeR30EFGQtvhQQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "^18.11.18"+ }+ },+ "node_modules/@types/ssh2/node_modules/@types/node": {+ "version": "18.19.130",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz",+ "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~5.26.4"+ }+ },+ "node_modules/@types/ssh2/node_modules/undici-types": {+ "version": "5.26.5",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/stack-utils": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz",+ "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/superagent": {+ "version": "8.1.9",+ "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-8.1.9.tgz",+ "integrity": "sha512-pTVjI73witn+9ILmoJdajHGW2jkSaOzhiFYF1Rd3EQ94kymLqB9PjD9ISg7WaALC7+dCHT0FGe9T2LktLq/3GQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/cookiejar": "^2.1.5",+ "@types/methods": "^1.1.4",+ "@types/node": "*",+ "form-data": "^4.0.0"+ }+ },+ "node_modules/@types/supertest": {+ "version": "6.0.3",+ "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-6.0.3.tgz",+ "integrity": "sha512-8WzXq62EXFhJ7QsH3Ocb/iKQ/Ty9ZVWnVzoTKc9tyyFRRF3a74Tk2+TLFgaFFw364Ere+npzHKEJ6ga2LzIL7w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/methods": "^1.1.4",+ "@types/superagent": "^8.1.0"+ }+ },+ "node_modules/@types/tar-stream": {+ "version": "3.1.4",+ "resolved": "https://registry.npmjs.org/@types/tar-stream/-/tar-stream-3.1.4.tgz",+ "integrity": "sha512-921gW0+g29mCJX0fRvqeHzBlE/XclDaAG0Ousy1LCghsOhvaKacDeRGEVzQP9IPfKn8Vysy7FEXAIxycpc/CMg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/uuid": {+ "version": "10.0.0",+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",+ "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/validator": {+ "version": "13.15.10",+ "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.10.tgz",+ "integrity": "sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==",+ "license": "MIT"+ },+ "node_modules/@types/yargs": {+ "version": "17.0.35",+ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz",+ "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/yargs-parser": "*"+ }+ },+ "node_modules/@types/yargs-parser": {+ "version": "21.0.3",+ "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz",+ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/yauzl": {+ "version": "2.10.3",+ "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz",+ "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@typescript-eslint/eslint-plugin": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.54.0.tgz",+ "integrity": "sha512-hAAP5io/7csFStuOmR782YmTthKBJ9ND3WVL60hcOjvtGFb+HJxH4O5huAcmcZ9v9G8P+JETiZ/G1B8MALnWZQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@eslint-community/regexpp": "^4.12.2",+ "@typescript-eslint/scope-manager": "8.54.0",+ "@typescript-eslint/type-utils": "8.54.0",+ "@typescript-eslint/utils": "8.54.0",+ "@typescript-eslint/visitor-keys": "8.54.0",+ "ignore": "^7.0.5",+ "natural-compare": "^1.4.0",+ "ts-api-utils": "^2.4.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "@typescript-eslint/parser": "^8.54.0",+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {+ "version": "7.0.5",+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",+ "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/@typescript-eslint/parser": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.54.0.tgz",+ "integrity": "sha512-BtE0k6cjwjLZoZixN0t5AKP0kSzlGu7FctRXYuPAm//aaiZhmfq1JwdYpYr1brzEspYyFeF+8XF5j2VK6oalrA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@typescript-eslint/scope-manager": "8.54.0",+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/typescript-estree": "8.54.0",+ "@typescript-eslint/visitor-keys": "8.54.0",+ "debug": "^4.4.3"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/project-service": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.54.0.tgz",+ "integrity": "sha512-YPf+rvJ1s7MyiWM4uTRhE4DvBXrEV+d8oC3P9Y2eT7S+HBS0clybdMIPnhiATi9vZOYDc7OQ1L/i6ga6NFYK/g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/tsconfig-utils": "^8.54.0",+ "@typescript-eslint/types": "^8.54.0",+ "debug": "^4.4.3"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/scope-manager": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.54.0.tgz",+ "integrity": "sha512-27rYVQku26j/PbHYcVfRPonmOlVI6gihHtXFbTdB5sb6qA0wdAQAbyXFVarQ5t4HRojIz64IV90YtsjQSSGlQg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/visitor-keys": "8.54.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@typescript-eslint/tsconfig-utils": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.54.0.tgz",+ "integrity": "sha512-dRgOyT2hPk/JwxNMZDsIXDgyl9axdJI3ogZ2XWhBPsnZUv+hPesa5iuhdYt2gzwA9t8RE5ytOJ6xB0moV0Ujvw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/type-utils": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.54.0.tgz",+ "integrity": "sha512-hiLguxJWHjjwL6xMBwD903ciAwd7DmK30Y9Axs/etOkftC3ZNN9K44IuRD/EB08amu+Zw6W37x9RecLkOo3pMA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/typescript-estree": "8.54.0",+ "@typescript-eslint/utils": "8.54.0",+ "debug": "^4.4.3",+ "ts-api-utils": "^2.4.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/types": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.54.0.tgz",+ "integrity": "sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.54.0.tgz",+ "integrity": "sha512-BUwcskRaPvTk6fzVWgDPdUndLjB87KYDrN5EYGetnktoeAvPtO4ONHlAZDnj5VFnUANg0Sjm7j4usBlnoVMHwA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/project-service": "8.54.0",+ "@typescript-eslint/tsconfig-utils": "8.54.0",+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/visitor-keys": "8.54.0",+ "debug": "^4.4.3",+ "minimatch": "^9.0.5",+ "semver": "^7.7.3",+ "tinyglobby": "^0.2.15",+ "ts-api-utils": "^2.4.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {+ "version": "9.0.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/@typescript-eslint/utils": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.54.0.tgz",+ "integrity": "sha512-9Cnda8GS57AQakvRyG0PTejJNlA2xhvyNtEVIMlDWOOeEyBkYWhGPnfrIAnqxLMTSTo6q8g12XVjjev5l1NvMA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@eslint-community/eslint-utils": "^4.9.1",+ "@typescript-eslint/scope-manager": "8.54.0",+ "@typescript-eslint/types": "8.54.0",+ "@typescript-eslint/typescript-estree": "8.54.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/visitor-keys": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.54.0.tgz",+ "integrity": "sha512-VFlhGSl4opC0bprJiItPQ1RfUhGDIBokcPwaFH4yiBCaNPeld/9VeXbiPO1cLyorQi1G1vL+ecBk1x8o1axORA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.54.0",+ "eslint-visitor-keys": "^4.2.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@ungap/structured-clone": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz",+ "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/@unrs/resolver-binding-android-arm-eabi": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz",+ "integrity": "sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@unrs/resolver-binding-android-arm64": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz",+ "integrity": "sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@unrs/resolver-binding-darwin-arm64": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz",+ "integrity": "sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@unrs/resolver-binding-darwin-x64": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz",+ "integrity": "sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@unrs/resolver-binding-freebsd-x64": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz",+ "integrity": "sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz",+ "integrity": "sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz",+ "integrity": "sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-arm64-gnu": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz",+ "integrity": "sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-arm64-musl": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz",+ "integrity": "sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz",+ "integrity": "sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz",+ "integrity": "sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-riscv64-musl": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz",+ "integrity": "sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-s390x-gnu": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz",+ "integrity": "sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-x64-gnu": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz",+ "integrity": "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-linux-x64-musl": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz",+ "integrity": "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@unrs/resolver-binding-wasm32-wasi": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz",+ "integrity": "sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==",+ "cpu": [+ "wasm32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@napi-rs/wasm-runtime": "^0.2.11"+ },+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/@unrs/resolver-binding-win32-arm64-msvc": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz",+ "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@unrs/resolver-binding-win32-ia32-msvc": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz",+ "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@unrs/resolver-binding-win32-x64-msvc": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz",+ "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@webassemblyjs/ast": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz",+ "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@webassemblyjs/helper-numbers": "1.13.2",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2"+ }+ },+ "node_modules/@webassemblyjs/floating-point-hex-parser": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz",+ "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@webassemblyjs/helper-api-error": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz",+ "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@webassemblyjs/helper-buffer": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz",+ "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@webassemblyjs/helper-numbers": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz",+ "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@webassemblyjs/floating-point-hex-parser": "1.13.2",+ "@webassemblyjs/helper-api-error": "1.13.2",+ "@xtuc/long": "4.2.2"+ }+ },+ "node_modules/@webassemblyjs/helper-wasm-bytecode": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz",+ "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@webassemblyjs/helper-wasm-section": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz",+ "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-buffer": "1.14.1",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2",+ "@webassemblyjs/wasm-gen": "1.14.1"+ }+ },+ "node_modules/@webassemblyjs/ieee754": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz",+ "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@xtuc/ieee754": "^1.2.0"+ }+ },+ "node_modules/@webassemblyjs/leb128": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz",+ "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@xtuc/long": "4.2.2"+ }+ },+ "node_modules/@webassemblyjs/utf8": {+ "version": "1.13.2",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz",+ "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@webassemblyjs/wasm-edit": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz",+ "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-buffer": "1.14.1",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2",+ "@webassemblyjs/helper-wasm-section": "1.14.1",+ "@webassemblyjs/wasm-gen": "1.14.1",+ "@webassemblyjs/wasm-opt": "1.14.1",+ "@webassemblyjs/wasm-parser": "1.14.1",+ "@webassemblyjs/wast-printer": "1.14.1"+ }+ },+ "node_modules/@webassemblyjs/wasm-gen": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz",+ "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2",+ "@webassemblyjs/ieee754": "1.13.2",+ "@webassemblyjs/leb128": "1.13.2",+ "@webassemblyjs/utf8": "1.13.2"+ }+ },+ "node_modules/@webassemblyjs/wasm-opt": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz",+ "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-buffer": "1.14.1",+ "@webassemblyjs/wasm-gen": "1.14.1",+ "@webassemblyjs/wasm-parser": "1.14.1"+ }+ },+ "node_modules/@webassemblyjs/wasm-parser": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz",+ "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@webassemblyjs/helper-api-error": "1.13.2",+ "@webassemblyjs/helper-wasm-bytecode": "1.13.2",+ "@webassemblyjs/ieee754": "1.13.2",+ "@webassemblyjs/leb128": "1.13.2",+ "@webassemblyjs/utf8": "1.13.2"+ }+ },+ "node_modules/@webassemblyjs/wast-printer": {+ "version": "1.14.1",+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz",+ "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@webassemblyjs/ast": "1.14.1",+ "@xtuc/long": "4.2.2"+ }+ },+ "node_modules/@xtuc/ieee754": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",+ "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/@xtuc/long": {+ "version": "4.2.2",+ "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",+ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==",+ "dev": true,+ "license": "Apache-2.0"+ },+ "node_modules/abbrev": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/abort-controller": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",+ "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",+ "license": "MIT",+ "dependencies": {+ "event-target-shim": "^5.0.0"+ },+ "engines": {+ "node": ">=6.5"+ }+ },+ "node_modules/accepts": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",+ "license": "MIT",+ "dependencies": {+ "mime-types": "^3.0.0",+ "negotiator": "^1.0.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/acorn": {+ "version": "8.15.0",+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",+ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",+ "devOptional": true,+ "license": "MIT",+ "peer": true,+ "bin": {+ "acorn": "bin/acorn"+ },+ "engines": {+ "node": ">=0.4.0"+ }+ },+ "node_modules/acorn-import-phases": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz",+ "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10.13.0"+ },+ "peerDependencies": {+ "acorn": "^8.14.0"+ }+ },+ "node_modules/acorn-jsx": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",+ "dev": true,+ "license": "MIT",+ "peerDependencies": {+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"+ }+ },+ "node_modules/acorn-walk": {+ "version": "8.3.4",+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz",+ "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "acorn": "^8.11.0"+ },+ "engines": {+ "node": ">=0.4.0"+ }+ },+ "node_modules/agent-base": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",+ "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "debug": "4"+ },+ "engines": {+ "node": ">= 6.0.0"+ }+ },+ "node_modules/agentkeepalive": {+ "version": "4.6.0",+ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz",+ "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "humanize-ms": "^1.2.1"+ },+ "engines": {+ "node": ">= 8.0.0"+ }+ },+ "node_modules/aggregate-error": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",+ "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "clean-stack": "^2.0.0",+ "indent-string": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/ajv": {+ "version": "6.12.6",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.1",+ "fast-json-stable-stringify": "^2.0.0",+ "json-schema-traverse": "^0.4.1",+ "uri-js": "^4.2.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/ajv-formats": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",+ "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependenciesMeta": {+ "ajv": {+ "optional": true+ }+ }+ },+ "node_modules/ajv-formats/node_modules/ajv": {+ "version": "8.17.1",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/ajv-formats/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/ajv-keywords": {+ "version": "3.5.2",+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",+ "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",+ "dev": true,+ "license": "MIT",+ "peerDependencies": {+ "ajv": "^6.9.1"+ }+ },+ "node_modules/ansi-align": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz",+ "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "string-width": "^4.1.0"+ }+ },+ "node_modules/ansi-colors": {+ "version": "4.1.3",+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",+ "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/ansi-escapes": {+ "version": "4.3.2",+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",+ "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "type-fest": "^0.21.3"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/ansi-regex": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/ansi-styles": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",+ "license": "MIT",+ "dependencies": {+ "color-convert": "^2.0.1"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/ansis": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/ansis/-/ansis-4.2.0.tgz",+ "integrity": "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==",+ "license": "ISC",+ "engines": {+ "node": ">=14"+ }+ },+ "node_modules/anymatch": {+ "version": "3.1.3",+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",+ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "normalize-path": "^3.0.0",+ "picomatch": "^2.0.4"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/anymatch/node_modules/picomatch": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/app-root-path": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz",+ "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==",+ "license": "MIT",+ "engines": {+ "node": ">= 6.0.0"+ }+ },+ "node_modules/append-field": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz",+ "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==",+ "license": "MIT"+ },+ "node_modules/aproba": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz",+ "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/archiver": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz",+ "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==",+ "license": "MIT",+ "dependencies": {+ "archiver-utils": "^5.0.2",+ "async": "^3.2.4",+ "buffer-crc32": "^1.0.0",+ "readable-stream": "^4.0.0",+ "readdir-glob": "^1.1.2",+ "tar-stream": "^3.0.0",+ "zip-stream": "^6.0.1"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/archiver-utils": {+ "version": "5.0.2",+ "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz",+ "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==",+ "license": "MIT",+ "dependencies": {+ "glob": "^10.0.0",+ "graceful-fs": "^4.2.0",+ "is-stream": "^2.0.1",+ "lazystream": "^1.0.0",+ "lodash": "^4.17.15",+ "normalize-path": "^3.0.0",+ "readable-stream": "^4.0.0"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/archiver-utils/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/archiver-utils/node_modules/glob": {+ "version": "10.5.0",+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",+ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "license": "ISC",+ "dependencies": {+ "foreground-child": "^3.1.0",+ "jackspeak": "^3.1.2",+ "minimatch": "^9.0.4",+ "minipass": "^7.1.2",+ "package-json-from-dist": "^1.0.0",+ "path-scurry": "^1.11.1"+ },+ "bin": {+ "glob": "dist/esm/bin.mjs"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/archiver-utils/node_modules/lru-cache": {+ "version": "10.4.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",+ "license": "ISC"+ },+ "node_modules/archiver-utils/node_modules/minimatch": {+ "version": "9.0.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/archiver-utils/node_modules/path-scurry": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "lru-cache": "^10.2.0",+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"+ },+ "engines": {+ "node": ">=16 || 14 >=14.18"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/are-we-there-yet": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz",+ "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==",+ "deprecated": "This package is no longer supported.",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "delegates": "^1.0.0",+ "readable-stream": "^3.6.0"+ },+ "engines": {+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"+ }+ },+ "node_modules/are-we-there-yet/node_modules/readable-stream": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "inherits": "^2.0.3",+ "string_decoder": "^1.1.1",+ "util-deprecate": "^1.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/arg": {+ "version": "4.1.3",+ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",+ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/argparse": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",+ "license": "Python-2.0"+ },+ "node_modules/array-timsort": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz",+ "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/asap": {+ "version": "2.0.6",+ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",+ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/asn1": {+ "version": "0.2.6",+ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",+ "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",+ "license": "MIT",+ "dependencies": {+ "safer-buffer": "~2.1.0"+ }+ },+ "node_modules/ast-types": {+ "version": "0.13.4",+ "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz",+ "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==",+ "license": "MIT",+ "dependencies": {+ "tslib": "^2.0.1"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/async": {+ "version": "3.2.6",+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",+ "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==",+ "license": "MIT"+ },+ "node_modules/asynckit": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/available-typed-arrays": {+ "version": "1.0.7",+ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",+ "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==",+ "license": "MIT",+ "dependencies": {+ "possible-typed-array-names": "^1.0.0"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/b4a": {+ "version": "1.7.3",+ "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.7.3.tgz",+ "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==",+ "license": "Apache-2.0",+ "peerDependencies": {+ "react-native-b4a": "*"+ },+ "peerDependenciesMeta": {+ "react-native-b4a": {+ "optional": true+ }+ }+ },+ "node_modules/babel-jest": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.2.0.tgz",+ "integrity": "sha512-0YiBEOxWqKkSQWL9nNGGEgndoeL0ZpWrbLMNL5u/Kaxrli3Eaxlt3ZtIDktEvXt4L/R9r3ODr2zKwGM/2BjxVw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/transform": "30.2.0",+ "@types/babel__core": "^7.20.5",+ "babel-plugin-istanbul": "^7.0.1",+ "babel-preset-jest": "30.2.0",+ "chalk": "^4.1.2",+ "graceful-fs": "^4.2.11",+ "slash": "^3.0.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.11.0 || ^8.0.0-0"+ }+ },+ "node_modules/babel-plugin-istanbul": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.1.tgz",+ "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "workspaces": [+ "test/babel-8"+ ],+ "dependencies": {+ "@babel/helper-plugin-utils": "^7.0.0",+ "@istanbuljs/load-nyc-config": "^1.0.0",+ "@istanbuljs/schema": "^0.1.3",+ "istanbul-lib-instrument": "^6.0.2",+ "test-exclude": "^6.0.0"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/babel-plugin-jest-hoist": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.2.0.tgz",+ "integrity": "sha512-ftzhzSGMUnOzcCXd6WHdBGMyuwy15Wnn0iyyWGKgBDLxf9/s5ABuraCSpBX2uG0jUg4rqJnxsLc5+oYBqoxVaA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/babel__core": "^7.20.5"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/babel-preset-current-node-syntax": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz",+ "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/plugin-syntax-async-generators": "^7.8.4",+ "@babel/plugin-syntax-bigint": "^7.8.3",+ "@babel/plugin-syntax-class-properties": "^7.12.13",+ "@babel/plugin-syntax-class-static-block": "^7.14.5",+ "@babel/plugin-syntax-import-attributes": "^7.24.7",+ "@babel/plugin-syntax-import-meta": "^7.10.4",+ "@babel/plugin-syntax-json-strings": "^7.8.3",+ "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4",+ "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",+ "@babel/plugin-syntax-numeric-separator": "^7.10.4",+ "@babel/plugin-syntax-object-rest-spread": "^7.8.3",+ "@babel/plugin-syntax-optional-catch-binding": "^7.8.3",+ "@babel/plugin-syntax-optional-chaining": "^7.8.3",+ "@babel/plugin-syntax-private-property-in-object": "^7.14.5",+ "@babel/plugin-syntax-top-level-await": "^7.14.5"+ },+ "peerDependencies": {+ "@babel/core": "^7.0.0 || ^8.0.0-0"+ }+ },+ "node_modules/babel-preset-jest": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.2.0.tgz",+ "integrity": "sha512-US4Z3NOieAQumwFnYdUWKvUKh8+YSnS/gB3t6YBiz0bskpu7Pine8pPCheNxlPEW4wnUkma2a94YuW2q3guvCQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "babel-plugin-jest-hoist": "30.2.0",+ "babel-preset-current-node-syntax": "^1.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "peerDependencies": {+ "@babel/core": "^7.11.0 || ^8.0.0-beta.1"+ }+ },+ "node_modules/balanced-match": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",+ "license": "MIT"+ },+ "node_modules/bare-events": {+ "version": "2.8.2",+ "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",+ "integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==",+ "license": "Apache-2.0",+ "peerDependencies": {+ "bare-abort-controller": "*"+ },+ "peerDependenciesMeta": {+ "bare-abort-controller": {+ "optional": true+ }+ }+ },+ "node_modules/bare-fs": {+ "version": "4.5.3",+ "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.3.tgz",+ "integrity": "sha512-9+kwVx8QYvt3hPWnmb19tPnh38c6Nihz8Lx3t0g9+4GoIf3/fTgYwM4Z6NxgI+B9elLQA7mLE9PpqcWtOMRDiQ==",+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "bare-events": "^2.5.4",+ "bare-path": "^3.0.0",+ "bare-stream": "^2.6.4",+ "bare-url": "^2.2.2",+ "fast-fifo": "^1.3.2"+ },+ "engines": {+ "bare": ">=1.16.0"+ },+ "peerDependencies": {+ "bare-buffer": "*"+ },+ "peerDependenciesMeta": {+ "bare-buffer": {+ "optional": true+ }+ }+ },+ "node_modules/bare-os": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.2.tgz",+ "integrity": "sha512-T+V1+1srU2qYNBmJCXZkUY5vQ0B4FSlL3QDROnKQYOqeiQR8UbjNHlPa+TIbM4cuidiN9GaTaOZgSEgsvPbh5A==",+ "license": "Apache-2.0",+ "optional": true,+ "engines": {+ "bare": ">=1.14.0"+ }+ },+ "node_modules/bare-path": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",+ "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==",+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "bare-os": "^3.0.1"+ }+ },+ "node_modules/bare-stream": {+ "version": "2.7.0",+ "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.7.0.tgz",+ "integrity": "sha512-oyXQNicV1y8nc2aKffH+BUHFRXmx6VrPzlnaEvMhram0nPBrKcEdcyBg5r08D0i8VxngHFAiVyn1QKXpSG0B8A==",+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "streamx": "^2.21.0"+ },+ "peerDependencies": {+ "bare-buffer": "*",+ "bare-events": "*"+ },+ "peerDependenciesMeta": {+ "bare-buffer": {+ "optional": true+ },+ "bare-events": {+ "optional": true+ }+ }+ },+ "node_modules/bare-url": {+ "version": "2.3.2",+ "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.3.2.tgz",+ "integrity": "sha512-ZMq4gd9ngV5aTMa5p9+UfY0b3skwhHELaDkhEHetMdX0LRkW9kzaym4oo/Eh+Ghm0CCDuMTsRIGM/ytUc1ZYmw==",+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "bare-path": "^3.0.0"+ }+ },+ "node_modules/base64-js": {+ "version": "1.5.1",+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/base64id": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",+ "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==",+ "license": "MIT",+ "engines": {+ "node": "^4.5.0 || >= 5.9"+ }+ },+ "node_modules/baseline-browser-mapping": {+ "version": "2.9.19",+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz",+ "integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "baseline-browser-mapping": "dist/cli.js"+ }+ },+ "node_modules/basic-ftp": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.1.0.tgz",+ "integrity": "sha512-RkaJzeJKDbaDWTIPiJwubyljaEPwpVWkm9Rt5h9Nd6h7tEXTJ3VB4qxdZBioV7JO5yLUaOKwz7vDOzlncUsegw==",+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/bcrypt-pbkdf": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",+ "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "tweetnacl": "^0.14.3"+ }+ },+ "node_modules/big-integer": {+ "version": "1.6.52",+ "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz",+ "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==",+ "license": "Unlicense",+ "optional": true,+ "engines": {+ "node": ">=0.6"+ }+ },+ "node_modules/binary": {+ "version": "0.3.0",+ "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",+ "integrity": "sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "buffers": "~0.1.1",+ "chainsaw": "~0.1.0"+ },+ "engines": {+ "node": "*"+ }+ },+ "node_modules/bindings": {+ "version": "1.5.0",+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",+ "license": "MIT",+ "dependencies": {+ "file-uri-to-path": "1.0.0"+ }+ },+ "node_modules/bl": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",+ "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",+ "license": "MIT",+ "dependencies": {+ "buffer": "^5.5.0",+ "inherits": "^2.0.4",+ "readable-stream": "^3.4.0"+ }+ },+ "node_modules/bl/node_modules/readable-stream": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",+ "license": "MIT",+ "dependencies": {+ "inherits": "^2.0.3",+ "string_decoder": "^1.1.1",+ "util-deprecate": "^1.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/bluebird": {+ "version": "3.4.7",+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz",+ "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/body-parser": {+ "version": "2.2.2",+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz",+ "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==",+ "license": "MIT",+ "dependencies": {+ "bytes": "^3.1.2",+ "content-type": "^1.0.5",+ "debug": "^4.4.3",+ "http-errors": "^2.0.0",+ "iconv-lite": "^0.7.0",+ "on-finished": "^2.4.1",+ "qs": "^6.14.1",+ "raw-body": "^3.0.1",+ "type-is": "^2.0.1"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/bowser": {+ "version": "2.13.1",+ "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.13.1.tgz",+ "integrity": "sha512-OHawaAbjwx6rqICCKgSG0SAnT05bzd7ppyKLVUITZpANBaaMFBAsaNkto3LoQ31tyFP5kNujE8Cdx85G9VzOkw==",+ "license": "MIT"+ },+ "node_modules/boxen": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz",+ "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "ansi-align": "^3.0.0",+ "camelcase": "^6.2.0",+ "chalk": "^4.1.0",+ "cli-boxes": "^2.2.1",+ "string-width": "^4.2.2",+ "type-fest": "^0.20.2",+ "widest-line": "^3.1.0",+ "wrap-ansi": "^7.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/boxen/node_modules/camelcase": {+ "version": "6.3.0",+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/boxen/node_modules/type-fest": {+ "version": "0.20.2",+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",+ "license": "(MIT OR CC0-1.0)",+ "optional": true,+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/boxen/node_modules/wrap-ansi": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/brace-expansion": {+ "version": "1.1.12",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0",+ "concat-map": "0.0.1"+ }+ },+ "node_modules/braces": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fill-range": "^7.1.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/browserslist": {+ "version": "4.28.1",+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",+ "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/browserslist"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "baseline-browser-mapping": "^2.9.0",+ "caniuse-lite": "^1.0.30001759",+ "electron-to-chromium": "^1.5.263",+ "node-releases": "^2.0.27",+ "update-browserslist-db": "^1.2.0"+ },+ "bin": {+ "browserslist": "cli.js"+ },+ "engines": {+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"+ }+ },+ "node_modules/bs-logger": {+ "version": "0.2.6",+ "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz",+ "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-json-stable-stringify": "2.x"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/bser": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz",+ "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "node-int64": "^0.4.0"+ }+ },+ "node_modules/buffer": {+ "version": "5.7.1",+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "base64-js": "^1.3.1",+ "ieee754": "^1.1.13"+ }+ },+ "node_modules/buffer-crc32": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz",+ "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==",+ "license": "MIT",+ "engines": {+ "node": ">=8.0.0"+ }+ },+ "node_modules/buffer-from": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",+ "license": "MIT"+ },+ "node_modules/buffer-indexof-polyfill": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz",+ "integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=0.10"+ }+ },+ "node_modules/buffers": {+ "version": "0.1.1",+ "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",+ "integrity": "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==",+ "optional": true,+ "engines": {+ "node": ">=0.2.0"+ }+ },+ "node_modules/buildcheck": {+ "version": "0.0.7",+ "resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.7.tgz",+ "integrity": "sha512-lHblz4ahamxpTmnsk+MNTRWsjYKv965MwOrSJyeD588rR3Jcu7swE+0wN5F+PbL5cjgu/9ObkhfzEPuofEMwLA==",+ "optional": true,+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/bullmq": {+ "version": "5.67.2",+ "resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.67.2.tgz",+ "integrity": "sha512-3KYqNqQptKcgksACO1li4YW9/jxEh6XWa1lUg4OFrHa80Pf0C7H9zeb6ssbQQDfQab/K3QCXopbZ40vrvcyrLw==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "cron-parser": "4.9.0",+ "ioredis": "5.9.2",+ "msgpackr": "1.11.5",+ "node-abort-controller": "3.1.1",+ "semver": "7.7.3",+ "tslib": "2.8.1",+ "uuid": "11.1.0"+ }+ },+ "node_modules/busboy": {+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",+ "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",+ "dependencies": {+ "streamsearch": "^1.1.0"+ },+ "engines": {+ "node": ">=10.16.0"+ }+ },+ "node_modules/bytes": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/cacache": {+ "version": "15.3.0",+ "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz",+ "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "@npmcli/fs": "^1.0.0",+ "@npmcli/move-file": "^1.0.1",+ "chownr": "^2.0.0",+ "fs-minipass": "^2.0.0",+ "glob": "^7.1.4",+ "infer-owner": "^1.0.4",+ "lru-cache": "^6.0.0",+ "minipass": "^3.1.1",+ "minipass-collect": "^1.0.2",+ "minipass-flush": "^1.0.5",+ "minipass-pipeline": "^1.2.2",+ "mkdirp": "^1.0.3",+ "p-map": "^4.0.0",+ "promise-inflight": "^1.0.1",+ "rimraf": "^3.0.2",+ "ssri": "^8.0.1",+ "tar": "^6.0.2",+ "unique-filename": "^1.1.1"+ },+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/cacache/node_modules/glob": {+ "version": "7.2.3",+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "fs.realpath": "^1.0.0",+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "^3.1.1",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ },+ "engines": {+ "node": "*"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/cacache/node_modules/lru-cache": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/cacache/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/cacache/node_modules/mkdirp": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",+ "license": "MIT",+ "optional": true,+ "bin": {+ "mkdirp": "bin/cmd.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/cacache/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/call-bind": {+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",+ "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.0",+ "es-define-property": "^1.0.0",+ "get-intrinsic": "^1.2.4",+ "set-function-length": "^1.2.2"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/call-bind-apply-helpers": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "function-bind": "^1.1.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/call-bound": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.2",+ "get-intrinsic": "^1.3.0"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/callsites": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/camelcase": {+ "version": "5.3.1",+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/caniuse-lite": {+ "version": "1.0.30001767",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001767.tgz",+ "integrity": "sha512-34+zUAMhSH+r+9eKmYG+k2Rpt8XttfE4yXAjoZvkAPs15xcYQhyBYdalJ65BzivAvGRMViEjy6oKr/S91loekQ==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "CC-BY-4.0"+ },+ "node_modules/chainsaw": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",+ "integrity": "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==",+ "license": "MIT/X11",+ "optional": true,+ "dependencies": {+ "traverse": ">=0.3.0 <0.4"+ },+ "engines": {+ "node": "*"+ }+ },+ "node_modules/chalk": {+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.1.0",+ "supports-color": "^7.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/chalk?sponsor=1"+ }+ },+ "node_modules/chalk/node_modules/supports-color": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "has-flag": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/char-regex": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz",+ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/chardet": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz",+ "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/check-disk-space": {+ "version": "3.4.0",+ "resolved": "https://registry.npmjs.org/check-disk-space/-/check-disk-space-3.4.0.tgz",+ "integrity": "sha512-drVkSqfwA+TvuEhFipiR1OC9boEGZL5RrWvVsOthdcvQNXyCCuKkEiTOTXZ7qxSf/GLwq4GvzfrQD/Wz325hgw==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/chokidar": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",+ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "readdirp": "^4.0.1"+ },+ "engines": {+ "node": ">= 14.16.0"+ },+ "funding": {+ "url": "https://paulmillr.com/funding/"+ }+ },+ "node_modules/chownr": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",+ "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",+ "license": "ISC",+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/chrome-trace-event": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz",+ "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0"+ }+ },+ "node_modules/chromium-bidi": {+ "version": "13.0.1",+ "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-13.0.1.tgz",+ "integrity": "sha512-c+RLxH0Vg2x2syS9wPw378oJgiJNXtYXUvnVAldUlt5uaHekn0CCU7gPksNgHjrH1qFhmjVXQj4esvuthuC7OQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "mitt": "^3.0.1",+ "zod": "^3.24.1"+ },+ "peerDependencies": {+ "devtools-protocol": "*"+ }+ },+ "node_modules/ci-info": {+ "version": "4.4.0",+ "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz",+ "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/sibiraj-s"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/cjs-module-lexer": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.2.0.tgz",+ "integrity": "sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/class-transformer": {+ "version": "0.5.1",+ "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz",+ "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==",+ "license": "MIT",+ "peer": true+ },+ "node_modules/class-validator": {+ "version": "0.14.3",+ "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.3.tgz",+ "integrity": "sha512-rXXekcjofVN1LTOSw+u4u9WXVEUvNBVjORW154q/IdmYWy1nMbOU9aNtZB0t8m+FJQ9q91jlr2f9CwwUFdFMRA==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@types/validator": "^13.15.3",+ "libphonenumber-js": "^1.11.1",+ "validator": "^13.15.20"+ }+ },+ "node_modules/clean-stack": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",+ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/cli-boxes": {+ "version": "2.2.1",+ "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz",+ "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/cli-cursor": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",+ "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "restore-cursor": "^3.1.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/cli-spinners": {+ "version": "2.9.2",+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",+ "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/cli-table3": {+ "version": "0.6.5",+ "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz",+ "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "string-width": "^4.2.0"+ },+ "engines": {+ "node": "10.* || >= 12.*"+ },+ "optionalDependencies": {+ "@colors/colors": "1.5.0"+ }+ },+ "node_modules/cli-width": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz",+ "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==",+ "dev": true,+ "license": "ISC",+ "engines": {+ "node": ">= 12"+ }+ },+ "node_modules/cliui": {+ "version": "8.0.1",+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",+ "license": "ISC",+ "dependencies": {+ "string-width": "^4.2.0",+ "strip-ansi": "^6.0.1",+ "wrap-ansi": "^7.0.0"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/cliui/node_modules/wrap-ansi": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/clone": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",+ "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.8"+ }+ },+ "node_modules/cluster-key-slot": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz",+ "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/co": {+ "version": "4.6.0",+ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",+ "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "iojs": ">= 1.0.0",+ "node": ">= 0.12.0"+ }+ },+ "node_modules/collect-v8-coverage": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz",+ "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "license": "MIT",+ "dependencies": {+ "color-name": "~1.1.4"+ },+ "engines": {+ "node": ">=7.0.0"+ }+ },+ "node_modules/color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "license": "MIT"+ },+ "node_modules/color-support": {+ "version": "1.1.3",+ "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",+ "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",+ "license": "ISC",+ "optional": true,+ "bin": {+ "color-support": "bin.js"+ }+ },+ "node_modules/combined-stream": {+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "delayed-stream": "~1.0.0"+ },+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/commander": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",+ "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/comment-json": {+ "version": "4.4.1",+ "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.4.1.tgz",+ "integrity": "sha512-r1To31BQD5060QdkC+Iheai7gHwoSZobzunqkf2/kQ6xIAfJyrKNAFUwdKvkK7Qgu7pVTKQEa7ok7Ed3ycAJgg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "array-timsort": "^1.0.3",+ "core-util-is": "^1.0.3",+ "esprima": "^4.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/component-emitter": {+ "version": "1.3.1",+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz",+ "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/compress-commons": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz",+ "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==",+ "license": "MIT",+ "dependencies": {+ "crc-32": "^1.2.0",+ "crc32-stream": "^6.0.0",+ "is-stream": "^2.0.1",+ "normalize-path": "^3.0.0",+ "readable-stream": "^4.0.0"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/concat-map": {+ "version": "0.0.1",+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/concat-stream": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",+ "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",+ "engines": [+ "node >= 6.0"+ ],+ "license": "MIT",+ "dependencies": {+ "buffer-from": "^1.0.0",+ "inherits": "^2.0.3",+ "readable-stream": "^3.0.2",+ "typedarray": "^0.0.6"+ }+ },+ "node_modules/concat-stream/node_modules/readable-stream": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",+ "license": "MIT",+ "dependencies": {+ "inherits": "^2.0.3",+ "string_decoder": "^1.1.1",+ "util-deprecate": "^1.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/concurrently": {+ "version": "9.2.1",+ "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz",+ "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "chalk": "4.1.2",+ "rxjs": "7.8.2",+ "shell-quote": "1.8.3",+ "supports-color": "8.1.1",+ "tree-kill": "1.2.2",+ "yargs": "17.7.2"+ },+ "bin": {+ "conc": "dist/bin/concurrently.js",+ "concurrently": "dist/bin/concurrently.js"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/open-cli-tools/concurrently?sponsor=1"+ }+ },+ "node_modules/consola": {+ "version": "3.4.2",+ "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",+ "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",+ "license": "MIT",+ "engines": {+ "node": "^14.18.0 || >=16.10.0"+ }+ },+ "node_modules/console-control-strings": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",+ "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/content-disposition": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz",+ "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/content-type": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/convert-source-map": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/cookie": {+ "version": "0.7.2",+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/cookie-signature": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",+ "license": "MIT",+ "engines": {+ "node": ">=6.6.0"+ }+ },+ "node_modules/cookiejar": {+ "version": "2.1.4",+ "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",+ "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/core-util-is": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",+ "license": "MIT"+ },+ "node_modules/cors": {+ "version": "2.8.6",+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",+ "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",+ "license": "MIT",+ "dependencies": {+ "object-assign": "^4",+ "vary": "^1"+ },+ "engines": {+ "node": ">= 0.10"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/cosmiconfig": {+ "version": "8.3.6",+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz",+ "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "import-fresh": "^3.3.0",+ "js-yaml": "^4.1.0",+ "parse-json": "^5.2.0",+ "path-type": "^4.0.0"+ },+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/sponsors/d-fischer"+ },+ "peerDependencies": {+ "typescript": ">=4.9.5"+ },+ "peerDependenciesMeta": {+ "typescript": {+ "optional": true+ }+ }+ },+ "node_modules/cpu-features": {+ "version": "0.0.10",+ "resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.10.tgz",+ "integrity": "sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA==",+ "hasInstallScript": true,+ "optional": true,+ "dependencies": {+ "buildcheck": "~0.0.6",+ "nan": "^2.19.0"+ },+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/crc-32": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",+ "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",+ "license": "Apache-2.0",+ "bin": {+ "crc32": "bin/crc32.njs"+ },+ "engines": {+ "node": ">=0.8"+ }+ },+ "node_modules/crc32-stream": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz",+ "integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==",+ "license": "MIT",+ "dependencies": {+ "crc-32": "^1.2.0",+ "readable-stream": "^4.0.0"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/create-require": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",+ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/cron-parser": {+ "version": "4.9.0",+ "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.9.0.tgz",+ "integrity": "sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==",+ "license": "MIT",+ "dependencies": {+ "luxon": "^3.2.1"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/cross-spawn": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.1.0",+ "shebang-command": "^2.0.0",+ "which": "^2.0.1"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/data-uri-to-buffer": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz",+ "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==",+ "license": "MIT",+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/dayjs": {+ "version": "1.11.19",+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",+ "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==",+ "license": "MIT"+ },+ "node_modules/debug": {+ "version": "4.4.3",+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",+ "license": "MIT",+ "dependencies": {+ "ms": "^2.1.3"+ },+ "engines": {+ "node": ">=6.0"+ },+ "peerDependenciesMeta": {+ "supports-color": {+ "optional": true+ }+ }+ },+ "node_modules/decamelize": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",+ "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/decompress-response": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",+ "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",+ "license": "MIT",+ "dependencies": {+ "mimic-response": "^3.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/dedent": {+ "version": "1.7.1",+ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.1.tgz",+ "integrity": "sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg==",+ "license": "MIT",+ "peerDependencies": {+ "babel-plugin-macros": "^3.1.0"+ },+ "peerDependenciesMeta": {+ "babel-plugin-macros": {+ "optional": true+ }+ }+ },+ "node_modules/deep-extend": {+ "version": "0.6.0",+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",+ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",+ "license": "MIT",+ "engines": {+ "node": ">=4.0.0"+ }+ },+ "node_modules/deep-is": {+ "version": "0.1.4",+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/deepmerge": {+ "version": "4.3.1",+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/defaults": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz",+ "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "clone": "^1.0.2"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/define-data-property": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",+ "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",+ "license": "MIT",+ "dependencies": {+ "es-define-property": "^1.0.0",+ "es-errors": "^1.3.0",+ "gopd": "^1.0.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/degenerator": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz",+ "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==",+ "license": "MIT",+ "dependencies": {+ "ast-types": "^0.13.4",+ "escodegen": "^2.1.0",+ "esprima": "^4.0.1"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/delayed-stream": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.4.0"+ }+ },+ "node_modules/delegates": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",+ "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/denque": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz",+ "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">=0.10"+ }+ },+ "node_modules/depd": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "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==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/detect-newline": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz",+ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/devtools-protocol": {+ "version": "0.0.1551306",+ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1551306.tgz",+ "integrity": "sha512-CFx8QdSim8iIv+2ZcEOclBKTQY6BI1IEDa7Tm9YkwAXzEWFndTEzpTo5jAUhSnq24IC7xaDw0wvGcm96+Y3PEg==",+ "license": "BSD-3-Clause",+ "peer": true+ },+ "node_modules/dezalgo": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz",+ "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "asap": "^2.0.0",+ "wrappy": "1"+ }+ },+ "node_modules/diff": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz",+ "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==",+ "devOptional": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.3.1"+ }+ },+ "node_modules/dijkstrajs": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",+ "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",+ "license": "MIT"+ },+ "node_modules/docker-modem": {+ "version": "5.0.6",+ "resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.6.tgz",+ "integrity": "sha512-ens7BiayssQz/uAxGzH8zGXCtiV24rRWXdjNha5V4zSOcxmAZsfGVm/PPFbwQdqEkDnhG+SyR9E3zSHUbOKXBQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "debug": "^4.1.1",+ "readable-stream": "^3.5.0",+ "split-ca": "^1.0.1",+ "ssh2": "^1.15.0"+ },+ "engines": {+ "node": ">= 8.0"+ }+ },+ "node_modules/docker-modem/node_modules/readable-stream": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",+ "license": "MIT",+ "dependencies": {+ "inherits": "^2.0.3",+ "string_decoder": "^1.1.1",+ "util-deprecate": "^1.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/dockerode": {+ "version": "4.0.9",+ "resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.9.tgz",+ "integrity": "sha512-iND4mcOWhPaCNh54WmK/KoSb35AFqPAUWFMffTQcp52uQt36b5uNwEJTSXntJZBbeGad72Crbi/hvDIv6us/6Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "@balena/dockerignore": "^1.0.2",+ "@grpc/grpc-js": "^1.11.1",+ "@grpc/proto-loader": "^0.7.13",+ "docker-modem": "^5.0.6",+ "protobufjs": "^7.3.2",+ "tar-fs": "^2.1.4",+ "uuid": "^10.0.0"+ },+ "engines": {+ "node": ">= 8.0"+ }+ },+ "node_modules/dockerode/node_modules/uuid": {+ "version": "10.0.0",+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz",+ "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==",+ "funding": [+ "https://github.com/sponsors/broofa",+ "https://github.com/sponsors/ctavan"+ ],+ "license": "MIT",+ "bin": {+ "uuid": "dist/bin/uuid"+ }+ },+ "node_modules/dotenv": {+ "version": "17.2.3",+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz",+ "integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==",+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://dotenvx.com"+ }+ },+ "node_modules/dotenv-expand": {+ "version": "12.0.3",+ "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-12.0.3.tgz",+ "integrity": "sha512-uc47g4b+4k/M/SeaW1y4OApx+mtLWl92l5LMPP0GNXctZqELk+YGgOPIIC5elYmUH4OuoK3JLhuRUYegeySiFA==",+ "license": "BSD-2-Clause",+ "dependencies": {+ "dotenv": "^16.4.5"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://dotenvx.com"+ }+ },+ "node_modules/dotenv-expand/node_modules/dotenv": {+ "version": "16.6.1",+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",+ "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://dotenvx.com"+ }+ },+ "node_modules/dunder-proto": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.1",+ "es-errors": "^1.3.0",+ "gopd": "^1.2.0"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/duplexer2": {+ "version": "0.1.4",+ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",+ "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==",+ "license": "BSD-3-Clause",+ "optional": true,+ "dependencies": {+ "readable-stream": "^2.0.2"+ }+ },+ "node_modules/duplexer2/node_modules/isarray": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/duplexer2/node_modules/readable-stream": {+ "version": "2.3.8",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "core-util-is": "~1.0.0",+ "inherits": "~2.0.3",+ "isarray": "~1.0.0",+ "process-nextick-args": "~2.0.0",+ "safe-buffer": "~5.1.1",+ "string_decoder": "~1.1.1",+ "util-deprecate": "~1.0.1"+ }+ },+ "node_modules/duplexer2/node_modules/safe-buffer": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/duplexer2/node_modules/string_decoder": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "safe-buffer": "~5.1.0"+ }+ },+ "node_modules/eastasianwidth": {+ "version": "0.2.0",+ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",+ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",+ "license": "MIT"+ },+ "node_modules/ee-first": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",+ "license": "MIT"+ },+ "node_modules/ejs": {+ "version": "3.1.10",+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",+ "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",+ "license": "Apache-2.0",+ "dependencies": {+ "jake": "^10.8.5"+ },+ "bin": {+ "ejs": "bin/cli.js"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/electron-to-chromium": {+ "version": "1.5.286",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz",+ "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/emittery": {+ "version": "0.13.1",+ "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz",+ "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/emittery?sponsor=1"+ }+ },+ "node_modules/emoji-regex": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",+ "license": "MIT"+ },+ "node_modules/encodeurl": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/encoding": {+ "version": "0.1.13",+ "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",+ "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "iconv-lite": "^0.6.2"+ }+ },+ "node_modules/encoding/node_modules/iconv-lite": {+ "version": "0.6.3",+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "safer-buffer": ">= 2.1.2 < 3.0.0"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/end-of-stream": {+ "version": "1.4.5",+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",+ "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",+ "license": "MIT",+ "dependencies": {+ "once": "^1.4.0"+ }+ },+ "node_modules/engine.io": {+ "version": "6.6.5",+ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.5.tgz",+ "integrity": "sha512-2RZdgEbXmp5+dVbRm0P7HQUImZpICccJy7rN7Tv+SFa55pH+lxnuw6/K1ZxxBfHoYpSkHLAO92oa8O4SwFXA2A==",+ "license": "MIT",+ "dependencies": {+ "@types/cors": "^2.8.12",+ "@types/node": ">=10.0.0",+ "accepts": "~1.3.4",+ "base64id": "2.0.0",+ "cookie": "~0.7.2",+ "cors": "~2.8.5",+ "debug": "~4.4.1",+ "engine.io-parser": "~5.2.1",+ "ws": "~8.18.3"+ },+ "engines": {+ "node": ">=10.2.0"+ }+ },+ "node_modules/engine.io-parser": {+ "version": "5.2.3",+ "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz",+ "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==",+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/engine.io/node_modules/accepts": {+ "version": "1.3.8",+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",+ "license": "MIT",+ "dependencies": {+ "mime-types": "~2.1.34",+ "negotiator": "0.6.3"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/engine.io/node_modules/mime-db": {+ "version": "1.52.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/engine.io/node_modules/mime-types": {+ "version": "2.1.35",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",+ "license": "MIT",+ "dependencies": {+ "mime-db": "1.52.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/engine.io/node_modules/negotiator": {+ "version": "0.6.3",+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/enhanced-resolve": {+ "version": "5.19.0",+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz",+ "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "graceful-fs": "^4.2.4",+ "tapable": "^2.3.0"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/env-paths": {+ "version": "2.2.1",+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",+ "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/err-code": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",+ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/error-ex": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz",+ "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==",+ "license": "MIT",+ "dependencies": {+ "is-arrayish": "^0.2.1"+ }+ },+ "node_modules/es-define-property": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-errors": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-module-lexer": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz",+ "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/es-object-atoms": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-set-tostringtag": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "get-intrinsic": "^1.2.6",+ "has-tostringtag": "^1.0.2",+ "hasown": "^2.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/escalade": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/escape-html": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",+ "license": "MIT"+ },+ "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/escodegen": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",+ "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",+ "license": "BSD-2-Clause",+ "dependencies": {+ "esprima": "^4.0.1",+ "estraverse": "^5.2.0",+ "esutils": "^2.0.2"+ },+ "bin": {+ "escodegen": "bin/escodegen.js",+ "esgenerate": "bin/esgenerate.js"+ },+ "engines": {+ "node": ">=6.0"+ },+ "optionalDependencies": {+ "source-map": "~0.6.1"+ }+ },+ "node_modules/escodegen/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==",+ "license": "BSD-3-Clause",+ "optional": true,+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/eslint": {+ "version": "9.39.2",+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz",+ "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@eslint-community/eslint-utils": "^4.8.0",+ "@eslint-community/regexpp": "^4.12.1",+ "@eslint/config-array": "^0.21.1",+ "@eslint/config-helpers": "^0.4.2",+ "@eslint/core": "^0.17.0",+ "@eslint/eslintrc": "^3.3.1",+ "@eslint/js": "9.39.2",+ "@eslint/plugin-kit": "^0.4.1",+ "@humanfs/node": "^0.16.6",+ "@humanwhocodes/module-importer": "^1.0.1",+ "@humanwhocodes/retry": "^0.4.2",+ "@types/estree": "^1.0.6",+ "ajv": "^6.12.4",+ "chalk": "^4.0.0",+ "cross-spawn": "^7.0.6",+ "debug": "^4.3.2",+ "escape-string-regexp": "^4.0.0",+ "eslint-scope": "^8.4.0",+ "eslint-visitor-keys": "^4.2.1",+ "espree": "^10.4.0",+ "esquery": "^1.5.0",+ "esutils": "^2.0.2",+ "fast-deep-equal": "^3.1.3",+ "file-entry-cache": "^8.0.0",+ "find-up": "^5.0.0",+ "glob-parent": "^6.0.2",+ "ignore": "^5.2.0",+ "imurmurhash": "^0.1.4",+ "is-glob": "^4.0.0",+ "json-stable-stringify-without-jsonify": "^1.0.1",+ "lodash.merge": "^4.6.2",+ "minimatch": "^3.1.2",+ "natural-compare": "^1.4.0",+ "optionator": "^0.9.3"+ },+ "bin": {+ "eslint": "bin/eslint.js"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://eslint.org/donate"+ },+ "peerDependencies": {+ "jiti": "*"+ },+ "peerDependenciesMeta": {+ "jiti": {+ "optional": true+ }+ }+ },+ "node_modules/eslint-config-prettier": {+ "version": "10.1.8",+ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz",+ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "bin": {+ "eslint-config-prettier": "bin/cli.js"+ },+ "funding": {+ "url": "https://opencollective.com/eslint-config-prettier"+ },+ "peerDependencies": {+ "eslint": ">=7.0.0"+ }+ },+ "node_modules/eslint-plugin-prettier": {+ "version": "5.5.5",+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.5.tgz",+ "integrity": "sha512-hscXkbqUZ2sPithAuLm5MXL+Wph+U7wHngPBv9OMWwlP8iaflyxpjTYZkmdgB4/vPIhemRlBEoLrH7UC1n7aUw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "prettier-linter-helpers": "^1.0.1",+ "synckit": "^0.11.12"+ },+ "engines": {+ "node": "^14.18.0 || >=16.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint-plugin-prettier"+ },+ "peerDependencies": {+ "@types/eslint": ">=8.0.0",+ "eslint": ">=8.0.0",+ "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0",+ "prettier": ">=3.0.0"+ },+ "peerDependenciesMeta": {+ "@types/eslint": {+ "optional": true+ },+ "eslint-config-prettier": {+ "optional": true+ }+ }+ },+ "node_modules/eslint-scope": {+ "version": "8.4.0",+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",+ "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "esrecurse": "^4.3.0",+ "estraverse": "^5.2.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/eslint-visitor-keys": {+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/espree": {+ "version": "10.4.0",+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "acorn": "^8.15.0",+ "acorn-jsx": "^5.3.2",+ "eslint-visitor-keys": "^4.2.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },+ "node_modules/esprima": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",+ "license": "BSD-2-Clause",+ "bin": {+ "esparse": "bin/esparse.js",+ "esvalidate": "bin/esvalidate.js"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/esquery": {+ "version": "1.7.0",+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",+ "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "estraverse": "^5.1.0"+ },+ "engines": {+ "node": ">=0.10"+ }+ },+ "node_modules/esrecurse": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "estraverse": "^5.2.0"+ },+ "engines": {+ "node": ">=4.0"+ }+ },+ "node_modules/estraverse": {+ "version": "5.3.0",+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=4.0"+ }+ },+ "node_modules/esutils": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/etag": {+ "version": "1.8.1",+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/event-target-shim": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",+ "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/events": {+ "version": "3.3.0",+ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",+ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",+ "license": "MIT",+ "engines": {+ "node": ">=0.8.x"+ }+ },+ "node_modules/events-universal": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",+ "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==",+ "license": "Apache-2.0",+ "dependencies": {+ "bare-events": "^2.7.0"+ }+ },+ "node_modules/execa": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cross-spawn": "^7.0.3",+ "get-stream": "^6.0.0",+ "human-signals": "^2.1.0",+ "is-stream": "^2.0.0",+ "merge-stream": "^2.0.0",+ "npm-run-path": "^4.0.1",+ "onetime": "^5.1.2",+ "signal-exit": "^3.0.3",+ "strip-final-newline": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/execa?sponsor=1"+ }+ },+ "node_modules/execa/node_modules/signal-exit": {+ "version": "3.0.7",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/exit-x": {+ "version": "0.2.2",+ "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz",+ "integrity": "sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "node_modules/expand-template": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",+ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",+ "license": "(MIT OR WTFPL)",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/expect": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/expect/-/expect-30.2.0.tgz",+ "integrity": "sha512-u/feCi0GPsI+988gU2FLcsHyAHTU0MX1Wg68NhAnN7z/+C5wqG+CY8J53N9ioe8RXgaoz0nBR/TYMf3AycUuPw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/expect-utils": "30.2.0",+ "@jest/get-type": "30.1.0",+ "jest-matcher-utils": "30.2.0",+ "jest-message-util": "30.2.0",+ "jest-mock": "30.2.0",+ "jest-util": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/express": {+ "version": "5.2.1",+ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",+ "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",+ "license": "MIT",+ "dependencies": {+ "accepts": "^2.0.0",+ "body-parser": "^2.2.1",+ "content-disposition": "^1.0.0",+ "content-type": "^1.0.5",+ "cookie": "^0.7.1",+ "cookie-signature": "^1.2.1",+ "debug": "^4.4.0",+ "depd": "^2.0.0",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "etag": "^1.8.1",+ "finalhandler": "^2.1.0",+ "fresh": "^2.0.0",+ "http-errors": "^2.0.0",+ "merge-descriptors": "^2.0.0",+ "mime-types": "^3.0.0",+ "on-finished": "^2.4.1",+ "once": "^1.4.0",+ "parseurl": "^1.3.3",+ "proxy-addr": "^2.0.7",+ "qs": "^6.14.0",+ "range-parser": "^1.2.1",+ "router": "^2.2.0",+ "send": "^1.1.0",+ "serve-static": "^2.2.0",+ "statuses": "^2.0.1",+ "type-is": "^2.0.1",+ "vary": "^1.1.2"+ },+ "engines": {+ "node": ">= 18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/extract-zip": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",+ "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==",+ "license": "BSD-2-Clause",+ "dependencies": {+ "debug": "^4.1.1",+ "get-stream": "^5.1.0",+ "yauzl": "^2.10.0"+ },+ "bin": {+ "extract-zip": "cli.js"+ },+ "engines": {+ "node": ">= 10.17.0"+ },+ "optionalDependencies": {+ "@types/yauzl": "^2.9.1"+ }+ },+ "node_modules/extract-zip/node_modules/get-stream": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",+ "license": "MIT",+ "dependencies": {+ "pump": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/fast-deep-equal": {+ "version": "3.1.3",+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/fast-diff": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",+ "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",+ "dev": true,+ "license": "Apache-2.0"+ },+ "node_modules/fast-fifo": {+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",+ "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",+ "license": "MIT"+ },+ "node_modules/fast-json-stable-stringify": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/fast-levenshtein": {+ "version": "2.0.6",+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/fast-safe-stringify": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",+ "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",+ "license": "MIT"+ },+ "node_modules/fast-uri": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",+ "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/fastify"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/fastify"+ }+ ],+ "license": "BSD-3-Clause"+ },+ "node_modules/fast-xml-parser": {+ "version": "5.3.4",+ "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.4.tgz",+ "integrity": "sha512-EFd6afGmXlCx8H8WTZHhAoDaWaGyuIBoZJ2mknrNxug+aZKjkp0a0dlars9Izl+jF+7Gu1/5f/2h68cQpe0IiA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/NaturalIntelligence"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "strnum": "^2.1.0"+ },+ "bin": {+ "fxparser": "src/cli/cli.js"+ }+ },+ "node_modules/fb-watchman": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz",+ "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "bser": "2.1.1"+ }+ },+ "node_modules/fd-slicer": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",+ "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==",+ "license": "MIT",+ "dependencies": {+ "pend": "~1.2.0"+ }+ },+ "node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/file-entry-cache": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",+ "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "flat-cache": "^4.0.0"+ },+ "engines": {+ "node": ">=16.0.0"+ }+ },+ "node_modules/file-type": {+ "version": "21.3.0",+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.3.0.tgz",+ "integrity": "sha512-8kPJMIGz1Yt/aPEwOsrR97ZyZaD1Iqm8PClb1nYFclUCkBi0Ma5IsYNQzvSFS9ib51lWyIw5mIT9rWzI/xjpzA==",+ "license": "MIT",+ "dependencies": {+ "@tokenizer/inflate": "^0.4.1",+ "strtok3": "^10.3.4",+ "token-types": "^6.1.1",+ "uint8array-extras": "^1.4.0"+ },+ "engines": {+ "node": ">=20"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/file-type?sponsor=1"+ }+ },+ "node_modules/file-uri-to-path": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",+ "license": "MIT"+ },+ "node_modules/filelist": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz",+ "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==",+ "license": "Apache-2.0",+ "dependencies": {+ "minimatch": "^5.0.1"+ }+ },+ "node_modules/filelist/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/filelist/node_modules/minimatch": {+ "version": "5.1.6",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",+ "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/fill-range": {+ "version": "7.1.1",+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "to-regex-range": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/finalhandler": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",+ "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",+ "license": "MIT",+ "dependencies": {+ "debug": "^4.4.0",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "on-finished": "^2.4.1",+ "parseurl": "^1.3.3",+ "statuses": "^2.0.1"+ },+ "engines": {+ "node": ">= 18.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/find-up": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "locate-path": "^6.0.0",+ "path-exists": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/flat-cache": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",+ "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "flatted": "^3.2.9",+ "keyv": "^4.5.4"+ },+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/flatted": {+ "version": "3.3.3",+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",+ "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/fluent-ffmpeg": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.3.tgz",+ "integrity": "sha512-Be3narBNt2s6bsaqP6Jzq91heDgOEaDCJAXcE3qcma/EJBSy5FB4cvO31XBInuAuKBx8Kptf8dkhjK0IOru39Q==",+ "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.",+ "license": "MIT",+ "dependencies": {+ "async": "^0.2.9",+ "which": "^1.1.1"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/fluent-ffmpeg/node_modules/async": {+ "version": "0.2.10",+ "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",+ "integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ=="+ },+ "node_modules/fluent-ffmpeg/node_modules/which": {+ "version": "1.3.1",+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",+ "license": "ISC",+ "dependencies": {+ "isexe": "^2.0.0"+ },+ "bin": {+ "which": "bin/which"+ }+ },+ "node_modules/for-each": {+ "version": "0.3.5",+ "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz",+ "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==",+ "license": "MIT",+ "dependencies": {+ "is-callable": "^1.2.7"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/foreground-child": {+ "version": "3.3.1",+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",+ "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",+ "license": "ISC",+ "dependencies": {+ "cross-spawn": "^7.0.6",+ "signal-exit": "^4.0.1"+ },+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/fork-ts-checker-webpack-plugin": {+ "version": "9.1.0",+ "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-9.1.0.tgz",+ "integrity": "sha512-mpafl89VFPJmhnJ1ssH+8wmM2b50n+Rew5x42NeI2U78aRWgtkEtGmctp7iT16UjquJTjorEmIfESj3DxdW84Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.16.7",+ "chalk": "^4.1.2",+ "chokidar": "^4.0.1",+ "cosmiconfig": "^8.2.0",+ "deepmerge": "^4.2.2",+ "fs-extra": "^10.0.0",+ "memfs": "^3.4.1",+ "minimatch": "^3.0.4",+ "node-abort-controller": "^3.0.1",+ "schema-utils": "^3.1.1",+ "semver": "^7.3.5",+ "tapable": "^2.2.1"+ },+ "engines": {+ "node": ">=14.21.3"+ },+ "peerDependencies": {+ "typescript": ">3.6.0",+ "webpack": "^5.11.0"+ }+ },+ "node_modules/form-data": {+ "version": "4.0.5",+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",+ "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "asynckit": "^0.4.0",+ "combined-stream": "^1.0.8",+ "es-set-tostringtag": "^2.1.0",+ "hasown": "^2.0.2",+ "mime-types": "^2.1.12"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/form-data/node_modules/mime-db": {+ "version": "1.52.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/form-data/node_modules/mime-types": {+ "version": "2.1.35",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "mime-db": "1.52.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/formidable": {+ "version": "3.5.4",+ "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.4.tgz",+ "integrity": "sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@paralleldrive/cuid2": "^2.2.2",+ "dezalgo": "^1.0.4",+ "once": "^1.4.0"+ },+ "engines": {+ "node": ">=14.0.0"+ },+ "funding": {+ "url": "https://ko-fi.com/tunnckoCore/commissions"+ }+ },+ "node_modules/forwarded": {+ "version": "0.2.0",+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/fresh": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/fs-constants": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",+ "license": "MIT"+ },+ "node_modules/fs-extra": {+ "version": "10.1.0",+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",+ "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "graceful-fs": "^4.2.0",+ "jsonfile": "^6.0.1",+ "universalify": "^2.0.0"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/fs-minipass": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",+ "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",+ "license": "ISC",+ "dependencies": {+ "minipass": "^3.0.0"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/fs-minipass/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/fs-minipass/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC"+ },+ "node_modules/fs-monkey": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.1.0.tgz",+ "integrity": "sha512-QMUezzXWII9EV5aTFXW1UBVUO77wYPpjqIF8/AviUCThNeSYZykpoTixUeaNNBwmCev0AMDWMAni+f8Hxb1IFw==",+ "dev": true,+ "license": "Unlicense"+ },+ "node_modules/fs.realpath": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",+ "devOptional": true,+ "license": "ISC"+ },+ "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/fstream": {+ "version": "1.0.12",+ "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",+ "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",+ "deprecated": "This package is no longer supported.",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "graceful-fs": "^4.1.2",+ "inherits": "~2.0.0",+ "mkdirp": ">=0.5 0",+ "rimraf": "2"+ },+ "engines": {+ "node": ">=0.6"+ }+ },+ "node_modules/fstream/node_modules/glob": {+ "version": "7.2.3",+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "fs.realpath": "^1.0.0",+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "^3.1.1",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ },+ "engines": {+ "node": "*"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/fstream/node_modules/rimraf": {+ "version": "2.7.1",+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",+ "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",+ "deprecated": "Rimraf versions prior to v4 are no longer supported",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "glob": "^7.1.3"+ },+ "bin": {+ "rimraf": "bin.js"+ }+ },+ "node_modules/function-bind": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/gauge": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz",+ "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==",+ "deprecated": "This package is no longer supported.",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "aproba": "^1.0.3 || ^2.0.0",+ "color-support": "^1.1.3",+ "console-control-strings": "^1.1.0",+ "has-unicode": "^2.0.1",+ "signal-exit": "^3.0.7",+ "string-width": "^4.2.3",+ "strip-ansi": "^6.0.1",+ "wide-align": "^1.1.5"+ },+ "engines": {+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"+ }+ },+ "node_modules/gauge/node_modules/signal-exit": {+ "version": "3.0.7",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/gensync": {+ "version": "1.0.0-beta.2",+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.9.0"+ }+ },+ "node_modules/get-caller-file": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",+ "license": "ISC",+ "engines": {+ "node": "6.* || 8.* || >= 10.*"+ }+ },+ "node_modules/get-intrinsic": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.2",+ "es-define-property": "^1.0.1",+ "es-errors": "^1.3.0",+ "es-object-atoms": "^1.1.1",+ "function-bind": "^1.1.2",+ "get-proto": "^1.0.1",+ "gopd": "^1.2.0",+ "has-symbols": "^1.1.0",+ "hasown": "^2.0.2",+ "math-intrinsics": "^1.1.0"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/get-package-type": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz",+ "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8.0.0"+ }+ },+ "node_modules/get-proto": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",+ "license": "MIT",+ "dependencies": {+ "dunder-proto": "^1.0.1",+ "es-object-atoms": "^1.0.0"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/get-stream": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/get-uri": {+ "version": "6.0.5",+ "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz",+ "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==",+ "license": "MIT",+ "dependencies": {+ "basic-ftp": "^5.0.2",+ "data-uri-to-buffer": "^6.0.2",+ "debug": "^4.3.4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/github-from-package": {+ "version": "0.0.0",+ "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",+ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==",+ "license": "MIT"+ },+ "node_modules/glob": {+ "version": "13.0.0",+ "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.0.tgz",+ "integrity": "sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "minimatch": "^10.1.1",+ "minipass": "^7.1.2",+ "path-scurry": "^2.0.0"+ },+ "engines": {+ "node": "20 || >=22"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/glob-parent": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "is-glob": "^4.0.3"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "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/glob/node_modules/minimatch": {+ "version": "10.1.2",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.2.tgz",+ "integrity": "sha512-fu656aJ0n2kcXwsnwnv9g24tkU5uSmOlTjd6WyyaKm2Z+h1qmY6bAjrcaIxF/BslFqbZ8UBtbJi7KgQOZD2PTw==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "@isaacs/brace-expansion": "^5.0.1"+ },+ "engines": {+ "node": "20 || >=22"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/globals": {+ "version": "16.5.0",+ "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz",+ "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/gopd": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/graceful-fs": {+ "version": "4.2.11",+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",+ "license": "ISC"+ },+ "node_modules/handlebars": {+ "version": "4.7.8",+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",+ "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "minimist": "^1.2.5",+ "neo-async": "^2.6.2",+ "source-map": "^0.6.1",+ "wordwrap": "^1.0.0"+ },+ "bin": {+ "handlebars": "bin/handlebars"+ },+ "engines": {+ "node": ">=0.4.7"+ },+ "optionalDependencies": {+ "uglify-js": "^3.1.4"+ }+ },+ "node_modules/handlebars/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/has-flag": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",+ "devOptional": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/has-property-descriptors": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",+ "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",+ "license": "MIT",+ "dependencies": {+ "es-define-property": "^1.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/has-symbols": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/has-tostringtag": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",+ "license": "MIT",+ "dependencies": {+ "has-symbols": "^1.0.3"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/has-unicode": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",+ "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/hasown": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",+ "license": "MIT",+ "dependencies": {+ "function-bind": "^1.1.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/helmet": {+ "version": "8.1.0",+ "resolved": "https://registry.npmjs.org/helmet/-/helmet-8.1.0.tgz",+ "integrity": "sha512-jOiHyAZsmnr8LqoPGmCjYAaiuWwjAPLgY8ZX2XrmHawt99/u1y6RgrZMTeoPfpUbV96HOalYgz1qzkRbw54Pmg==",+ "license": "MIT",+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/html-escaper": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",+ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/http-cache-semantics": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz",+ "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==",+ "license": "BSD-2-Clause",+ "optional": true+ },+ "node_modules/http-errors": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",+ "license": "MIT",+ "dependencies": {+ "depd": "~2.0.0",+ "inherits": "~2.0.4",+ "setprototypeof": "~1.2.0",+ "statuses": "~2.0.2",+ "toidentifier": "~1.0.1"+ },+ "engines": {+ "node": ">= 0.8"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/http-proxy-agent": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",+ "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@tootallnate/once": "1",+ "agent-base": "6",+ "debug": "4"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/https-proxy-agent": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",+ "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "agent-base": "6",+ "debug": "4"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/human-signals": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=10.17.0"+ }+ },+ "node_modules/humanize-ms": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",+ "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "ms": "^2.0.0"+ }+ },+ "node_modules/iconv-lite": {+ "version": "0.7.2",+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",+ "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",+ "license": "MIT",+ "dependencies": {+ "safer-buffer": ">= 2.1.2 < 3.0.0"+ },+ "engines": {+ "node": ">=0.10.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/ieee754": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "BSD-3-Clause"+ },+ "node_modules/ignore": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",+ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/import-fresh": {+ "version": "3.3.1",+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",+ "license": "MIT",+ "dependencies": {+ "parent-module": "^1.0.0",+ "resolve-from": "^4.0.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/import-local": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz",+ "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "pkg-dir": "^4.2.0",+ "resolve-cwd": "^3.0.0"+ },+ "bin": {+ "import-local-fixture": "fixtures/cli.js"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/imurmurhash": {+ "version": "0.1.4",+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",+ "devOptional": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.8.19"+ }+ },+ "node_modules/indent-string": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",+ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/infer-owner": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz",+ "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/inflight": {+ "version": "1.0.6",+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",+ "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",+ "devOptional": true,+ "license": "ISC",+ "dependencies": {+ "once": "^1.3.0",+ "wrappy": "1"+ }+ },+ "node_modules/inherits": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",+ "license": "ISC"+ },+ "node_modules/ini": {+ "version": "1.3.8",+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",+ "license": "ISC"+ },+ "node_modules/ioredis": {+ "version": "5.9.2",+ "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.9.2.tgz",+ "integrity": "sha512-tAAg/72/VxOUW7RQSX1pIxJVucYKcjFjfvj60L57jrZpYCHC3XN0WCQ3sNYL4Gmvv+7GPvTAjc+KSdeNuE8oWQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@ioredis/commands": "1.5.0",+ "cluster-key-slot": "^1.1.0",+ "debug": "^4.3.4",+ "denque": "^2.1.0",+ "lodash.defaults": "^4.2.0",+ "lodash.isarguments": "^3.1.0",+ "redis-errors": "^1.2.0",+ "redis-parser": "^3.0.0",+ "standard-as-callback": "^2.1.0"+ },+ "engines": {+ "node": ">=12.22.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/ioredis"+ }+ },+ "node_modules/ip-address": {+ "version": "10.1.0",+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz",+ "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==",+ "license": "MIT",+ "engines": {+ "node": ">= 12"+ }+ },+ "node_modules/ipaddr.js": {+ "version": "1.9.1",+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.10"+ }+ },+ "node_modules/is-arrayish": {+ "version": "0.2.1",+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",+ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",+ "license": "MIT"+ },+ "node_modules/is-callable": {+ "version": "1.2.7",+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",+ "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/is-extglob": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/is-fullwidth-code-point": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/is-generator-fn": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz",+ "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/is-glob": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "is-extglob": "^2.1.1"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/is-interactive": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz",+ "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/is-lambda": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz",+ "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/is-number": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.12.0"+ }+ },+ "node_modules/is-promise": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",+ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",+ "license": "MIT"+ },+ "node_modules/is-stream": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/is-typed-array": {+ "version": "1.1.15",+ "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz",+ "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==",+ "license": "MIT",+ "dependencies": {+ "which-typed-array": "^1.1.16"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/is-unicode-supported": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",+ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/isarray": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",+ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",+ "license": "MIT"+ },+ "node_modules/isexe": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",+ "license": "ISC"+ },+ "node_modules/istanbul-lib-coverage": {+ "version": "3.2.2",+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz",+ "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/istanbul-lib-instrument": {+ "version": "6.0.3",+ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz",+ "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@babel/core": "^7.23.9",+ "@babel/parser": "^7.23.9",+ "@istanbuljs/schema": "^0.1.3",+ "istanbul-lib-coverage": "^3.2.0",+ "semver": "^7.5.4"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/istanbul-lib-report": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",+ "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "istanbul-lib-coverage": "^3.0.0",+ "make-dir": "^4.0.0",+ "supports-color": "^7.1.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/istanbul-lib-report/node_modules/supports-color": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "has-flag": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/istanbul-lib-source-maps": {+ "version": "5.0.6",+ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz",+ "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@jridgewell/trace-mapping": "^0.3.23",+ "debug": "^4.1.1",+ "istanbul-lib-coverage": "^3.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/istanbul-reports": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz",+ "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "html-escaper": "^2.0.0",+ "istanbul-lib-report": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/iterare": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz",+ "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==",+ "license": "ISC",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/jackspeak": {+ "version": "3.4.3",+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",+ "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "@isaacs/cliui": "^8.0.2"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ },+ "optionalDependencies": {+ "@pkgjs/parseargs": "^0.11.0"+ }+ },+ "node_modules/jake": {+ "version": "10.9.4",+ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz",+ "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==",+ "license": "Apache-2.0",+ "dependencies": {+ "async": "^3.2.6",+ "filelist": "^1.0.4",+ "picocolors": "^1.1.1"+ },+ "bin": {+ "jake": "bin/cli.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/jest": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest/-/jest-30.2.0.tgz",+ "integrity": "sha512-F26gjC0yWN8uAA5m5Ss8ZQf5nDHWGlN/xWZIh8S5SRbsEKBovwZhxGd6LJlbZYxBgCYOtreSUyb8hpXyGC5O4A==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@jest/core": "30.2.0",+ "@jest/types": "30.2.0",+ "import-local": "^3.2.0",+ "jest-cli": "30.2.0"+ },+ "bin": {+ "jest": "bin/jest.js"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "peerDependencies": {+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"+ },+ "peerDependenciesMeta": {+ "node-notifier": {+ "optional": true+ }+ }+ },+ "node_modules/jest-changed-files": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.2.0.tgz",+ "integrity": "sha512-L8lR1ChrRnSdfeOvTrwZMlnWV8G/LLjQ0nG9MBclwWZidA2N5FviRki0Bvh20WRMOX31/JYvzdqTJrk5oBdydQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "execa": "^5.1.1",+ "jest-util": "30.2.0",+ "p-limit": "^3.1.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-circus": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.2.0.tgz",+ "integrity": "sha512-Fh0096NC3ZkFx05EP2OXCxJAREVxj1BcW/i6EWqqymcgYKWjyyDpral3fMxVcHXg6oZM7iULer9wGRFvfpl+Tg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/environment": "30.2.0",+ "@jest/expect": "30.2.0",+ "@jest/test-result": "30.2.0",+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "chalk": "^4.1.2",+ "co": "^4.6.0",+ "dedent": "^1.6.0",+ "is-generator-fn": "^2.1.0",+ "jest-each": "30.2.0",+ "jest-matcher-utils": "30.2.0",+ "jest-message-util": "30.2.0",+ "jest-runtime": "30.2.0",+ "jest-snapshot": "30.2.0",+ "jest-util": "30.2.0",+ "p-limit": "^3.1.0",+ "pretty-format": "30.2.0",+ "pure-rand": "^7.0.0",+ "slash": "^3.0.0",+ "stack-utils": "^2.0.6"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-cli": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.2.0.tgz",+ "integrity": "sha512-Os9ukIvADX/A9sLt6Zse3+nmHtHaE6hqOsjQtNiugFTbKRHYIYtZXNGNK9NChseXy7djFPjndX1tL0sCTlfpAA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/core": "30.2.0",+ "@jest/test-result": "30.2.0",+ "@jest/types": "30.2.0",+ "chalk": "^4.1.2",+ "exit-x": "^0.2.2",+ "import-local": "^3.2.0",+ "jest-config": "30.2.0",+ "jest-util": "30.2.0",+ "jest-validate": "30.2.0",+ "yargs": "^17.7.2"+ },+ "bin": {+ "jest": "bin/jest.js"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "peerDependencies": {+ "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"+ },+ "peerDependenciesMeta": {+ "node-notifier": {+ "optional": true+ }+ }+ },+ "node_modules/jest-config": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.2.0.tgz",+ "integrity": "sha512-g4WkyzFQVWHtu6uqGmQR4CQxz/CH3yDSlhzXMWzNjDx843gYjReZnMRanjRCq5XZFuQrGDxgUaiYWE8BRfVckA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/core": "^7.27.4",+ "@jest/get-type": "30.1.0",+ "@jest/pattern": "30.0.1",+ "@jest/test-sequencer": "30.2.0",+ "@jest/types": "30.2.0",+ "babel-jest": "30.2.0",+ "chalk": "^4.1.2",+ "ci-info": "^4.2.0",+ "deepmerge": "^4.3.1",+ "glob": "^10.3.10",+ "graceful-fs": "^4.2.11",+ "jest-circus": "30.2.0",+ "jest-docblock": "30.2.0",+ "jest-environment-node": "30.2.0",+ "jest-regex-util": "30.0.1",+ "jest-resolve": "30.2.0",+ "jest-runner": "30.2.0",+ "jest-util": "30.2.0",+ "jest-validate": "30.2.0",+ "micromatch": "^4.0.8",+ "parse-json": "^5.2.0",+ "pretty-format": "30.2.0",+ "slash": "^3.0.0",+ "strip-json-comments": "^3.1.1"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "peerDependencies": {+ "@types/node": "*",+ "esbuild-register": ">=3.4.0",+ "ts-node": ">=9.0.0"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "esbuild-register": {+ "optional": true+ },+ "ts-node": {+ "optional": true+ }+ }+ },+ "node_modules/jest-config/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/jest-config/node_modules/glob": {+ "version": "10.5.0",+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",+ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "foreground-child": "^3.1.0",+ "jackspeak": "^3.1.2",+ "minimatch": "^9.0.4",+ "minipass": "^7.1.2",+ "package-json-from-dist": "^1.0.0",+ "path-scurry": "^1.11.1"+ },+ "bin": {+ "glob": "dist/esm/bin.mjs"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/jest-config/node_modules/lru-cache": {+ "version": "10.4.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/jest-config/node_modules/minimatch": {+ "version": "9.0.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/jest-config/node_modules/path-scurry": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "lru-cache": "^10.2.0",+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"+ },+ "engines": {+ "node": ">=16 || 14 >=14.18"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/jest-diff": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.2.0.tgz",+ "integrity": "sha512-dQHFo3Pt4/NLlG5z4PxZ/3yZTZ1C7s9hveiOj+GCN+uT109NC2QgsoVZsVOAvbJ3RgKkvyLGXZV9+piDpWbm6A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/diff-sequences": "30.0.1",+ "@jest/get-type": "30.1.0",+ "chalk": "^4.1.2",+ "pretty-format": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-docblock": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.2.0.tgz",+ "integrity": "sha512-tR/FFgZKS1CXluOQzZvNH3+0z9jXr3ldGSD8bhyuxvlVUwbeLOGynkunvlTMxchC5urrKndYiwCFC0DLVjpOCA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "detect-newline": "^3.1.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-each": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.2.0.tgz",+ "integrity": "sha512-lpWlJlM7bCUf1mfmuqTA8+j2lNURW9eNafOy99knBM01i5CQeY5UH1vZjgT9071nDJac1M4XsbyI44oNOdhlDQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/get-type": "30.1.0",+ "@jest/types": "30.2.0",+ "chalk": "^4.1.2",+ "jest-util": "30.2.0",+ "pretty-format": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-environment-node": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.2.0.tgz",+ "integrity": "sha512-ElU8v92QJ9UrYsKrxDIKCxu6PfNj4Hdcktcn0JX12zqNdqWHB0N+hwOnnBBXvjLd2vApZtuLUGs1QSY+MsXoNA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/environment": "30.2.0",+ "@jest/fake-timers": "30.2.0",+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "jest-mock": "30.2.0",+ "jest-util": "30.2.0",+ "jest-validate": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-haste-map": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.2.0.tgz",+ "integrity": "sha512-sQA/jCb9kNt+neM0anSj6eZhLZUIhQgwDt7cPGjumgLM4rXsfb9kpnlacmvZz3Q5tb80nS+oG/if+NBKrHC+Xw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "anymatch": "^3.1.3",+ "fb-watchman": "^2.0.2",+ "graceful-fs": "^4.2.11",+ "jest-regex-util": "30.0.1",+ "jest-util": "30.2.0",+ "jest-worker": "30.2.0",+ "micromatch": "^4.0.8",+ "walker": "^1.0.8"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "optionalDependencies": {+ "fsevents": "^2.3.3"+ }+ },+ "node_modules/jest-leak-detector": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.2.0.tgz",+ "integrity": "sha512-M6jKAjyzjHG0SrQgwhgZGy9hFazcudwCNovY/9HPIicmNSBuockPSedAP9vlPK6ONFJ1zfyH/M2/YYJxOz5cdQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/get-type": "30.1.0",+ "pretty-format": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-matcher-utils": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.2.0.tgz",+ "integrity": "sha512-dQ94Nq4dbzmUWkQ0ANAWS9tBRfqCrn0bV9AMYdOi/MHW726xn7eQmMeRTpX2ViC00bpNaWXq+7o4lIQ3AX13Hg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/get-type": "30.1.0",+ "chalk": "^4.1.2",+ "jest-diff": "30.2.0",+ "pretty-format": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-message-util": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.2.0.tgz",+ "integrity": "sha512-y4DKFLZ2y6DxTWD4cDe07RglV88ZiNEdlRfGtqahfbIjfsw1nMCPx49Uev4IA/hWn3sDKyAnSPwoYSsAEdcimw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.27.1",+ "@jest/types": "30.2.0",+ "@types/stack-utils": "^2.0.3",+ "chalk": "^4.1.2",+ "graceful-fs": "^4.2.11",+ "micromatch": "^4.0.8",+ "pretty-format": "30.2.0",+ "slash": "^3.0.0",+ "stack-utils": "^2.0.6"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-mock": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.2.0.tgz",+ "integrity": "sha512-JNNNl2rj4b5ICpmAcq+WbLH83XswjPbjH4T7yvGzfAGCPh1rw+xVNbtk+FnRslvt9lkCcdn9i1oAoKUuFsOxRw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "jest-util": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-pnp-resolver": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz",+ "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ },+ "peerDependencies": {+ "jest-resolve": "*"+ },+ "peerDependenciesMeta": {+ "jest-resolve": {+ "optional": true+ }+ }+ },+ "node_modules/jest-regex-util": {+ "version": "30.0.1",+ "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.0.1.tgz",+ "integrity": "sha512-jHEQgBXAgc+Gh4g0p3bCevgRCVRkB4VB70zhoAE48gxeSr1hfUOsM/C2WoJgVL7Eyg//hudYENbm3Ne+/dRVVA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-resolve": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.2.0.tgz",+ "integrity": "sha512-TCrHSxPlx3tBY3hWNtRQKbtgLhsXa1WmbJEqBlTBrGafd5fiQFByy2GNCEoGR+Tns8d15GaL9cxEzKOO3GEb2A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "chalk": "^4.1.2",+ "graceful-fs": "^4.2.11",+ "jest-haste-map": "30.2.0",+ "jest-pnp-resolver": "^1.2.3",+ "jest-util": "30.2.0",+ "jest-validate": "30.2.0",+ "slash": "^3.0.0",+ "unrs-resolver": "^1.7.11"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-resolve-dependencies": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.2.0.tgz",+ "integrity": "sha512-xTOIGug/0RmIe3mmCqCT95yO0vj6JURrn1TKWlNbhiAefJRWINNPgwVkrVgt/YaerPzY3iItufd80v3lOrFJ2w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "jest-regex-util": "30.0.1",+ "jest-snapshot": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-runner": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.2.0.tgz",+ "integrity": "sha512-PqvZ2B2XEyPEbclp+gV6KO/F1FIFSbIwewRgmROCMBo/aZ6J1w8Qypoj2pEOcg3G2HzLlaP6VUtvwCI8dM3oqQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/console": "30.2.0",+ "@jest/environment": "30.2.0",+ "@jest/test-result": "30.2.0",+ "@jest/transform": "30.2.0",+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "chalk": "^4.1.2",+ "emittery": "^0.13.1",+ "exit-x": "^0.2.2",+ "graceful-fs": "^4.2.11",+ "jest-docblock": "30.2.0",+ "jest-environment-node": "30.2.0",+ "jest-haste-map": "30.2.0",+ "jest-leak-detector": "30.2.0",+ "jest-message-util": "30.2.0",+ "jest-resolve": "30.2.0",+ "jest-runtime": "30.2.0",+ "jest-util": "30.2.0",+ "jest-watcher": "30.2.0",+ "jest-worker": "30.2.0",+ "p-limit": "^3.1.0",+ "source-map-support": "0.5.13"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-runner/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/jest-runner/node_modules/source-map-support": {+ "version": "0.5.13",+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",+ "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "buffer-from": "^1.0.0",+ "source-map": "^0.6.0"+ }+ },+ "node_modules/jest-runtime": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.2.0.tgz",+ "integrity": "sha512-p1+GVX/PJqTucvsmERPMgCPvQJpFt4hFbM+VN3n8TMo47decMUcJbt+rgzwrEme0MQUA/R+1de2axftTHkKckg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/environment": "30.2.0",+ "@jest/fake-timers": "30.2.0",+ "@jest/globals": "30.2.0",+ "@jest/source-map": "30.0.1",+ "@jest/test-result": "30.2.0",+ "@jest/transform": "30.2.0",+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "chalk": "^4.1.2",+ "cjs-module-lexer": "^2.1.0",+ "collect-v8-coverage": "^1.0.2",+ "glob": "^10.3.10",+ "graceful-fs": "^4.2.11",+ "jest-haste-map": "30.2.0",+ "jest-message-util": "30.2.0",+ "jest-mock": "30.2.0",+ "jest-regex-util": "30.0.1",+ "jest-resolve": "30.2.0",+ "jest-snapshot": "30.2.0",+ "jest-util": "30.2.0",+ "slash": "^3.0.0",+ "strip-bom": "^4.0.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-runtime/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/jest-runtime/node_modules/glob": {+ "version": "10.5.0",+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",+ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "foreground-child": "^3.1.0",+ "jackspeak": "^3.1.2",+ "minimatch": "^9.0.4",+ "minipass": "^7.1.2",+ "package-json-from-dist": "^1.0.0",+ "path-scurry": "^1.11.1"+ },+ "bin": {+ "glob": "dist/esm/bin.mjs"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/jest-runtime/node_modules/lru-cache": {+ "version": "10.4.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/jest-runtime/node_modules/minimatch": {+ "version": "9.0.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/jest-runtime/node_modules/path-scurry": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "lru-cache": "^10.2.0",+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"+ },+ "engines": {+ "node": ">=16 || 14 >=14.18"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/jest-snapshot": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.2.0.tgz",+ "integrity": "sha512-5WEtTy2jXPFypadKNpbNkZ72puZCa6UjSr/7djeecHWOu7iYhSXSnHScT8wBz3Rn8Ena5d5RYRcsyKIeqG1IyA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@babel/core": "^7.27.4",+ "@babel/generator": "^7.27.5",+ "@babel/plugin-syntax-jsx": "^7.27.1",+ "@babel/plugin-syntax-typescript": "^7.27.1",+ "@babel/types": "^7.27.3",+ "@jest/expect-utils": "30.2.0",+ "@jest/get-type": "30.1.0",+ "@jest/snapshot-utils": "30.2.0",+ "@jest/transform": "30.2.0",+ "@jest/types": "30.2.0",+ "babel-preset-current-node-syntax": "^1.2.0",+ "chalk": "^4.1.2",+ "expect": "30.2.0",+ "graceful-fs": "^4.2.11",+ "jest-diff": "30.2.0",+ "jest-matcher-utils": "30.2.0",+ "jest-message-util": "30.2.0",+ "jest-util": "30.2.0",+ "pretty-format": "30.2.0",+ "semver": "^7.7.2",+ "synckit": "^0.11.8"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-util": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.2.0.tgz",+ "integrity": "sha512-QKNsM0o3Xe6ISQU869e+DhG+4CK/48aHYdJZGlFQVTjnbvgpcKyxpzk29fGiO7i/J8VENZ+d2iGnSsvmuHywlA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "chalk": "^4.1.2",+ "ci-info": "^4.2.0",+ "graceful-fs": "^4.2.11",+ "picomatch": "^4.0.2"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-validate": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.2.0.tgz",+ "integrity": "sha512-FBGWi7dP2hpdi8nBoWxSsLvBFewKAg0+uSQwBaof4Y4DPgBabXgpSYC5/lR7VmnIlSpASmCi/ntRWPbv7089Pw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/get-type": "30.1.0",+ "@jest/types": "30.2.0",+ "camelcase": "^6.3.0",+ "chalk": "^4.1.2",+ "leven": "^3.1.0",+ "pretty-format": "30.2.0"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-validate/node_modules/camelcase": {+ "version": "6.3.0",+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/jest-watcher": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.2.0.tgz",+ "integrity": "sha512-PYxa28dxJ9g777pGm/7PrbnMeA0Jr7osHP9bS7eJy9DuAjMgdGtxgf0uKMyoIsTWAkIbUW5hSDdJ3urmgXBqxg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/test-result": "30.2.0",+ "@jest/types": "30.2.0",+ "@types/node": "*",+ "ansi-escapes": "^4.3.2",+ "chalk": "^4.1.2",+ "emittery": "^0.13.1",+ "jest-util": "30.2.0",+ "string-length": "^4.0.2"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/jest-worker": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.2.0.tgz",+ "integrity": "sha512-0Q4Uk8WF7BUwqXHuAjc23vmopWJw5WH7w2tqBoUOZpOjW/ZnR44GXXd1r82RvnmI2GZge3ivrYXk/BE2+VtW2g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*",+ "@ungap/structured-clone": "^1.3.0",+ "jest-util": "30.2.0",+ "merge-stream": "^2.0.0",+ "supports-color": "^8.1.1"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/js-tokens": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",+ "license": "MIT"+ },+ "node_modules/js-yaml": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",+ "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",+ "license": "MIT",+ "dependencies": {+ "argparse": "^2.0.1"+ },+ "bin": {+ "js-yaml": "bin/js-yaml.js"+ }+ },+ "node_modules/jsesc": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "jsesc": "bin/jsesc"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/json-buffer": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/json-parse-even-better-errors": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",+ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",+ "license": "MIT"+ },+ "node_modules/json-schema-traverse": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/json-stable-stringify-without-jsonify": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/json5": {+ "version": "2.2.3",+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "json5": "lib/cli.js"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/jsonc-parser": {+ "version": "3.3.1",+ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz",+ "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/jsonfile": {+ "version": "6.2.0",+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz",+ "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==",+ "devOptional": true,+ "license": "MIT",+ "dependencies": {+ "universalify": "^2.0.0"+ },+ "optionalDependencies": {+ "graceful-fs": "^4.1.6"+ }+ },+ "node_modules/keyv": {+ "version": "4.5.4",+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",+ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "json-buffer": "3.0.1"+ }+ },+ "node_modules/lazystream": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",+ "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==",+ "license": "MIT",+ "dependencies": {+ "readable-stream": "^2.0.5"+ },+ "engines": {+ "node": ">= 0.6.3"+ }+ },+ "node_modules/lazystream/node_modules/isarray": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",+ "license": "MIT"+ },+ "node_modules/lazystream/node_modules/readable-stream": {+ "version": "2.3.8",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",+ "license": "MIT",+ "dependencies": {+ "core-util-is": "~1.0.0",+ "inherits": "~2.0.3",+ "isarray": "~1.0.0",+ "process-nextick-args": "~2.0.0",+ "safe-buffer": "~5.1.1",+ "string_decoder": "~1.1.1",+ "util-deprecate": "~1.0.1"+ }+ },+ "node_modules/lazystream/node_modules/safe-buffer": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",+ "license": "MIT"+ },+ "node_modules/lazystream/node_modules/string_decoder": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",+ "license": "MIT",+ "dependencies": {+ "safe-buffer": "~5.1.0"+ }+ },+ "node_modules/leven": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",+ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/levn": {+ "version": "0.4.1",+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "prelude-ls": "^1.2.1",+ "type-check": "~0.4.0"+ },+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "node_modules/libphonenumber-js": {+ "version": "1.12.36",+ "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.36.tgz",+ "integrity": "sha512-woWhKMAVx1fzzUnMCyOzglgSgf6/AFHLASdOBcchYCyvWSGWt12imw3iu2hdI5d4dGZRsNWAmWiz37sDKUPaRQ==",+ "license": "MIT"+ },+ "node_modules/lines-and-columns": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",+ "license": "MIT"+ },+ "node_modules/listenercount": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz",+ "integrity": "sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/load-esm": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/load-esm/-/load-esm-1.0.3.tgz",+ "integrity": "sha512-v5xlu8eHD1+6r8EHTg6hfmO97LN8ugKtiXcy5e6oN72iD2r6u0RPfLl6fxM+7Wnh2ZRq15o0russMst44WauPA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/Borewit"+ },+ {+ "type": "buymeacoffee",+ "url": "https://buymeacoffee.com/borewit"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=13.2.0"+ }+ },+ "node_modules/loader-runner": {+ "version": "4.3.1",+ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz",+ "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.11.5"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },+ "node_modules/locate-path": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-locate": "^5.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/lodash": {+ "version": "4.17.23",+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",+ "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",+ "license": "MIT"+ },+ "node_modules/lodash.camelcase": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",+ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",+ "license": "MIT"+ },+ "node_modules/lodash.defaults": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",+ "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==",+ "license": "MIT"+ },+ "node_modules/lodash.difference": {+ "version": "4.5.0",+ "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",+ "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/lodash.flatten": {+ "version": "4.4.0",+ "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",+ "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/lodash.isarguments": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",+ "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==",+ "license": "MIT"+ },+ "node_modules/lodash.isplainobject": {+ "version": "4.0.6",+ "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",+ "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/lodash.memoize": {+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",+ "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/lodash.merge": {+ "version": "4.6.2",+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/lodash.union": {+ "version": "4.6.0",+ "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz",+ "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/log-symbols": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",+ "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "chalk": "^4.1.0",+ "is-unicode-supported": "^0.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/long": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",+ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",+ "license": "Apache-2.0"+ },+ "node_modules/lru-cache": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "yallist": "^3.0.2"+ }+ },+ "node_modules/luxon": {+ "version": "3.7.2",+ "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz",+ "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==",+ "license": "MIT",+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/magic-string": {+ "version": "0.30.17",+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz",+ "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.0"+ }+ },+ "node_modules/make-dir": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",+ "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "semver": "^7.5.3"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/make-error": {+ "version": "1.3.6",+ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",+ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",+ "devOptional": true,+ "license": "ISC"+ },+ "node_modules/make-fetch-happen": {+ "version": "9.1.0",+ "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz",+ "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "agentkeepalive": "^4.1.3",+ "cacache": "^15.2.0",+ "http-cache-semantics": "^4.1.0",+ "http-proxy-agent": "^4.0.1",+ "https-proxy-agent": "^5.0.0",+ "is-lambda": "^1.0.1",+ "lru-cache": "^6.0.0",+ "minipass": "^3.1.3",+ "minipass-collect": "^1.0.2",+ "minipass-fetch": "^1.3.2",+ "minipass-flush": "^1.0.5",+ "minipass-pipeline": "^1.2.4",+ "negotiator": "^0.6.2",+ "promise-retry": "^2.0.1",+ "socks-proxy-agent": "^6.0.0",+ "ssri": "^8.0.0"+ },+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/make-fetch-happen/node_modules/lru-cache": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/make-fetch-happen/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/make-fetch-happen/node_modules/negotiator": {+ "version": "0.6.4",+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz",+ "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/make-fetch-happen/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/makeerror": {+ "version": "1.0.12",+ "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz",+ "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "tmpl": "1.0.5"+ }+ },+ "node_modules/math-intrinsics": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/media-typer": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",+ "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/memfs": {+ "version": "3.5.3",+ "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz",+ "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==",+ "dev": true,+ "license": "Unlicense",+ "dependencies": {+ "fs-monkey": "^1.0.4"+ },+ "engines": {+ "node": ">= 4.0.0"+ }+ },+ "node_modules/merge-descriptors": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/merge-stream": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/methods": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/micromatch": {+ "version": "4.0.8",+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "braces": "^3.0.3",+ "picomatch": "^2.3.1"+ },+ "engines": {+ "node": ">=8.6"+ }+ },+ "node_modules/micromatch/node_modules/picomatch": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/mime": {+ "version": "2.6.0",+ "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",+ "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "mime": "cli.js"+ },+ "engines": {+ "node": ">=4.0.0"+ }+ },+ "node_modules/mime-db": {+ "version": "1.54.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/mime-types": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",+ "license": "MIT",+ "dependencies": {+ "mime-db": "^1.54.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/mimic-fn": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/mimic-response": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",+ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/minimatch": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",+ "devOptional": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^1.1.7"+ },+ "engines": {+ "node": "*"+ }+ },+ "node_modules/minimist": {+ "version": "1.2.8",+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/minipass": {+ "version": "7.1.2",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",+ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",+ "license": "ISC",+ "engines": {+ "node": ">=16 || 14 >=14.17"+ }+ },+ "node_modules/minipass-collect": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz",+ "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "minipass": "^3.0.0"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/minipass-collect/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/minipass-collect/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/minipass-fetch": {+ "version": "1.4.1",+ "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz",+ "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "minipass": "^3.1.0",+ "minipass-sized": "^1.0.3",+ "minizlib": "^2.0.0"+ },+ "engines": {+ "node": ">=8"+ },+ "optionalDependencies": {+ "encoding": "^0.1.12"+ }+ },+ "node_modules/minipass-fetch/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/minipass-fetch/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/minipass-flush": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz",+ "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "minipass": "^3.0.0"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/minipass-flush/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/minipass-flush/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/minipass-pipeline": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz",+ "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "minipass": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/minipass-pipeline/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/minipass-pipeline/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/minipass-sized": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz",+ "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "minipass": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/minipass-sized/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/minipass-sized/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/minizlib": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",+ "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",+ "license": "MIT",+ "dependencies": {+ "minipass": "^3.0.0",+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/minizlib/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/minizlib/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC"+ },+ "node_modules/mitt": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",+ "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==",+ "license": "MIT"+ },+ "node_modules/mkdirp": {+ "version": "0.5.6",+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",+ "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",+ "license": "MIT",+ "dependencies": {+ "minimist": "^1.2.6"+ },+ "bin": {+ "mkdirp": "bin/cmd.js"+ }+ },+ "node_modules/mkdirp-classic": {+ "version": "0.5.3",+ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",+ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",+ "license": "MIT"+ },+ "node_modules/ms": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",+ "license": "MIT"+ },+ "node_modules/msgpackr": {+ "version": "1.11.5",+ "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.5.tgz",+ "integrity": "sha512-UjkUHN0yqp9RWKy0Lplhh+wlpdt9oQBYgULZOiFhV3VclSF1JnSQWZ5r9gORQlNYaUKQoR8itv7g7z1xDDuACA==",+ "license": "MIT",+ "optionalDependencies": {+ "msgpackr-extract": "^3.0.2"+ }+ },+ "node_modules/msgpackr-extract": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz",+ "integrity": "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==",+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "node-gyp-build-optional-packages": "5.2.2"+ },+ "bin": {+ "download-msgpackr-prebuilds": "bin/download-prebuilds.js"+ },+ "optionalDependencies": {+ "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3",+ "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3",+ "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3",+ "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3",+ "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3",+ "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3"+ }+ },+ "node_modules/multer": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/multer/-/multer-2.0.2.tgz",+ "integrity": "sha512-u7f2xaZ/UG8oLXHvtF/oWTRvT44p9ecwBBqTwgJVq0+4BW1g8OW01TyMEGWBHbyMOYVHXslaut7qEQ1meATXgw==",+ "license": "MIT",+ "dependencies": {+ "append-field": "^1.0.0",+ "busboy": "^1.6.0",+ "concat-stream": "^2.0.0",+ "mkdirp": "^0.5.6",+ "object-assign": "^4.1.1",+ "type-is": "^1.6.18",+ "xtend": "^4.0.2"+ },+ "engines": {+ "node": ">= 10.16.0"+ }+ },+ "node_modules/multer/node_modules/media-typer": {+ "version": "0.3.0",+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/multer/node_modules/mime-db": {+ "version": "1.52.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/multer/node_modules/mime-types": {+ "version": "2.1.35",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",+ "license": "MIT",+ "dependencies": {+ "mime-db": "1.52.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/multer/node_modules/type-is": {+ "version": "1.6.18",+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",+ "license": "MIT",+ "dependencies": {+ "media-typer": "0.3.0",+ "mime-types": "~2.1.24"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/mute-stream": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz",+ "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==",+ "dev": true,+ "license": "ISC",+ "engines": {+ "node": "^18.17.0 || >=20.5.0"+ }+ },+ "node_modules/nan": {+ "version": "2.25.0",+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.25.0.tgz",+ "integrity": "sha512-0M90Ag7Xn5KMLLZ7zliPWP3rT90P6PN+IzVFS0VqmnPktBk3700xUVv8Ikm9EUaUE5SDWdp/BIxdENzVznpm1g==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/napi-build-utils": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz",+ "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==",+ "license": "MIT"+ },+ "node_modules/napi-postinstall": {+ "version": "0.3.4",+ "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz",+ "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "napi-postinstall": "lib/cli.js"+ },+ "engines": {+ "node": "^12.20.0 || ^14.18.0 || >=16.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/napi-postinstall"+ }+ },+ "node_modules/natural-compare": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/negotiator": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/neo-async": {+ "version": "2.6.2",+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/netmask": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz",+ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4.0"+ }+ },+ "node_modules/node-abi": {+ "version": "3.87.0",+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.87.0.tgz",+ "integrity": "sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ==",+ "license": "MIT",+ "dependencies": {+ "semver": "^7.3.5"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/node-abort-controller": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz",+ "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==",+ "license": "MIT"+ },+ "node_modules/node-addon-api": {+ "version": "7.1.1",+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",+ "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",+ "license": "MIT"+ },+ "node_modules/node-emoji": {+ "version": "1.11.0",+ "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz",+ "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "lodash": "^4.17.21"+ }+ },+ "node_modules/node-fetch": {+ "version": "2.7.0",+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",+ "license": "MIT",+ "dependencies": {+ "whatwg-url": "^5.0.0"+ },+ "engines": {+ "node": "4.x || >=6.0.0"+ },+ "peerDependencies": {+ "encoding": "^0.1.0"+ },+ "peerDependenciesMeta": {+ "encoding": {+ "optional": true+ }+ }+ },+ "node_modules/node-gyp": {+ "version": "8.4.1",+ "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz",+ "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "env-paths": "^2.2.0",+ "glob": "^7.1.4",+ "graceful-fs": "^4.2.6",+ "make-fetch-happen": "^9.1.0",+ "nopt": "^5.0.0",+ "npmlog": "^6.0.0",+ "rimraf": "^3.0.2",+ "semver": "^7.3.5",+ "tar": "^6.1.2",+ "which": "^2.0.2"+ },+ "bin": {+ "node-gyp": "bin/node-gyp.js"+ },+ "engines": {+ "node": ">= 10.12.0"+ }+ },+ "node_modules/node-gyp-build-optional-packages": {+ "version": "5.2.2",+ "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz",+ "integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "detect-libc": "^2.0.1"+ },+ "bin": {+ "node-gyp-build-optional-packages": "bin.js",+ "node-gyp-build-optional-packages-optional": "optional.js",+ "node-gyp-build-optional-packages-test": "build-test.js"+ }+ },+ "node_modules/node-gyp/node_modules/glob": {+ "version": "7.2.3",+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "fs.realpath": "^1.0.0",+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "^3.1.1",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ },+ "engines": {+ "node": "*"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/node-int64": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",+ "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/node-releases": {+ "version": "2.0.27",+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",+ "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/node-webpmux": {+ "version": "3.1.7",+ "resolved": "https://registry.npmjs.org/node-webpmux/-/node-webpmux-3.1.7.tgz",+ "integrity": "sha512-ySkL4lBCto86OyQ0blAGzylWSECcn5I0lM3bYEhe75T8Zxt/BFUMHa8ktUguR7zwXNdS/Hms31VfSsYKN1383g==",+ "license": "ISC"+ },+ "node_modules/nopt": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",+ "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "abbrev": "1"+ },+ "bin": {+ "nopt": "bin/nopt.js"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/normalize-path": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/npm-run-path": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/npmlog": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz",+ "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==",+ "deprecated": "This package is no longer supported.",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "are-we-there-yet": "^3.0.0",+ "console-control-strings": "^1.1.0",+ "gauge": "^4.0.3",+ "set-blocking": "^2.0.0"+ },+ "engines": {+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"+ }+ },+ "node_modules/object-assign": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/object-hash": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz",+ "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==",+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/object-inspect": {+ "version": "1.13.4",+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/on-finished": {+ "version": "2.4.1",+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",+ "license": "MIT",+ "dependencies": {+ "ee-first": "1.1.1"+ },+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/once": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",+ "license": "ISC",+ "dependencies": {+ "wrappy": "1"+ }+ },+ "node_modules/onetime": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "mimic-fn": "^2.1.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/optionator": {+ "version": "0.9.4",+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",+ "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "deep-is": "^0.1.3",+ "fast-levenshtein": "^2.0.6",+ "levn": "^0.4.1",+ "prelude-ls": "^1.2.1",+ "type-check": "^0.4.0",+ "word-wrap": "^1.2.5"+ },+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "node_modules/ora": {+ "version": "5.4.1",+ "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz",+ "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "bl": "^4.1.0",+ "chalk": "^4.1.0",+ "cli-cursor": "^3.1.0",+ "cli-spinners": "^2.5.0",+ "is-interactive": "^1.0.0",+ "is-unicode-supported": "^0.1.0",+ "log-symbols": "^4.1.0",+ "strip-ansi": "^6.0.0",+ "wcwidth": "^1.0.1"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-limit": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "yocto-queue": "^0.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-locate": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-limit": "^3.0.2"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-map": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",+ "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "aggregate-error": "^3.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-try": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/pac-proxy-agent": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz",+ "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==",+ "license": "MIT",+ "dependencies": {+ "@tootallnate/quickjs-emscripten": "^0.23.0",+ "agent-base": "^7.1.2",+ "debug": "^4.3.4",+ "get-uri": "^6.0.1",+ "http-proxy-agent": "^7.0.0",+ "https-proxy-agent": "^7.0.6",+ "pac-resolver": "^7.0.1",+ "socks-proxy-agent": "^8.0.5"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/pac-proxy-agent/node_modules/agent-base": {+ "version": "7.1.4",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/pac-proxy-agent/node_modules/http-proxy-agent": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",+ "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.0",+ "debug": "^4.3.4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.2",+ "debug": "4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/pac-proxy-agent/node_modules/socks-proxy-agent": {+ "version": "8.0.5",+ "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",+ "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.2",+ "debug": "^4.3.4",+ "socks": "^2.8.3"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/pac-resolver": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz",+ "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==",+ "license": "MIT",+ "dependencies": {+ "degenerator": "^5.0.0",+ "netmask": "^2.0.2"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/package-json-from-dist": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",+ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",+ "license": "BlueOak-1.0.0"+ },+ "node_modules/parent-module": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",+ "license": "MIT",+ "dependencies": {+ "callsites": "^3.0.0"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/parse-json": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",+ "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",+ "license": "MIT",+ "dependencies": {+ "@babel/code-frame": "^7.0.0",+ "error-ex": "^1.3.1",+ "json-parse-even-better-errors": "^2.3.0",+ "lines-and-columns": "^1.1.6"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/parseurl": {+ "version": "1.3.3",+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/path-exists": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/path-is-absolute": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",+ "devOptional": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/path-key": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/path-scurry": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz",+ "integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "lru-cache": "^11.0.0",+ "minipass": "^7.1.2"+ },+ "engines": {+ "node": "20 || >=22"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/path-scurry/node_modules/lru-cache": {+ "version": "11.2.5",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.5.tgz",+ "integrity": "sha512-vFrFJkWtJvJnD5hg+hJvVE8Lh/TcMzKnTgCWmtBipwI5yLX/iX+5UB2tfuyODF5E7k9xEzMdYgGqaSb1c0c5Yw==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": "20 || >=22"+ }+ },+ "node_modules/path-to-regexp": {+ "version": "8.3.0",+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",+ "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",+ "license": "MIT",+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/path-type": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",+ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/pend": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",+ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==",+ "license": "MIT"+ },+ "node_modules/pg": {+ "version": "8.18.0",+ "resolved": "https://registry.npmjs.org/pg/-/pg-8.18.0.tgz",+ "integrity": "sha512-xqrUDL1b9MbkydY/s+VZ6v+xiMUmOUk7SS9d/1kpyQxoJ6U9AO1oIJyUWVZojbfe5Cc/oluutcgFG4L9RDP1iQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "pg-connection-string": "^2.11.0",+ "pg-pool": "^3.11.0",+ "pg-protocol": "^1.11.0",+ "pg-types": "2.2.0",+ "pgpass": "1.0.5"+ },+ "engines": {+ "node": ">= 16.0.0"+ },+ "optionalDependencies": {+ "pg-cloudflare": "^1.3.0"+ },+ "peerDependencies": {+ "pg-native": ">=3.0.1"+ },+ "peerDependenciesMeta": {+ "pg-native": {+ "optional": true+ }+ }+ },+ "node_modules/pg-cloudflare": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.3.0.tgz",+ "integrity": "sha512-6lswVVSztmHiRtD6I8hw4qP/nDm1EJbKMRhf3HCYaqud7frGysPv7FYJ5noZQdhQtN2xJnimfMtvQq21pdbzyQ==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/pg-connection-string": {+ "version": "2.11.0",+ "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.11.0.tgz",+ "integrity": "sha512-kecgoJwhOpxYU21rZjULrmrBJ698U2RxXofKVzOn5UDj61BPj/qMb7diYUR1nLScCDbrztQFl1TaQZT0t1EtzQ==",+ "license": "MIT"+ },+ "node_modules/pg-int8": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",+ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",+ "license": "ISC",+ "engines": {+ "node": ">=4.0.0"+ }+ },+ "node_modules/pg-pool": {+ "version": "3.11.0",+ "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.11.0.tgz",+ "integrity": "sha512-MJYfvHwtGp870aeusDh+hg9apvOe2zmpZJpyt+BMtzUWlVqbhFmMK6bOBXLBUPd7iRtIF9fZplDc7KrPN3PN7w==",+ "license": "MIT",+ "peerDependencies": {+ "pg": ">=8.0"+ }+ },+ "node_modules/pg-protocol": {+ "version": "1.11.0",+ "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.11.0.tgz",+ "integrity": "sha512-pfsxk2M9M3BuGgDOfuy37VNRRX3jmKgMjcvAcWqNDpZSf4cUmv8HSOl5ViRQFsfARFn0KuUQTgLxVMbNq5NW3g==",+ "license": "MIT"+ },+ "node_modules/pg-types": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",+ "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",+ "license": "MIT",+ "dependencies": {+ "pg-int8": "1.0.1",+ "postgres-array": "~2.0.0",+ "postgres-bytea": "~1.0.0",+ "postgres-date": "~1.0.4",+ "postgres-interval": "^1.1.0"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/pgpass": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",+ "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",+ "license": "MIT",+ "dependencies": {+ "split2": "^4.1.0"+ }+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "license": "ISC"+ },+ "node_modules/picomatch": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",+ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/pirates": {+ "version": "4.0.7",+ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",+ "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/pkg-dir": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",+ "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "find-up": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/pkg-dir/node_modules/find-up": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "locate-path": "^5.0.0",+ "path-exists": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/pkg-dir/node_modules/locate-path": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-locate": "^4.1.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/pkg-dir/node_modules/p-limit": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-try": "^2.0.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/pkg-dir/node_modules/p-locate": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-limit": "^2.2.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/pluralize": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",+ "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/pngjs": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",+ "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",+ "license": "MIT",+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/possible-typed-array-names": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",+ "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/postgres-array": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",+ "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",+ "license": "MIT",+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/postgres-bytea": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz",+ "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/postgres-date": {+ "version": "1.0.7",+ "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",+ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/postgres-interval": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",+ "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",+ "license": "MIT",+ "dependencies": {+ "xtend": "^4.0.0"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/prebuild-install": {+ "version": "7.1.3",+ "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz",+ "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==",+ "license": "MIT",+ "dependencies": {+ "detect-libc": "^2.0.0",+ "expand-template": "^2.0.3",+ "github-from-package": "0.0.0",+ "minimist": "^1.2.3",+ "mkdirp-classic": "^0.5.3",+ "napi-build-utils": "^2.0.0",+ "node-abi": "^3.3.0",+ "pump": "^3.0.0",+ "rc": "^1.2.7",+ "simple-get": "^4.0.0",+ "tar-fs": "^2.0.0",+ "tunnel-agent": "^0.6.0"+ },+ "bin": {+ "prebuild-install": "bin.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/prelude-ls": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "node_modules/prettier": {+ "version": "3.8.1",+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz",+ "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "bin": {+ "prettier": "bin/prettier.cjs"+ },+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/prettier/prettier?sponsor=1"+ }+ },+ "node_modules/prettier-linter-helpers": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.1.tgz",+ "integrity": "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-diff": "^1.1.2"+ },+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/pretty-format": {+ "version": "30.2.0",+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.2.0.tgz",+ "integrity": "sha512-9uBdv/B4EefsuAL+pWqueZyZS2Ba+LxfFeQ9DN14HU4bN8bhaxKdkpjpB6fs9+pSjIBu+FXQHImEg8j/Lw0+vA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jest/schemas": "30.0.5",+ "ansi-styles": "^5.2.0",+ "react-is": "^18.3.1"+ },+ "engines": {+ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"+ }+ },+ "node_modules/pretty-format/node_modules/ansi-styles": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",+ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/process": {+ "version": "0.11.10",+ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",+ "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6.0"+ }+ },+ "node_modules/process-nextick-args": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",+ "license": "MIT"+ },+ "node_modules/progress": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",+ "license": "MIT",+ "engines": {+ "node": ">=0.4.0"+ }+ },+ "node_modules/promise-inflight": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",+ "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/promise-retry": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",+ "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "err-code": "^2.0.2",+ "retry": "^0.12.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/protobufjs": {+ "version": "7.5.4",+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",+ "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==",+ "hasInstallScript": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.2",+ "@protobufjs/base64": "^1.1.2",+ "@protobufjs/codegen": "^2.0.4",+ "@protobufjs/eventemitter": "^1.1.0",+ "@protobufjs/fetch": "^1.1.0",+ "@protobufjs/float": "^1.0.2",+ "@protobufjs/inquire": "^1.1.0",+ "@protobufjs/path": "^1.1.2",+ "@protobufjs/pool": "^1.1.0",+ "@protobufjs/utf8": "^1.1.0",+ "@types/node": ">=13.7.0",+ "long": "^5.0.0"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/proxy-addr": {+ "version": "2.0.7",+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",+ "license": "MIT",+ "dependencies": {+ "forwarded": "0.2.0",+ "ipaddr.js": "1.9.1"+ },+ "engines": {+ "node": ">= 0.10"+ }+ },+ "node_modules/proxy-agent": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz",+ "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==",+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.2",+ "debug": "^4.3.4",+ "http-proxy-agent": "^7.0.1",+ "https-proxy-agent": "^7.0.6",+ "lru-cache": "^7.14.1",+ "pac-proxy-agent": "^7.1.0",+ "proxy-from-env": "^1.1.0",+ "socks-proxy-agent": "^8.0.5"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/proxy-agent/node_modules/agent-base": {+ "version": "7.1.4",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/proxy-agent/node_modules/http-proxy-agent": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",+ "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.0",+ "debug": "^4.3.4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/proxy-agent/node_modules/https-proxy-agent": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.2",+ "debug": "4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/proxy-agent/node_modules/lru-cache": {+ "version": "7.18.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",+ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",+ "license": "ISC",+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/proxy-agent/node_modules/socks-proxy-agent": {+ "version": "8.0.5",+ "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",+ "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.2",+ "debug": "^4.3.4",+ "socks": "^2.8.3"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/proxy-from-env": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",+ "license": "MIT"+ },+ "node_modules/pump": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",+ "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",+ "license": "MIT",+ "dependencies": {+ "end-of-stream": "^1.1.0",+ "once": "^1.3.1"+ }+ },+ "node_modules/punycode": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/puppeteer": {+ "version": "24.36.1",+ "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.36.1.tgz",+ "integrity": "sha512-uPiDUyf7gd7Il1KnqfNUtHqntL0w1LapEw5Zsuh8oCK8GsqdxySX1PzdIHKB2Dw273gWY4MW0zC5gy3Re9XlqQ==",+ "hasInstallScript": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@puppeteer/browsers": "2.11.2",+ "chromium-bidi": "13.0.1",+ "cosmiconfig": "^9.0.0",+ "devtools-protocol": "0.0.1551306",+ "puppeteer-core": "24.36.1",+ "typed-query-selector": "^2.12.0"+ },+ "bin": {+ "puppeteer": "lib/cjs/puppeteer/node/cli.js"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/puppeteer-core": {+ "version": "24.36.1",+ "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.36.1.tgz",+ "integrity": "sha512-L7ykMWc3lQf3HS7ME3PSjp7wMIjJeW6+bKfH/RSTz5l6VUDGubnrC2BKj3UvM28Y5PMDFW0xniJOZHBZPpW1dQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@puppeteer/browsers": "2.11.2",+ "chromium-bidi": "13.0.1",+ "debug": "^4.4.3",+ "devtools-protocol": "0.0.1551306",+ "typed-query-selector": "^2.12.0",+ "webdriver-bidi-protocol": "0.4.0",+ "ws": "^8.19.0"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/puppeteer-core/node_modules/ws": {+ "version": "8.19.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",+ "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==",+ "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/puppeteer/node_modules/cosmiconfig": {+ "version": "9.0.0",+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz",+ "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==",+ "license": "MIT",+ "dependencies": {+ "env-paths": "^2.2.1",+ "import-fresh": "^3.3.0",+ "js-yaml": "^4.1.0",+ "parse-json": "^5.2.0"+ },+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/sponsors/d-fischer"+ },+ "peerDependencies": {+ "typescript": ">=4.9.5"+ },+ "peerDependenciesMeta": {+ "typescript": {+ "optional": true+ }+ }+ },+ "node_modules/pure-rand": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz",+ "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==",+ "dev": true,+ "funding": [+ {+ "type": "individual",+ "url": "https://github.com/sponsors/dubzzz"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/fast-check"+ }+ ],+ "license": "MIT"+ },+ "node_modules/qrcode": {+ "version": "1.5.4",+ "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",+ "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",+ "license": "MIT",+ "dependencies": {+ "dijkstrajs": "^1.0.1",+ "pngjs": "^5.0.0",+ "yargs": "^15.3.1"+ },+ "bin": {+ "qrcode": "bin/qrcode"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/qrcode/node_modules/cliui": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",+ "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",+ "license": "ISC",+ "dependencies": {+ "string-width": "^4.2.0",+ "strip-ansi": "^6.0.0",+ "wrap-ansi": "^6.2.0"+ }+ },+ "node_modules/qrcode/node_modules/find-up": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",+ "license": "MIT",+ "dependencies": {+ "locate-path": "^5.0.0",+ "path-exists": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/qrcode/node_modules/locate-path": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",+ "license": "MIT",+ "dependencies": {+ "p-locate": "^4.1.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/qrcode/node_modules/p-limit": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",+ "license": "MIT",+ "dependencies": {+ "p-try": "^2.0.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/qrcode/node_modules/p-locate": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",+ "license": "MIT",+ "dependencies": {+ "p-limit": "^2.2.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/qrcode/node_modules/y18n": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",+ "license": "ISC"+ },+ "node_modules/qrcode/node_modules/yargs": {+ "version": "15.4.1",+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",+ "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",+ "license": "MIT",+ "dependencies": {+ "cliui": "^6.0.0",+ "decamelize": "^1.2.0",+ "find-up": "^4.1.0",+ "get-caller-file": "^2.0.1",+ "require-directory": "^2.1.1",+ "require-main-filename": "^2.0.0",+ "set-blocking": "^2.0.0",+ "string-width": "^4.2.0",+ "which-module": "^2.0.0",+ "y18n": "^4.0.0",+ "yargs-parser": "^18.1.2"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/qrcode/node_modules/yargs-parser": {+ "version": "18.1.3",+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",+ "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",+ "license": "ISC",+ "dependencies": {+ "camelcase": "^5.0.0",+ "decamelize": "^1.2.0"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/qs": {+ "version": "6.14.1",+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",+ "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "side-channel": "^1.1.0"+ },+ "engines": {+ "node": ">=0.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/randombytes": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",+ "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "safe-buffer": "^5.1.0"+ }+ },+ "node_modules/range-parser": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/raw-body": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",+ "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",+ "license": "MIT",+ "dependencies": {+ "bytes": "~3.1.2",+ "http-errors": "~2.0.1",+ "iconv-lite": "~0.7.0",+ "unpipe": "~1.0.0"+ },+ "engines": {+ "node": ">= 0.10"+ }+ },+ "node_modules/rc": {+ "version": "1.2.8",+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",+ "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",+ "license": "(BSD-2-Clause OR MIT OR Apache-2.0)",+ "dependencies": {+ "deep-extend": "^0.6.0",+ "ini": "~1.3.0",+ "minimist": "^1.2.0",+ "strip-json-comments": "~2.0.1"+ },+ "bin": {+ "rc": "cli.js"+ }+ },+ "node_modules/rc/node_modules/strip-json-comments": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",+ "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/react-is": {+ "version": "18.3.1",+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz",+ "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/readable-stream": {+ "version": "4.7.0",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz",+ "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==",+ "license": "MIT",+ "dependencies": {+ "abort-controller": "^3.0.0",+ "buffer": "^6.0.3",+ "events": "^3.3.0",+ "process": "^0.11.10",+ "string_decoder": "^1.3.0"+ },+ "engines": {+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"+ }+ },+ "node_modules/readable-stream/node_modules/buffer": {+ "version": "6.0.3",+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "base64-js": "^1.3.1",+ "ieee754": "^1.2.1"+ }+ },+ "node_modules/readdir-glob": {+ "version": "1.1.3",+ "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz",+ "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==",+ "license": "Apache-2.0",+ "dependencies": {+ "minimatch": "^5.1.0"+ }+ },+ "node_modules/readdir-glob/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/readdir-glob/node_modules/minimatch": {+ "version": "5.1.6",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",+ "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/readdirp": {+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",+ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 14.18.0"+ },+ "funding": {+ "type": "individual",+ "url": "https://paulmillr.com/funding/"+ }+ },+ "node_modules/redis-errors": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz",+ "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==",+ "license": "MIT",+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/redis-info": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/redis-info/-/redis-info-3.1.0.tgz",+ "integrity": "sha512-ER4L9Sh/vm63DkIE0bkSjxluQlioBiBgf5w1UuldaW/3vPcecdljVDisZhmnCMvsxHNiARTTDDHGg9cGwTfrKg==",+ "license": "MIT",+ "dependencies": {+ "lodash": "^4.17.11"+ }+ },+ "node_modules/redis-parser": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz",+ "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==",+ "license": "MIT",+ "dependencies": {+ "redis-errors": "^1.0.0"+ },+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/reflect-metadata": {+ "version": "0.2.2",+ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",+ "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==",+ "license": "Apache-2.0",+ "peer": true+ },+ "node_modules/require-directory": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/require-from-string": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/require-main-filename": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",+ "license": "ISC"+ },+ "node_modules/resolve-cwd": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz",+ "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "resolve-from": "^5.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/resolve-cwd/node_modules/resolve-from": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",+ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/resolve-from": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",+ "license": "MIT",+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/restore-cursor": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",+ "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "onetime": "^5.1.0",+ "signal-exit": "^3.0.2"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/restore-cursor/node_modules/signal-exit": {+ "version": "3.0.7",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/retry": {+ "version": "0.12.0",+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",+ "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/rimraf": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",+ "deprecated": "Rimraf versions prior to v4 are no longer supported",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "glob": "^7.1.3"+ },+ "bin": {+ "rimraf": "bin.js"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/rimraf/node_modules/glob": {+ "version": "7.2.3",+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "fs.realpath": "^1.0.0",+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "^3.1.1",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ },+ "engines": {+ "node": "*"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/router": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",+ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",+ "license": "MIT",+ "dependencies": {+ "debug": "^4.4.0",+ "depd": "^2.0.0",+ "is-promise": "^4.0.0",+ "parseurl": "^1.3.3",+ "path-to-regexp": "^8.0.0"+ },+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/rxjs": {+ "version": "7.8.2",+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",+ "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==",+ "license": "Apache-2.0",+ "peer": true,+ "dependencies": {+ "tslib": "^2.1.0"+ }+ },+ "node_modules/safe-buffer": {+ "version": "5.2.1",+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/safer-buffer": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",+ "license": "MIT"+ },+ "node_modules/schema-utils": {+ "version": "3.3.0",+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",+ "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/json-schema": "^7.0.8",+ "ajv": "^6.12.5",+ "ajv-keywords": "^3.5.2"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },+ "node_modules/semver": {+ "version": "7.7.3",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",+ "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/send": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",+ "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",+ "license": "MIT",+ "dependencies": {+ "debug": "^4.4.3",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "etag": "^1.8.1",+ "fresh": "^2.0.0",+ "http-errors": "^2.0.1",+ "mime-types": "^3.0.2",+ "ms": "^2.1.3",+ "on-finished": "^2.4.1",+ "range-parser": "^1.2.1",+ "statuses": "^2.0.2"+ },+ "engines": {+ "node": ">= 18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/serialize-javascript": {+ "version": "6.0.2",+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",+ "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "randombytes": "^2.1.0"+ }+ },+ "node_modules/serve-static": {+ "version": "2.2.1",+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",+ "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",+ "license": "MIT",+ "dependencies": {+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "parseurl": "^1.3.3",+ "send": "^1.2.0"+ },+ "engines": {+ "node": ">= 18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/set-blocking": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",+ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",+ "license": "ISC"+ },+ "node_modules/set-function-length": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",+ "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",+ "license": "MIT",+ "dependencies": {+ "define-data-property": "^1.1.4",+ "es-errors": "^1.3.0",+ "function-bind": "^1.1.2",+ "get-intrinsic": "^1.2.4",+ "gopd": "^1.0.1",+ "has-property-descriptors": "^1.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/setimmediate": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",+ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/setprototypeof": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",+ "license": "ISC"+ },+ "node_modules/sha.js": {+ "version": "2.4.12",+ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz",+ "integrity": "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==",+ "license": "(MIT AND BSD-3-Clause)",+ "dependencies": {+ "inherits": "^2.0.4",+ "safe-buffer": "^5.2.1",+ "to-buffer": "^1.2.0"+ },+ "bin": {+ "sha.js": "bin.js"+ },+ "engines": {+ "node": ">= 0.10"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/shebang-command": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",+ "license": "MIT",+ "dependencies": {+ "shebang-regex": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/shebang-regex": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/shell-quote": {+ "version": "1.8.3",+ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz",+ "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",+ "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "object-inspect": "^1.13.3",+ "side-channel-list": "^1.0.0",+ "side-channel-map": "^1.0.1",+ "side-channel-weakmap": "^1.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-list": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",+ "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "object-inspect": "^1.13.3"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-map": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",+ "license": "MIT",+ "dependencies": {+ "call-bound": "^1.0.2",+ "es-errors": "^1.3.0",+ "get-intrinsic": "^1.2.5",+ "object-inspect": "^1.13.3"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-weakmap": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",+ "license": "MIT",+ "dependencies": {+ "call-bound": "^1.0.2",+ "es-errors": "^1.3.0",+ "get-intrinsic": "^1.2.5",+ "object-inspect": "^1.13.3",+ "side-channel-map": "^1.0.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/signal-exit": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",+ "license": "ISC",+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/simple-concat": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",+ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/simple-get": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",+ "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "decompress-response": "^6.0.0",+ "once": "^1.3.1",+ "simple-concat": "^1.0.0"+ }+ },+ "node_modules/slash": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",+ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/smart-buffer": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",+ "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",+ "license": "MIT",+ "engines": {+ "node": ">= 6.0.0",+ "npm": ">= 3.0.0"+ }+ },+ "node_modules/socket.io": {+ "version": "4.8.3",+ "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.3.tgz",+ "integrity": "sha512-2Dd78bqzzjE6KPkD5fHZmDAKRNe3J15q+YHDrIsy9WEkqttc7GY+kT9OBLSMaPbQaEd0x1BjcmtMtXkfpc+T5A==",+ "license": "MIT",+ "dependencies": {+ "accepts": "~1.3.4",+ "base64id": "~2.0.0",+ "cors": "~2.8.5",+ "debug": "~4.4.1",+ "engine.io": "~6.6.0",+ "socket.io-adapter": "~2.5.2",+ "socket.io-parser": "~4.2.4"+ },+ "engines": {+ "node": ">=10.2.0"+ }+ },+ "node_modules/socket.io-adapter": {+ "version": "2.5.6",+ "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.6.tgz",+ "integrity": "sha512-DkkO/dz7MGln0dHn5bmN3pPy+JmywNICWrJqVWiVOyvXjWQFIv9c2h24JrQLLFJ2aQVQf/Cvl1vblnd4r2apLQ==",+ "license": "MIT",+ "dependencies": {+ "debug": "~4.4.1",+ "ws": "~8.18.3"+ }+ },+ "node_modules/socket.io-parser": {+ "version": "4.2.5",+ "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.5.tgz",+ "integrity": "sha512-bPMmpy/5WWKHea5Y/jYAP6k74A+hvmRCQaJuJB6I/ML5JZq/KfNieUVo/3Mh7SAqn7TyFdIo6wqYHInG1MU1bQ==",+ "license": "MIT",+ "dependencies": {+ "@socket.io/component-emitter": "~3.1.0",+ "debug": "~4.4.1"+ },+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/socket.io/node_modules/accepts": {+ "version": "1.3.8",+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",+ "license": "MIT",+ "dependencies": {+ "mime-types": "~2.1.34",+ "negotiator": "0.6.3"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/socket.io/node_modules/mime-db": {+ "version": "1.52.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/socket.io/node_modules/mime-types": {+ "version": "2.1.35",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",+ "license": "MIT",+ "dependencies": {+ "mime-db": "1.52.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/socket.io/node_modules/negotiator": {+ "version": "0.6.3",+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/socks": {+ "version": "2.8.7",+ "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz",+ "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==",+ "license": "MIT",+ "dependencies": {+ "ip-address": "^10.0.1",+ "smart-buffer": "^4.2.0"+ },+ "engines": {+ "node": ">= 10.0.0",+ "npm": ">= 3.0.0"+ }+ },+ "node_modules/socks-proxy-agent": {+ "version": "6.2.1",+ "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz",+ "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "agent-base": "^6.0.2",+ "debug": "^4.3.3",+ "socks": "^2.6.2"+ },+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/source-map": {+ "version": "0.7.4",+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",+ "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/source-map-support": {+ "version": "0.5.21",+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "buffer-from": "^1.0.0",+ "source-map": "^0.6.0"+ }+ },+ "node_modules/source-map-support/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/split-ca": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/split-ca/-/split-ca-1.0.1.tgz",+ "integrity": "sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ==",+ "license": "ISC"+ },+ "node_modules/split2": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",+ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",+ "license": "ISC",+ "engines": {+ "node": ">= 10.x"+ }+ },+ "node_modules/sprintf-js": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",+ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/sql-highlight": {+ "version": "6.1.0",+ "resolved": "https://registry.npmjs.org/sql-highlight/-/sql-highlight-6.1.0.tgz",+ "integrity": "sha512-ed7OK4e9ywpE7pgRMkMQmZDPKSVdm0oX5IEtZiKnFucSF0zu6c80GZBe38UqHuVhTWJ9xsKgSMjCG2bml86KvA==",+ "funding": [+ "https://github.com/scriptcoded/sql-highlight?sponsor=1",+ {+ "type": "github",+ "url": "https://github.com/sponsors/scriptcoded"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=14"+ }+ },+ "node_modules/sqlite3": {+ "version": "5.1.7",+ "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz",+ "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==",+ "hasInstallScript": true,+ "license": "BSD-3-Clause",+ "peer": true,+ "dependencies": {+ "bindings": "^1.5.0",+ "node-addon-api": "^7.0.0",+ "prebuild-install": "^7.1.1",+ "tar": "^6.1.11"+ },+ "optionalDependencies": {+ "node-gyp": "8.x"+ },+ "peerDependencies": {+ "node-gyp": "8.x"+ },+ "peerDependenciesMeta": {+ "node-gyp": {+ "optional": true+ }+ }+ },+ "node_modules/ssh2": {+ "version": "1.17.0",+ "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.17.0.tgz",+ "integrity": "sha512-wPldCk3asibAjQ/kziWQQt1Wh3PgDFpC0XpwclzKcdT1vql6KeYxf5LIt4nlFkUeR8WuphYMKqUA56X4rjbfgQ==",+ "hasInstallScript": true,+ "dependencies": {+ "asn1": "^0.2.6",+ "bcrypt-pbkdf": "^1.0.2"+ },+ "engines": {+ "node": ">=10.16.0"+ },+ "optionalDependencies": {+ "cpu-features": "~0.0.10",+ "nan": "^2.23.0"+ }+ },+ "node_modules/ssri": {+ "version": "8.0.1",+ "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",+ "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "minipass": "^3.1.1"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/ssri/node_modules/minipass": {+ "version": "3.3.6",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/ssri/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC",+ "optional": true+ },+ "node_modules/stack-utils": {+ "version": "2.0.6",+ "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz",+ "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "escape-string-regexp": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/stack-utils/node_modules/escape-string-regexp": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",+ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/standard-as-callback": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz",+ "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==",+ "license": "MIT"+ },+ "node_modules/statuses": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/streamsearch": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",+ "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/streamx": {+ "version": "2.23.0",+ "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz",+ "integrity": "sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==",+ "license": "MIT",+ "dependencies": {+ "events-universal": "^1.0.0",+ "fast-fifo": "^1.3.2",+ "text-decoder": "^1.1.0"+ }+ },+ "node_modules/string_decoder": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",+ "license": "MIT",+ "dependencies": {+ "safe-buffer": "~5.2.0"+ }+ },+ "node_modules/string-length": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz",+ "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "char-regex": "^1.0.2",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/string-width": {+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^8.0.0",+ "is-fullwidth-code-point": "^3.0.0",+ "strip-ansi": "^6.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/string-width-cjs": {+ "name": "string-width",+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^8.0.0",+ "is-fullwidth-code-point": "^3.0.0",+ "strip-ansi": "^6.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/strip-ansi": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/strip-ansi-cjs": {+ "name": "strip-ansi",+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/strip-bom": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",+ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/strip-final-newline": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/strip-json-comments": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/strnum": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.2.tgz",+ "integrity": "sha512-l63NF9y/cLROq/yqKXSLtcMeeyOfnSQlfMSlzFt/K73oIaD8DGaQWd7Z34X9GPiKqP5rbSh84Hl4bOlLcjiSrQ==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/NaturalIntelligence"+ }+ ],+ "license": "MIT"+ },+ "node_modules/strtok3": {+ "version": "10.3.4",+ "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz",+ "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==",+ "license": "MIT",+ "dependencies": {+ "@tokenizer/token": "^0.3.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/Borewit"+ }+ },+ "node_modules/superagent": {+ "version": "10.3.0",+ "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.3.0.tgz",+ "integrity": "sha512-B+4Ik7ROgVKrQsXTV0Jwp2u+PXYLSlqtDAhYnkkD+zn3yg8s/zjA2MeGayPoY/KICrbitwneDHrjSotxKL+0XQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "component-emitter": "^1.3.1",+ "cookiejar": "^2.1.4",+ "debug": "^4.3.7",+ "fast-safe-stringify": "^2.1.1",+ "form-data": "^4.0.5",+ "formidable": "^3.5.4",+ "methods": "^1.1.2",+ "mime": "2.6.0",+ "qs": "^6.14.1"+ },+ "engines": {+ "node": ">=14.18.0"+ }+ },+ "node_modules/supertest": {+ "version": "7.2.2",+ "resolved": "https://registry.npmjs.org/supertest/-/supertest-7.2.2.tgz",+ "integrity": "sha512-oK8WG9diS3DlhdUkcFn4tkNIiIbBx9lI2ClF8K+b2/m8Eyv47LSawxUzZQSNKUrVb2KsqeTDCcjAAVPYaSLVTA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cookie-signature": "^1.2.2",+ "methods": "^1.1.2",+ "superagent": "^10.3.0"+ },+ "engines": {+ "node": ">=14.18.0"+ }+ },+ "node_modules/supports-color": {+ "version": "8.1.1",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "has-flag": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/supports-color?sponsor=1"+ }+ },+ "node_modules/swagger-ui-dist": {+ "version": "5.31.0",+ "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.31.0.tgz",+ "integrity": "sha512-zSUTIck02fSga6rc0RZP3b7J7wgHXwLea8ZjgLA3Vgnb8QeOl3Wou2/j5QkzSGeoz6HusP/coYuJl33aQxQZpg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@scarf/scarf": "=1.4.0"+ }+ },+ "node_modules/symbol-observable": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz",+ "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10"+ }+ },+ "node_modules/synckit": {+ "version": "0.11.12",+ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.12.tgz",+ "integrity": "sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@pkgr/core": "^0.2.9"+ },+ "engines": {+ "node": "^14.18.0 || >=16.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/synckit"+ }+ },+ "node_modules/tapable": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz",+ "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },+ "node_modules/tar": {+ "version": "6.2.1",+ "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",+ "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",+ "deprecated": "Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "license": "ISC",+ "dependencies": {+ "chownr": "^2.0.0",+ "fs-minipass": "^2.0.0",+ "minipass": "^5.0.0",+ "minizlib": "^2.1.1",+ "mkdirp": "^1.0.3",+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/tar-fs": {+ "version": "2.1.4",+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz",+ "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==",+ "license": "MIT",+ "dependencies": {+ "chownr": "^1.1.1",+ "mkdirp-classic": "^0.5.2",+ "pump": "^3.0.0",+ "tar-stream": "^2.1.4"+ }+ },+ "node_modules/tar-fs/node_modules/chownr": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",+ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",+ "license": "ISC"+ },+ "node_modules/tar-fs/node_modules/readable-stream": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",+ "license": "MIT",+ "dependencies": {+ "inherits": "^2.0.3",+ "string_decoder": "^1.1.1",+ "util-deprecate": "^1.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/tar-fs/node_modules/tar-stream": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",+ "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",+ "license": "MIT",+ "dependencies": {+ "bl": "^4.0.3",+ "end-of-stream": "^1.4.1",+ "fs-constants": "^1.0.0",+ "inherits": "^2.0.3",+ "readable-stream": "^3.1.1"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/tar-stream": {+ "version": "3.1.7",+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz",+ "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==",+ "license": "MIT",+ "dependencies": {+ "b4a": "^1.6.4",+ "fast-fifo": "^1.2.0",+ "streamx": "^2.15.0"+ }+ },+ "node_modules/tar/node_modules/minipass": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",+ "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",+ "license": "ISC",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/tar/node_modules/mkdirp": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",+ "license": "MIT",+ "bin": {+ "mkdirp": "bin/cmd.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/tar/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",+ "license": "ISC"+ },+ "node_modules/terser": {+ "version": "5.46.0",+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.0.tgz",+ "integrity": "sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "@jridgewell/source-map": "^0.3.3",+ "acorn": "^8.15.0",+ "commander": "^2.20.0",+ "source-map-support": "~0.5.20"+ },+ "bin": {+ "terser": "bin/terser"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/terser-webpack-plugin": {+ "version": "5.3.16",+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz",+ "integrity": "sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/trace-mapping": "^0.3.25",+ "jest-worker": "^27.4.5",+ "schema-utils": "^4.3.0",+ "serialize-javascript": "^6.0.2",+ "terser": "^5.31.1"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ },+ "peerDependencies": {+ "webpack": "^5.1.0"+ },+ "peerDependenciesMeta": {+ "@swc/core": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "uglify-js": {+ "optional": true+ }+ }+ },+ "node_modules/terser-webpack-plugin/node_modules/ajv": {+ "version": "8.17.1",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/terser-webpack-plugin/node_modules/ajv-formats": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",+ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependenciesMeta": {+ "ajv": {+ "optional": true+ }+ }+ },+ "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz",+ "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-deep-equal": "^3.1.3"+ },+ "peerDependencies": {+ "ajv": "^8.8.2"+ }+ },+ "node_modules/terser-webpack-plugin/node_modules/jest-worker": {+ "version": "27.5.1",+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",+ "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*",+ "merge-stream": "^2.0.0",+ "supports-color": "^8.0.0"+ },+ "engines": {+ "node": ">= 10.13.0"+ }+ },+ "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/terser-webpack-plugin/node_modules/schema-utils": {+ "version": "4.3.3",+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz",+ "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/json-schema": "^7.0.9",+ "ajv": "^8.9.0",+ "ajv-formats": "^2.1.1",+ "ajv-keywords": "^5.1.0"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },+ "node_modules/terser/node_modules/commander": {+ "version": "2.20.3",+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/test-exclude": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz",+ "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "@istanbuljs/schema": "^0.1.2",+ "glob": "^7.1.4",+ "minimatch": "^3.0.4"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/test-exclude/node_modules/glob": {+ "version": "7.2.3",+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "fs.realpath": "^1.0.0",+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "^3.1.1",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ },+ "engines": {+ "node": "*"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/text-decoder": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz",+ "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==",+ "license": "Apache-2.0",+ "dependencies": {+ "b4a": "^1.6.4"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.15",+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",+ "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.3"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/tinyglobby/node_modules/picomatch": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/tmpl": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",+ "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==",+ "dev": true,+ "license": "BSD-3-Clause"+ },+ "node_modules/to-buffer": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz",+ "integrity": "sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==",+ "license": "MIT",+ "dependencies": {+ "isarray": "^2.0.5",+ "safe-buffer": "^5.2.1",+ "typed-array-buffer": "^1.0.3"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/to-regex-range": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "is-number": "^7.0.0"+ },+ "engines": {+ "node": ">=8.0"+ }+ },+ "node_modules/toidentifier": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",+ "license": "MIT",+ "engines": {+ "node": ">=0.6"+ }+ },+ "node_modules/token-types": {+ "version": "6.1.2",+ "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.2.tgz",+ "integrity": "sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==",+ "license": "MIT",+ "dependencies": {+ "@borewit/text-codec": "^0.2.1",+ "@tokenizer/token": "^0.3.0",+ "ieee754": "^1.2.1"+ },+ "engines": {+ "node": ">=14.16"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/Borewit"+ }+ },+ "node_modules/tr46": {+ "version": "0.0.3",+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",+ "license": "MIT"+ },+ "node_modules/traverse": {+ "version": "0.3.9",+ "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",+ "integrity": "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==",+ "license": "MIT/X11",+ "optional": true,+ "engines": {+ "node": "*"+ }+ },+ "node_modules/tree-kill": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",+ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "tree-kill": "cli.js"+ }+ },+ "node_modules/ts-api-utils": {+ "version": "2.4.0",+ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz",+ "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18.12"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4"+ }+ },+ "node_modules/ts-jest": {+ "version": "29.4.6",+ "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.6.tgz",+ "integrity": "sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "bs-logger": "^0.2.6",+ "fast-json-stable-stringify": "^2.1.0",+ "handlebars": "^4.7.8",+ "json5": "^2.2.3",+ "lodash.memoize": "^4.1.2",+ "make-error": "^1.3.6",+ "semver": "^7.7.3",+ "type-fest": "^4.41.0",+ "yargs-parser": "^21.1.1"+ },+ "bin": {+ "ts-jest": "cli.js"+ },+ "engines": {+ "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0"+ },+ "peerDependencies": {+ "@babel/core": ">=7.0.0-beta.0 <8",+ "@jest/transform": "^29.0.0 || ^30.0.0",+ "@jest/types": "^29.0.0 || ^30.0.0",+ "babel-jest": "^29.0.0 || ^30.0.0",+ "jest": "^29.0.0 || ^30.0.0",+ "jest-util": "^29.0.0 || ^30.0.0",+ "typescript": ">=4.3 <6"+ },+ "peerDependenciesMeta": {+ "@babel/core": {+ "optional": true+ },+ "@jest/transform": {+ "optional": true+ },+ "@jest/types": {+ "optional": true+ },+ "babel-jest": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "jest-util": {+ "optional": true+ }+ }+ },+ "node_modules/ts-jest/node_modules/type-fest": {+ "version": "4.41.0",+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz",+ "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==",+ "dev": true,+ "license": "(MIT OR CC0-1.0)",+ "engines": {+ "node": ">=16"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/ts-loader": {+ "version": "9.5.4",+ "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.4.tgz",+ "integrity": "sha512-nCz0rEwunlTZiy6rXFByQU1kVVpCIgUpc/psFiKVrUwrizdnIbRFu8w7bxhUF0X613DYwT4XzrZHpVyMe758hQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "chalk": "^4.1.0",+ "enhanced-resolve": "^5.0.0",+ "micromatch": "^4.0.0",+ "semver": "^7.3.4",+ "source-map": "^0.7.4"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "typescript": "*",+ "webpack": "^5.0.0"+ }+ },+ "node_modules/ts-node": {+ "version": "10.9.2",+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",+ "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",+ "devOptional": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@cspotcode/source-map-support": "^0.8.0",+ "@tsconfig/node10": "^1.0.7",+ "@tsconfig/node12": "^1.0.7",+ "@tsconfig/node14": "^1.0.0",+ "@tsconfig/node16": "^1.0.2",+ "acorn": "^8.4.1",+ "acorn-walk": "^8.1.1",+ "arg": "^4.1.0",+ "create-require": "^1.1.0",+ "diff": "^4.0.1",+ "make-error": "^1.1.1",+ "v8-compile-cache-lib": "^3.0.1",+ "yn": "3.1.1"+ },+ "bin": {+ "ts-node": "dist/bin.js",+ "ts-node-cwd": "dist/bin-cwd.js",+ "ts-node-esm": "dist/bin-esm.js",+ "ts-node-script": "dist/bin-script.js",+ "ts-node-transpile-only": "dist/bin-transpile.js",+ "ts-script": "dist/bin-script-deprecated.js"+ },+ "peerDependencies": {+ "@swc/core": ">=1.2.50",+ "@swc/wasm": ">=1.2.50",+ "@types/node": "*",+ "typescript": ">=2.7"+ },+ "peerDependenciesMeta": {+ "@swc/core": {+ "optional": true+ },+ "@swc/wasm": {+ "optional": true+ }+ }+ },+ "node_modules/tsconfig-paths": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",+ "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "json5": "^2.2.2",+ "minimist": "^1.2.6",+ "strip-bom": "^3.0.0"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/tsconfig-paths-webpack-plugin": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.2.0.tgz",+ "integrity": "sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "chalk": "^4.1.0",+ "enhanced-resolve": "^5.7.0",+ "tapable": "^2.2.1",+ "tsconfig-paths": "^4.1.2"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/tsconfig-paths/node_modules/strip-bom": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",+ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/tslib": {+ "version": "2.8.1",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",+ "license": "0BSD"+ },+ "node_modules/tunnel-agent": {+ "version": "0.6.0",+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",+ "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",+ "license": "Apache-2.0",+ "dependencies": {+ "safe-buffer": "^5.0.1"+ },+ "engines": {+ "node": "*"+ }+ },+ "node_modules/tweetnacl": {+ "version": "0.14.5",+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",+ "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==",+ "license": "Unlicense"+ },+ "node_modules/type-check": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "prelude-ls": "^1.2.1"+ },+ "engines": {+ "node": ">= 0.8.0"+ }+ },+ "node_modules/type-detect": {+ "version": "4.0.8",+ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",+ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=4"+ }+ },+ "node_modules/type-fest": {+ "version": "0.21.3",+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",+ "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==",+ "dev": true,+ "license": "(MIT OR CC0-1.0)",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/type-is": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",+ "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",+ "license": "MIT",+ "dependencies": {+ "content-type": "^1.0.5",+ "media-typer": "^1.1.0",+ "mime-types": "^3.0.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/typed-array-buffer": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz",+ "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==",+ "license": "MIT",+ "dependencies": {+ "call-bound": "^1.0.3",+ "es-errors": "^1.3.0",+ "is-typed-array": "^1.1.14"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/typed-query-selector": {+ "version": "2.12.0",+ "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz",+ "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==",+ "license": "MIT"+ },+ "node_modules/typedarray": {+ "version": "0.0.6",+ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",+ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",+ "license": "MIT"+ },+ "node_modules/typeorm": {+ "version": "0.3.28",+ "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.28.tgz",+ "integrity": "sha512-6GH7wXhtfq2D33ZuRXYwIsl/qM5685WZcODZb7noOOcRMteM9KF2x2ap3H0EBjnSV0VO4gNAfJT5Ukp0PkOlvg==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@sqltools/formatter": "^1.2.5",+ "ansis": "^4.2.0",+ "app-root-path": "^3.1.0",+ "buffer": "^6.0.3",+ "dayjs": "^1.11.19",+ "debug": "^4.4.3",+ "dedent": "^1.7.0",+ "dotenv": "^16.6.1",+ "glob": "^10.5.0",+ "reflect-metadata": "^0.2.2",+ "sha.js": "^2.4.12",+ "sql-highlight": "^6.1.0",+ "tslib": "^2.8.1",+ "uuid": "^11.1.0",+ "yargs": "^17.7.2"+ },+ "bin": {+ "typeorm": "cli.js",+ "typeorm-ts-node-commonjs": "cli-ts-node-commonjs.js",+ "typeorm-ts-node-esm": "cli-ts-node-esm.js"+ },+ "engines": {+ "node": ">=16.13.0"+ },+ "funding": {+ "url": "https://opencollective.com/typeorm"+ },+ "peerDependencies": {+ "@google-cloud/spanner": "^5.18.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",+ "@sap/hana-client": "^2.14.22",+ "better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0",+ "ioredis": "^5.0.4",+ "mongodb": "^5.8.0 || ^6.0.0",+ "mssql": "^9.1.1 || ^10.0.0 || ^11.0.0 || ^12.0.0",+ "mysql2": "^2.2.5 || ^3.0.1",+ "oracledb": "^6.3.0",+ "pg": "^8.5.1",+ "pg-native": "^3.0.0",+ "pg-query-stream": "^4.0.0",+ "redis": "^3.1.1 || ^4.0.0 || ^5.0.14",+ "sql.js": "^1.4.0",+ "sqlite3": "^5.0.3",+ "ts-node": "^10.7.0",+ "typeorm-aurora-data-api-driver": "^2.0.0 || ^3.0.0"+ },+ "peerDependenciesMeta": {+ "@google-cloud/spanner": {+ "optional": true+ },+ "@sap/hana-client": {+ "optional": true+ },+ "better-sqlite3": {+ "optional": true+ },+ "ioredis": {+ "optional": true+ },+ "mongodb": {+ "optional": true+ },+ "mssql": {+ "optional": true+ },+ "mysql2": {+ "optional": true+ },+ "oracledb": {+ "optional": true+ },+ "pg": {+ "optional": true+ },+ "pg-native": {+ "optional": true+ },+ "pg-query-stream": {+ "optional": true+ },+ "redis": {+ "optional": true+ },+ "sql.js": {+ "optional": true+ },+ "sqlite3": {+ "optional": true+ },+ "ts-node": {+ "optional": true+ },+ "typeorm-aurora-data-api-driver": {+ "optional": true+ }+ }+ },+ "node_modules/typeorm/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/typeorm/node_modules/buffer": {+ "version": "6.0.3",+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "base64-js": "^1.3.1",+ "ieee754": "^1.2.1"+ }+ },+ "node_modules/typeorm/node_modules/dotenv": {+ "version": "16.6.1",+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",+ "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://dotenvx.com"+ }+ },+ "node_modules/typeorm/node_modules/glob": {+ "version": "10.5.0",+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",+ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "license": "ISC",+ "dependencies": {+ "foreground-child": "^3.1.0",+ "jackspeak": "^3.1.2",+ "minimatch": "^9.0.4",+ "minipass": "^7.1.2",+ "package-json-from-dist": "^1.0.0",+ "path-scurry": "^1.11.1"+ },+ "bin": {+ "glob": "dist/esm/bin.mjs"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/typeorm/node_modules/lru-cache": {+ "version": "10.4.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",+ "license": "ISC"+ },+ "node_modules/typeorm/node_modules/minimatch": {+ "version": "9.0.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/typeorm/node_modules/path-scurry": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "lru-cache": "^10.2.0",+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"+ },+ "engines": {+ "node": ">=16 || 14 >=14.18"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/typescript": {+ "version": "5.9.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",+ "devOptional": true,+ "license": "Apache-2.0",+ "peer": true,+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/typescript-eslint": {+ "version": "8.54.0",+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.54.0.tgz",+ "integrity": "sha512-CKsJ+g53QpsNPqbzUsfKVgd3Lny4yKZ1pP4qN3jdMOg/sisIDLGyDMezycquXLE5JsEU0wp3dGNdzig0/fmSVQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/eslint-plugin": "8.54.0",+ "@typescript-eslint/parser": "8.54.0",+ "@typescript-eslint/typescript-estree": "8.54.0",+ "@typescript-eslint/utils": "8.54.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/uglify-js": {+ "version": "3.19.3",+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",+ "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",+ "dev": true,+ "license": "BSD-2-Clause",+ "optional": true,+ "bin": {+ "uglifyjs": "bin/uglifyjs"+ },+ "engines": {+ "node": ">=0.8.0"+ }+ },+ "node_modules/uid": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz",+ "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==",+ "license": "MIT",+ "dependencies": {+ "@lukeed/csprng": "^1.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/uint8array-extras": {+ "version": "1.5.0",+ "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz",+ "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "license": "MIT"+ },+ "node_modules/unique-filename": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz",+ "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "unique-slug": "^2.0.0"+ }+ },+ "node_modules/unique-slug": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz",+ "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "imurmurhash": "^0.1.4"+ }+ },+ "node_modules/universalify": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",+ "devOptional": true,+ "license": "MIT",+ "engines": {+ "node": ">= 10.0.0"+ }+ },+ "node_modules/unpipe": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/unrs-resolver": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz",+ "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "dependencies": {+ "napi-postinstall": "^0.3.0"+ },+ "funding": {+ "url": "https://opencollective.com/unrs-resolver"+ },+ "optionalDependencies": {+ "@unrs/resolver-binding-android-arm-eabi": "1.11.1",+ "@unrs/resolver-binding-android-arm64": "1.11.1",+ "@unrs/resolver-binding-darwin-arm64": "1.11.1",+ "@unrs/resolver-binding-darwin-x64": "1.11.1",+ "@unrs/resolver-binding-freebsd-x64": "1.11.1",+ "@unrs/resolver-binding-linux-arm-gnueabihf": "1.11.1",+ "@unrs/resolver-binding-linux-arm-musleabihf": "1.11.1",+ "@unrs/resolver-binding-linux-arm64-gnu": "1.11.1",+ "@unrs/resolver-binding-linux-arm64-musl": "1.11.1",+ "@unrs/resolver-binding-linux-ppc64-gnu": "1.11.1",+ "@unrs/resolver-binding-linux-riscv64-gnu": "1.11.1",+ "@unrs/resolver-binding-linux-riscv64-musl": "1.11.1",+ "@unrs/resolver-binding-linux-s390x-gnu": "1.11.1",+ "@unrs/resolver-binding-linux-x64-gnu": "1.11.1",+ "@unrs/resolver-binding-linux-x64-musl": "1.11.1",+ "@unrs/resolver-binding-wasm32-wasi": "1.11.1",+ "@unrs/resolver-binding-win32-arm64-msvc": "1.11.1",+ "@unrs/resolver-binding-win32-ia32-msvc": "1.11.1",+ "@unrs/resolver-binding-win32-x64-msvc": "1.11.1"+ }+ },+ "node_modules/unzipper": {+ "version": "0.10.14",+ "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.14.tgz",+ "integrity": "sha512-ti4wZj+0bQTiX2KmKWuwj7lhV+2n//uXEotUmGuQqrbVZSEGFMbI68+c6JCQ8aAmUWYvtHEz2A8K6wXvueR/6g==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "big-integer": "^1.6.17",+ "binary": "~0.3.0",+ "bluebird": "~3.4.1",+ "buffer-indexof-polyfill": "~1.0.0",+ "duplexer2": "~0.1.4",+ "fstream": "^1.0.12",+ "graceful-fs": "^4.2.2",+ "listenercount": "~1.0.1",+ "readable-stream": "~2.3.6",+ "setimmediate": "~1.0.4"+ }+ },+ "node_modules/unzipper/node_modules/isarray": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/unzipper/node_modules/readable-stream": {+ "version": "2.3.8",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "core-util-is": "~1.0.0",+ "inherits": "~2.0.3",+ "isarray": "~1.0.0",+ "process-nextick-args": "~2.0.0",+ "safe-buffer": "~5.1.1",+ "string_decoder": "~1.1.1",+ "util-deprecate": "~1.0.1"+ }+ },+ "node_modules/unzipper/node_modules/safe-buffer": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/unzipper/node_modules/string_decoder": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "safe-buffer": "~5.1.0"+ }+ },+ "node_modules/update-browserslist-db": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",+ "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/browserslist"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/browserslist"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "escalade": "^3.2.0",+ "picocolors": "^1.1.1"+ },+ "bin": {+ "update-browserslist-db": "cli.js"+ },+ "peerDependencies": {+ "browserslist": ">= 4.21.0"+ }+ },+ "node_modules/uri-js": {+ "version": "4.4.1",+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "punycode": "^2.1.0"+ }+ },+ "node_modules/util-deprecate": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",+ "license": "MIT"+ },+ "node_modules/uuid": {+ "version": "11.1.0",+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",+ "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",+ "funding": [+ "https://github.com/sponsors/broofa",+ "https://github.com/sponsors/ctavan"+ ],+ "license": "MIT",+ "bin": {+ "uuid": "dist/esm/bin/uuid"+ }+ },+ "node_modules/v8-compile-cache-lib": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",+ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",+ "devOptional": true,+ "license": "MIT"+ },+ "node_modules/v8-to-istanbul": {+ "version": "9.3.0",+ "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",+ "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "@jridgewell/trace-mapping": "^0.3.12",+ "@types/istanbul-lib-coverage": "^2.0.1",+ "convert-source-map": "^2.0.0"+ },+ "engines": {+ "node": ">=10.12.0"+ }+ },+ "node_modules/validator": {+ "version": "13.15.26",+ "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.26.tgz",+ "integrity": "sha512-spH26xU080ydGggxRyR1Yhcbgx+j3y5jbNXk/8L+iRvdIEQ4uTRH2Sgf2dokud6Q4oAtsbNvJ1Ft+9xmm6IZcA==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.10"+ }+ },+ "node_modules/vary": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/walker": {+ "version": "1.0.8",+ "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",+ "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "makeerror": "1.0.12"+ }+ },+ "node_modules/watchpack": {+ "version": "2.5.1",+ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.1.tgz",+ "integrity": "sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "glob-to-regexp": "^0.4.1",+ "graceful-fs": "^4.1.2"+ },+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/wcwidth": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",+ "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "defaults": "^1.0.3"+ }+ },+ "node_modules/webdriver-bidi-protocol": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.4.0.tgz",+ "integrity": "sha512-U9VIlNRrq94d1xxR9JrCEAx5Gv/2W7ERSv8oWRoNe/QYbfccS0V3h/H6qeNeCRJxXGMhhnkqvwNrvPAYeuP9VA==",+ "license": "Apache-2.0"+ },+ "node_modules/webidl-conversions": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",+ "license": "BSD-2-Clause"+ },+ "node_modules/webpack": {+ "version": "5.105.0",+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.0.tgz",+ "integrity": "sha512-gX/dMkRQc7QOMzgTe6KsYFM7DxeIONQSui1s0n/0xht36HvrgbxtM1xBlgx596NbpHuQU8P7QpKwrZYwUX48nw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@types/eslint-scope": "^3.7.7",+ "@types/estree": "^1.0.8",+ "@types/json-schema": "^7.0.15",+ "@webassemblyjs/ast": "^1.14.1",+ "@webassemblyjs/wasm-edit": "^1.14.1",+ "@webassemblyjs/wasm-parser": "^1.14.1",+ "acorn": "^8.15.0",+ "acorn-import-phases": "^1.0.3",+ "browserslist": "^4.28.1",+ "chrome-trace-event": "^1.0.2",+ "enhanced-resolve": "^5.19.0",+ "es-module-lexer": "^2.0.0",+ "eslint-scope": "5.1.1",+ "events": "^3.2.0",+ "glob-to-regexp": "^0.4.1",+ "graceful-fs": "^4.2.11",+ "json-parse-even-better-errors": "^2.3.1",+ "loader-runner": "^4.3.1",+ "mime-types": "^2.1.27",+ "neo-async": "^2.6.2",+ "schema-utils": "^4.3.3",+ "tapable": "^2.3.0",+ "terser-webpack-plugin": "^5.3.16",+ "watchpack": "^2.5.1",+ "webpack-sources": "^3.3.3"+ },+ "bin": {+ "webpack": "bin/webpack.js"+ },+ "engines": {+ "node": ">=10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ },+ "peerDependenciesMeta": {+ "webpack-cli": {+ "optional": true+ }+ }+ },+ "node_modules/webpack-node-externals": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz",+ "integrity": "sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/webpack-sources": {+ "version": "3.3.3",+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz",+ "integrity": "sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10.13.0"+ }+ },+ "node_modules/webpack/node_modules/ajv": {+ "version": "8.17.1",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/webpack/node_modules/ajv-formats": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",+ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependenciesMeta": {+ "ajv": {+ "optional": true+ }+ }+ },+ "node_modules/webpack/node_modules/ajv-keywords": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz",+ "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fast-deep-equal": "^3.1.3"+ },+ "peerDependencies": {+ "ajv": "^8.8.2"+ }+ },+ "node_modules/webpack/node_modules/eslint-scope": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",+ "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",+ "dev": true,+ "license": "BSD-2-Clause",+ "dependencies": {+ "esrecurse": "^4.3.0",+ "estraverse": "^4.1.1"+ },+ "engines": {+ "node": ">=8.0.0"+ }+ },+ "node_modules/webpack/node_modules/estraverse": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",+ "dev": true,+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=4.0"+ }+ },+ "node_modules/webpack/node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/webpack/node_modules/mime-db": {+ "version": "1.52.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/webpack/node_modules/mime-types": {+ "version": "2.1.35",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "mime-db": "1.52.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/webpack/node_modules/schema-utils": {+ "version": "4.3.3",+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz",+ "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/json-schema": "^7.0.9",+ "ajv": "^8.9.0",+ "ajv-formats": "^2.1.1",+ "ajv-keywords": "^5.1.0"+ },+ "engines": {+ "node": ">= 10.13.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/webpack"+ }+ },+ "node_modules/whatsapp-web.js": {+ "version": "1.34.6",+ "resolved": "https://registry.npmjs.org/whatsapp-web.js/-/whatsapp-web.js-1.34.6.tgz",+ "integrity": "sha512-+zgLBqARcVfuCG7b80c7Gkt+4Yh8w+oDWx7lL2gTA6nlaykHBne7NwJ5yGe2r7O9IYraIzs6HiCzNGKfu9AUBg==",+ "license": "Apache-2.0",+ "dependencies": {+ "@pedroslopez/moduleraid": "^5.0.2",+ "fluent-ffmpeg": "2.1.3",+ "mime": "^3.0.0",+ "node-fetch": "^2.6.9",+ "node-webpmux": "3.1.7",+ "puppeteer": "^24.31.0"+ },+ "engines": {+ "node": ">=18.0.0"+ },+ "optionalDependencies": {+ "archiver": "^5.3.1",+ "fs-extra": "^10.1.0",+ "unzipper": "^0.10.11"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/archiver": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.2.tgz",+ "integrity": "sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "archiver-utils": "^2.1.0",+ "async": "^3.2.4",+ "buffer-crc32": "^0.2.1",+ "readable-stream": "^3.6.0",+ "readdir-glob": "^1.1.2",+ "tar-stream": "^2.2.0",+ "zip-stream": "^4.1.0"+ },+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/archiver-utils": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz",+ "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "glob": "^7.1.4",+ "graceful-fs": "^4.2.0",+ "lazystream": "^1.0.0",+ "lodash.defaults": "^4.2.0",+ "lodash.difference": "^4.5.0",+ "lodash.flatten": "^4.4.0",+ "lodash.isplainobject": "^4.0.6",+ "lodash.union": "^4.6.0",+ "normalize-path": "^3.0.0",+ "readable-stream": "^2.0.0"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/archiver-utils/node_modules/readable-stream": {+ "version": "2.3.8",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "core-util-is": "~1.0.0",+ "inherits": "~2.0.3",+ "isarray": "~1.0.0",+ "process-nextick-args": "~2.0.0",+ "safe-buffer": "~5.1.1",+ "string_decoder": "~1.1.1",+ "util-deprecate": "~1.0.1"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/buffer-crc32": {+ "version": "0.2.13",+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",+ "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": "*"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/compress-commons": {+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz",+ "integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "buffer-crc32": "^0.2.13",+ "crc32-stream": "^4.0.2",+ "normalize-path": "^3.0.0",+ "readable-stream": "^3.6.0"+ },+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/crc32-stream": {+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.3.tgz",+ "integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "crc-32": "^1.2.0",+ "readable-stream": "^3.4.0"+ },+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/glob": {+ "version": "7.2.3",+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "fs.realpath": "^1.0.0",+ "inflight": "^1.0.4",+ "inherits": "2",+ "minimatch": "^3.1.1",+ "once": "^1.3.0",+ "path-is-absolute": "^1.0.0"+ },+ "engines": {+ "node": "*"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/isarray": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/whatsapp-web.js/node_modules/mime": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz",+ "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==",+ "license": "MIT",+ "bin": {+ "mime": "cli.js"+ },+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/readable-stream": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "inherits": "^2.0.3",+ "string_decoder": "^1.1.1",+ "util-deprecate": "^1.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/safe-buffer": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",+ "license": "MIT",+ "optional": true+ },+ "node_modules/whatsapp-web.js/node_modules/string_decoder": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "safe-buffer": "~5.1.0"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/tar-stream": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",+ "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "bl": "^4.0.3",+ "end-of-stream": "^1.4.1",+ "fs-constants": "^1.0.0",+ "inherits": "^2.0.3",+ "readable-stream": "^3.1.1"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/zip-stream": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.1.tgz",+ "integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "archiver-utils": "^3.0.4",+ "compress-commons": "^4.1.2",+ "readable-stream": "^3.6.0"+ },+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/whatsapp-web.js/node_modules/zip-stream/node_modules/archiver-utils": {+ "version": "3.0.4",+ "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-3.0.4.tgz",+ "integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "glob": "^7.2.3",+ "graceful-fs": "^4.2.0",+ "lazystream": "^1.0.0",+ "lodash.defaults": "^4.2.0",+ "lodash.difference": "^4.5.0",+ "lodash.flatten": "^4.4.0",+ "lodash.isplainobject": "^4.0.6",+ "lodash.union": "^4.6.0",+ "normalize-path": "^3.0.0",+ "readable-stream": "^3.6.0"+ },+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/whatwg-url": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",+ "license": "MIT",+ "dependencies": {+ "tr46": "~0.0.3",+ "webidl-conversions": "^3.0.0"+ }+ },+ "node_modules/which": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",+ "license": "ISC",+ "dependencies": {+ "isexe": "^2.0.0"+ },+ "bin": {+ "node-which": "bin/node-which"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/which-module": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",+ "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",+ "license": "ISC"+ },+ "node_modules/which-typed-array": {+ "version": "1.1.20",+ "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz",+ "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==",+ "license": "MIT",+ "dependencies": {+ "available-typed-arrays": "^1.0.7",+ "call-bind": "^1.0.8",+ "call-bound": "^1.0.4",+ "for-each": "^0.3.5",+ "get-proto": "^1.0.1",+ "gopd": "^1.2.0",+ "has-tostringtag": "^1.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/wide-align": {+ "version": "1.1.5",+ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",+ "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",+ "license": "ISC",+ "optional": true,+ "dependencies": {+ "string-width": "^1.0.2 || 2 || 3 || 4"+ }+ },+ "node_modules/widest-line": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz",+ "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "string-width": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/word-wrap": {+ "version": "1.2.5",+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",+ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/wordwrap": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",+ "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/wrap-ansi": {+ "version": "6.2.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/wrap-ansi-cjs": {+ "name": "wrap-ansi",+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/wrappy": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",+ "license": "ISC"+ },+ "node_modules/write-file-atomic": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz",+ "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "imurmurhash": "^0.1.4",+ "signal-exit": "^4.0.1"+ },+ "engines": {+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"+ }+ },+ "node_modules/ws": {+ "version": "8.18.3",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",+ "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",+ "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/xtend": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",+ "license": "MIT",+ "engines": {+ "node": ">=0.4"+ }+ },+ "node_modules/y18n": {+ "version": "5.0.8",+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",+ "license": "ISC",+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/yallist": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/yargs": {+ "version": "17.7.2",+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",+ "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",+ "license": "MIT",+ "dependencies": {+ "cliui": "^8.0.1",+ "escalade": "^3.1.1",+ "get-caller-file": "^2.0.5",+ "require-directory": "^2.1.1",+ "string-width": "^4.2.3",+ "y18n": "^5.0.5",+ "yargs-parser": "^21.1.1"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/yargs-parser": {+ "version": "21.1.1",+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",+ "license": "ISC",+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/yauzl": {+ "version": "2.10.0",+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",+ "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==",+ "license": "MIT",+ "dependencies": {+ "buffer-crc32": "~0.2.3",+ "fd-slicer": "~1.1.0"+ }+ },+ "node_modules/yauzl/node_modules/buffer-crc32": {+ "version": "0.2.13",+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",+ "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",+ "license": "MIT",+ "engines": {+ "node": "*"+ }+ },+ "node_modules/yn": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",+ "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",+ "devOptional": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/yocto-queue": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/yoctocolors-cjs": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz",+ "integrity": "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/zip-stream": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz",+ "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==",+ "license": "MIT",+ "dependencies": {+ "archiver-utils": "^5.0.0",+ "compress-commons": "^6.0.2",+ "readable-stream": "^4.0.0"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/zod": {+ "version": "3.25.76",+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",+ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/colinhacks"+ }+ }+ }+}diff --git a/package.json b/package.jsonnew file mode 100644index 000000000..8d4797187--- /dev/null+++ b/package.json@@ -0,0 +1,114 @@+{+ "name": "openwa",+ "version": "0.1.0",+ "description": "Open Source WhatsApp API Gateway - Free, Self-Hosted HTTP API for WhatsApp",+ "author": "Yudhi Armyndharis & OpenWA Contributors",+ "private": true,+ "license": "MIT",+ "scripts": {+ "build": "nest build",+ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",+ "start": "nest start",+ "start:dev": "nest start --watch",+ "start:debug": "nest start --debug --watch",+ "start:prod": "node dist/main",+ "dev": "concurrently -n api,dashboard -c blue,green \"npm run start:dev\" \"npm run dashboard:dev\"",+ "dashboard:install": "cd dashboard && npm install",+ "dashboard:dev": "cd dashboard && npm run dev",+ "dashboard:build": "cd dashboard && npm run build",+ "postinstall": "[ -d dashboard ] && npm run dashboard:install || true",+ "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",+ "test": "jest",+ "test:watch": "jest --watch",+ "test:cov": "jest --coverage",+ "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",+ "test:e2e": "jest --config ./test/jest-e2e.json",+ "typeorm": "typeorm-ts-node-commonjs",+ "migration:create": "npm run typeorm -- migration:create src/database/migrations/$npm_config_name",+ "migration:generate": "npm run typeorm -- migration:generate src/database/migrations/$npm_config_name -d src/database/data-source.ts",+ "migration:run": "npm run typeorm -- migration:run -d src/database/data-source.ts",+ "migration:revert": "npm run typeorm -- migration:revert -d src/database/data-source.ts",+ "migration:show": "npm run typeorm -- migration:show -d src/database/data-source.ts"+ },+ "dependencies": {+ "@aws-sdk/client-s3": "^3.983.0",+ "@bull-board/api": "^6.16.4",+ "@bull-board/express": "^6.16.4",+ "@bull-board/nestjs": "^6.16.4",+ "@nestjs-modules/ioredis": "^2.0.2",+ "@nestjs/bullmq": "^11.0.4",+ "@nestjs/common": "^11.0.1",+ "@nestjs/config": "^4.0.2",+ "@nestjs/core": "^11.0.1",+ "@nestjs/platform-express": "^11.0.1",+ "@nestjs/platform-socket.io": "^11.1.12",+ "@nestjs/swagger": "^11.2.5",+ "@nestjs/throttler": "^6.5.0",+ "@nestjs/typeorm": "^11.0.0",+ "archiver": "^7.0.1",+ "bullmq": "^5.67.2",+ "class-transformer": "^0.5.1",+ "class-validator": "^0.14.1",+ "dockerode": "^4.0.9",+ "helmet": "^8.0.0",+ "ioredis": "^5.9.2",+ "pg": "^8.18.0",+ "qrcode": "^1.5.4",+ "reflect-metadata": "^0.2.2",+ "rxjs": "^7.8.1",+ "socket.io": "^4.8.3",+ "sqlite3": "^5.1.7",+ "tar-stream": "^3.1.7",+ "typeorm": "^0.3.20",+ "uuid": "^11.0.5",+ "whatsapp-web.js": "^1.26.1-alpha.3"+ },+ "devDependencies": {+ "@eslint/eslintrc": "^3.2.0",+ "@eslint/js": "^9.18.0",+ "@nestjs/cli": "^11.0.0",+ "@nestjs/schematics": "^11.0.0",+ "@nestjs/testing": "^11.0.1",+ "@types/archiver": "^7.0.0",+ "@types/dockerode": "^4.0.1",+ "@types/express": "^5.0.0",+ "@types/jest": "^30.0.0",+ "@types/node": "^22.10.7",+ "@types/qrcode": "^1.5.5",+ "@types/supertest": "^6.0.2",+ "@types/tar-stream": "^3.1.4",+ "@types/uuid": "^10.0.0",+ "concurrently": "^9.2.1",+ "eslint": "^9.18.0",+ "eslint-config-prettier": "^10.0.1",+ "eslint-plugin-prettier": "^5.2.2",+ "globals": "^16.0.0",+ "jest": "^30.0.0",+ "prettier": "^3.4.2",+ "source-map-support": "^0.5.21",+ "supertest": "^7.0.0",+ "ts-jest": "^29.2.5",+ "ts-loader": "^9.5.2",+ "ts-node": "^10.9.2",+ "tsconfig-paths": "^4.2.0",+ "typescript": "^5.7.3",+ "typescript-eslint": "^8.20.0"+ },+ "jest": {+ "moduleFileExtensions": [+ "js",+ "json",+ "ts"+ ],+ "rootDir": "src",+ "testRegex": ".*\\.spec\\.ts$",+ "transform": {+ "^.+\\.(t|j)s$": "ts-jest"+ },+ "collectCoverageFrom": [+ "**/*.(t|j)s"+ ],+ "coverageDirectory": "../coverage",+ "testEnvironment": "node"+ }+}\ No newline at end of filediff --git a/scripts/openwa.sh b/scripts/openwa.shnew file mode 100755index 000000000..eea0acf6e--- /dev/null+++ b/scripts/openwa.sh@@ -0,0 +1,215 @@+#!/bin/bash+# OpenWA Smart Orchestration Script+# Reads .env and activates appropriate Docker profiles++set -e++# Colors+RED='\033[0;31m'+GREEN='\033[0;32m'+YELLOW='\033[1;33m'+BLUE='\033[0;34m'+NC='\033[0m' # No Color++# Script directory+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+PROJECT_DIR="$(dirname "$SCRIPT_DIR")"++# Log functions+log_info() { echo -e "${BLUE}ℹ${NC} $1"; }+log_success() { echo -e "${GREEN}✓${NC} $1"; }+log_warn() { echo -e "${YELLOW}⚠${NC} $1"; }+log_error() { echo -e "${RED}✗${NC} $1"; }++# Load environment variables+load_env() {+ if [ -f "$PROJECT_DIR/.env" ]; then+ log_info "Loading .env file..."+ set -a+ source "$PROJECT_DIR/.env"+ set +a+ else+ log_warn ".env file not found, using defaults"+ fi+}++# Determine which profiles to activate+get_profiles() {+ local profiles=""++ # Dashboard (default: enabled)+ if [ "${DASHBOARD_ENABLED:-true}" = "true" ]; then+ profiles="$profiles --profile with-dashboard"+ log_info "Dashboard: enabled"+ fi++ # Proxy (default: enabled)+ if [ "${PROXY_ENABLED:-true}" = "true" ]; then+ profiles="$profiles --profile with-proxy"+ log_info "Proxy (Traefik): enabled"+ fi++ # PostgreSQL (built-in)+ if [ "${DATABASE_TYPE:-sqlite}" = "postgres" ] && [ "${POSTGRES_BUILTIN:-false}" = "true" ]; then+ profiles="$profiles --profile postgres"+ log_info "PostgreSQL: built-in container"+ elif [ "${DATABASE_TYPE:-sqlite}" = "postgres" ]; then+ log_info "PostgreSQL: external (${DATABASE_HOST:-localhost}:${DATABASE_PORT:-5432})"+ else+ log_info "Database: SQLite"+ fi++ # Redis (built-in)+ if [ "${REDIS_ENABLED:-false}" = "true" ] && [ "${REDIS_BUILTIN:-false}" = "true" ]; then+ profiles="$profiles --profile redis"+ log_info "Redis: built-in container"+ elif [ "${REDIS_ENABLED:-false}" = "true" ]; then+ log_info "Redis: external (${REDIS_HOST:-localhost}:${REDIS_PORT:-6379})"+ else+ log_info "Redis: disabled"+ fi++ # MinIO (built-in S3)+ if [ "${STORAGE_TYPE:-local}" = "s3" ] && [ "${MINIO_BUILTIN:-false}" = "true" ]; then+ profiles="$profiles --profile minio"+ log_info "Storage: built-in MinIO"+ elif [ "${STORAGE_TYPE:-local}" = "s3" ]; then+ log_info "Storage: external S3 (${S3_ENDPOINT})"+ else+ log_info "Storage: local filesystem"+ fi++ # Engine type+ log_info "Engine: ${ENGINE_TYPE:-whatsapp-web.js}"++ echo "$profiles"+}++# Validate engine type+validate_engine() {+ local engine="${ENGINE_TYPE:-whatsapp-web.js}"+ local valid_engines=("whatsapp-web.js" "baileys")++ for valid in "${valid_engines[@]}"; do+ if [ "$engine" = "$valid" ]; then+ return 0+ fi+ done++ log_error "Invalid ENGINE_TYPE: $engine"+ log_error "Valid options: ${valid_engines[*]}"+ exit 1+}++# Start OpenWA+cmd_start() {+ log_info "Starting OpenWA..."+ load_env+ validate_engine++ local profiles=$(get_profiles)++ echo ""+ log_info "Activating profiles:$profiles"+ echo ""++ cd "$PROJECT_DIR"+ docker compose $profiles up -d++ echo ""+ log_success "OpenWA started successfully!"+ echo ""+ log_info "Dashboard: http://localhost:${DASHBOARD_PORT:-2886}"+ log_info "API: http://localhost:${API_PORT:-2785}"+}++# Stop OpenWA+cmd_stop() {+ log_info "Stopping OpenWA..."+ cd "$PROJECT_DIR"+ docker compose --profile postgres --profile redis --profile minio --profile with-dashboard --profile with-proxy down+ log_success "OpenWA stopped"+}++# Restart OpenWA+cmd_restart() {+ cmd_stop+ cmd_start+}++# Show status+cmd_status() {+ log_info "OpenWA container status:"+ echo ""+ cd "$PROJECT_DIR"+ docker compose ps --format "table {{.Name}}\t{{.Status}}\t{{.Ports}}"+}++# Show logs+cmd_logs() {+ local service="${1:-openwa-api}"+ local lines="${2:-100}"+ cd "$PROJECT_DIR"+ docker compose logs -f --tail="$lines" "$service"+}++# Build images+cmd_build() {+ log_info "Building OpenWA images..."+ load_env+ local profiles=$(get_profiles)+ cd "$PROJECT_DIR"+ docker compose $profiles build+ log_success "Build complete"+}++# Update (pull + build + restart)+cmd_update() {+ log_info "Updating OpenWA..."+ cd "$PROJECT_DIR"+ git pull+ cmd_build+ cmd_restart+ log_success "Update complete"+}++# Show help+cmd_help() {+ echo ""+ echo "OpenWA Smart Orchestration Script"+ echo ""+ echo "Usage: $0 <command> [options]"+ echo ""+ echo "Commands:"+ echo " start Start OpenWA with auto-detected profiles"+ echo " stop Stop all OpenWA containers"+ echo " restart Restart OpenWA"+ echo " status Show container status"+ echo " logs Show logs (default: openwa-api)"+ echo " build Build Docker images"+ echo " update Pull latest code and restart"+ echo " help Show this help"+ echo ""+ echo "Profile activation is automatic based on .env:"+ echo " POSTGRES_BUILTIN=true → activates postgres profile"+ echo " REDIS_BUILTIN=true → activates redis profile"+ echo " MINIO_BUILTIN=true → activates minio profile"+ echo ""+}++# Main+case "${1:-help}" in+ start) cmd_start ;;+ stop) cmd_stop ;;+ restart) cmd_restart ;;+ status) cmd_status ;;+ logs) cmd_logs "${2:-}" "${3:-}" ;;+ build) cmd_build ;;+ update) cmd_update ;;+ help) cmd_help ;;+ *)+ log_error "Unknown command: $1"+ cmd_help+ exit 1+ ;;+esacdiff --git a/src/app.module.ts b/src/app.module.tsnew file mode 100644index 000000000..8569c4878--- /dev/null+++ b/src/app.module.ts@@ -0,0 +1,154 @@+import { Module, DynamicModule, Type } from '@nestjs/common';+import { ConfigModule, ConfigService } from '@nestjs/config';+import { TypeOrmModule } from '@nestjs/typeorm';+import { ThrottlerModule } from '@nestjs/throttler';+import configuration from './config/configuration';+import { SessionModule } from './modules/session/session.module';+import { MessageModule } from './modules/message/message.module';+import { WebhookModule } from './modules/webhook/webhook.module';+import { HealthModule } from './modules/health/health.module';+import { AuthModule } from './modules/auth/auth.module';+import { AuditModule } from './modules/audit/audit.module';+import { EngineModule } from './engine/engine.module';+import { LoggerModule } from './common/services/logger.module';+import { SettingsModule } from './modules/settings/settings.module';+import { InfraModule } from './modules/infra/infra.module';+import { EventsModule } from './modules/events/events.module';+import { ContactModule } from './modules/contact/contact.module';+import { GroupModule } from './modules/group/group.module';+import { LabelModule } from './modules/label/label.module';+import { ChannelModule } from './modules/channel/channel.module';+import { CacheModule } from './common/cache';+import { StorageModule } from './common/storage/storage.module';+import { StatsModule } from './modules/stats/stats.module';+import { StatusModule } from './modules/status/status.module';+import { CatalogModule } from './modules/catalog/catalog.module';+import { HooksModule } from './core/hooks';+import { PluginsModule } from './core/plugins';+import { PluginsApiModule } from './modules/plugins/plugins.module';++// Only import QueueModule if explicitly enabled to avoid Redis connection errors+const queueModules: Array<Type | DynamicModule> = [];+if (process.env.QUEUE_ENABLED === 'true') {+ // eslint-disable-next-line @typescript-eslint/no-require-imports+ const queueModule = require('./modules/queue/queue.module') as {+ QueueModule: Type;+ };+ queueModules.push(queueModule.QueueModule);+}++@Module({+ imports: [+ // Configuration+ ConfigModule.forRoot({+ isGlobal: true,+ load: [configuration],+ }),++ // Main Database (always SQLite - boot config)+ TypeOrmModule.forRootAsync({+ name: 'main',+ imports: [ConfigModule],+ inject: [ConfigService],+ useFactory: (configService: ConfigService) => ({+ type: 'sqlite' as const,+ database: configService.get<string>('database.database', './data/main.sqlite'),+ entities: [__dirname + '/modules/auth/**/*.entity{.ts,.js}', __dirname + '/modules/audit/**/*.entity{.ts,.js}'],+ synchronize: true,+ logging: configService.get<boolean>('database.logging', false),+ }),+ }),++ // Data Storage Database (pluggable - user data)+ TypeOrmModule.forRootAsync({+ name: 'data',+ imports: [ConfigModule],+ inject: [ConfigService],+ useFactory: (configService: ConfigService) => {+ const dbType = configService.get<'sqlite' | 'postgres'>('dataDatabase.type', 'sqlite');+ const baseConfig = {+ entities: [+ __dirname + '/modules/session/**/*.entity{.ts,.js}',+ __dirname + '/modules/webhook/**/*.entity{.ts,.js}',+ __dirname + '/modules/message/**/*.entity{.ts,.js}',+ ],+ synchronize: configService.get<boolean>('dataDatabase.synchronize', true),+ logging: configService.get<boolean>('dataDatabase.logging', false),+ };++ if (dbType === 'postgres') {+ return {+ ...baseConfig,+ type: 'postgres' as const,+ host: configService.get<string>('dataDatabase.host'),+ port: configService.get<number>('dataDatabase.port'),+ username: configService.get<string>('dataDatabase.username'),+ password: configService.get<string>('dataDatabase.password'),+ database: 'openwa',+ extra: {+ max: configService.get<number>('dataDatabase.poolSize', 10),+ },+ };+ }++ return {+ ...baseConfig,+ type: 'sqlite' as const,+ database: configService.get<string>('dataDatabase.database', './data/openwa.sqlite'),+ };+ },+ }),++ // Rate limiting+ ThrottlerModule.forRootAsync({+ imports: [ConfigModule],+ inject: [ConfigService],+ useFactory: (configService: ConfigService) => ({+ throttlers: [+ {+ name: 'short',+ ttl: configService.get<number>('api.rateLimit.shortTtl', 1000),+ limit: configService.get<number>('api.rateLimit.shortLimit', 10),+ },+ {+ name: 'medium',+ ttl: configService.get<number>('api.rateLimit.mediumTtl', 60000),+ limit: configService.get<number>('api.rateLimit.mediumLimit', 100),+ },+ {+ name: 'long',+ ttl: configService.get<number>('api.rateLimit.longTtl', 3600000),+ limit: configService.get<number>('api.rateLimit.longLimit', 1000),+ },+ ],+ }),+ }),++ // Core modules+ HooksModule, // Global hook system for plugin integration+ PluginsModule, // Global plugin system+ LoggerModule,+ CacheModule,+ StorageModule,+ AuditModule,+ EventsModule, // WebSocket real-time events+ ...queueModules,+ AuthModule,+ EngineModule,+ SessionModule,+ MessageModule,+ WebhookModule,+ HealthModule,+ SettingsModule,+ InfraModule,+ ContactModule,+ GroupModule,+ LabelModule, // Phase 3: Labels Management+ ChannelModule, // Phase 3: Channels/Newsletter+ StatsModule, // Phase 3: Statistics Dashboard+ StatusModule, // Phase 3: Status/Stories API+ CatalogModule, // Phase 3: Catalog API (WhatsApp Business)+ PluginsApiModule, // Phase 5: Plugins API+ ],+})+export class AppModule {}diff --git a/src/common/cache/cache.module.ts b/src/common/cache/cache.module.tsnew file mode 100644index 000000000..5cb29c569--- /dev/null+++ b/src/common/cache/cache.module.ts@@ -0,0 +1,11 @@+import { Global, Module } from '@nestjs/common';+import { ConfigModule } from '@nestjs/config';+import { CacheService } from './cache.service';++@Global()+@Module({+ imports: [ConfigModule],+ providers: [CacheService],+ exports: [CacheService],+})+export class CacheModule {}diff --git a/src/common/cache/cache.service.ts b/src/common/cache/cache.service.tsnew file mode 100644index 000000000..df35400ca--- /dev/null+++ b/src/common/cache/cache.service.ts@@ -0,0 +1,271 @@+import { Injectable, OnModuleDestroy } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import Redis from 'ioredis';+import { createLogger } from '../services/logger.service';++export interface SessionInfo {+ id: string;+ name: string;+ status: string;+ phone?: string;+ pushName?: string;+ connectedAt?: string;+}++export interface SessionStats {+ active: number;+ total: number;+ byStatus: Record<string, number>;+}++// TTL constants in seconds+const TTL = {+ SESSION_STATUS: 300, // 5 min+ SESSION_INFO: 600, // 10 min+ SESSION_QR: 60, // 1 min+ SESSIONS_LIST: 30, // 30 sec+ SESSIONS_STATS: 15, // 15 sec+};++@Injectable()+export class CacheService implements OnModuleDestroy {+ private readonly logger = createLogger('CacheService');+ private redis: Redis | null = null;+ private readonly enabled: boolean;+ private connecting = false;+ private connectionAttempts = 0;+ private readonly maxConnectionAttempts = 5;++ constructor(private readonly configService: ConfigService) {+ // Check REDIS_ENABLED env var directly (from saved .env.generated)+ // Fallback to config 'cache.enabled' for backward compatibility+ this.enabled = process.env.REDIS_ENABLED === 'true' || configService.get<boolean>('cache.enabled', false);++ this.logger.log(`CacheService: enabled=${this.enabled}, REDIS_ENABLED=${process.env.REDIS_ENABLED}`);++ // Don't connect immediately - wait for Redis container to be ready+ // Connection will be established on first use via isAvailable()+ }++ /**+ * Try to (re)connect to Redis+ * Returns true if connection succeeded+ */+ async tryConnect(): Promise<boolean> {+ if (!this.enabled) return false;+ if (this.connecting) return false;+ if (this.redis && (await this.ping())) return true;++ this.connecting = true;+ this.connectionAttempts++;++ try {+ const host = process.env.REDIS_HOST || this.configService.get<string>('REDIS_HOST', 'localhost');+ const port = parseInt(process.env.REDIS_PORT || '', 10) || this.configService.get<number>('REDIS_PORT', 6379);++ this.logger.log(`Connecting to Redis at ${host}:${port} (attempt ${this.connectionAttempts})`);++ this.redis = new Redis({+ host,+ port,+ password: this.configService.get<string>('REDIS_PASSWORD'),+ db: this.configService.get<number>('REDIS_CACHE_DB', 1),+ lazyConnect: true,+ maxRetriesPerRequest: 3,+ connectTimeout: 5000,+ retryStrategy: times => {+ if (times > 3) return null;+ return Math.min(times * 500, 3000);+ },+ });++ this.redis.on('error', err => {+ this.logger.warn(`Redis error: ${err.message}`);+ });++ this.redis.on('connect', () => {+ this.logger.log('Redis cache connected');+ this.connectionAttempts = 0; // Reset on success+ });++ await this.redis.connect();+ this.connecting = false;+ return true;+ } catch (error) {+ this.logger.warn(`Redis connection failed (attempt ${this.connectionAttempts}): ${String(error)}`);+ this.redis = null;+ this.connecting = false;+ return false;+ }+ }++ private async ping(): Promise<boolean> {+ if (!this.redis) return false;+ try {+ await this.redis.ping();+ return true;+ } catch {+ return false;+ }+ }++ async onModuleDestroy(): Promise<void> {+ if (this.redis) {+ await this.redis.quit();+ }+ }++ async isAvailable(): Promise<boolean> {+ if (!this.enabled) return false;++ // If not connected, try to connect (with rate limiting)+ if (!this.redis && this.connectionAttempts < this.maxConnectionAttempts) {+ await this.tryConnect();+ }++ return this.ping();+ }++ // ========== Session Status ==========++ async getSessionStatus(id: string): Promise<string | null> {+ if (!(await this.isAvailable())) return null;+ try {+ return await this.redis!.get(`session:${id}:status`);+ } catch (error) {+ this.logger.warn(`Cache read failed (session:status): ${String(error)}`);+ return null;+ }+ }++ async setSessionStatus(id: string, status: string): Promise<void> {+ if (!(await this.isAvailable())) return;+ try {+ await this.redis!.setex(`session:${id}:status`, TTL.SESSION_STATUS, status);+ } catch (error) {+ this.logger.warn(`Cache write failed (session:status): ${String(error)}`);+ }+ }++ // ========== Session Info ==========++ async getSessionInfo(id: string): Promise<SessionInfo | null> {+ if (!(await this.isAvailable())) return null;+ try {+ const data = await this.redis!.get(`session:${id}:info`);+ return data ? (JSON.parse(data) as SessionInfo) : null;+ } catch (error) {+ this.logger.warn(`Cache read failed (session:info): ${String(error)}`);+ return null;+ }+ }++ async setSessionInfo(id: string, info: SessionInfo): Promise<void> {+ if (!(await this.isAvailable())) return;+ try {+ await this.redis!.setex(`session:${id}:info`, TTL.SESSION_INFO, JSON.stringify(info));+ } catch (error) {+ this.logger.warn(`Cache write failed (session:info): ${String(error)}`);+ }+ }++ // ========== Session QR ==========++ async getSessionQR(id: string): Promise<string | null> {+ if (!(await this.isAvailable())) return null;+ try {+ return await this.redis!.get(`session:${id}:qr`);+ } catch (error) {+ this.logger.warn(`Cache read failed (session:qr): ${String(error)}`);+ return null;+ }+ }++ async setSessionQR(id: string, qr: string): Promise<void> {+ if (!(await this.isAvailable())) return;+ try {+ await this.redis!.setex(`session:${id}:qr`, TTL.SESSION_QR, qr);+ } catch (error) {+ this.logger.warn(`Cache write failed (session:qr): ${String(error)}`);+ }+ }++ // ========== Sessions List ==========++ async getSessionsList(): Promise<string[] | null> {+ if (!(await this.isAvailable())) return null;+ try {+ const data = await this.redis!.get('sessions:list');+ return data ? (JSON.parse(data) as string[]) : null;+ } catch (error) {+ this.logger.warn(`Cache read failed (sessions:list): ${String(error)}`);+ return null;+ }+ }++ async setSessionsList(ids: string[]): Promise<void> {+ if (!(await this.isAvailable())) return;+ try {+ await this.redis!.setex('sessions:list', TTL.SESSIONS_LIST, JSON.stringify(ids));+ } catch (error) {+ this.logger.warn(`Cache write failed (sessions:list): ${String(error)}`);+ }+ }++ // ========== Sessions Stats ==========++ async getSessionsStats(): Promise<SessionStats | null> {+ if (!(await this.isAvailable())) return null;+ try {+ const data = await this.redis!.get('sessions:stats');+ return data ? (JSON.parse(data) as SessionStats) : null;+ } catch (error) {+ this.logger.warn(`Cache read failed (sessions:stats): ${String(error)}`);+ return null;+ }+ }++ async setSessionsStats(stats: SessionStats): Promise<void> {+ if (!(await this.isAvailable())) return;+ try {+ await this.redis!.setex('sessions:stats', TTL.SESSIONS_STATS, JSON.stringify(stats));+ } catch (error) {+ this.logger.warn(`Cache write failed (sessions:stats): ${String(error)}`);+ }+ }++ // ========== Invalidation ==========++ async invalidateSession(id: string): Promise<void> {+ if (!(await this.isAvailable())) return;+ try {+ await this.redis!.del(`session:${id}:status`, `session:${id}:info`, `session:${id}:qr`);+ // Also invalidate list since a session changed+ await this.redis!.del('sessions:list', 'sessions:stats');+ } catch (error) {+ this.logger.warn(`Cache invalidation failed: ${String(error)}`);+ }+ }++ async invalidateSessionsList(): Promise<void> {+ if (!(await this.isAvailable())) return;+ try {+ await this.redis!.del('sessions:list', 'sessions:stats');+ } catch (error) {+ this.logger.warn(`Cache invalidation failed: ${String(error)}`);+ }+ }++ async invalidateAll(): Promise<void> {+ if (!(await this.isAvailable())) return;+ try {+ const keys = await this.redis!.keys('session:*');+ keys.push('sessions:list', 'sessions:stats');+ if (keys.length > 0) {+ await this.redis!.del(...keys);+ }+ } catch (error) {+ this.logger.warn(`Cache invalidation failed: ${String(error)}`);+ }+ }+}diff --git a/src/common/cache/index.ts b/src/common/cache/index.tsnew file mode 100644index 000000000..e5865dde7--- /dev/null+++ b/src/common/cache/index.ts@@ -0,0 +1,2 @@+export * from './cache.module';+export * from './cache.service';diff --git a/src/common/filters/http-exception.filter.ts b/src/common/filters/http-exception.filter.tsnew file mode 100644index 000000000..9e95048c7--- /dev/null+++ b/src/common/filters/http-exception.filter.ts@@ -0,0 +1,84 @@+import { ExceptionFilter, Catch, ArgumentsHost, HttpException, HttpStatus } from '@nestjs/common';+import { Response, Request } from 'express';+import { ApiResponse } from '../interfaces/response.interface';++@Catch()+export class HttpExceptionFilter implements ExceptionFilter {+ catch(exception: unknown, host: ArgumentsHost) {+ const ctx = host.switchToHttp();+ const response = ctx.getResponse<Response>();+ const request = ctx.getRequest<Request>();++ let status = HttpStatus.INTERNAL_SERVER_ERROR;+ let code = 'INTERNAL_ERROR';+ let message = 'An unexpected error occurred';+ let details: Record<string, unknown> | undefined;++ if (exception instanceof HttpException) {+ status = exception.getStatus();+ const exceptionResponse = exception.getResponse();++ if (typeof exceptionResponse === 'string') {+ message = exceptionResponse;+ } else if (typeof exceptionResponse === 'object' && exceptionResponse !== null) {+ const resp = exceptionResponse as {+ message?: string | string[];+ error?: string;+ details?: Record<string, unknown>;+ };+ message = typeof resp.message === 'string' ? resp.message : message;+ code = resp.error || this.getErrorCode(status);+ details = resp.details;++ // Handle validation errors+ if (Array.isArray(resp.message)) {+ message = 'Validation failed';+ details = { errors: resp.message };+ }+ }++ // Only set code from status if not already set from response+ if (code === 'INTERNAL_ERROR') {+ code = this.getErrorCode(status);+ }+ } else if (exception instanceof Error) {+ message = exception.message;+ }++ const errorResponse: ApiResponse = {+ success: false,+ error: {+ code,+ message,+ details,+ },+ meta: {+ timestamp: new Date().toISOString(),+ requestId: request.headers['x-request-id'] as string,+ },+ };++ response.status(status).json(errorResponse);+ }++ private getErrorCode(status: number): string {+ switch (status) {+ case 400:+ return 'BAD_REQUEST';+ case 401:+ return 'UNAUTHORIZED';+ case 403:+ return 'FORBIDDEN';+ case 404:+ return 'NOT_FOUND';+ case 409:+ return 'CONFLICT';+ case 422:+ return 'VALIDATION_ERROR';+ case 429:+ return 'TOO_MANY_REQUESTS';+ default:+ return 'INTERNAL_ERROR';+ }+ }+}diff --git a/src/common/interceptors/response.interceptor.ts b/src/common/interceptors/response.interceptor.tsnew file mode 100644index 000000000..a6d1fafc7--- /dev/null+++ b/src/common/interceptors/response.interceptor.ts@@ -0,0 +1,25 @@+import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';+import { Observable } from 'rxjs';+import { map } from 'rxjs/operators';+import { Request } from 'express';+import { ApiResponse } from '../interfaces/response.interface';++@Injectable()+export class ResponseInterceptor<T> implements NestInterceptor<T, ApiResponse<T>> {+ intercept(context: ExecutionContext, next: CallHandler): Observable<ApiResponse<T>> {+ const request = context.switchToHttp().getRequest<Request>();+ const requestId = (request.headers['x-request-id'] as string) || undefined;++ return next.handle().pipe(+ map(data => ({+ success: true,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment+ data,+ meta: {+ timestamp: new Date().toISOString(),+ requestId,+ },+ })),+ );+ }+}diff --git a/src/common/interfaces/response.interface.ts b/src/common/interfaces/response.interface.tsnew file mode 100644index 000000000..d518bf36e--- /dev/null+++ b/src/common/interfaces/response.interface.ts@@ -0,0 +1,28 @@+// Common response interface for all API endpoints++export interface ApiResponse<T = any> {+ success: boolean;+ data?: T;+ error?: ApiError;+ meta?: ApiMeta;+}++export interface ApiError {+ code: string;+ message: string;+ details?: Record<string, any>;+}++export interface ApiMeta {+ timestamp: string;+ requestId?: string;+}++export interface PaginatedResponse<T = any> extends ApiResponse<T[]> {+ pagination?: {+ page: number;+ limit: number;+ total: number;+ totalPages: number;+ };+}diff --git a/src/common/security/security.middleware.ts b/src/common/security/security.middleware.tsnew file mode 100644index 000000000..e333c3a89--- /dev/null+++ b/src/common/security/security.middleware.ts@@ -0,0 +1,110 @@+import { Injectable, NestMiddleware } from '@nestjs/common';+import { Request, Response, NextFunction } from 'express';+import { randomUUID } from 'crypto';++/**+ * Security middleware for request tracking and security headers+ * Phase 3 Security Audit+ */+@Injectable()+export class SecurityMiddleware implements NestMiddleware {+ use(req: Request, res: Response, next: NextFunction): void {+ // Generate or use existing request ID for tracing+ const requestId = (req.headers['x-request-id'] as string) || randomUUID();+ req.headers['x-request-id'] = requestId;+ res.setHeader('X-Request-ID', requestId);++ // Add additional security headers+ res.setHeader('X-Content-Type-Options', 'nosniff');+ res.setHeader('X-Frame-Options', 'DENY');+ res.setHeader('X-XSS-Protection', '1; mode=block');++ // Remove server header to avoid fingerprinting+ res.removeHeader('X-Powered-By');++ next();+ }+}++/**+ * Sanitize input strings to prevent XSS and injection attacks+ */+export function sanitizeString(input: string): string {+ if (typeof input !== 'string') return input;++ return input+ .replace(/</g, '<')+ .replace(/>/g, '>')+ .replace(/"/g, '"')+ .replace(/'/g, ''')+ .replace(/\//g, '/')+ .replace(/\\/g, '\')+ .replace(/`/g, '`');+}++/**+ * Validate that a string matches safe patterns+ */+export function isValidSessionName(name: string): boolean {+ // Only allow alphanumeric, hyphens, underscores, 3-50 chars+ return /^[a-zA-Z0-9_-]{3,50}$/.test(name);+}++/**+ * Validate WhatsApp chat ID format+ */+export function isValidChatId(chatId: string): boolean {+ // Format: <phone>@c.us (individual) or <id>@g.us (group)+ return /^\d+@(c\.us|g\.us)$/.test(chatId);+}++/**+ * Validate phone number format+ */+export function isValidPhoneNumber(phone: string): boolean {+ // 10-15 digits+ return /^\d{10,15}$/.test(phone);+}++/**+ * Mask sensitive data for logging+ */+export function maskSensitiveData(data: string, visibleChars: number = 4): string {+ if (!data || data.length <= visibleChars) return '***';+ return data.substring(0, visibleChars) + '*'.repeat(Math.min(data.length - visibleChars, 8));+}++/**+ * Security configuration constants+ */+export const SecurityConfig = {+ // Rate limiting defaults+ rateLimit: {+ short: { ttl: 1000, limit: 10 },+ medium: { ttl: 60000, limit: 100 },+ long: { ttl: 3600000, limit: 1000 },+ },++ // Input validation limits+ inputLimits: {+ maxTextLength: 65536,+ maxSessionNameLength: 50,+ maxUrlLength: 2048,+ maxArrayItems: 100,+ },++ // Session limits+ sessionLimits: {+ maxSessionsPerInstance: 100,+ sessionIdleTimeout: 86400000, // 24 hours+ qrCodeTimeout: 120000, // 2 minutes+ },++ // API key configuration+ apiKey: {+ prefix: 'owa_k1_',+ hashAlgorithm: 'sha256',+ randomBytes: 32,+ prefixLength: 12,+ },+} as const;diff --git a/src/common/services/logger.module.ts b/src/common/services/logger.module.tsnew file mode 100644index 000000000..191271d6a--- /dev/null+++ b/src/common/services/logger.module.ts@@ -0,0 +1,9 @@+import { Global, Module } from '@nestjs/common';+import { LoggerService } from './logger.service';++@Global()+@Module({+ providers: [LoggerService],+ exports: [LoggerService],+})+export class LoggerModule {}diff --git a/src/common/services/logger.service.spec.ts b/src/common/services/logger.service.spec.tsnew file mode 100644index 000000000..bcc68eeef--- /dev/null+++ b/src/common/services/logger.service.spec.ts@@ -0,0 +1,106 @@+import { LoggerService, LogLevel, createLogger } from './logger.service';++interface LogEntry {+ timestamp: string;+ level: string;+ context: string;+ message: string;+ sessionId?: string;+ action?: string;+ trace?: string;+}++// Helper to safely extract log output from mock calls+function getLogOutput(spy: jest.SpyInstance): LogEntry {+ const calls = spy.mock.calls as string[][];+ return JSON.parse(calls[0][0]) as LogEntry;+}++describe('LoggerService', () => {+ let logger: LoggerService;+ let consoleSpy: jest.SpyInstance;++ beforeEach(() => {+ logger = new LoggerService();+ logger.setContext('TestContext');+ consoleSpy = jest.spyOn(console, 'log').mockImplementation();+ jest.spyOn(console, 'warn').mockImplementation();+ jest.spyOn(console, 'error').mockImplementation();+ });++ afterEach(() => {+ jest.restoreAllMocks();+ });++ describe('log', () => {+ it('should log info messages with context', () => {+ logger.log('Test message');++ expect(consoleSpy).toHaveBeenCalled();+ const output = getLogOutput(consoleSpy);+ expect(output.level).toBe('info');+ expect(output.message).toBe('Test message');+ expect(output.context).toBe('TestContext');+ expect(output.timestamp).toBeDefined();+ });++ it('should log with additional metadata', () => {+ logger.log('Test message', { sessionId: '123', action: 'test' });++ const output = getLogOutput(consoleSpy);+ expect(output.sessionId).toBe('123');+ expect(output.action).toBe('test');+ });+ });++ describe('error', () => {+ it('should log error messages to console.error', () => {+ const errorSpy = jest.spyOn(console, 'error');+ logger.error('Error message', 'stack trace');++ expect(errorSpy).toHaveBeenCalled();+ const output = getLogOutput(errorSpy);+ expect(output.level).toBe('error');+ expect(output.message).toBe('Error message');+ expect(output.trace).toBe('stack trace');+ });+ });++ describe('warn', () => {+ it('should log warning messages to console.warn', () => {+ const warnSpy = jest.spyOn(console, 'warn');+ logger.warn('Warning message');++ expect(warnSpy).toHaveBeenCalled();+ const output = getLogOutput(warnSpy);+ expect(output.level).toBe('warn');+ expect(output.message).toBe('Warning message');+ });+ });++ describe('log levels', () => {+ it('should not log debug when level is INFO', () => {+ LoggerService.setLogLevel(LogLevel.INFO);+ logger.debug('Debug message');++ expect(consoleSpy).not.toHaveBeenCalled();+ });++ it('should log debug when level is DEBUG', () => {+ LoggerService.setLogLevel(LogLevel.DEBUG);+ logger.debug('Debug message');++ expect(consoleSpy).toHaveBeenCalled();+ });+ });++ describe('createLogger', () => {+ it('should create logger with context', () => {+ const testLogger = createLogger('MyContext');+ testLogger.log('Test');++ const output = getLogOutput(consoleSpy);+ expect(output.context).toBe('MyContext');+ });+ });+});diff --git a/src/common/services/logger.service.ts b/src/common/services/logger.service.tsnew file mode 100644index 000000000..047ebb101--- /dev/null+++ b/src/common/services/logger.service.ts@@ -0,0 +1,97 @@+import { Injectable, LoggerService as NestLoggerService, Scope } from '@nestjs/common';++export enum LogLevel {+ ERROR = 'error',+ WARN = 'warn',+ INFO = 'info',+ DEBUG = 'debug',+ VERBOSE = 'verbose',+}++export interface LogContext {+ sessionId?: string;+ messageId?: string;+ webhookId?: string;+ action?: string;+ duration?: number;+ [key: string]: any;+}++@Injectable({ scope: Scope.TRANSIENT })+export class LoggerService implements NestLoggerService {+ private context: string = 'Application';+ private static logLevel: LogLevel = LogLevel.INFO;++ static setLogLevel(level: LogLevel): void {+ LoggerService.logLevel = level;+ }++ setContext(context: string): void {+ this.context = context;+ }++ log(message: string, context?: string | LogContext): void {+ this.writeLog(LogLevel.INFO, message, context);+ }++ error(message: string, trace?: string, context?: string | LogContext): void {+ const ctx = typeof context === 'string' ? { context } : context;+ this.writeLog(LogLevel.ERROR, message, { ...ctx, trace });+ }++ warn(message: string, context?: string | LogContext): void {+ this.writeLog(LogLevel.WARN, message, context);+ }++ debug(message: string, context?: string | LogContext): void {+ this.writeLog(LogLevel.DEBUG, message, context);+ }++ verbose(message: string, context?: string | LogContext): void {+ this.writeLog(LogLevel.VERBOSE, message, context);+ }++ private writeLog(level: LogLevel, message: string, context?: string | LogContext): void {+ if (!this.shouldLog(level)) return;++ const timestamp = new Date().toISOString();+ const contextName = typeof context === 'string' ? context : this.context;+ const metadata = typeof context === 'object' ? context : {};++ const logEntry = {+ timestamp,+ level,+ context: contextName,+ message,+ ...metadata,+ };++ // Output as JSON for structured logging (easy to parse by log aggregators)+ const output = JSON.stringify(logEntry);++ switch (level) {+ case LogLevel.ERROR:+ console.error(output);+ break;+ case LogLevel.WARN:+ console.warn(output);+ break;+ default:+ console.log(output);+ }+ }++ private shouldLog(level: LogLevel): boolean {+ const levels = [LogLevel.ERROR, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG, LogLevel.VERBOSE];+ const currentIndex = levels.indexOf(LoggerService.logLevel);+ const targetIndex = levels.indexOf(level);+ return targetIndex <= currentIndex;+ }+}++// Create a factory for easy instantiation+export function createLogger(context: string): LoggerService {+ const logger = new LoggerService();+ logger.setContext(context);+ return logger;+}diff --git a/src/common/storage/storage.module.ts b/src/common/storage/storage.module.tsnew file mode 100644index 000000000..015523972--- /dev/null+++ b/src/common/storage/storage.module.ts@@ -0,0 +1,11 @@+import { Global, Module } from '@nestjs/common';+import { ConfigModule } from '@nestjs/config';+import { StorageService } from './storage.service';++@Global()+@Module({+ imports: [ConfigModule],+ providers: [StorageService],+ exports: [StorageService],+})+export class StorageModule {}diff --git a/src/common/storage/storage.service.ts b/src/common/storage/storage.service.tsnew file mode 100644index 000000000..862283b11--- /dev/null+++ b/src/common/storage/storage.service.ts@@ -0,0 +1,334 @@+import { Injectable } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import * as fs from 'fs';+import * as path from 'path';+import * as archiver from 'archiver';+import * as tar from 'tar-stream';+import { createGunzip } from 'zlib';+import { Readable, PassThrough } from 'stream';+import {+ S3Client,+ ListObjectsV2Command,+ GetObjectCommand,+ PutObjectCommand,+ HeadBucketCommand,+ CreateBucketCommand,+} from '@aws-sdk/client-s3';+import { createLogger } from '../services/logger.service';++interface S3Config {+ endpoint?: string;+ accessKeyId?: string;+ secretAccessKey?: string;+ region?: string;+ bucket?: string;+}++@Injectable()+export class StorageService {+ private readonly logger = createLogger('StorageService');+ private readonly storageType: string;+ private readonly localPath: string;+ private s3Client: S3Client | null = null;+ private s3Bucket = 'openwa';+ private s3Available = false;++ constructor(private readonly configService: ConfigService) {+ this.storageType = this.configService.get<string>('storage.type') || 'local';+ this.localPath = this.configService.get<string>('storage.localPath') || './data/media';++ // Initialize S3 client if storage type is s3+ if (this.storageType === 's3') {+ const s3Config = this.configService.get<S3Config>('storage.s3') || {};+ const endpoint = process.env.S3_ENDPOINT || s3Config.endpoint;+ const accessKeyId = process.env.S3_ACCESS_KEY || s3Config.accessKeyId;+ const secretAccessKey = process.env.S3_SECRET_KEY || s3Config.secretAccessKey;+ const region = process.env.S3_REGION || s3Config.region || 'us-east-1';++ if (endpoint && accessKeyId && secretAccessKey) {+ this.s3Client = new S3Client({+ endpoint,+ region,+ credentials: {+ accessKeyId,+ secretAccessKey,+ },+ forcePathStyle: true, // Required for MinIO+ });+ this.s3Bucket = process.env.S3_BUCKET || s3Config.bucket || 'openwa';+ void this.initializeS3Bucket();+ }+ }++ // Ensure local directory exists+ if (!fs.existsSync(this.localPath)) {+ fs.mkdirSync(this.localPath, { recursive: true });+ }+ }++ private async initializeS3Bucket(): Promise<void> {+ if (!this.s3Client) return;++ try {+ await this.s3Client.send(new HeadBucketCommand({ Bucket: this.s3Bucket }));+ this.s3Available = true;+ this.logger.log(`S3 bucket '${this.s3Bucket}' is available`);+ } catch (error: unknown) {+ const err = error as { name?: string };+ if (err.name === 'NotFound' || err.name === 'NoSuchBucket') {+ // Create bucket+ try {+ await this.s3Client.send(new CreateBucketCommand({ Bucket: this.s3Bucket }));+ this.s3Available = true;+ this.logger.log(`Created S3 bucket '${this.s3Bucket}'`);+ } catch (createError) {+ this.logger.error('Failed to create S3 bucket', String(createError));+ }+ } else {+ this.logger.error('S3 bucket check failed', String(error));+ }+ }+ }++ // ============================================================================+ // Current Storage Operations+ // ============================================================================++ getCurrentStorageType(): string {+ return this.storageType;+ }++ isS3Available(): boolean {+ return this.s3Available;+ }++ async listFiles(): Promise<string[]> {+ if (this.storageType === 's3' && this.s3Client && this.s3Available) {+ return this.listS3Files();+ }+ return this.listLocalFiles();+ }++ async getFile(filePath: string): Promise<Buffer> {+ if (this.storageType === 's3' && this.s3Client && this.s3Available) {+ return this.getS3File(filePath);+ }+ return this.getLocalFile(filePath);+ }++ async putFile(filePath: string, data: Buffer): Promise<void> {+ if (this.storageType === 's3' && this.s3Client && this.s3Available) {+ return this.putS3File(filePath, data);+ }+ return this.putLocalFile(filePath, data);+ }++ async getFileCount(): Promise<{ count: number; sizeBytes: number }> {+ const files = await this.listFiles();+ let sizeBytes = 0;++ if (this.storageType === 's3' && this.s3Client && this.s3Available) {+ // S3 size would require additional API calls, estimate+ sizeBytes = files.length * 100000; // Estimate 100KB per file+ } else {+ for (const file of files) {+ try {+ const fullPath = path.join(this.localPath, file);+ const stats = fs.statSync(fullPath);+ sizeBytes += stats.size;+ } catch {+ // File might not exist+ }+ }+ }++ return { count: files.length, sizeBytes };+ }++ // ============================================================================+ // Export - Create tar.gz stream from current storage+ // ============================================================================++ async createExportStream(): Promise<PassThrough> {+ const files = await this.listFiles();+ const output = new PassThrough();++ const archive = archiver.default('tar', {+ gzip: true,+ gzipOptions: { level: 6 },+ });++ archive.pipe(output);++ // Add files to archive+ for (const file of files) {+ try {+ const data = await this.getFile(file);+ archive.append(data, { name: file });+ } catch (error) {+ this.logger.warn(`Failed to export file: ${file}`, { error: String(error) });+ }+ }++ void archive.finalize();+ return output;+ }++ // ============================================================================+ // Import - Extract tar.gz stream to current storage+ // ============================================================================++ async importFromStream(inputStream: Readable): Promise<number> {+ let importedCount = 0;++ const extract = tar.extract();+ const gunzip = createGunzip();++ return new Promise<number>((resolve, reject) => {+ extract.on('entry', (header, stream, next) => {+ const chunks: Buffer[] = [];++ stream.on('data', (chunk: Buffer) => chunks.push(chunk));+ stream.on('end', () => {+ const data = Buffer.concat(chunks);+ this.putFile(header.name, data)+ .then(() => {+ importedCount++;+ this.logger.debug(`Imported file: ${header.name}`);+ next();+ })+ .catch((error: unknown) => {+ this.logger.error(`Failed to import file: ${header.name}`, String(error));+ next();+ });+ });+ stream.resume();+ });++ extract.on('finish', () => {+ this.logger.log(`Import completed: ${importedCount} files`);+ resolve(importedCount);+ });++ extract.on('error', (err: Error) => {+ this.logger.error('Import failed', String(err));+ reject(err);+ });++ inputStream.pipe(gunzip).pipe(extract);+ });+ }++ // ============================================================================+ // Local Storage Operations+ // ============================================================================++ private listLocalFiles(dir = ''): string[] {+ const fullPath = path.join(this.localPath, dir);+ const files: string[] = [];++ if (!fs.existsSync(fullPath)) {+ return files;+ }++ const entries = fs.readdirSync(fullPath, { withFileTypes: true });++ for (const entry of entries) {+ const relativePath = dir ? path.join(dir, entry.name) : entry.name;++ if (entry.isDirectory()) {+ files.push(...this.listLocalFiles(relativePath));+ } else if (entry.isFile()) {+ files.push(relativePath);+ }+ }++ return files;+ }++ private getLocalFile(filePath: string): Promise<Buffer> {+ const fullPath = path.join(this.localPath, filePath);+ return Promise.resolve(fs.readFileSync(fullPath));+ }++ private putLocalFile(filePath: string, data: Buffer): Promise<void> {+ const fullPath = path.join(this.localPath, filePath);+ const dir = path.dirname(fullPath);++ if (!fs.existsSync(dir)) {+ fs.mkdirSync(dir, { recursive: true });+ }++ fs.writeFileSync(fullPath, data);+ return Promise.resolve();+ }++ // ============================================================================+ // S3 Storage Operations+ // ============================================================================++ private async listS3Files(): Promise<string[]> {+ if (!this.s3Client) return [];++ const files: string[] = [];+ let continuationToken: string | undefined;++ do {+ const response = await this.s3Client.send(+ new ListObjectsV2Command({+ Bucket: this.s3Bucket,+ Prefix: 'media/',+ ContinuationToken: continuationToken,+ }),+ );++ if (response.Contents) {+ for (const obj of response.Contents) {+ if (obj.Key) {+ // Remove 'media/' prefix+ files.push(obj.Key.replace(/^media\//, ''));+ }+ }+ }++ continuationToken = response.NextContinuationToken;+ } while (continuationToken);++ return files;+ }++ private async getS3File(filePath: string): Promise<Buffer> {+ if (!this.s3Client) throw new Error('S3 client not initialized');++ const response = await this.s3Client.send(+ new GetObjectCommand({+ Bucket: this.s3Bucket,+ Key: `media/${filePath}`,+ }),+ );++ if (!response.Body) throw new Error('Empty response body');++ // Convert stream to buffer+ const chunks: Buffer[] = [];+ const stream = response.Body as Readable;++ for await (const chunk of stream) {+ chunks.push(Buffer.from(chunk as ArrayBuffer));+ }++ return Buffer.concat(chunks);+ }++ private async putS3File(filePath: string, data: Buffer): Promise<void> {+ if (!this.s3Client) throw new Error('S3 client not initialized');++ await this.s3Client.send(+ new PutObjectCommand({+ Bucket: this.s3Bucket,+ Key: `media/${filePath}`,+ Body: data,+ }),+ );+ }+}diff --git a/src/common/transformers/date.transformer.ts b/src/common/transformers/date.transformer.tsnew file mode 100644index 000000000..5aaf6e159--- /dev/null+++ b/src/common/transformers/date.transformer.ts@@ -0,0 +1,18 @@+import { ValueTransformer } from 'typeorm';++/**+ * Transformer for storing Date objects as ISO strings in database.+ * This provides cross-database compatibility between SQLite and PostgreSQL.+ * - SQLite doesn't have native date type, stores as TEXT+ * - PostgreSQL can store as TEXT for portability+ */+export const DateTransformer: ValueTransformer = {+ from: (value: string | null): Date | null => {+ if (!value) return null;+ return new Date(value);+ },+ to: (value: Date | null): string | null => {+ if (!value) return null;+ return value instanceof Date ? value.toISOString() : value;+ },+};diff --git a/src/config/configuration.ts b/src/config/configuration.tsnew file mode 100644index 000000000..2864d0f91--- /dev/null+++ b/src/config/configuration.ts@@ -0,0 +1,92 @@+export default () => ({+ port: parseInt(process.env.PORT || '2785', 10),++ // Redis configuration+ redis: {+ host: process.env.REDIS_HOST || 'localhost',+ port: parseInt(process.env.REDIS_PORT || '6379', 10),+ password: process.env.REDIS_PASSWORD,+ },++ // Queue configuration+ queue: {+ enabled: process.env.QUEUE_ENABLED === 'true',+ },++ // Cache configuration+ cache: {+ enabled: process.env.CACHE_ENABLED === 'true',+ },++ // Main Database configuration (always SQLite for boot config)+ database: {+ type: 'sqlite' as const,+ database: './data/main.sqlite',+ synchronize: true,+ logging: process.env.DATABASE_LOGGING === 'true',+ },++ // Data Storage Database configuration (pluggable: SQLite, PostgreSQL, etc.)+ dataDatabase: {+ type: process.env.DATABASE_TYPE || 'sqlite',+ // SQLite path (used when type is sqlite)+ database: process.env.DATABASE_NAME || './data/openwa.sqlite',+ // PostgreSQL/MySQL connection (used when type is postgres/mysql)+ host: process.env.DATABASE_HOST || 'localhost',+ port: parseInt(process.env.DATABASE_PORT || '5432', 10),+ username: process.env.DATABASE_USERNAME,+ password: process.env.DATABASE_PASSWORD,+ synchronize: process.env.DATABASE_SYNCHRONIZE !== 'false',+ logging: process.env.DATABASE_LOGGING === 'true',+ // Connection pooling (PostgreSQL)+ poolSize: parseInt(process.env.DATABASE_POOL_SIZE || '10', 10),+ // SSL configuration+ ssl: process.env.DATABASE_SSL === 'true',+ sslRejectUnauthorized: process.env.DATABASE_SSL_REJECT_UNAUTHORIZED !== 'false',+ },++ // WhatsApp engine configuration+ engine: {+ type: process.env.ENGINE_TYPE || 'whatsapp-web.js',+ puppeteer: {+ headless: process.env.PUPPETEER_HEADLESS !== 'false',+ args: (process.env.PUPPETEER_ARGS || '--no-sandbox,--disable-setuid-sandbox').split(','),+ },+ sessionDataPath: process.env.SESSION_DATA_PATH || './data/sessions',+ },++ // Webhook configuration+ webhook: {+ timeout: parseInt(process.env.WEBHOOK_TIMEOUT || '10000', 10),+ maxRetries: parseInt(process.env.WEBHOOK_MAX_RETRIES || '3', 10),+ retryDelay: parseInt(process.env.WEBHOOK_RETRY_DELAY || '5000', 10),+ },++ // API configuration+ api: {+ rateLimit: {+ // Short burst protection: 10 requests per second+ shortTtl: parseInt(process.env.RATE_LIMIT_SHORT_TTL || '1000', 10),+ shortLimit: parseInt(process.env.RATE_LIMIT_SHORT_LIMIT || '10', 10),+ // Medium protection: 100 requests per minute+ mediumTtl: parseInt(process.env.RATE_LIMIT_MEDIUM_TTL || '60000', 10),+ mediumLimit: parseInt(process.env.RATE_LIMIT_MEDIUM_LIMIT || '100', 10),+ // Long protection: 1000 requests per hour+ longTtl: parseInt(process.env.RATE_LIMIT_LONG_TTL || '3600000', 10),+ longLimit: parseInt(process.env.RATE_LIMIT_LONG_LIMIT || '1000', 10),+ },+ },++ // Storage configuration+ storage: {+ type: process.env.STORAGE_TYPE || 'local',+ localPath: process.env.STORAGE_LOCAL_PATH || './data/media',+ s3: {+ bucket: process.env.S3_BUCKET,+ region: process.env.S3_REGION,+ accessKeyId: process.env.S3_ACCESS_KEY_ID,+ secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,+ endpoint: process.env.S3_ENDPOINT,+ },+ },+});diff --git a/src/core/hooks/hook-manager.service.ts b/src/core/hooks/hook-manager.service.tsnew file mode 100644index 000000000..557493a3e--- /dev/null+++ b/src/core/hooks/hook-manager.service.ts@@ -0,0 +1,178 @@+import { Injectable, Logger } from '@nestjs/common';+import { HookEvent, HookHandler, HookContext, HookRegistration } from './hook.interfaces';++@Injectable()+export class HookManager {+ private readonly logger = new Logger(HookManager.name);+ private readonly hooks = new Map<HookEvent, HookRegistration[]>();+ private readonly pluginHooks = new Map<string, Set<string>>(); // pluginId -> hookIds++ /**+ * Register a hook handler+ */+ register(pluginId: string, event: HookEvent, handler: HookHandler, priority = 100): string {+ const id = `${pluginId}:${event}:${Date.now()}`;+ const registration: HookRegistration = {+ id,+ pluginId,+ event,+ handler,+ priority,+ };++ // Add to event handlers+ if (!this.hooks.has(event)) {+ this.hooks.set(event, []);+ }+ this.hooks.get(event)!.push(registration);++ // Sort by priority+ this.hooks.get(event)!.sort((a, b) => a.priority - b.priority);++ // Track plugin's hooks for cleanup+ if (!this.pluginHooks.has(pluginId)) {+ this.pluginHooks.set(pluginId, new Set());+ }+ this.pluginHooks.get(pluginId)!.add(id);++ this.logger.debug(`Hook registered: ${event} by ${pluginId} (priority: ${priority})`);+ return id;+ }++ /**+ * Unregister a specific hook by ID+ */+ unregister(hookId: string): void {+ for (const registrations of this.hooks.values()) {+ const index = registrations.findIndex(r => r.id === hookId);+ if (index !== -1) {+ const registration = registrations[index];+ registrations.splice(index, 1);++ // Remove from plugin tracking+ const pluginHookIds = this.pluginHooks.get(registration.pluginId);+ if (pluginHookIds) {+ pluginHookIds.delete(hookId);+ }++ this.logger.debug(`Hook unregistered: ${hookId}`);+ return;+ }+ }+ }++ /**+ * Unregister all hooks for a plugin+ */+ unregisterPlugin(pluginId: string): void {+ const hookIds = this.pluginHooks.get(pluginId);+ if (!hookIds) return;++ for (const [eventKey, registrations] of this.hooks.entries()) {+ const filtered = registrations.filter(r => r.pluginId !== pluginId);+ this.hooks.set(eventKey, filtered);+ }++ this.pluginHooks.delete(pluginId);+ this.logger.debug(`Unregistered all hooks for plugin: ${pluginId}`);+ }++ /**+ * Execute hooks for an event+ * Returns: { continue: boolean, data: T }+ */+ async execute<T>(+ event: HookEvent,+ data: T,+ options: { sessionId?: string; source: string },+ ): Promise<{ continue: boolean; data: T }> {+ const registrations = this.hooks.get(event) || [];++ if (registrations.length === 0) {+ return { continue: true, data };+ }++ let currentData = data;+ const ctx: HookContext<T> = {+ event,+ data: currentData,+ sessionId: options.sessionId,+ timestamp: new Date(),+ source: options.source,+ };++ for (const registration of registrations) {+ try {+ ctx.data = currentData;+ const result = await registration.handler(ctx);++ // Update data if modified+ if (result.data !== undefined) {+ currentData = result.data as T;+ }++ // Stop chain if continue is false+ if (!result.continue) {+ this.logger.debug(`Hook chain stopped by ${registration.pluginId} at event ${event}`);+ return { continue: false, data: currentData };+ }++ // Propagate error+ if (result.error) {+ throw result.error;+ }+ } catch (error) {+ this.logger.error(`Hook error in ${registration.pluginId} for ${event}: ${error}`);+ // Continue to next handler, don't break the chain on error+ }+ }++ return { continue: true, data: currentData };+ }++ /**+ * Check if any hooks are registered for an event+ */+ hasHooks(event: HookEvent): boolean {+ const registrations = this.hooks.get(event);+ return registrations !== undefined && registrations.length > 0;+ }++ /**+ * Get count of registered hooks for an event+ */+ getHookCount(event: HookEvent): number {+ return this.hooks.get(event)?.length || 0;+ }++ /**+ * Get registered hooks info (for debugging/dashboard)+ */+ getRegisteredHooks(): Record<HookEvent, { pluginId: string; priority: number }[]> {+ const result: Record<string, { pluginId: string; priority: number }[]> = {};++ for (const [event, registrations] of this.hooks.entries()) {+ result[event] = registrations.map(r => ({+ pluginId: r.pluginId,+ priority: r.priority,+ }));+ }++ return result as Record<HookEvent, { pluginId: string; priority: number }[]>;+ }++ /**+ * Get all events that a plugin has registered+ */+ getPluginEvents(pluginId: string): HookEvent[] {+ const events: HookEvent[] = [];++ for (const [event, registrations] of this.hooks.entries()) {+ if (registrations.some(r => r.pluginId === pluginId)) {+ events.push(event);+ }+ }++ return events;+ }+}diff --git a/src/core/hooks/hook.interfaces.ts b/src/core/hooks/hook.interfaces.tsnew file mode 100644index 000000000..194bb7ce0--- /dev/null+++ b/src/core/hooks/hook.interfaces.ts@@ -0,0 +1,49 @@+/**+ * Hook System Interfaces+ * Central event bus for plugin integration+ */++export type HookEvent =+ // Session lifecycle+ | 'session:created'+ | 'session:starting'+ | 'session:ready'+ | 'session:qr'+ | 'session:disconnected'+ | 'session:deleted'+ // Message lifecycle+ | 'message:received'+ | 'message:sending'+ | 'message:sent'+ | 'message:failed'+ | 'message:ack'+ // Webhook lifecycle+ | 'webhook:before'+ | 'webhook:queued' // After webhook job added to queue (queue mode only)+ | 'webhook:delivered' // After webhook successfully delivered (direct or queue)+ | 'webhook:after' // After webhook attempt (direct mode only, deprecated for queue)+ | 'webhook:error'; // After webhook delivery failed (all retries exhausted)++export interface HookContext<T = unknown> {+ event: HookEvent;+ data: T;+ sessionId?: string;+ timestamp: Date;+ source: string; // Which service emitted this+}++export interface HookResult<T = unknown> {+ continue: boolean; // false = stop processing chain+ data?: T; // Modified data (optional)+ error?: Error; // Error to propagate+}++export type HookHandler<T = unknown> = (ctx: HookContext<T>) => Promise<HookResult<T>>;++export interface HookRegistration {+ id: string;+ pluginId: string;+ event: HookEvent;+ handler: HookHandler;+ priority: number; // Lower = runs first+}diff --git a/src/core/hooks/hooks.module.ts b/src/core/hooks/hooks.module.tsnew file mode 100644index 000000000..a2c484800--- /dev/null+++ b/src/core/hooks/hooks.module.ts@@ -0,0 +1,9 @@+import { Global, Module } from '@nestjs/common';+import { HookManager } from './hook-manager.service';++@Global() // Make HookManager available everywhere without importing+@Module({+ providers: [HookManager],+ exports: [HookManager],+})+export class HooksModule {}diff --git a/src/core/hooks/index.ts b/src/core/hooks/index.tsnew file mode 100644index 000000000..8cff5554a--- /dev/null+++ b/src/core/hooks/index.ts@@ -0,0 +1,3 @@+export * from './hook.interfaces';+export * from './hook-manager.service';+export * from './hooks.module';diff --git a/src/core/plugins/index.ts b/src/core/plugins/index.tsnew file mode 100644index 000000000..cd17c7a1b--- /dev/null+++ b/src/core/plugins/index.ts@@ -0,0 +1,4 @@+export * from './plugin.interfaces';+export * from './plugin-loader.service';+export * from './plugin-storage.service';+export * from './plugins.module';diff --git a/src/core/plugins/plugin-loader.service.ts b/src/core/plugins/plugin-loader.service.tsnew file mode 100644index 000000000..2117d146f--- /dev/null+++ b/src/core/plugins/plugin-loader.service.ts@@ -0,0 +1,340 @@+import { Injectable, OnModuleInit } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import * as fs from 'fs';+import * as path from 'path';+import { createLogger } from '../../common/services/logger.service';+import { HookManager } from '../hooks';+import {+ PluginManifest,+ PluginInstance,+ PluginStatus,+ PluginContext,+ IPlugin,+ PluginType,+ PluginLogger,+} from './plugin.interfaces';+import { PluginStorageService } from './plugin-storage.service';++@Injectable()+export class PluginLoaderService implements OnModuleInit {+ private readonly logger = createLogger('PluginLoaderService');+ private readonly plugins = new Map<string, PluginInstance>();+ private readonly pluginsDir: string;++ constructor(+ private readonly configService: ConfigService,+ private readonly hookManager: HookManager,+ private readonly pluginStorage: PluginStorageService,+ ) {+ this.pluginsDir = this.configService.get<string>('plugins.dir') ?? './plugins';+ }++ onModuleInit(): void {+ // Load built-in plugins first (synchronous registration)+ this.loadBuiltInPlugins();++ // Then load user plugins if directory exists+ if (fs.existsSync(this.pluginsDir)) {+ this.loadPluginsFromDirectory(this.pluginsDir);+ }++ this.logger.log(`Loaded ${this.plugins.size} plugins`, {+ action: 'plugins_loaded',+ count: this.plugins.size,+ });+ }++ private loadBuiltInPlugins(): void {+ // Built-in plugins are registered programmatically+ // This will be used by Phase 4 to register engine plugins+ this.logger.debug('Built-in plugins loading point (Phase 4)', {+ action: 'builtin_plugins_init',+ });+ }++ private loadPluginsFromDirectory(dir: string): void {+ const entries = fs.readdirSync(dir, { withFileTypes: true });++ for (const entry of entries) {+ if (!entry.isDirectory()) continue;++ const pluginPath = path.join(dir, entry.name);+ const manifestPath = path.join(pluginPath, 'manifest.json');++ if (!fs.existsSync(manifestPath)) {+ this.logger.warn(`Plugin ${entry.name} missing manifest.json`, {+ pluginPath,+ action: 'manifest_missing',+ });+ continue;+ }++ try {+ this.loadPlugin(pluginPath);+ } catch (error) {+ this.logger.error(+ `Failed to load plugin ${entry.name}`,+ error instanceof Error ? error.message : String(error),+ { pluginPath, action: 'plugin_load_failed' },+ );+ }+ }+ }++ loadPlugin(pluginPath: string): PluginInstance {+ const manifestPath = path.join(pluginPath, 'manifest.json');+ const manifestContent = fs.readFileSync(manifestPath, 'utf-8');+ const manifest = JSON.parse(manifestContent) as PluginManifest;++ // Validate manifest+ if (!manifest.id || !manifest.name || !manifest.version || !manifest.type || !manifest.main) {+ throw new Error(`Invalid manifest: missing required fields`);+ }++ // Check if plugin already loaded+ if (this.plugins.has(manifest.id)) {+ throw new Error(`Plugin ${manifest.id} is already loaded`);+ }++ // Load stored config+ const storedConfig = this.pluginStorage.getPluginConfig(manifest.id);++ const pluginInstance: PluginInstance = {+ manifest,+ status: PluginStatus.INSTALLED,+ config: storedConfig ?? {},+ instance: null,+ loadedAt: new Date(),+ };++ this.plugins.set(manifest.id, pluginInstance);++ this.logger.log(`Plugin loaded: ${manifest.name} v${manifest.version}`, {+ pluginId: manifest.id,+ type: manifest.type,+ action: 'plugin_loaded',+ });++ return pluginInstance;+ }++ async enablePlugin(pluginId: string): Promise<void> {+ const plugin = this.plugins.get(pluginId);+ if (!plugin) {+ throw new Error(`Plugin ${pluginId} not found`);+ }++ if (plugin.status === PluginStatus.ENABLED) {+ return; // Already enabled+ }++ try {+ // Create plugin context+ const context = this.createPluginContext(plugin);++ // Load the plugin instance if not already loaded+ if (!plugin.instance) {+ const mainPath = path.join(this.pluginsDir, pluginId, plugin.manifest.main);+ // Dynamic require for user plugins+ // eslint-disable-next-line @typescript-eslint/no-require-imports+ const pluginModule = require(mainPath) as { default?: new () => IPlugin };+ if (pluginModule.default) {+ plugin.instance = new pluginModule.default();+ } else {+ throw new Error(`Plugin ${pluginId} does not export a default class`);+ }+ }++ // Call lifecycle hooks+ if (plugin.instance.onLoad) {+ await plugin.instance.onLoad(context);+ }++ if (plugin.instance.onEnable) {+ await plugin.instance.onEnable(context);+ }++ plugin.status = PluginStatus.ENABLED;+ plugin.enabledAt = new Date();+ plugin.error = undefined;++ // Persist status+ this.pluginStorage.setPluginStatus(pluginId, PluginStatus.ENABLED);++ this.logger.log(`Plugin enabled: ${plugin.manifest.name}`, {+ pluginId,+ action: 'plugin_enabled',+ });+ } catch (error) {+ plugin.status = PluginStatus.ERROR;+ plugin.error = error instanceof Error ? error.message : String(error);++ this.pluginStorage.setPluginStatus(pluginId, PluginStatus.ERROR);++ throw error;+ }+ }++ async disablePlugin(pluginId: string): Promise<void> {+ const plugin = this.plugins.get(pluginId);+ if (!plugin) {+ throw new Error(`Plugin ${pluginId} not found`);+ }++ if (plugin.status !== PluginStatus.ENABLED) {+ return; // Not enabled+ }++ try {+ const context = this.createPluginContext(plugin);++ if (plugin.instance?.onDisable) {+ await plugin.instance.onDisable(context);+ }++ // Unregister all hooks for this plugin+ this.hookManager.unregisterPlugin(pluginId);++ plugin.status = PluginStatus.DISABLED;++ this.pluginStorage.setPluginStatus(pluginId, PluginStatus.DISABLED);++ this.logger.log(`Plugin disabled: ${plugin.manifest.name}`, {+ pluginId,+ action: 'plugin_disabled',+ });+ } catch (error) {+ plugin.status = PluginStatus.ERROR;+ plugin.error = error instanceof Error ? error.message : String(error);+ throw error;+ }+ }++ async unloadPlugin(pluginId: string): Promise<void> {+ const plugin = this.plugins.get(pluginId);+ if (!plugin) {+ throw new Error(`Plugin ${pluginId} not found`);+ }++ // Disable first if enabled+ if (plugin.status === PluginStatus.ENABLED) {+ await this.disablePlugin(pluginId);+ }++ // Call onUnload+ if (plugin.instance?.onUnload) {+ const context = this.createPluginContext(plugin);+ await plugin.instance.onUnload(context);+ }++ this.plugins.delete(pluginId);++ this.logger.log(`Plugin unloaded: ${plugin.manifest.name}`, {+ pluginId,+ action: 'plugin_unloaded',+ });+ }++ updatePluginConfig(pluginId: string, config: Record<string, unknown>): void {+ const plugin = this.plugins.get(pluginId);+ if (!plugin) {+ throw new Error(`Plugin ${pluginId} not found`);+ }++ plugin.config = { ...plugin.config, ...config };++ // Persist config+ this.pluginStorage.setPluginConfig(pluginId, plugin.config);++ // Notify plugin of config change (async, fire and forget)+ if (plugin.instance?.onConfigChange && plugin.status === PluginStatus.ENABLED) {+ const context = this.createPluginContext(plugin);+ void plugin.instance.onConfigChange(context, plugin.config);+ }++ this.logger.debug(`Plugin config updated: ${pluginId}`, {+ pluginId,+ action: 'plugin_config_updated',+ });+ }++ private createPluginContext(plugin: PluginInstance): PluginContext {+ const pluginLogger: PluginLogger = {+ log: (message, meta) =>+ this.logger.log(`[${plugin.manifest.id}] ${message}`, { ...meta, pluginId: plugin.manifest.id }),+ debug: (message, meta) =>+ this.logger.debug(`[${plugin.manifest.id}] ${message}`, { ...meta, pluginId: plugin.manifest.id }),+ warn: (message, meta) =>+ this.logger.warn(`[${plugin.manifest.id}] ${message}`, { ...meta, pluginId: plugin.manifest.id }),+ error: (message, error, meta) =>+ this.logger.error(+ `[${plugin.manifest.id}] ${message}`,+ error instanceof Error ? error.message : String(error),+ { ...meta, pluginId: plugin.manifest.id },+ ),+ };++ return {+ pluginId: plugin.manifest.id,+ manifest: plugin.manifest,+ config: plugin.config,+ hookManager: this.hookManager,+ logger: pluginLogger,+ storage: this.pluginStorage.createPluginStorage(plugin.manifest.id),+ registerHook: (event, handler, priority) => {+ this.hookManager.register(plugin.manifest.id, event, handler, priority);+ },+ getService: <T>(): T | undefined => {+ // Limited service access for sandboxing+ // Only expose safe services+ return undefined;+ },+ };+ }++ // ============================================================================+ // Query Methods+ // ============================================================================++ getPlugin(pluginId: string): PluginInstance | undefined {+ return this.plugins.get(pluginId);+ }++ getAllPlugins(): PluginInstance[] {+ return Array.from(this.plugins.values());+ }++ getPluginsByType(type: PluginType): PluginInstance[] {+ return this.getAllPlugins().filter(p => p.manifest.type === type);+ }++ getEnabledPlugins(): PluginInstance[] {+ return this.getAllPlugins().filter(p => p.status === PluginStatus.ENABLED);+ }++ isPluginEnabled(pluginId: string): boolean {+ const plugin = this.plugins.get(pluginId);+ return plugin?.status === PluginStatus.ENABLED;+ }++ // ============================================================================+ // Built-in Plugin Registration (for Phase 4)+ // ============================================================================++ registerBuiltInPlugin(manifest: PluginManifest, instance: IPlugin): void {+ const pluginInstance: PluginInstance = {+ manifest,+ status: PluginStatus.INSTALLED,+ config: {},+ instance,+ loadedAt: new Date(),+ };++ this.plugins.set(manifest.id, pluginInstance);++ this.logger.debug(`Built-in plugin registered: ${manifest.name}`, {+ pluginId: manifest.id,+ action: 'builtin_plugin_registered',+ });+ }+}diff --git a/src/core/plugins/plugin-storage.service.ts b/src/core/plugins/plugin-storage.service.tsnew file mode 100644index 000000000..1e9b5f30a--- /dev/null+++ b/src/core/plugins/plugin-storage.service.ts@@ -0,0 +1,182 @@+import { Injectable } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import * as fs from 'fs';+import * as path from 'path';+import { createLogger } from '../../common/services/logger.service';+import { PluginStatus, PluginStorage, PluginRegistryEntry } from './plugin.interfaces';++@Injectable()+export class PluginStorageService {+ private readonly logger = createLogger('PluginStorageService');+ private readonly dataDir: string;+ private readonly registryPath: string;+ private registry: Map<string, PluginRegistryEntry> = new Map();++ constructor(private readonly configService: ConfigService) {+ this.dataDir = this.configService.get<string>('dataDir') ?? './data';+ this.registryPath = path.join(this.dataDir, 'plugins', 'registry.json');+ this.loadRegistry();+ }++ private loadRegistry(): void {+ try {+ if (fs.existsSync(this.registryPath)) {+ const content = fs.readFileSync(this.registryPath, 'utf-8');+ const entries = JSON.parse(content) as PluginRegistryEntry[];+ this.registry = new Map(entries.map(e => [e.id, e]));+ this.logger.debug(`Loaded ${this.registry.size} plugins from registry`, {+ action: 'registry_loaded',+ });+ }+ } catch (error) {+ this.logger.error('Failed to load plugin registry', String(error), {+ action: 'registry_load_failed',+ });+ }+ }++ private saveRegistry(): void {+ try {+ const dir = path.dirname(this.registryPath);+ if (!fs.existsSync(dir)) {+ fs.mkdirSync(dir, { recursive: true });+ }++ const entries = Array.from(this.registry.values());+ fs.writeFileSync(this.registryPath, JSON.stringify(entries, null, 2));+ } catch (error) {+ this.logger.error('Failed to save plugin registry', String(error), {+ action: 'registry_save_failed',+ });+ }+ }++ // ============================================================================+ // Registry Methods+ // ============================================================================++ getPluginEntry(pluginId: string): PluginRegistryEntry | undefined {+ return this.registry.get(pluginId);+ }++ setPluginEntry(entry: PluginRegistryEntry): void {+ entry.updatedAt = new Date();+ this.registry.set(entry.id, entry);+ this.saveRegistry();+ }++ deletePluginEntry(pluginId: string): void {+ this.registry.delete(pluginId);+ this.saveRegistry();+ }++ getAllEntries(): PluginRegistryEntry[] {+ return Array.from(this.registry.values());+ }++ // ============================================================================+ // Status Management+ // ============================================================================++ getPluginStatus(pluginId: string): PluginStatus | null {+ const entry = this.registry.get(pluginId);+ return entry?.status ?? null;+ }++ setPluginStatus(pluginId: string, status: PluginStatus): void {+ const entry = this.registry.get(pluginId);+ if (entry) {+ entry.status = status;+ entry.updatedAt = new Date();+ this.saveRegistry();+ }+ }++ // ============================================================================+ // Config Management+ // ============================================================================++ getPluginConfig(pluginId: string): Record<string, unknown> | null {+ const entry = this.registry.get(pluginId);+ return entry?.config ?? null;+ }++ setPluginConfig(pluginId: string, config: Record<string, unknown>): void {+ const entry = this.registry.get(pluginId);+ if (entry) {+ entry.config = config;+ entry.updatedAt = new Date();+ this.saveRegistry();+ }+ }++ // ============================================================================+ // Plugin Data Storage (sandboxed per-plugin storage)+ // ============================================================================++ createPluginStorage(pluginId: string): PluginStorage {+ const pluginDataDir = path.join(this.dataDir, 'plugins', pluginId);++ // Ensure directory exists+ if (!fs.existsSync(pluginDataDir)) {+ fs.mkdirSync(pluginDataDir, { recursive: true });+ }++ const logger = this.logger;++ return {+ get: <T = unknown>(key: string): Promise<T | null> => {+ const filePath = path.join(pluginDataDir, `${key}.json`);+ try {+ if (fs.existsSync(filePath)) {+ const content = fs.readFileSync(filePath, 'utf-8');+ return Promise.resolve(JSON.parse(content) as T);+ }+ } catch (error) {+ logger.error(`Failed to read plugin data: ${pluginId}/${key}`, String(error));+ }+ return Promise.resolve(null);+ },++ set: <T = unknown>(key: string, value: T): Promise<void> => {+ const filePath = path.join(pluginDataDir, `${key}.json`);+ try {+ fs.writeFileSync(filePath, JSON.stringify(value, null, 2));+ return Promise.resolve();+ } catch (error) {+ logger.error(`Failed to write plugin data: ${pluginId}/${key}`, String(error));+ return Promise.reject(new Error(error instanceof Error ? error.message : String(error)));+ }+ },++ delete: (key: string): Promise<void> => {+ const filePath = path.join(pluginDataDir, `${key}.json`);+ try {+ if (fs.existsSync(filePath)) {+ fs.unlinkSync(filePath);+ }+ return Promise.resolve();+ } catch (error) {+ logger.error(`Failed to delete plugin data: ${pluginId}/${key}`, String(error));+ return Promise.reject(new Error(error instanceof Error ? error.message : String(error)));+ }+ },++ list: (prefix?: string): Promise<string[]> => {+ try {+ const files = fs.readdirSync(pluginDataDir);+ let keys = files.filter(f => f.endsWith('.json')).map(f => f.replace('.json', ''));++ if (prefix) {+ keys = keys.filter(k => k.startsWith(prefix));+ }++ return Promise.resolve(keys);+ } catch (error) {+ logger.error(`Failed to list plugin data: ${pluginId}`, String(error));+ return Promise.resolve([]);+ }+ },+ };+ }+}diff --git a/src/core/plugins/plugin.interfaces.ts b/src/core/plugins/plugin.interfaces.tsnew file mode 100644index 000000000..6726fff49--- /dev/null+++ b/src/core/plugins/plugin.interfaces.ts@@ -0,0 +1,180 @@+/**+ * Plugin System Interfaces+ * Defines the contract for OpenWA plugins+ */++import { HookManager, HookEvent, HookHandler } from '../hooks';++// ============================================================================+// Plugin Types+// ============================================================================++export enum PluginType {+ ENGINE = 'engine', // WhatsApp engine (whatsapp-web.js, baileys, etc.)+ STORAGE = 'storage', // Storage backends (local, S3, GCS, etc.)+ QUEUE = 'queue', // Queue systems (Redis, RabbitMQ, etc.)+ AUTH = 'auth', // Authentication providers+ EXTENSION = 'extension', // General extensions (auto-reply, scheduler, etc.)+}++export enum PluginStatus {+ INSTALLED = 'installed',+ ENABLED = 'enabled',+ DISABLED = 'disabled',+ ERROR = 'error',+}++// ============================================================================+// Plugin Manifest+// ============================================================================++export interface PluginManifest {+ id: string; // Unique identifier (e.g., 'whatsapp-web.js', 'auto-reply')+ name: string; // Display name+ version: string; // Semver+ type: PluginType;+ description?: string;+ author?: string;+ homepage?: string;+ repository?: string;+ license?: string;++ // Entry point+ main: string; // Relative path to main file++ // Dependencies+ dependencies?: Record<string, string>;+ peerDependencies?: Record<string, string>;++ // Configuration schema (optional, for UI generation)+ configSchema?: PluginConfigSchema;++ // Hooks this plugin listens to+ hooks?: HookEvent[];++ // Features provided by this plugin+ provides?: string[];++ // Required features from other plugins+ requires?: string[];+}++export interface PluginConfigSchema {+ type: 'object';+ properties: Record<+ string,+ {+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';+ title?: string;+ description?: string;+ default?: unknown;+ enum?: unknown[];+ required?: boolean;+ secret?: boolean; // For sensitive values like API keys+ }+ >;+}++// ============================================================================+// Plugin Context (passed to plugin on initialization)+// ============================================================================++export interface PluginContext {+ // Plugin info+ pluginId: string;+ manifest: PluginManifest;++ // Configuration+ config: Record<string, unknown>;++ // Hook system+ hookManager: HookManager;++ // Logger instance for this plugin+ logger: PluginLogger;++ // Storage for plugin data+ storage: PluginStorage;++ // Register a hook handler+ registerHook: (event: HookEvent, handler: HookHandler, priority?: number) => void;++ // Get service from DI container (limited access)+ getService: <T>(token: string) => T | undefined;+}++export interface PluginLogger {+ log: (message: string, meta?: Record<string, unknown>) => void;+ debug: (message: string, meta?: Record<string, unknown>) => void;+ warn: (message: string, meta?: Record<string, unknown>) => void;+ error: (message: string, error?: unknown, meta?: Record<string, unknown>) => void;+}++export interface PluginStorage {+ get: <T = unknown>(key: string) => Promise<T | null>;+ set: <T = unknown>(key: string, value: T) => Promise<void>;+ delete: (key: string) => Promise<void>;+ list: (prefix?: string) => Promise<string[]>;+}++// ============================================================================+// Plugin Interface (what plugins must implement)+// ============================================================================++export interface IPlugin {+ // Lifecycle hooks+ onLoad?: (context: PluginContext) => Promise<void>;+ onEnable?: (context: PluginContext) => Promise<void>;+ onDisable?: (context: PluginContext) => Promise<void>;+ onUnload?: (context: PluginContext) => Promise<void>;++ // Configuration change handler+ onConfigChange?: (context: PluginContext, newConfig: Record<string, unknown>) => Promise<void>;++ // Health check (for dashboard monitoring)+ healthCheck?: () => Promise<{ healthy: boolean; message?: string }>;+}++// ============================================================================+// Engine Plugin Interface (extends IPlugin for engine-specific methods)+// ============================================================================++export interface IEnginePlugin extends IPlugin {+ type: PluginType.ENGINE;++ // Engine factory method+ createEngine: (config: Record<string, unknown>) => unknown;++ // Get supported features+ getFeatures: () => string[];+}++// ============================================================================+// Plugin Instance (runtime representation)+// ============================================================================++export interface PluginInstance {+ manifest: PluginManifest;+ status: PluginStatus;+ config: Record<string, unknown>;+ instance: IPlugin | null;+ error?: string;+ loadedAt?: Date;+ enabledAt?: Date;+}++// ============================================================================+// Plugin Registry Entry (for storage)+// ============================================================================++export interface PluginRegistryEntry {+ id: string;+ type: PluginType;+ name: string;+ version: string;+ status: PluginStatus;+ config: Record<string, unknown>;+ builtIn: boolean; // True for bundled plugins+ installedAt: Date;+ updatedAt: Date;+}diff --git a/src/core/plugins/plugins.module.ts b/src/core/plugins/plugins.module.tsnew file mode 100644index 000000000..d05689224--- /dev/null+++ b/src/core/plugins/plugins.module.ts@@ -0,0 +1,10 @@+import { Global, Module } from '@nestjs/common';+import { PluginLoaderService } from './plugin-loader.service';+import { PluginStorageService } from './plugin-storage.service';++@Global() // Make plugin services available everywhere+@Module({+ providers: [PluginStorageService, PluginLoaderService],+ exports: [PluginLoaderService, PluginStorageService],+})+export class PluginsModule {}diff --git a/src/database/data-source.ts b/src/database/data-source.tsnew file mode 100644index 000000000..24d07cbb0--- /dev/null+++ b/src/database/data-source.ts@@ -0,0 +1,44 @@+import { DataSource } from 'typeorm';+import { config } from 'dotenv';++// Load environment variables+config();++const isProduction = process.env.NODE_ENV === 'production';+const dbType = process.env.DATABASE_TYPE || 'sqlite';++// SQLite configuration+const sqliteDataSource = new DataSource({+ type: 'sqlite',+ database: process.env.DATABASE_NAME || './data/openwa.sqlite',+ entities: [__dirname + '/../**/*.entity{.ts,.js}'],+ migrations: [__dirname + '/migrations/*{.ts,.js}'],+ synchronize: !isProduction,+ logging: process.env.DATABASE_LOGGING === 'true',+});++// PostgreSQL configuration+const postgresDataSource = new DataSource({+ type: 'postgres',+ host: process.env.DATABASE_HOST || 'localhost',+ port: parseInt(process.env.DATABASE_PORT || '5432', 10),+ username: process.env.DATABASE_USERNAME,+ password: process.env.DATABASE_PASSWORD,+ database: process.env.DATABASE_NAME || 'openwa',+ entities: [__dirname + '/../**/*.entity{.ts,.js}'],+ migrations: [__dirname + '/migrations/*{.ts,.js}'],+ synchronize: false, // Never auto-sync in production+ logging: process.env.DATABASE_LOGGING === 'true',+ ssl:+ process.env.DATABASE_SSL === 'true'+ ? {+ rejectUnauthorized: process.env.DATABASE_SSL_REJECT_UNAUTHORIZED !== 'false',+ }+ : false,+ extra: {+ max: parseInt(process.env.DATABASE_POOL_SIZE || '10', 10),+ },+});++// Export the appropriate data source based on DATABASE_TYPE+export default dbType === 'postgres' ? postgresDataSource : sqliteDataSource;diff --git a/src/database/migrations/.gitkeep b/src/database/migrations/.gitkeepnew file mode 100644index 000000000..e69de29bbdiff --git a/src/database/migrations/1770108659848-AddMessageStatus.ts b/src/database/migrations/1770108659848-AddMessageStatus.tsnew file mode 100644index 000000000..329f95102--- /dev/null+++ b/src/database/migrations/1770108659848-AddMessageStatus.ts@@ -0,0 +1,69 @@+import { MigrationInterface, QueryRunner } from 'typeorm';++export class AddMessageStatus1770108659848 implements MigrationInterface {+ name = 'AddMessageStatus1770108659848';++ public async up(queryRunner: QueryRunner): Promise<void> {+ await queryRunner.query(+ `CREATE TABLE "sessions" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar(100) NOT NULL, "status" varchar(50) NOT NULL DEFAULT ('created'), "phone" varchar(20), "pushName" varchar(100), "config" text NOT NULL DEFAULT ('{}'), "proxyUrl" varchar(255), "proxyType" varchar(10), "connectedAt" datetime, "lastActiveAt" datetime, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_ac984ccbd8b01af155e1874e8cb" UNIQUE ("name"))`,+ );+ await queryRunner.query(+ `CREATE TABLE "webhooks" ("id" varchar PRIMARY KEY NOT NULL, "sessionId" varchar NOT NULL, "url" varchar(2048) NOT NULL, "events" text NOT NULL DEFAULT ('["message.received"]'), "secret" varchar(255), "headers" text NOT NULL DEFAULT ('{}'), "active" boolean NOT NULL DEFAULT (1), "retryCount" integer NOT NULL DEFAULT (3), "lastTriggeredAt" datetime, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')))`,+ );+ await queryRunner.query(+ `CREATE TABLE "messages" ("id" varchar PRIMARY KEY NOT NULL, "sessionId" varchar NOT NULL, "waMessageId" varchar, "chatId" varchar NOT NULL, "from" varchar NOT NULL, "to" varchar NOT NULL, "body" text, "type" varchar NOT NULL DEFAULT ('text'), "direction" varchar NOT NULL DEFAULT ('outgoing'), "timestamp" bigint, "metadata" text, "status" varchar NOT NULL DEFAULT ('sent'), "createdAt" datetime NOT NULL DEFAULT (datetime('now')))`,+ );+ await queryRunner.query(`CREATE INDEX "IDX_066163c46cda7e8187f96bc87a" ON "messages" ("sessionId") `);+ await queryRunner.query(`CREATE INDEX "IDX_befd307485dbf0559d17e4a4d2" ON "messages" ("status") `);+ await queryRunner.query(`CREATE INDEX "IDX_36bc604c820bb9adc4c75cd411" ON "messages" ("chatId") `);+ await queryRunner.query(`CREATE INDEX "IDX_399833392126349ef0b04b9bed" ON "messages" ("sessionId", "createdAt") `);+ await queryRunner.query(+ `CREATE TABLE "message_batches" ("id" varchar PRIMARY KEY NOT NULL, "batch_id" varchar NOT NULL, "session_id" varchar NOT NULL, "status" varchar NOT NULL DEFAULT ('pending'), "messages" text NOT NULL, "options" text, "progress" text, "results" text, "current_index" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "started_at" datetime, "completed_at" datetime, CONSTRAINT "UQ_ff274470c0dbaff6c7d1f9795f5" UNIQUE ("batch_id"))`,+ );+ await queryRunner.query(+ `CREATE TABLE "api_keys" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar(100) NOT NULL, "keyHash" varchar(64) NOT NULL, "keyPrefix" varchar(8) NOT NULL, "role" varchar(20) NOT NULL DEFAULT ('operator'), "allowedIps" text, "allowedSessions" text, "isActive" boolean NOT NULL DEFAULT (1), "expiresAt" datetime, "lastUsedAt" datetime, "usageCount" integer NOT NULL DEFAULT (0), "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')))`,+ );+ await queryRunner.query(`CREATE UNIQUE INDEX "IDX_df3b25181df0b4b59bd93f16e1" ON "api_keys" ("keyHash") `);+ await queryRunner.query(+ `CREATE TABLE "audit_logs" ("id" varchar PRIMARY KEY NOT NULL, "action" varchar(50) NOT NULL, "severity" varchar(10) NOT NULL DEFAULT ('info'), "apiKeyId" varchar(36), "apiKeyName" varchar(100), "sessionId" varchar(36), "sessionName" varchar(100), "ipAddress" varchar(45), "userAgent" varchar(500), "method" varchar(10), "path" varchar(500), "statusCode" integer, "metadata" text, "errorMessage" text, "createdAt" datetime NOT NULL DEFAULT (datetime('now')))`,+ );+ await queryRunner.query(`CREATE INDEX "IDX_cee5459245f652b75eb2759b4c" ON "audit_logs" ("action") `);+ await queryRunner.query(`CREATE INDEX "IDX_741fa976d1e04e695f3aa23cb8" ON "audit_logs" ("apiKeyId") `);+ await queryRunner.query(`CREATE INDEX "IDX_dd2b6e43c767b6b5b2bb227ace" ON "audit_logs" ("sessionId") `);+ await queryRunner.query(`CREATE INDEX "IDX_c69efb19bf127c97e6740ad530" ON "audit_logs" ("createdAt") `);+ await queryRunner.query(+ `CREATE TABLE "temporary_webhooks" ("id" varchar PRIMARY KEY NOT NULL, "sessionId" varchar NOT NULL, "url" varchar(2048) NOT NULL, "events" text NOT NULL DEFAULT ('["message.received"]'), "secret" varchar(255), "headers" text NOT NULL DEFAULT ('{}'), "active" boolean NOT NULL DEFAULT (1), "retryCount" integer NOT NULL DEFAULT (3), "lastTriggeredAt" datetime, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "FK_d209715bb62b12255e825580af6" FOREIGN KEY ("sessionId") REFERENCES "sessions" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,+ );+ await queryRunner.query(+ `INSERT INTO "temporary_webhooks"("id", "sessionId", "url", "events", "secret", "headers", "active", "retryCount", "lastTriggeredAt", "createdAt", "updatedAt") SELECT "id", "sessionId", "url", "events", "secret", "headers", "active", "retryCount", "lastTriggeredAt", "createdAt", "updatedAt" FROM "webhooks"`,+ );+ await queryRunner.query(`DROP TABLE "webhooks"`);+ await queryRunner.query(`ALTER TABLE "temporary_webhooks" RENAME TO "webhooks"`);+ }++ public async down(queryRunner: QueryRunner): Promise<void> {+ await queryRunner.query(`ALTER TABLE "webhooks" RENAME TO "temporary_webhooks"`);+ await queryRunner.query(+ `CREATE TABLE "webhooks" ("id" varchar PRIMARY KEY NOT NULL, "sessionId" varchar NOT NULL, "url" varchar(2048) NOT NULL, "events" text NOT NULL DEFAULT ('["message.received"]'), "secret" varchar(255), "headers" text NOT NULL DEFAULT ('{}'), "active" boolean NOT NULL DEFAULT (1), "retryCount" integer NOT NULL DEFAULT (3), "lastTriggeredAt" datetime, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')))`,+ );+ await queryRunner.query(+ `INSERT INTO "webhooks"("id", "sessionId", "url", "events", "secret", "headers", "active", "retryCount", "lastTriggeredAt", "createdAt", "updatedAt") SELECT "id", "sessionId", "url", "events", "secret", "headers", "active", "retryCount", "lastTriggeredAt", "createdAt", "updatedAt" FROM "temporary_webhooks"`,+ );+ await queryRunner.query(`DROP TABLE "temporary_webhooks"`);+ await queryRunner.query(`DROP INDEX "IDX_c69efb19bf127c97e6740ad530"`);+ await queryRunner.query(`DROP INDEX "IDX_dd2b6e43c767b6b5b2bb227ace"`);+ await queryRunner.query(`DROP INDEX "IDX_741fa976d1e04e695f3aa23cb8"`);+ await queryRunner.query(`DROP INDEX "IDX_cee5459245f652b75eb2759b4c"`);+ await queryRunner.query(`DROP TABLE "audit_logs"`);+ await queryRunner.query(`DROP INDEX "IDX_df3b25181df0b4b59bd93f16e1"`);+ await queryRunner.query(`DROP TABLE "api_keys"`);+ await queryRunner.query(`DROP TABLE "message_batches"`);+ await queryRunner.query(`DROP INDEX "IDX_399833392126349ef0b04b9bed"`);+ await queryRunner.query(`DROP INDEX "IDX_36bc604c820bb9adc4c75cd411"`);+ await queryRunner.query(`DROP INDEX "IDX_befd307485dbf0559d17e4a4d2"`);+ await queryRunner.query(`DROP INDEX "IDX_066163c46cda7e8187f96bc87a"`);+ await queryRunner.query(`DROP TABLE "messages"`);+ await queryRunner.query(`DROP TABLE "webhooks"`);+ await queryRunner.query(`DROP TABLE "sessions"`);+ }+}diff --git a/src/engine/adapters/whatsapp-web-js.adapter.ts b/src/engine/adapters/whatsapp-web-js.adapter.tsnew file mode 100644index 000000000..89060595e--- /dev/null+++ b/src/engine/adapters/whatsapp-web-js.adapter.ts@@ -0,0 +1,970 @@+import { EventEmitter } from 'events';+import { Client, LocalAuth, MessageMedia } from 'whatsapp-web.js';+import * as qrcode from 'qrcode';+import * as path from 'path';+import {+ IWhatsAppEngine,+ EngineStatus,+ EngineEventCallbacks,+ MessageResult,+ MediaInput,+ IncomingMessage,+ Contact,+ Group,+ GroupInfo,+ GroupParticipant,+ LocationInput,+ ContactCard,+ MessageReaction,+ Label,+ Channel,+ ChannelMessage,+ Status,+ TextStatusOptions,+ StatusResult,+ Catalog,+ Product,+ ProductQueryOptions,+ PaginatedProducts,+} from '../interfaces/whatsapp-engine.interface';+import { createLogger } from '../../common/services/logger.service';++export interface WhatsAppWebJsConfig {+ sessionId: string;+ sessionDataPath: string;+ puppeteer?: {+ headless?: boolean;+ args?: string[];+ };+ // Phase 3: Proxy per session+ proxy?: {+ url: string;+ type: 'http' | 'https' | 'socks4' | 'socks5';+ };+}++export class WhatsAppWebJsAdapter extends EventEmitter implements IWhatsAppEngine {+ private client: Client | null = null;+ private status: EngineStatus = EngineStatus.DISCONNECTED;+ private qrCode: string | null = null;+ private phoneNumber: string | null = null;+ private pushName: string | null = null;+ private callbacks: EngineEventCallbacks = {};++ constructor(private readonly config: WhatsAppWebJsConfig) {+ super();+ }++ private readonly logger = createLogger('WhatsAppWebJsAdapter');++ async initialize(callbacks: EngineEventCallbacks): Promise<void> {+ this.callbacks = callbacks;+ this.setStatus(EngineStatus.INITIALIZING);++ try {+ // Build puppeteer args, including proxy if configured+ const puppeteerArgs = this.config.puppeteer?.args || [+ '--no-sandbox',+ '--disable-setuid-sandbox',+ '--disable-dev-shm-usage',+ '--disable-accelerated-2d-canvas',+ '--no-first-run',+ '--no-zygote',+ '--disable-gpu',+ ];++ // Add proxy configuration if provided+ if (this.config.proxy) {+ puppeteerArgs.push(`--proxy-server=${this.config.proxy.url}`);+ this.logger.log(+ `Using proxy: ${this.config.proxy.type}://${this.config.proxy.url.replace(/:[^:@]*@/, ':***@')}`,+ );+ }++ this.client = new Client({+ authStrategy: new LocalAuth({+ clientId: this.config.sessionId,+ dataPath: path.resolve(this.config.sessionDataPath),+ }),+ puppeteer: {+ headless: this.config.puppeteer?.headless ?? true,+ args: puppeteerArgs,+ },+ });++ this.setupEventHandlers();+ await this.client.initialize();+ } catch (error) {+ this.setStatus(EngineStatus.FAILED);+ throw error;+ }+ }++ private setupEventHandlers(): void {+ if (!this.client) return;++ // eslint-disable-next-line @typescript-eslint/no-misused-promises+ this.client.on('qr', async (qr: string) => {+ try {+ this.qrCode = await qrcode.toDataURL(qr);+ this.setStatus(EngineStatus.QR_READY);+ this.callbacks.onQRCode?.(this.qrCode);+ } catch (error) {+ this.logger.error('Error generating QR code', String(error));+ }+ });++ this.client.on('authenticated', () => {+ this.setStatus(EngineStatus.AUTHENTICATING);+ this.qrCode = null;+ });++ this.client.on('ready', () => {+ try {+ const info = this.client?.info;+ this.phoneNumber = info?.wid?.user || null;+ this.pushName = info?.pushname || null;+ this.setStatus(EngineStatus.READY);+ this.callbacks.onReady?.(this.phoneNumber || '', this.pushName || '');+ } catch (error) {+ this.logger.error('Error getting client info', String(error));+ this.setStatus(EngineStatus.READY);+ this.callbacks.onReady?.('', '');+ }+ });++ // eslint-disable-next-line @typescript-eslint/no-misused-promises+ this.client.on('message', async msg => {+ try {+ const incomingMessage: IncomingMessage = {+ id: msg.id._serialized,+ from: msg.from,+ to: msg.to,+ chatId: msg.from,+ body: msg.body,+ type: msg.type,+ timestamp: msg.timestamp,+ fromMe: msg.fromMe,+ isGroup: msg.from.endsWith('@g.us'),+ };++ // Handle media+ if (msg.hasMedia) {+ try {+ const media = await msg.downloadMedia();+ if (media) {+ incomingMessage.media = {+ mimetype: media.mimetype,+ filename: media.filename || undefined,+ data: media.data,+ };+ }+ } catch (error) {+ this.logger.error('Error downloading media', String(error));+ }+ }++ // Handle quoted message+ if (msg.hasQuotedMsg) {+ try {+ const quoted = await msg.getQuotedMessage();+ incomingMessage.quotedMessage = {+ id: quoted.id._serialized,+ body: quoted.body,+ };+ } catch (error) {+ this.logger.error('Error getting quoted message', String(error));+ }+ }++ this.callbacks.onMessage?.(incomingMessage);+ } catch (error) {+ this.logger.error('Error processing incoming message', String(error));+ }+ });++ this.client.on('message_ack', (msg, ack) => {+ this.callbacks.onMessageAck?.(msg.id._serialized, ack);+ });++ this.client.on('disconnected', reason => {+ this.setStatus(EngineStatus.DISCONNECTED);+ this.callbacks.onDisconnected?.(reason);+ });++ this.client.on('auth_failure', () => {+ this.setStatus(EngineStatus.FAILED);+ this.callbacks.onDisconnected?.('Authentication failed');+ });+ }++ private setStatus(status: EngineStatus): void {+ this.status = status;+ this.callbacks.onStateChanged?.(status);+ this.emit('stateChanged', status);+ }++ async disconnect(): Promise<void> {+ if (this.client) {+ try {+ // Use destroy instead of logout to preserve session data+ // This allows reconnecting without needing to scan QR again+ await this.client.destroy();+ } catch (error) {+ this.logger.warn('Destroy client failed:', String(error));+ // Already destroyed or not initialized - ignore+ }+ this.client = null;+ this.setStatus(EngineStatus.DISCONNECTED);+ }+ }++ async logout(): Promise<void> {+ if (this.client) {+ try {+ // Logout clears session data - user will need to scan QR again+ await this.client.logout();+ } catch (error) {+ this.logger.warn('Logout failed:', String(error));+ // Fall back to destroy if logout fails+ try {+ await this.client.destroy();+ } catch {+ // Ignore+ }+ }+ this.client = null;+ this.setStatus(EngineStatus.DISCONNECTED);+ }+ }++ async destroy(): Promise<void> {+ if (this.client) {+ await this.client.destroy();+ this.client = null;+ this.setStatus(EngineStatus.DISCONNECTED);+ }+ }++ getStatus(): EngineStatus {+ return this.status;+ }++ getQRCode(): string | null {+ return this.qrCode;+ }++ getPhoneNumber(): string | null {+ return this.phoneNumber;+ }++ getPushName(): string | null {+ return this.pushName;+ }++ async sendTextMessage(chatId: string, text: string): Promise<MessageResult> {+ this.ensureReady();+ const msg = await this.client!.sendMessage(chatId, text);+ return {+ id: msg.id._serialized,+ timestamp: msg.timestamp,+ };+ }++ async sendImageMessage(chatId: string, media: MediaInput): Promise<MessageResult> {+ return this.sendMediaMessage(chatId, media);+ }++ async sendVideoMessage(chatId: string, media: MediaInput): Promise<MessageResult> {+ return this.sendMediaMessage(chatId, media);+ }++ async sendAudioMessage(chatId: string, media: MediaInput): Promise<MessageResult> {+ return this.sendMediaMessage(chatId, media);+ }++ async sendDocumentMessage(chatId: string, media: MediaInput): Promise<MessageResult> {+ return this.sendMediaMessage(chatId, media);+ }++ private async sendMediaMessage(chatId: string, media: MediaInput): Promise<MessageResult> {+ this.ensureReady();++ let messageMedia: MessageMedia;++ if (typeof media.data === 'string') {+ if (media.data.startsWith('http://') || media.data.startsWith('https://')) {+ // URL+ messageMedia = await MessageMedia.fromUrl(media.data);+ } else {+ // Base64+ messageMedia = new MessageMedia(media.mimetype, media.data, media.filename);+ }+ } else {+ // Buffer+ messageMedia = new MessageMedia(media.mimetype, media.data.toString('base64'), media.filename);+ }++ const msg = await this.client!.sendMessage(chatId, messageMedia, {+ caption: media.caption,+ });++ return {+ id: msg.id._serialized,+ timestamp: msg.timestamp,+ };+ }++ async getContacts(): Promise<Contact[]> {+ this.ensureReady();+ const contacts = await this.client!.getContacts();++ return contacts.map(c => ({+ id: c.id._serialized,+ name: c.name || undefined,+ pushName: c.pushname || undefined,+ number: c.number,+ isMyContact: c.isMyContact,+ isBlocked: c.isBlocked,+ }));+ }++ async getContactById(contactId: string): Promise<Contact | null> {+ this.ensureReady();+ try {+ const contact = await this.client!.getContactById(contactId);+ return {+ id: contact.id._serialized,+ name: contact.name || undefined,+ pushName: contact.pushname || undefined,+ number: contact.number,+ isMyContact: contact.isMyContact,+ isBlocked: contact.isBlocked,+ };+ } catch {+ return null;+ }+ }++ async checkNumberExists(number: string): Promise<boolean> {+ this.ensureReady();+ const numberId = await this.client!.getNumberId(number);+ return numberId !== null;+ }++ async getGroups(): Promise<Group[]> {+ this.ensureReady();+ const chats = await this.client!.getChats();++ // Filter only group chats+ const groups = chats.filter(chat => chat.isGroup);++ return groups.map(g => ({+ id: g.id._serialized,+ name: g.name,+ participantsCount: (g as unknown as { participants?: unknown[] }).participants?.length,+ isAdmin: (g as unknown as { isAdmin?: boolean }).isAdmin,+ }));+ }++ // ============= Phase 3: Extended Messaging =============++ async sendLocationMessage(chatId: string, location: LocationInput): Promise<MessageResult> {+ this.ensureReady();+ // Import Location class dynamically from whatsapp-web.js+ const { Location } = await import('whatsapp-web.js');+ const loc = new Location(location.latitude, location.longitude, {+ name: location.description || '',+ address: location.address || '',+ });+ const msg = await this.client!.sendMessage(chatId, loc);+ return {+ id: msg.id._serialized,+ timestamp: msg.timestamp,+ };+ }++ async sendContactMessage(chatId: string, contact: ContactCard): Promise<MessageResult> {+ this.ensureReady();+ // Create vCard format+ const vcard = [+ 'BEGIN:VCARD',+ 'VERSION:3.0',+ `FN:${contact.name}`,+ `TEL;type=CELL;type=VOICE;waid=${contact.number}:+${contact.number}`,+ 'END:VCARD',+ ].join('\n');++ const msg = await this.client!.sendMessage(chatId, vcard, {+ parseVCards: true,+ });+ return {+ id: msg.id._serialized,+ timestamp: msg.timestamp,+ };+ }++ async sendStickerMessage(chatId: string, media: MediaInput): Promise<MessageResult> {+ this.ensureReady();+ let messageMedia: MessageMedia;++ if (typeof media.data === 'string') {+ if (media.data.startsWith('http://') || media.data.startsWith('https://')) {+ messageMedia = await MessageMedia.fromUrl(media.data);+ } else {+ messageMedia = new MessageMedia(media.mimetype, media.data, media.filename);+ }+ } else {+ messageMedia = new MessageMedia(media.mimetype, media.data.toString('base64'), media.filename);+ }++ const msg = await this.client!.sendMessage(chatId, messageMedia, {+ sendMediaAsSticker: true,+ });+ return {+ id: msg.id._serialized,+ timestamp: msg.timestamp,+ };+ }++ async replyToMessage(chatId: string, quotedMsgId: string, text: string): Promise<MessageResult> {+ this.ensureReady();+ // Find the message to quote+ const chat = await this.client!.getChatById(chatId);+ const messages = await chat.fetchMessages({ limit: 100 });+ const quotedMsg = messages.find(m => m.id._serialized === quotedMsgId);++ if (!quotedMsg) {+ throw new Error(`Message ${quotedMsgId} not found`);+ }++ const msg = await quotedMsg.reply(text);+ return {+ id: msg.id._serialized,+ timestamp: msg.timestamp,+ };+ }++ async forwardMessage(fromChatId: string, toChatId: string, messageId: string): Promise<MessageResult> {+ this.ensureReady();+ const chat = await this.client!.getChatById(fromChatId);+ const messages = await chat.fetchMessages({ limit: 100 });+ const msgToForward = messages.find(m => m.id._serialized === messageId);++ if (!msgToForward) {+ throw new Error(`Message ${messageId} not found`);+ }++ await msgToForward.forward(toChatId);+ // forward() returns void, so we generate a result based on original message+ return {+ id: `fwd_${messageId}`,+ timestamp: Date.now(),+ };+ }++ // ============= Phase 3: Group Management =============++ async getGroupInfo(groupId: string): Promise<GroupInfo | null> {+ this.ensureReady();+ try {+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ return null;+ }+ // whatsapp-web.js GroupChat type lacks full definitions+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment+ const groupChat = chat as any;+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const participants: GroupParticipant[] = (groupChat.participants || []).map((p: any) => ({+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ id: String(p.id._serialized),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ number: String(p.id.user),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ name: p.name ? String(p.name) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ isAdmin: Boolean(p.isAdmin),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ isSuperAdmin: Boolean(p.isSuperAdmin),+ }));++ return {+ id: chat.id._serialized,+ name: chat.name,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ description: groupChat.description ? String(groupChat.description) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ owner: groupChat.owner?._serialized ? String(groupChat.owner._serialized) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ createdAt: groupChat.creationAt as number | undefined,+ participants,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ isReadOnly: Boolean(groupChat.isReadOnly),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ isAnnounce: Boolean(groupChat.isAnnounce),+ };+ } catch {+ return null;+ }+ }++ async createGroup(name: string, participants: string[]): Promise<Group> {+ this.ensureReady();+ // Ensure participant IDs are in correct format+ const participantIds = participants.map(p => (p.includes('@') ? p : `${p}@c.us`));+ const result = await this.client!.createGroup(name, participantIds);++ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ const groupId = String((result as any).gid._serialized);+ return {+ id: groupId,+ name: name,+ participantsCount: participants.length,+ };+ }++ async addParticipants(groupId: string, participants: string[]): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error('Chat is not a group');+ }+ const participantIds = participants.map(p => (p.includes('@') ? p : `${p}@c.us`));+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).addParticipants(participantIds);+ }++ async removeParticipants(groupId: string, participants: string[]): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error('Chat is not a group');+ }+ const participantIds = participants.map(p => (p.includes('@') ? p : `${p}@c.us`));+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).removeParticipants(participantIds);+ }++ async promoteParticipants(groupId: string, participants: string[]): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error('Chat is not a group');+ }+ const participantIds = participants.map(p => (p.includes('@') ? p : `${p}@c.us`));+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).promoteParticipants(participantIds);+ }++ async demoteParticipants(groupId: string, participants: string[]): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error('Chat is not a group');+ }+ const participantIds = participants.map(p => (p.includes('@') ? p : `${p}@c.us`));+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).demoteParticipants(participantIds);+ }++ async leaveGroup(groupId: string): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error('Chat is not a group');+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).leave();+ }++ async setGroupSubject(groupId: string, subject: string): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error('Chat is not a group');+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).setSubject(subject);+ }++ async setGroupDescription(groupId: string, description: string): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error('Chat is not a group');+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).setDescription(description);+ }++ // Reactions (Phase 3)+ async reactToMessage(chatId: string, messageId: string, emoji: string): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(chatId);+ const messages = await chat.fetchMessages({ limit: 100 });+ const message = messages.find(m => m.id._serialized === messageId);+ if (!message) {+ throw new Error(`Message ${messageId} not found in chat ${chatId}`);+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (message as any).react(emoji);+ this.logger.log(`Reacted to message ${messageId} with ${emoji || '(removed)'}`);+ }++ async getMessageReactions(chatId: string, messageId: string): Promise<MessageReaction[]> {+ this.ensureReady();+ const chat = await this.client!.getChatById(chatId);+ const messages = await chat.fetchMessages({ limit: 100 });+ const message = messages.find(m => m.id._serialized === messageId);+ if (!message) {+ throw new Error(`Message ${messageId} not found in chat ${chatId}`);+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ if (!(message as any).hasReaction) {+ return [];+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const reactions = await (message as any).getReactions();+ if (!reactions) {+ return [];+ }+ // Map reactions to our interface format+ const result: MessageReaction[] = [];++ for (const r of reactions as Array<{+ id: string;+ senders: Array<{ senderId: string; reaction: string; timestamp: number }>;+ }>) {+ result.push({+ emoji: String(r.id),+ senders: (r.senders || []).map(s => ({+ senderId: String(s.senderId),+ emoji: String(s.reaction),+ timestamp: Number(s.timestamp),+ })),+ });+ }+ return result;+ }++ // Labels (Phase 3) - WhatsApp Business only+ async getLabels(): Promise<Label[]> {+ this.ensureReady();+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const labels = await (this.client as any).getLabels();+ if (!labels) {+ return [];+ }++ return (labels as Array<{ id: string; name: string; hexColor: string }>).map(label => ({+ id: String(label.id),+ name: String(label.name),+ hexColor: String(label.hexColor),+ }));+ }++ async getLabelById(labelId: string): Promise<Label | null> {+ this.ensureReady();+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const label = await (this.client as any).getLabelById(labelId);+ if (!label) {+ return null;+ }+ return {+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ id: String(label.id),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ name: String(label.name),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ hexColor: String(label.hexColor),+ };+ }++ async getChatLabels(chatId: string): Promise<Label[]> {+ this.ensureReady();+ const chat = await this.client!.getChatById(chatId);+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const labels = await (chat as any).getLabels();+ if (!labels) {+ return [];+ }++ return (labels as Array<{ id: string; name: string; hexColor: string }>).map(label => ({+ id: String(label.id),+ name: String(label.name),+ hexColor: String(label.hexColor),+ }));+ }++ async addLabelToChat(chatId: string, labelId: string): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(chatId);+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).addLabel(labelId);+ this.logger.log(`Added label ${labelId} to chat ${chatId}`);+ }++ async removeLabelFromChat(chatId: string, labelId: string): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(chatId);+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (chat as any).removeLabel(labelId);+ this.logger.log(`Removed label ${labelId} from chat ${chatId}`);+ }++ // Channels/Newsletter (Phase 3)+ async getSubscribedChannels(): Promise<Channel[]> {+ this.ensureReady();+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const channels = await (this.client as any).getChannels();+ if (!channels) {+ return [];+ }+ return (channels as Array<any>).map(ch => ({+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ id: String(ch.id?._serialized || ch.id),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ name: String(ch.name || ''),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ description: ch.description ? String(ch.description) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ inviteCode: ch.inviteCode ? String(ch.inviteCode) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ subscriberCount: ch.subscriberCount ? Number(ch.subscriberCount) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ verified: ch.verified ? Boolean(ch.verified) : undefined,+ }));+ }++ async getChannelById(channelId: string): Promise<Channel | null> {+ this.ensureReady();+ try {+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const ch = await (this.client as any).getChannelById(channelId);+ if (!ch) {+ return null;+ }+ return {+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ id: String(ch.id?._serialized || ch.id),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ name: String(ch.name || ''),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ description: ch.description ? String(ch.description) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ inviteCode: ch.inviteCode ? String(ch.inviteCode) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ subscriberCount: ch.subscriberCount ? Number(ch.subscriberCount) : undefined,+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ verified: ch.verified ? Boolean(ch.verified) : undefined,+ };+ } catch {+ return null;+ }+ }++ async subscribeToChannel(inviteCode: string): Promise<Channel> {+ this.ensureReady();+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const ch = await (this.client as any).subscribeToChannel(inviteCode);+ this.logger.log(`Subscribed to channel with invite code: ${inviteCode}`);+ return {+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ id: String(ch.id?._serialized || ch.id),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ name: String(ch.name || ''),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ description: ch.description ? String(ch.description) : undefined,+ };+ }++ async unsubscribeFromChannel(channelId: string): Promise<void> {+ this.ensureReady();+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call+ await (this.client as any).unsubscribeFromChannel(channelId);+ this.logger.log(`Unsubscribed from channel: ${channelId}`);+ }++ async getChannelMessages(channelId: string, limit: number = 50): Promise<ChannelMessage[]> {+ this.ensureReady();+ try {+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const ch = await (this.client as any).getChannelById(channelId);+ if (!ch) {+ throw new Error(`Channel ${channelId} not found`);+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const messages = await ch.fetchMessages({ limit });+ if (!messages) {+ return [];+ }+ return (messages as Array<any>).map(msg => ({+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ id: String(msg.id?._serialized || msg.id),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ body: String(msg.body || ''),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ timestamp: Number(msg.timestamp),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ hasMedia: Boolean(msg.hasMedia),+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access+ mediaUrl: msg.mediaUrl ? String(msg.mediaUrl) : undefined,+ }));+ } catch (error) {+ this.logger.error(`Failed to get channel messages: ${String(error)}`);+ return [];+ }+ }++ // ========== Gap Quick Wins Implementation ==========++ // Delete Message+ async deleteMessage(chatId: string, messageId: string, forEveryone: boolean = true): Promise<void> {+ this.ensureReady();+ const chat = await this.client!.getChatById(chatId);+ const messages = await chat.fetchMessages({ limit: 100 });+ const message = messages.find(m => m.id._serialized === messageId || m.id.id === messageId);+ if (!message) {+ throw new Error(`Message ${messageId} not found in chat ${chatId}`);+ }+ await message.delete(forEveryone);+ this.logger.log(`Deleted message ${messageId} from chat ${chatId} (forEveryone: ${forEveryone})`);+ }++ // Get Profile Picture+ async getProfilePicture(contactId: string): Promise<string | null> {+ this.ensureReady();+ try {+ const url = await this.client!.getProfilePicUrl(contactId);+ return url || null;+ } catch (error) {+ this.logger.warn(`Failed to get profile picture for ${contactId}: ${String(error)}`);+ return null;+ }+ }++ // Block Contact+ async blockContact(contactId: string): Promise<void> {+ this.ensureReady();+ const contact = await this.client!.getContactById(contactId);+ await contact.block();+ this.logger.log(`Blocked contact ${contactId}`);+ }++ // Unblock Contact+ async unblockContact(contactId: string): Promise<void> {+ this.ensureReady();+ const contact = await this.client!.getContactById(contactId);+ await contact.unblock();+ this.logger.log(`Unblocked contact ${contactId}`);+ }++ // Get Group Invite Code+ async getGroupInviteCode(groupId: string): Promise<string> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error(`${groupId} is not a group`);+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const inviteCode = await (chat as any).getInviteCode();+ this.logger.log(`Got invite code for group ${groupId}`);+ return String(inviteCode);+ }++ // Revoke Group Invite Code+ async revokeGroupInviteCode(groupId: string): Promise<string> {+ this.ensureReady();+ const chat = await this.client!.getChatById(groupId);+ if (!chat.isGroup) {+ throw new Error(`${groupId} is not a group`);+ }+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment+ const newCode = await (chat as any).revokeInvite();+ this.logger.log(`Revoked invite code for group ${groupId}, new code generated`);+ return String(newCode);+ }++ // ========== Status/Stories (Phase 3) ==========+ // Note: These are stub implementations - whatsapp-web.js has limited Status API support+ /* eslint-disable @typescript-eslint/require-await, @typescript-eslint/no-unused-vars */++ async getContactStatuses(): Promise<Status[]> {+ this.ensureReady();+ // whatsapp-web.js has limited Status API support+ // This is a stub that can be enhanced when the library adds support+ this.logger.warn('getContactStatuses not fully implemented in whatsapp-web.js');+ return [];+ }++ async getContactStatus(_contactId: string): Promise<Status[]> {+ this.ensureReady();+ this.logger.warn('getContactStatus not fully implemented in whatsapp-web.js');+ return [];+ }++ async postTextStatus(_text: string, _options?: TextStatusOptions): Promise<StatusResult> {+ this.ensureReady();+ // whatsapp-web.js doesn't have native status posting+ // This would require using the underlying WhatsApp Web API directly+ throw new Error('postTextStatus not yet implemented in whatsapp-web.js adapter');+ }++ async postImageStatus(_media: MediaInput, _caption?: string): Promise<StatusResult> {+ this.ensureReady();+ throw new Error('postImageStatus not yet implemented in whatsapp-web.js adapter');+ }++ async postVideoStatus(_media: MediaInput, _caption?: string): Promise<StatusResult> {+ this.ensureReady();+ throw new Error('postVideoStatus not yet implemented in whatsapp-web.js adapter');+ }++ async deleteStatus(_statusId: string): Promise<void> {+ this.ensureReady();+ throw new Error('deleteStatus not yet implemented in whatsapp-web.js adapter');+ }++ // ========== Catalog (Phase 3) ==========++ async getCatalog(): Promise<Catalog | null> {+ this.ensureReady();+ // whatsapp-web.js doesn't have native Catalog API support+ this.logger.warn('getCatalog not implemented in whatsapp-web.js adapter');+ return null;+ }++ async getProducts(_options?: ProductQueryOptions): Promise<PaginatedProducts> {+ this.ensureReady();+ this.logger.warn('getProducts not implemented in whatsapp-web.js adapter');+ return {+ products: [],+ pagination: { page: 1, limit: 20, total: 0, totalPages: 0 },+ };+ }++ async getProduct(_productId: string): Promise<Product | null> {+ this.ensureReady();+ this.logger.warn('getProduct not implemented in whatsapp-web.js adapter');+ return null;+ }++ async sendProduct(_chatId: string, _productId: string, _body?: string): Promise<MessageResult> {+ this.ensureReady();+ throw new Error('sendProduct not yet implemented in whatsapp-web.js adapter');+ }++ async sendCatalog(_chatId: string, _body?: string): Promise<MessageResult> {+ this.ensureReady();+ throw new Error('sendCatalog not yet implemented in whatsapp-web.js adapter');+ }++ /* eslint-enable @typescript-eslint/require-await, @typescript-eslint/no-unused-vars */++ private ensureReady(): void {+ if (this.status !== EngineStatus.READY || !this.client) {+ throw new Error('WhatsApp client is not ready');+ }+ }+}diff --git a/src/engine/engine.factory.ts b/src/engine/engine.factory.tsnew file mode 100644index 000000000..a19e3d5b4--- /dev/null+++ b/src/engine/engine.factory.ts@@ -0,0 +1,134 @@+import { Injectable, OnModuleInit } from '@nestjs/common';+import { ConfigService } from '@nestjs/config';+import { IWhatsAppEngine } from './interfaces/whatsapp-engine.interface';+import { WhatsAppWebJsAdapter } from './adapters/whatsapp-web-js.adapter';+import { PluginLoaderService, PluginType, IEnginePlugin, PluginManifest } from '../core/plugins';+import { WhatsAppWebJsPlugin } from '../plugins/engines/whatsapp-web-js';+import { createLogger } from '../common/services/logger.service';++export interface EngineCreateOptions {+ sessionId: string;+ proxyUrl?: string;+ proxyType?: 'http' | 'https' | 'socks4' | 'socks5';+}++@Injectable()+export class EngineFactory implements OnModuleInit {+ private readonly logger = createLogger('EngineFactory');+ private readonly engineType: string;++ constructor(+ private readonly configService: ConfigService,+ private readonly pluginLoader: PluginLoaderService,+ ) {+ this.engineType = this.configService.get<string>('engine.type') ?? 'whatsapp-web.js';+ }++ async onModuleInit(): Promise<void> {+ // Register built-in engine plugins+ await this.registerBuiltInEngines();+ }++ private async registerBuiltInEngines(): Promise<void> {+ // Register WhatsApp-web.js as built-in plugin+ const wwjsManifest: PluginManifest = {+ id: 'whatsapp-web.js',+ name: 'WhatsApp Web.js Engine',+ version: '1.0.0',+ type: PluginType.ENGINE,+ description: 'Official WhatsApp-web.js engine adapter',+ main: 'index.ts',+ provides: ['whatsapp-engine'],+ };++ const wwjsPlugin = new WhatsAppWebJsPlugin();+ this.pluginLoader.registerBuiltInPlugin(wwjsManifest, wwjsPlugin);++ // Auto-enable the configured engine+ try {+ await this.pluginLoader.enablePlugin(this.engineType);+ this.logger.log(`Engine plugin enabled: ${this.engineType}`, {+ action: 'engine_enabled',+ engineType: this.engineType,+ });+ } catch (error) {+ this.logger.error(+ `Failed to enable engine plugin: ${this.engineType}`,+ error instanceof Error ? error.message : String(error),+ { action: 'engine_enable_failed' },+ );+ }+ }++ create(options: EngineCreateOptions): IWhatsAppEngine {+ // Try to get engine from plugin system+ const enginePlugin = this.pluginLoader.getPlugin(this.engineType);++ if (enginePlugin?.instance && this.isEnginePlugin(enginePlugin.instance)) {+ return enginePlugin.instance.createEngine({+ sessionId: options.sessionId,+ proxyUrl: options.proxyUrl,+ proxyType: options.proxyType,+ }) as IWhatsAppEngine;+ }++ // Fallback to direct adapter creation (legacy support)+ this.logger.warn(`Engine plugin ${this.engineType} not available, using fallback`, {+ action: 'engine_fallback',+ });++ return this.createFallbackEngine(options);+ }++ private isEnginePlugin(instance: unknown): instance is IEnginePlugin {+ return (+ typeof instance === 'object' &&+ instance !== null &&+ 'type' in instance &&+ (instance as { type: unknown }).type === PluginType.ENGINE &&+ 'createEngine' in instance &&+ typeof (instance as { createEngine: unknown }).createEngine === 'function'+ );+ }++ private createFallbackEngine(options: EngineCreateOptions): IWhatsAppEngine {+ // Legacy direct creation (fallback)+ return new WhatsAppWebJsAdapter({+ sessionId: options.sessionId,+ sessionDataPath: this.configService.get<string>('engine.sessionDataPath') ?? './data/sessions',+ puppeteer: {+ headless: this.configService.get<boolean>('engine.puppeteer.headless') ?? true,+ args: this.configService.get<string[]>('engine.puppeteer.args') ?? ['--no-sandbox', '--disable-setuid-sandbox'],+ },+ proxy: options.proxyUrl+ ? {+ url: options.proxyUrl,+ type: options.proxyType ?? 'http',+ }+ : undefined,+ });+ }++ // ============================================================================+ // Query Methods for API/Dashboard+ // ============================================================================++ getAvailableEngines(): Array<{ id: string; name: string; enabled: boolean; features: string[] }> {+ const enginePlugins = this.pluginLoader.getPluginsByType(PluginType.ENGINE);++ return enginePlugins.map(plugin => {+ const features = plugin.instance && this.isEnginePlugin(plugin.instance) ? plugin.instance.getFeatures() : [];++ return {+ id: plugin.manifest.id,+ name: plugin.manifest.name,+ enabled: this.pluginLoader.isPluginEnabled(plugin.manifest.id),+ features,+ };+ });+ }++ getCurrentEngine(): string {+ return this.engineType;+ }+}diff --git a/src/engine/engine.module.ts b/src/engine/engine.module.tsnew file mode 100644index 000000000..caf1485ae--- /dev/null+++ b/src/engine/engine.module.ts@@ -0,0 +1,9 @@+import { Global, Module } from '@nestjs/common';+import { EngineFactory } from './engine.factory';++@Global()+@Module({+ providers: [EngineFactory],+ exports: [EngineFactory],+})+export class EngineModule {}diff --git a/src/engine/interfaces/whatsapp-engine.interface.ts b/src/engine/interfaces/whatsapp-engine.interface.tsnew file mode 100644index 000000000..f3e5de621--- /dev/null+++ b/src/engine/interfaces/whatsapp-engine.interface.ts@@ -0,0 +1,296 @@+// WhatsApp Engine Interface - Abstract layer for WA engines++export enum EngineStatus {+ DISCONNECTED = 'disconnected',+ INITIALIZING = 'initializing',+ QR_READY = 'qr_ready',+ AUTHENTICATING = 'authenticating',+ READY = 'ready',+ FAILED = 'failed',+}++export interface MessageResult {+ id: string;+ timestamp: number;+ ack?: number;+}++export interface MediaInput {+ mimetype: string;+ data: Buffer | string; // Buffer or base64 or URL+ filename?: string;+ caption?: string;+}++export interface IncomingMessage {+ id: string;+ from: string;+ to: string;+ chatId: string;+ body: string;+ type: string;+ timestamp: number;+ fromMe: boolean;+ isGroup: boolean;+ media?: {+ mimetype: string;+ filename?: string;+ data?: string; // base64+ };+ quotedMessage?: {+ id: string;+ body: string;+ };+}++export interface Contact {+ id: string;+ name?: string;+ pushName?: string;+ number: string;+ isMyContact: boolean;+ isBlocked: boolean;+ profilePicUrl?: string;+}++export interface Group {+ id: string;+ name: string;+ participantsCount?: number;+ isAdmin?: boolean;+}++export interface GroupParticipant {+ id: string;+ number: string;+ name?: string;+ isAdmin: boolean;+ isSuperAdmin: boolean;+}++export interface GroupInfo {+ id: string;+ name: string;+ description?: string;+ owner?: string;+ createdAt?: number;+ participants: GroupParticipant[];+ isReadOnly?: boolean;+ isAnnounce?: boolean;+}++export interface ContactCard {+ name: string;+ number: string;+}++export interface LocationInput {+ latitude: number;+ longitude: number;+ description?: string;+ address?: string;+}++export interface ReactionSender {+ senderId: string;+ emoji: string;+ timestamp: number;+}++export interface MessageReaction {+ emoji: string;+ senders: ReactionSender[];+}++// Phase 3: Labels (WhatsApp Business)+export interface Label {+ id: string;+ name: string;+ hexColor: string;+}++// Phase 3: Status/Stories+export interface Status {+ id: string;+ contact: {+ id: string;+ name?: string;+ pushName?: string;+ };+ type: 'text' | 'image' | 'video';+ caption?: string;+ mediaUrl?: string;+ backgroundColor?: string;+ font?: number;+ timestamp: Date;+ expiresAt: Date;+}++export interface TextStatusOptions {+ backgroundColor?: string;+ font?: number;+}++export interface StatusResult {+ statusId: string;+ timestamp: Date;+ expiresAt: Date;+}++// Phase 3: Channels/Newsletter+export interface Channel {+ id: string;+ name: string;+ description?: string;+ inviteCode?: string;+ subscriberCount?: number;+ picture?: string;+ verified?: boolean;+ createdAt?: number;+}++export interface ChannelMessage {+ id: string;+ body: string;+ timestamp: number;+ hasMedia: boolean;+ mediaUrl?: string;+}++// Phase 3: Catalog (WhatsApp Business)+export interface Catalog {+ id: string;+ name: string;+ description?: string;+ productCount: number;+ url: string;+}++export interface Product {+ id: string;+ name: string;+ description?: string;+ price: number;+ currency: string;+ priceFormatted: string;+ imageUrl?: string;+ url: string;+ isAvailable: boolean;+ retailerId?: string;+}++export interface ProductQueryOptions {+ page?: number;+ limit?: number;+}++export interface PaginatedProducts {+ products: Product[];+ pagination: {+ page: number;+ limit: number;+ total: number;+ totalPages: number;+ };+}++export interface EngineEventCallbacks {+ onQRCode?: (qr: string) => void;+ onReady?: (phone: string, pushName: string) => void;+ onMessage?: (message: IncomingMessage) => void;+ onMessageAck?: (messageId: string, ack: number) => void;+ onDisconnected?: (reason: string) => void;+ onStateChanged?: (state: EngineStatus) => void;+}++export interface IWhatsAppEngine {+ // Lifecycle+ initialize(callbacks: EngineEventCallbacks): Promise<void>;+ disconnect(): Promise<void>; // Closes browser but keeps session (can reconnect without QR)+ logout(): Promise<void>; // Logs out and clears session data (requires QR scan again)+ destroy(): Promise<void>;++ // Status+ getStatus(): EngineStatus;+ getQRCode(): string | null;+ getPhoneNumber(): string | null;+ getPushName(): string | null;++ // Messaging - Basic+ sendTextMessage(chatId: string, text: string): Promise<MessageResult>;+ sendImageMessage(chatId: string, media: MediaInput): Promise<MessageResult>;+ sendVideoMessage(chatId: string, media: MediaInput): Promise<MessageResult>;+ sendAudioMessage(chatId: string, media: MediaInput): Promise<MessageResult>;+ sendDocumentMessage(chatId: string, media: MediaInput): Promise<MessageResult>;++ // Messaging - Extended (Phase 3)+ sendLocationMessage(chatId: string, location: LocationInput): Promise<MessageResult>;+ sendContactMessage(chatId: string, contact: ContactCard): Promise<MessageResult>;+ sendStickerMessage(chatId: string, media: MediaInput): Promise<MessageResult>;++ // Reply & Forward+ replyToMessage(chatId: string, quotedMsgId: string, text: string): Promise<MessageResult>;+ forwardMessage(fromChatId: string, toChatId: string, messageId: string): Promise<MessageResult>;++ // Reactions (Phase 3)+ reactToMessage(chatId: string, messageId: string, emoji: string): Promise<void>;+ getMessageReactions(chatId: string, messageId: string): Promise<MessageReaction[]>;++ // Contacts+ getContacts(): Promise<Contact[]>;+ getContactById(contactId: string): Promise<Contact | null>;+ checkNumberExists(number: string): Promise<boolean>;++ // Groups - Basic+ getGroups(): Promise<Group[]>;++ // Groups - Extended (Phase 3)+ getGroupInfo(groupId: string): Promise<GroupInfo | null>;+ createGroup(name: string, participants: string[]): Promise<Group>;+ addParticipants(groupId: string, participants: string[]): Promise<void>;+ removeParticipants(groupId: string, participants: string[]): Promise<void>;+ promoteParticipants(groupId: string, participants: string[]): Promise<void>;+ demoteParticipants(groupId: string, participants: string[]): Promise<void>;+ leaveGroup(groupId: string): Promise<void>;+ setGroupSubject(groupId: string, subject: string): Promise<void>;+ setGroupDescription(groupId: string, description: string): Promise<void>;+ getGroupInviteCode(groupId: string): Promise<string>;+ revokeGroupInviteCode(groupId: string): Promise<string>;++ // Message Operations+ deleteMessage(chatId: string, messageId: string, forEveryone?: boolean): Promise<void>;++ // Contact Extended Operations+ getProfilePicture(contactId: string): Promise<string | null>;+ blockContact(contactId: string): Promise<void>;+ unblockContact(contactId: string): Promise<void>;++ // Labels (Phase 3) - WhatsApp Business only+ getLabels(): Promise<Label[]>;+ getLabelById(labelId: string): Promise<Label | null>;+ getChatLabels(chatId: string): Promise<Label[]>;+ addLabelToChat(chatId: string, labelId: string): Promise<void>;+ removeLabelFromChat(chatId: string, labelId: string): Promise<void>;++ // Channels/Newsletter (Phase 3)+ getSubscribedChannels(): Promise<Channel[]>;+ getChannelById(channelId: string): Promise<Channel | null>;+ subscribeToChannel(inviteCode: string): Promise<Channel>;+ unsubscribeFromChannel(channelId: string): Promise<void>;+ getChannelMessages(channelId: string, limit?: number): Promise<ChannelMessage[]>;++ // Status/Stories (Phase 3)+ getContactStatuses(): Promise<Status[]>;+ getContactStatus(contactId: string): Promise<Status[]>;+ postTextStatus(text: string, options?: TextStatusOptions): Promise<StatusResult>;+ postImageStatus(media: MediaInput, caption?: string): Promise<StatusResult>;+ postVideoStatus(media: MediaInput, caption?: string): Promise<StatusResult>;+ deleteStatus(statusId: string): Promise<void>;++ // Catalog (Phase 3) - WhatsApp Business only+ getCatalog(): Promise<Catalog | null>;+ getProducts(options?: ProductQueryOptions): Promise<PaginatedProducts>;+ getProduct(productId: string): Promise<Product | null>;+ sendProduct(chatId: string, productId: string, body?: string): Promise<MessageResult>;+ sendCatalog(chatId: string, body?: string): Promise<MessageResult>;+}diff --git a/src/main.ts b/src/main.tsnew file mode 100644index 000000000..e6042ed4c--- /dev/null+++ b/src/main.ts@@ -0,0 +1,255 @@+import { NestFactory } from '@nestjs/core';+import { ValidationPipe } from '@nestjs/common';+import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';+import helmet from 'helmet';+import { AppModule } from './app.module';+import * as dotenv from 'dotenv';+import * as fs from 'fs';+import * as path from 'path';+import Docker from 'dockerode';++// Configuration loading:+// 1. If data/.env.generated exists, load it (persisted config from dashboard)+// 2. If not, create it with minimal defaults (first run)+// 3. .env.generated is the single source of truth+const generatedEnvPath = path.resolve(process.cwd(), 'data', '.env.generated');++// Ensure data directory exists+const dataDir = path.dirname(generatedEnvPath);+if (!fs.existsSync(dataDir)) {+ fs.mkdirSync(dataDir, { recursive: true });+}++if (fs.existsSync(generatedEnvPath)) {+ console.log('[Bootstrap] Loading saved configuration from:', generatedEnvPath);+ dotenv.config({ path: generatedEnvPath, override: true });+} else {+ console.log('[Bootstrap] First run detected, creating default configuration...');+ // Create minimal .env.generated with sensible defaults+ const minimalConfig = `# OpenWA Configuration+# Generated automatically on first run+# Edit via Dashboard > Infrastructure or modify this file directly++# Database (SQLite - no external service required)+DATABASE_TYPE=sqlite+POSTGRES_BUILTIN=false++# Redis & Queue (disabled by default)+REDIS_ENABLED=false+REDIS_BUILTIN=false+QUEUE_ENABLED=false++# Storage (Local filesystem)+STORAGE_TYPE=local+MINIO_BUILTIN=false+STORAGE_PATH=./data/media++# Docker Profiles: none (minimal setup)+`;+ fs.writeFileSync(generatedEnvPath, minimalConfig);+ console.log('[Bootstrap] Created default configuration at:', generatedEnvPath);+ dotenv.config({ path: generatedEnvPath, override: true });+}++// Pre-bootstrap PostgreSQL container if built-in is enabled+// This runs BEFORE NestJS starts so TypeORM can connect+async function preBootstrapPostgres(): Promise<void> {+ if (process.env.POSTGRES_BUILTIN !== 'true') {+ return; // Not using built-in PostgreSQL+ }++ console.log('[Pre-Bootstrap] PostgreSQL built-in enabled, ensuring container is ready...');++ const docker = new Docker({ socketPath: '/var/run/docker.sock' });+ const containerName = 'openwa-postgres';+ const networkName = 'openwa-network';++ try {+ // Check if container exists+ const containers = await docker.listContainers({ all: true });+ const existing = containers.find(c => c.Names.includes(`/${containerName}`));++ if (existing) {+ if (existing.State === 'running') {+ console.log('[Pre-Bootstrap] PostgreSQL container already running');+ } else {+ // Start existing container+ const container = docker.getContainer(existing.Id);+ await container.start();+ console.log('[Pre-Bootstrap] Started existing PostgreSQL container');+ }+ } else {+ // Create and start new container+ console.log('[Pre-Bootstrap] Creating PostgreSQL container...');++ // Ensure network exists+ const networks = await docker.listNetworks();+ if (!networks.find(n => n.Name === networkName)) {+ await docker.createNetwork({ Name: networkName });+ }++ // Ensure volume exists+ const volumes = await docker.listVolumes();+ if (!volumes.Volumes?.find(v => v.Name === 'openwa_postgres-data')) {+ await docker.createVolume({ Name: 'openwa_postgres-data' });+ }++ // Create container+ const container = await docker.createContainer({+ name: containerName,+ Image: 'postgres:16-alpine',+ Env: ['POSTGRES_USER=openwa', 'POSTGRES_PASSWORD=openwa', 'POSTGRES_DB=openwa'],+ Labels: {+ 'com.openwa.service': 'database',+ 'com.openwa.builtin': 'true',+ },+ HostConfig: {+ NetworkMode: networkName,+ RestartPolicy: { Name: 'unless-stopped' },+ Binds: ['openwa_postgres-data:/var/lib/postgresql/data'],+ },+ Healthcheck: {+ Test: ['CMD-SHELL', 'pg_isready -U openwa'],+ Interval: 5000000000, // 5s+ Timeout: 3000000000, // 3s+ Retries: 5,+ },+ NetworkingConfig: {+ EndpointsConfig: {+ [networkName]: {+ Aliases: ['postgres', 'openwa-postgres'],+ },+ },+ },+ });++ await container.start();+ console.log('[Pre-Bootstrap] PostgreSQL container created and started');+ }++ // Wait for PostgreSQL to be healthy (max 60 seconds)+ console.log('[Pre-Bootstrap] Waiting for PostgreSQL to be healthy...');+ const maxWaitMs = 60000;+ const startTime = Date.now();++ while (Date.now() - startTime < maxWaitMs) {+ const containerInfo = await docker.getContainer(containerName).inspect();+ const health = containerInfo.State?.Health?.Status;++ if (health === 'healthy') {+ console.log('[Pre-Bootstrap] PostgreSQL is healthy and ready!');+ return;+ }++ if (health === 'unhealthy') {+ throw new Error('PostgreSQL container became unhealthy');+ }++ // Wait 2 seconds before next check+ await new Promise(resolve => setTimeout(resolve, 2000));+ }++ throw new Error('PostgreSQL health check timeout after 60s');+ } catch (error) {+ console.error('[Pre-Bootstrap] PostgreSQL orchestration failed:', error);+ throw error;+ }+}++async function bootstrap() {+ // Pre-bootstrap: ensure PostgreSQL is ready before NestJS starts+ await preBootstrapPostgres();++ const app = await NestFactory.create(AppModule);++ // Enhanced Security Headers (Phase 3 Security Audit)+ app.use(+ helmet({+ contentSecurityPolicy: {+ directives: {+ defaultSrc: ["'self'"],+ styleSrc: ["'self'", "'unsafe-inline'"],+ scriptSrc: ["'self'"],+ imgSrc: ["'self'", 'data:', 'https:'],+ connectSrc: ["'self'"],+ fontSrc: ["'self'"],+ objectSrc: ["'none'"],+ upgradeInsecureRequests: process.env.NODE_ENV === 'production' ? [] : null,+ },+ },+ hsts: {+ maxAge: 31536000,+ includeSubDomains: true,+ preload: true,+ },+ noSniff: true,+ referrerPolicy: { policy: 'strict-origin-when-cross-origin' },+ // Disable for API usage+ crossOriginResourcePolicy: { policy: 'cross-origin' },+ }),+ );++ // CORS Configuration (Phase 3 Security Audit)+ const allowedOrigins = process.env.CORS_ORIGINS?.split(',').map(o => o.trim()) || ['*'];+ app.enableCors({+ origin: (origin: string | undefined, callback: (err: Error | null, allow?: boolean) => void) => {+ // Allow requests with no origin (mobile apps, Postman, server-to-server)+ if (!origin) return callback(null, true);++ // Check if wildcard or origin matches+ if (allowedOrigins.includes('*') || allowedOrigins.includes(origin)) {+ callback(null, true);+ } else {+ callback(new Error('Not allowed by CORS'));+ }+ },+ credentials: true,+ methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],+ allowedHeaders: ['Content-Type', 'X-API-Key', 'Authorization', 'X-Request-ID'],+ exposedHeaders: ['X-RateLimit-Limit', 'X-RateLimit-Remaining', 'X-RateLimit-Reset'],+ maxAge: 86400, // 24 hours+ });++ // Global prefix+ app.setGlobalPrefix('api');++ // Enhanced Validation pipe with security options+ app.useGlobalPipes(+ new ValidationPipe({+ whitelist: true, // Strip properties not in DTO+ forbidNonWhitelisted: true, // Throw error on unknown properties+ transform: true,+ transformOptions: {+ enableImplicitConversion: true,+ },+ disableErrorMessages: process.env.NODE_ENV === 'production', // Hide details in prod+ }),+ );++ // Swagger documentation+ const config = new DocumentBuilder()+ .setTitle('OpenWA API')+ .setDescription('Open Source WhatsApp API Gateway - Free, Self-Hosted HTTP API')+ .setVersion('0.1.0')+ .addApiKey({ type: 'apiKey', name: 'X-API-Key', in: 'header' }, 'X-API-Key')+ .addTag('sessions', 'WhatsApp session management')+ .addTag('messages', 'Send and manage messages')+ .addTag('webhooks', 'Webhook configuration')+ .addTag('contacts', 'Contact management')+ .addTag('groups', 'Group management')+ .addTag('labels', 'Label management (WhatsApp Business)')+ .addTag('channels', 'Channel/Newsletter management')+ .addTag('health', 'Health check endpoints')+ .build();++ const document = SwaggerModule.createDocument(app, config);+ SwaggerModule.setup('api/docs', app, document);++ const port = process.env.PORT || 2785;+ await app.listen(port);++ console.log(`🚀 OpenWA is running on: http://localhost:${port}`);+ console.log(`📚 Swagger docs: http://localhost:${port}/api/docs`);+}++void bootstrap();diff --git a/src/modules/audit/audit.controller.ts b/src/modules/audit/audit.controller.tsnew file mode 100644index 000000000..39b7a8742--- /dev/null+++ b/src/modules/audit/audit.controller.ts@@ -0,0 +1,41 @@+import { Controller, Get, Query } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiQuery } from '@nestjs/swagger';+import { AuditService, AuditQueryOptions } from './audit.service';+import { AuditLog, AuditAction, AuditSeverity } from './entities/audit-log.entity';++@ApiTags('audit')+@Controller('audit')+export class AuditController {+ constructor(private readonly auditService: AuditService) {}++ @Get()+ @ApiOperation({ summary: 'List audit logs with optional filters' })+ @ApiQuery({ name: 'action', required: false, enum: AuditAction })+ @ApiQuery({ name: 'severity', required: false, enum: AuditSeverity })+ @ApiQuery({ name: 'sessionId', required: false })+ @ApiQuery({ name: 'apiKeyId', required: false })+ @ApiQuery({ name: 'limit', required: false, type: Number })+ @ApiQuery({ name: 'offset', required: false, type: Number })+ @ApiResponse({+ status: 200,+ description: 'Paginated list of audit logs',+ })+ async findAll(+ @Query('action') action?: AuditAction,+ @Query('severity') severity?: AuditSeverity,+ @Query('sessionId') sessionId?: string,+ @Query('apiKeyId') apiKeyId?: string,+ @Query('limit') limit?: string,+ @Query('offset') offset?: string,+ ): Promise<{ data: AuditLog[]; total: number }> {+ const options: AuditQueryOptions = {};+ if (action) options.action = action;+ if (severity) options.severity = severity;+ if (sessionId) options.sessionId = sessionId;+ if (apiKeyId) options.apiKeyId = apiKeyId;+ if (limit) options.limit = parseInt(limit, 10);+ if (offset) options.offset = parseInt(offset, 10);++ return this.auditService.findAll(options);+ }+}diff --git a/src/modules/audit/audit.module.ts b/src/modules/audit/audit.module.tsnew file mode 100644index 000000000..992a13ba0--- /dev/null+++ b/src/modules/audit/audit.module.ts@@ -0,0 +1,14 @@+import { Module, Global } from '@nestjs/common';+import { TypeOrmModule } from '@nestjs/typeorm';+import { AuditLog } from './entities/audit-log.entity';+import { AuditService } from './audit.service';+import { AuditController } from './audit.controller';++@Global()+@Module({+ imports: [TypeOrmModule.forFeature([AuditLog], 'main')],+ controllers: [AuditController],+ providers: [AuditService],+ exports: [AuditService],+})+export class AuditModule {}diff --git a/src/modules/audit/audit.service.ts b/src/modules/audit/audit.service.tsnew file mode 100644index 000000000..cc4a85cb1--- /dev/null+++ b/src/modules/audit/audit.service.ts@@ -0,0 +1,125 @@+import { Injectable } from '@nestjs/common';+import { InjectRepository } from '@nestjs/typeorm';+import { Repository, Between, LessThan } from 'typeorm';+import { AuditLog, AuditAction, AuditSeverity } from './entities/audit-log.entity';+import { ApiKey } from '../auth/entities/api-key.entity';++interface AuditContext {+ apiKey?: ApiKey;+ sessionId?: string;+ sessionName?: string;+ ipAddress?: string;+ userAgent?: string;+ method?: string;+ path?: string;+ statusCode?: number;+ metadata?: Record<string, unknown>;+ errorMessage?: string;+}++export interface AuditQueryOptions {+ action?: AuditAction;+ apiKeyId?: string;+ sessionId?: string;+ severity?: AuditSeverity;+ startDate?: Date;+ endDate?: Date;+ limit?: number;+ offset?: number;+}++@Injectable()+export class AuditService {+ constructor(+ @InjectRepository(AuditLog, 'main')+ private readonly auditRepository: Repository<AuditLog>,+ ) {}++ async log(+ action: AuditAction,+ context: AuditContext = {},+ severity: AuditSeverity = AuditSeverity.INFO,+ ): Promise<AuditLog> {+ const auditLog = this.auditRepository.create({+ action,+ severity,+ apiKeyId: context.apiKey?.id || null,+ apiKeyName: context.apiKey?.name || null,+ sessionId: context.sessionId || null,+ sessionName: context.sessionName || null,+ ipAddress: context.ipAddress || null,+ userAgent: context.userAgent || null,+ method: context.method || null,+ path: context.path || null,+ statusCode: context.statusCode || null,+ metadata: context.metadata || null,+ errorMessage: context.errorMessage || null,+ });++ return this.auditRepository.save(auditLog);+ }++ async logInfo(action: AuditAction, context: AuditContext = {}): Promise<AuditLog> {+ return this.log(action, context, AuditSeverity.INFO);+ }++ async logWarn(action: AuditAction, context: AuditContext = {}): Promise<AuditLog> {+ return this.log(action, context, AuditSeverity.WARN);+ }++ async logError(action: AuditAction, context: AuditContext = {}): Promise<AuditLog> {+ return this.log(action, context, AuditSeverity.ERROR);+ }++ async findAll(options: AuditQueryOptions = {}): Promise<{+ data: AuditLog[];+ total: number;+ }> {+ const where: Record<string, unknown> = {};++ if (options.action) where.action = options.action;+ if (options.apiKeyId) where.apiKeyId = options.apiKeyId;+ if (options.sessionId) where.sessionId = options.sessionId;+ if (options.severity) where.severity = options.severity;++ if (options.startDate && options.endDate) {+ where.createdAt = Between(options.startDate, options.endDate);+ }++ const [data, total] = await this.auditRepository.findAndCount({+ where,+ order: { createdAt: 'DESC' },+ take: options.limit || 50,+ skip: options.offset || 0,+ });++ return { data, total };+ }++ async getRecentByApiKey(apiKeyId: string, limit = 10): Promise<AuditLog[]> {+ return this.auditRepository.find({+ where: { apiKeyId },+ order: { createdAt: 'DESC' },+ take: limit,+ });+ }++ async getRecentBySession(sessionId: string, limit = 10): Promise<AuditLog[]> {+ return this.auditRepository.find({+ where: { sessionId },+ order: { createdAt: 'DESC' },+ take: limit,+ });+ }++ async cleanup(olderThanDays = 30): Promise<number> {+ const cutoffDate = new Date();+ cutoffDate.setDate(cutoffDate.getDate() - olderThanDays);++ const result = await this.auditRepository.delete({+ createdAt: LessThan(cutoffDate),+ });++ return result.affected || 0;+ }+}diff --git a/src/modules/audit/entities/audit-log.entity.ts b/src/modules/audit/entities/audit-log.entity.tsnew file mode 100644index 000000000..4e340ffc2--- /dev/null+++ b/src/modules/audit/entities/audit-log.entity.ts@@ -0,0 +1,87 @@+import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, Index } from 'typeorm';++export enum AuditAction {+ // API Key events+ API_KEY_CREATED = 'api_key_created',+ API_KEY_USED = 'api_key_used',+ API_KEY_REVOKED = 'api_key_revoked',+ API_KEY_DELETED = 'api_key_deleted',+ API_KEY_AUTH_FAILED = 'api_key_auth_failed',++ // Session events+ SESSION_CREATED = 'session_created',+ SESSION_STARTED = 'session_started',+ SESSION_STOPPED = 'session_stopped',+ SESSION_DELETED = 'session_deleted',+ SESSION_QR_GENERATED = 'session_qr_generated',+ SESSION_CONNECTED = 'session_connected',+ SESSION_DISCONNECTED = 'session_disconnected',++ // Message events+ MESSAGE_SENT = 'message_sent',+ MESSAGE_FAILED = 'message_failed',++ // Webhook events+ WEBHOOK_CREATED = 'webhook_created',+ WEBHOOK_DELETED = 'webhook_deleted',+ WEBHOOK_TRIGGERED = 'webhook_triggered',+ WEBHOOK_FAILED = 'webhook_failed',+}++export enum AuditSeverity {+ INFO = 'info',+ WARN = 'warn',+ ERROR = 'error',+}++@Entity('audit_logs')+export class AuditLog {+ @PrimaryGeneratedColumn('uuid')+ id: string;++ @Index()+ @Column({ type: 'varchar', length: 50 })+ action: AuditAction;++ @Column({ type: 'varchar', length: 10, default: AuditSeverity.INFO })+ severity: AuditSeverity;++ @Index()+ @Column({ type: 'varchar', length: 36, nullable: true })+ apiKeyId: string | null;++ @Column({ type: 'varchar', length: 100, nullable: true })+ apiKeyName: string | null;++ @Index()+ @Column({ type: 'varchar', length: 36, nullable: true })+ sessionId: string | null;++ @Column({ type: 'varchar', length: 100, nullable: true })+ sessionName: string | null;++ @Column({ type: 'varchar', length: 45, nullable: true })+ ipAddress: string | null;++ @Column({ type: 'varchar', length: 500, nullable: true })+ userAgent: string | null;++ @Column({ type: 'varchar', length: 10, nullable: true })+ method: string | null;++ @Column({ type: 'varchar', length: 500, nullable: true })+ path: string | null;++ @Column({ type: 'int', nullable: true })+ statusCode: number | null;++ @Column({ type: 'simple-json', nullable: true })+ metadata: Record<string, unknown> | null;++ @Column({ type: 'text', nullable: true })+ errorMessage: string | null;++ @Index()+ @CreateDateColumn()+ createdAt: Date;+}diff --git a/src/modules/auth/auth-validate.controller.ts b/src/modules/auth/auth-validate.controller.tsnew file mode 100644index 000000000..e1d0ff586--- /dev/null+++ b/src/modules/auth/auth-validate.controller.ts@@ -0,0 +1,31 @@+import { Controller, Post, Headers, HttpCode, HttpStatus } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiHeader } from '@nestjs/swagger';+import { AuthService } from './auth.service';++@ApiTags('auth')+@Controller('auth')+export class AuthValidateController {+ constructor(private readonly authService: AuthService) {}++ @Post('validate')+ @HttpCode(HttpStatus.OK)+ @ApiOperation({ summary: 'Validate an API key' })+ @ApiHeader({ name: 'X-API-Key', description: 'API key to validate' })+ @ApiResponse({ status: 200, description: 'API key is valid' })+ @ApiResponse({ status: 401, description: 'Invalid or missing API key' })+ async validate(@Headers('x-api-key') apiKey?: string): Promise<{ valid: boolean; role?: string }> {+ if (!apiKey) {+ return { valid: false };+ }++ try {+ const keyEntity = await this.authService.validateApiKey(apiKey);+ if (keyEntity && keyEntity.isActive) {+ return { valid: true, role: keyEntity.role };+ }+ return { valid: false };+ } catch {+ return { valid: false };+ }+ }+}diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.tsnew file mode 100644index 000000000..3d723f396--- /dev/null+++ b/src/modules/auth/auth.controller.ts@@ -0,0 +1,132 @@+import { Controller, Get, Post, Put, Delete, Body, Param, HttpCode, HttpStatus } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';+import { AuthService } from './auth.service';+import { CreateApiKeyDto, UpdateApiKeyDto, ApiKeyResponseDto, ApiKeyCreatedResponseDto } from './dto';+import { RequireRole } from './decorators/auth.decorators';+import { ApiKeyRole } from './entities/api-key.entity';++@ApiTags('auth')+@ApiBearerAuth()+@Controller('auth/api-keys')+export class AuthController {+ constructor(private readonly authService: AuthService) {}++ @Post()+ @RequireRole(ApiKeyRole.ADMIN)+ @ApiOperation({ summary: 'Create a new API key (admin only)' })+ @ApiResponse({+ status: 201,+ description: 'API key created',+ type: ApiKeyCreatedResponseDto,+ })+ async create(@Body() dto: CreateApiKeyDto): Promise<ApiKeyCreatedResponseDto> {+ const { apiKey, rawKey } = await this.authService.createApiKey(dto);+ return {+ id: apiKey.id,+ name: apiKey.name,+ keyPrefix: apiKey.keyPrefix,+ role: apiKey.role,+ allowedIps: apiKey.allowedIps || undefined,+ allowedSessions: apiKey.allowedSessions || undefined,+ isActive: apiKey.isActive,+ expiresAt: apiKey.expiresAt || undefined,+ lastUsedAt: apiKey.lastUsedAt || undefined,+ usageCount: apiKey.usageCount,+ createdAt: apiKey.createdAt,+ apiKey: rawKey,+ };+ }++ @Get()+ @RequireRole(ApiKeyRole.ADMIN)+ @ApiOperation({ summary: 'List all API keys (admin only)' })+ @ApiResponse({ status: 200, type: [ApiKeyResponseDto] })+ async findAll(): Promise<ApiKeyResponseDto[]> {+ const keys = await this.authService.findAll();+ return keys.map(k => ({+ id: k.id,+ name: k.name,+ keyPrefix: k.keyPrefix,+ role: k.role,+ allowedIps: k.allowedIps || undefined,+ allowedSessions: k.allowedSessions || undefined,+ isActive: k.isActive,+ expiresAt: k.expiresAt || undefined,+ lastUsedAt: k.lastUsedAt || undefined,+ usageCount: k.usageCount,+ createdAt: k.createdAt,+ }));+ }++ @Get(':id')+ @RequireRole(ApiKeyRole.ADMIN)+ @ApiOperation({ summary: 'Get API key details (admin only)' })+ @ApiResponse({ status: 200, type: ApiKeyResponseDto })+ async findOne(@Param('id') id: string): Promise<ApiKeyResponseDto> {+ const k = await this.authService.findOne(id);+ return {+ id: k.id,+ name: k.name,+ keyPrefix: k.keyPrefix,+ role: k.role,+ allowedIps: k.allowedIps || undefined,+ allowedSessions: k.allowedSessions || undefined,+ isActive: k.isActive,+ expiresAt: k.expiresAt || undefined,+ lastUsedAt: k.lastUsedAt || undefined,+ usageCount: k.usageCount,+ createdAt: k.createdAt,+ };+ }++ @Put(':id')+ @RequireRole(ApiKeyRole.ADMIN)+ @ApiOperation({ summary: 'Update API key (admin only)' })+ @ApiResponse({ status: 200, type: ApiKeyResponseDto })+ async update(@Param('id') id: string, @Body() dto: UpdateApiKeyDto): Promise<ApiKeyResponseDto> {+ const k = await this.authService.update(id, dto);+ return {+ id: k.id,+ name: k.name,+ keyPrefix: k.keyPrefix,+ role: k.role,+ allowedIps: k.allowedIps || undefined,+ allowedSessions: k.allowedSessions || undefined,+ isActive: k.isActive,+ expiresAt: k.expiresAt || undefined,+ lastUsedAt: k.lastUsedAt || undefined,+ usageCount: k.usageCount,+ createdAt: k.createdAt,+ };+ }++ @Delete(':id')+ @RequireRole(ApiKeyRole.ADMIN)+ @HttpCode(HttpStatus.NO_CONTENT)+ @ApiOperation({ summary: 'Delete API key (admin only)' })+ @ApiResponse({ status: 204, description: 'API key deleted' })+ async delete(@Param('id') id: string): Promise<void> {+ await this.authService.delete(id);+ }++ @Post(':id/revoke')+ @RequireRole(ApiKeyRole.ADMIN)+ @ApiOperation({ summary: 'Revoke API key (admin only)' })+ @ApiResponse({ status: 200, type: ApiKeyResponseDto })+ async revoke(@Param('id') id: string): Promise<ApiKeyResponseDto> {+ const k = await this.authService.revoke(id);+ return {+ id: k.id,+ name: k.name,+ keyPrefix: k.keyPrefix,+ role: k.role,+ allowedIps: k.allowedIps || undefined,+ allowedSessions: k.allowedSessions || undefined,+ isActive: k.isActive,+ expiresAt: k.expiresAt || undefined,+ lastUsedAt: k.lastUsedAt || undefined,+ usageCount: k.usageCount,+ createdAt: k.createdAt,+ };+ }+}diff --git a/src/modules/auth/auth.module.ts b/src/modules/auth/auth.module.tsnew file mode 100644index 000000000..6ac0e25f7--- /dev/null+++ b/src/modules/auth/auth.module.ts@@ -0,0 +1,28 @@+import { Module, Global } from '@nestjs/common';+import { TypeOrmModule } from '@nestjs/typeorm';+import { APP_GUARD } from '@nestjs/core';+import { ThrottlerGuard } from '@nestjs/throttler';+import { ApiKey } from './entities/api-key.entity';+import { AuthService } from './auth.service';+import { AuthController } from './auth.controller';+import { AuthValidateController } from './auth-validate.controller';+import { ApiKeyGuard } from './guards/api-key.guard';++@Global()+@Module({+ imports: [TypeOrmModule.forFeature([ApiKey], 'main')],+ controllers: [AuthController, AuthValidateController],+ providers: [+ AuthService,+ {+ provide: APP_GUARD,+ useClass: ThrottlerGuard,+ },+ {+ provide: APP_GUARD,+ useClass: ApiKeyGuard,+ },+ ],+ exports: [AuthService],+})+export class AuthModule {}diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.tsnew file mode 100644index 000000000..b2024355e--- /dev/null+++ b/src/modules/auth/auth.service.ts@@ -0,0 +1,267 @@+import { Injectable, NotFoundException, UnauthorizedException, OnModuleInit } from '@nestjs/common';+import { InjectRepository } from '@nestjs/typeorm';+import { Repository } from 'typeorm';+import { createHash, randomBytes } from 'crypto';+import { existsSync, writeFileSync, readFileSync } from 'fs';+import { join } from 'path';+import { ApiKey, ApiKeyRole } from './entities/api-key.entity';+import { CreateApiKeyDto, UpdateApiKeyDto } from './dto';+import { createLogger } from '../../common/services/logger.service';++const API_KEY_FILE = join(process.cwd(), 'data', '.api-key');++@Injectable()+export class AuthService implements OnModuleInit {+ private readonly logger = createLogger('AuthService');++ constructor(+ @InjectRepository(ApiKey, 'main')+ private readonly apiKeyRepository: Repository<ApiKey>,+ ) {}++ async onModuleInit(): Promise<void> {+ // Seed a default API key if none exist+ const count = await this.apiKeyRepository.count();+ let displayKey: string;+ let isNewKey = false;++ if (count === 0) {+ // Use predictable key in development, random key in production+ displayKey =+ process.env.NODE_ENV === 'production' ? `owa_k1_${randomBytes(32).toString('hex')}` : 'dev-admin-key';++ await this.seedApiKey(displayKey, 'Default Admin Key', ApiKeyRole.ADMIN);+ isNewKey = true;++ // Save raw key to file for startup script to read+ try {+ writeFileSync(API_KEY_FILE, displayKey, 'utf-8');+ } catch (err) {+ this.logger.warn('Could not save API key file', { error: String(err) });+ }+ } else {+ // Read saved API key from file if exists+ if (existsSync(API_KEY_FILE)) {+ try {+ displayKey = readFileSync(API_KEY_FILE, 'utf-8').trim();+ } catch {+ displayKey = '(check dashboard for keys)';+ }+ } else {+ displayKey = '(check dashboard for keys)';+ }+ }++ // Always show the welcome banner on startup+ const apiBaseUrl = process.env.BASE_URL || `http://localhost:${process.env.PORT || 2785}`;+ const dashboardUrl = process.env.DASHBOARD_URL || `http://localhost:${process.env.DASHBOARD_PORT || 2886}`;++ this.logger.log('');+ this.logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');+ this.logger.log('');+ this.logger.log(' 🟢 Welcome to OpenWA - WhatsApp API Gateway');+ this.logger.log('');+ this.logger.log(` 📊 Dashboard: ${dashboardUrl}`);+ this.logger.log(` 📚 API Docs: ${apiBaseUrl}/api/docs`);+ this.logger.log('');+ if (isNewKey) {+ this.logger.log(' 🔑 API Key (newly created):');+ } else {+ this.logger.log(' 🔑 API Key:');+ }+ this.logger.log(` ${displayKey}`);+ this.logger.log('');+ this.logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');+ this.logger.log('');+ }++ private async seedApiKey(rawKey: string, name: string, role: ApiKeyRole): Promise<ApiKey> {+ const keyHash = this.hashKey(rawKey);+ const keyPrefix = rawKey.substring(0, 12);++ const apiKey = this.apiKeyRepository.create({+ name,+ keyHash,+ keyPrefix,+ role,+ });++ return this.apiKeyRepository.save(apiKey);+ }++ async createApiKey(dto: CreateApiKeyDto): Promise<{ apiKey: ApiKey; rawKey: string }> {+ // Generate secure random key: owa_k1_<32 bytes hex>+ const rawKey = `owa_k1_${randomBytes(32).toString('hex')}`;+ const keyHash = this.hashKey(rawKey);+ const keyPrefix = rawKey.substring(0, 12);++ const apiKey = this.apiKeyRepository.create({+ name: dto.name,+ keyHash,+ keyPrefix,+ role: dto.role || ApiKeyRole.OPERATOR,+ allowedIps: dto.allowedIps || null,+ allowedSessions: dto.allowedSessions || null,+ expiresAt: dto.expiresAt ? new Date(dto.expiresAt) : null,+ });++ const saved = await this.apiKeyRepository.save(apiKey);+ this.logger.log(`API key created: ${saved.name}`, {+ keyId: saved.id,+ role: saved.role,+ action: 'api_key_created',+ });++ return { apiKey: saved, rawKey };+ }++ async findAll(): Promise<ApiKey[]> {+ return this.apiKeyRepository.find({+ order: { createdAt: 'DESC' },+ });+ }++ async findOne(id: string): Promise<ApiKey> {+ const apiKey = await this.apiKeyRepository.findOne({ where: { id } });+ if (!apiKey) {+ throw new NotFoundException(`API key with id '${id}' not found`);+ }+ return apiKey;+ }++ async update(id: string, dto: UpdateApiKeyDto): Promise<ApiKey> {+ const apiKey = await this.findOne(id);++ if (dto.name) apiKey.name = dto.name;+ if (dto.role) apiKey.role = dto.role;+ if (dto.allowedIps !== undefined) apiKey.allowedIps = dto.allowedIps;+ if (dto.allowedSessions !== undefined) apiKey.allowedSessions = dto.allowedSessions;+ if (dto.expiresAt !== undefined) apiKey.expiresAt = dto.expiresAt ? new Date(dto.expiresAt) : null;++ return this.apiKeyRepository.save(apiKey);+ }++ async delete(id: string): Promise<void> {+ const apiKey = await this.findOne(id);+ await this.apiKeyRepository.remove(apiKey);+ this.logger.log(`API key deleted: ${apiKey.name}`, {+ keyId: id,+ action: 'api_key_deleted',+ });+ }++ async revoke(id: string): Promise<ApiKey> {+ const apiKey = await this.findOne(id);+ apiKey.isActive = false;+ return this.apiKeyRepository.save(apiKey);+ }++ async validateApiKey(rawKey: string, clientIp?: string, sessionId?: string): Promise<ApiKey> {+ const keyHash = this.hashKey(rawKey);+ const apiKey = await this.apiKeyRepository.findOne({ where: { keyHash } });++ if (!apiKey) {+ throw new UnauthorizedException('Invalid API key');+ }++ if (!apiKey.isActive) {+ throw new UnauthorizedException('API key is revoked');+ }++ if (apiKey.expiresAt && apiKey.expiresAt < new Date()) {+ throw new UnauthorizedException('API key has expired');+ }++ // Check IP whitelist+ if (apiKey.allowedIps && apiKey.allowedIps.length > 0 && clientIp) {+ if (!this.isIpAllowed(clientIp, apiKey.allowedIps)) {+ this.logger.warn(`IP not allowed: ${clientIp}`, {+ keyId: apiKey.id,+ action: 'ip_rejected',+ });+ throw new UnauthorizedException('IP address not allowed');+ }+ }++ // Check session restriction+ if (apiKey.allowedSessions && apiKey.allowedSessions.length > 0 && sessionId) {+ if (!apiKey.allowedSessions.includes(sessionId)) {+ throw new UnauthorizedException('API key not authorized for this session');+ }+ }++ // Update usage stats+ apiKey.lastUsedAt = new Date();+ apiKey.usageCount += 1;+ await this.apiKeyRepository.save(apiKey);++ return apiKey;+ }++ private hashKey(rawKey: string): string {+ return createHash('sha256').update(rawKey).digest('hex');+ }++ private isIpAllowed(clientIp: string, allowedIps: string[]): boolean {+ // Phase 3 Security Audit: Support both exact match and CIDR notation+ for (const entry of allowedIps) {+ if (entry.includes('/')) {+ // CIDR notation (e.g., "10.0.0.0/24")+ if (this.ipInCidr(clientIp, entry)) {+ return true;+ }+ } else {+ // Exact match+ if (clientIp === entry) {+ return true;+ }+ }+ }+ return false;+ }++ /**+ * Check if an IPv4 address is within a CIDR range+ * @param ip - Client IP address (e.g., "192.168.1.100")+ * @param cidr - CIDR notation (e.g., "192.168.1.0/24")+ */+ private ipInCidr(ip: string, cidr: string): boolean {+ try {+ const [range, bitsStr] = cidr.split('/');+ const bits = parseInt(bitsStr, 10);++ if (isNaN(bits) || bits < 0 || bits > 32) {+ return false;+ }++ const mask = ~(2 ** (32 - bits) - 1);+ const ipNum = this.ipToNumber(ip);+ const rangeNum = this.ipToNumber(range);++ return (ipNum & mask) === (rangeNum & mask);+ } catch {+ // If parsing fails, don't allow+ return false;+ }+ }++ /**+ * Convert IPv4 address string to 32-bit number+ */+ private ipToNumber(ip: string): number {+ const parts = ip.split('.');+ if (parts.length !== 4) return 0;++ return parts.reduce((acc, octet) => (acc << 8) + parseInt(octet, 10), 0) >>> 0;+ }++ hasPermission(apiKey: ApiKey, requiredRole: ApiKeyRole): boolean {+ const roleHierarchy: Record<ApiKeyRole, number> = {+ [ApiKeyRole.VIEWER]: 1,+ [ApiKeyRole.OPERATOR]: 2,+ [ApiKeyRole.ADMIN]: 3,+ };++ return roleHierarchy[apiKey.role] >= roleHierarchy[requiredRole];+ }+}diff --git a/src/modules/auth/decorators/auth.decorators.ts b/src/modules/auth/decorators/auth.decorators.tsnew file mode 100644index 000000000..e39d6c610--- /dev/null+++ b/src/modules/auth/decorators/auth.decorators.ts@@ -0,0 +1,28 @@+import { SetMetadata, createParamDecorator, ExecutionContext } from '@nestjs/common';+import { ApiKeyRole } from '../entities/api-key.entity';+import { Request } from 'express';+import { ApiKey } from '../entities/api-key.entity';++export const REQUIRED_ROLE_KEY = 'requiredRole';+export const PUBLIC_KEY = 'isPublic';++/**+ * Mark a route as requiring a specific role+ * @example @RequireRole(ApiKeyRole.ADMIN)+ */+export const RequireRole = (role: ApiKeyRole) => SetMetadata(REQUIRED_ROLE_KEY, role);++/**+ * Mark a route as public (no API key required)+ * @example @Public()+ */+export const Public = () => SetMetadata(PUBLIC_KEY, true);++/**+ * Get the current API key from request+ * @example @CurrentApiKey() apiKey: ApiKey+ */+export const CurrentApiKey = createParamDecorator((data: unknown, ctx: ExecutionContext): ApiKey | undefined => {+ const request = ctx.switchToHttp().getRequest<Request & { apiKey?: ApiKey }>();+ return request.apiKey;+});diff --git a/src/modules/auth/dto/api-key.dto.ts b/src/modules/auth/dto/api-key.dto.tsnew file mode 100644index 000000000..1d4469cd4--- /dev/null+++ b/src/modules/auth/dto/api-key.dto.ts@@ -0,0 +1,125 @@+import { IsString, IsOptional, IsEnum, IsArray, IsDateString, MinLength, MaxLength } from 'class-validator';+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';+import { ApiKeyRole } from '../entities/api-key.entity';++export class CreateApiKeyDto {+ @ApiProperty({+ description: 'Friendly name for the API key',+ example: 'Production Bot',+ })+ @IsString()+ @MinLength(3)+ @MaxLength(100)+ name: string;++ @ApiPropertyOptional({+ description: 'Role/permission level',+ enum: ApiKeyRole,+ default: ApiKeyRole.OPERATOR,+ })+ @IsOptional()+ @IsEnum(ApiKeyRole)+ role?: ApiKeyRole;++ @ApiPropertyOptional({+ description: 'Allowed IP addresses (whitelist)',+ example: ['192.168.1.1', '10.0.0.0/8'],+ })+ @IsOptional()+ @IsArray()+ @IsString({ each: true })+ allowedIps?: string[];++ @ApiPropertyOptional({+ description: 'Allowed session IDs this key can access',+ example: ['session-uuid-1', 'session-uuid-2'],+ })+ @IsOptional()+ @IsArray()+ @IsString({ each: true })+ allowedSessions?: string[];++ @ApiPropertyOptional({+ description: 'Expiration date (ISO 8601)',+ example: '2027-12-31T23:59:59Z',+ })+ @IsOptional()+ @IsDateString()+ expiresAt?: string;+}++export class ApiKeyResponseDto {+ @ApiProperty()+ id: string;++ @ApiProperty()+ name: string;++ @ApiProperty({+ description: 'First 8 characters of the key (for identification)',+ })+ keyPrefix: string;++ @ApiProperty({ enum: ApiKeyRole })+ role: ApiKeyRole;++ @ApiPropertyOptional()+ allowedIps?: string[];++ @ApiPropertyOptional()+ allowedSessions?: string[];++ @ApiProperty()+ isActive: boolean;++ @ApiPropertyOptional()+ expiresAt?: Date;++ @ApiPropertyOptional()+ lastUsedAt?: Date;++ @ApiProperty()+ usageCount: number;++ @ApiProperty()+ createdAt: Date;+}++export class ApiKeyCreatedResponseDto extends ApiKeyResponseDto {+ @ApiProperty({+ description: 'Full API key (only shown once at creation)',+ example: 'owa_k1_abc123...',+ })+ apiKey: string;+}++export class UpdateApiKeyDto {+ @ApiPropertyOptional()+ @IsOptional()+ @IsString()+ @MinLength(3)+ @MaxLength(100)+ name?: string;++ @ApiPropertyOptional({ enum: ApiKeyRole })+ @IsOptional()+ @IsEnum(ApiKeyRole)+ role?: ApiKeyRole;++ @ApiPropertyOptional()+ @IsOptional()+ @IsArray()+ @IsString({ each: true })+ allowedIps?: string[];++ @ApiPropertyOptional()+ @IsOptional()+ @IsArray()+ @IsString({ each: true })+ allowedSessions?: string[];++ @ApiPropertyOptional()+ @IsOptional()+ @IsDateString()+ expiresAt?: string;+}diff --git a/src/modules/auth/dto/index.ts b/src/modules/auth/dto/index.tsnew file mode 100644index 000000000..5f58d29d8--- /dev/null+++ b/src/modules/auth/dto/index.ts@@ -0,0 +1 @@+export * from './api-key.dto';diff --git a/src/modules/auth/entities/api-key.entity.ts b/src/modules/auth/entities/api-key.entity.tsnew file mode 100644index 000000000..22c70d50b--- /dev/null+++ b/src/modules/auth/entities/api-key.entity.ts@@ -0,0 +1,54 @@+import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, Index } from 'typeorm';++export enum ApiKeyRole {+ ADMIN = 'admin',+ OPERATOR = 'operator',+ VIEWER = 'viewer',+}++@Entity('api_keys')+export class ApiKey {+ @PrimaryGeneratedColumn('uuid')+ id: string;++ @Column({ type: 'varchar', length: 100 })+ name: string;++ @Index({ unique: true })+ @Column({ type: 'varchar', length: 64 })+ keyHash: string;++ @Column({ type: 'varchar', length: 8 })+ keyPrefix: string;++ @Column({+ type: 'varchar',+ length: 20,+ default: ApiKeyRole.OPERATOR,+ })+ role: ApiKeyRole;++ @Column({ type: 'simple-array', nullable: true })+ allowedIps: string[] | null;++ @Column({ type: 'simple-array', nullable: true })+ allowedSessions: string[] | null;++ @Column({ type: 'boolean', default: true })+ isActive: boolean;++ @Column({ type: 'datetime', nullable: true })+ expiresAt: Date | null;++ @Column({ type: 'datetime', nullable: true })+ lastUsedAt: Date | null;++ @Column({ type: 'int', default: 0 })+ usageCount: number;++ @CreateDateColumn()+ createdAt: Date;++ @UpdateDateColumn()+ updatedAt: Date;+}diff --git a/src/modules/auth/guards/api-key.guard.ts b/src/modules/auth/guards/api-key.guard.tsnew file mode 100644index 000000000..ed91c7293--- /dev/null+++ b/src/modules/auth/guards/api-key.guard.ts@@ -0,0 +1,74 @@+import { Injectable, CanActivate, ExecutionContext, UnauthorizedException } from '@nestjs/common';+import { Reflector } from '@nestjs/core';+import { Request } from 'express';+import { AuthService } from '../auth.service';+import { ApiKeyRole } from '../entities/api-key.entity';+import { REQUIRED_ROLE_KEY, PUBLIC_KEY } from '../decorators/auth.decorators';++@Injectable()+export class ApiKeyGuard implements CanActivate {+ constructor(+ private readonly authService: AuthService,+ private readonly reflector: Reflector,+ ) {}++ async canActivate(context: ExecutionContext): Promise<boolean> {+ // Check if route is marked as public+ const isPublic = this.reflector.getAllAndOverride<boolean>(PUBLIC_KEY, [context.getHandler(), context.getClass()]);++ if (isPublic) {+ return true;+ }++ const request = context.switchToHttp().getRequest<Request>();+ const apiKeyHeader = this.extractApiKey(request);++ if (!apiKeyHeader) {+ throw new UnauthorizedException('API key is required');+ }++ // Get session ID from route params if present+ const sessionId = (request.params['sessionId'] || request.params['id']) as string | undefined;+ const clientIp = this.getClientIp(request);++ // Validate API key+ const apiKey = await this.authService.validateApiKey(apiKeyHeader, clientIp, sessionId);++ // Check role permission+ const requiredRole = this.reflector.getAllAndOverride<ApiKeyRole>(REQUIRED_ROLE_KEY, [+ context.getHandler(),+ context.getClass(),+ ]);++ if (requiredRole && !this.authService.hasPermission(apiKey, requiredRole)) {+ throw new UnauthorizedException(`Insufficient permissions. Required: ${requiredRole}`);+ }++ // Attach API key to request for use in controllers+ (request as Request & { apiKey: typeof apiKey }).apiKey = apiKey;++ return true;+ }++ private extractApiKey(request: Request): string | undefined {+ // Support both X-API-Key header and Authorization Bearer+ const xApiKey = request.headers['x-api-key'] as string;+ if (xApiKey) return xApiKey;++ const authHeader = request.headers['authorization'];+ if (authHeader?.startsWith('Bearer ')) {+ return authHeader.substring(7);+ }++ return undefined;+ }++ private getClientIp(request: Request): string {+ const forwarded = request.headers['x-forwarded-for'];+ if (forwarded) {+ const ips = (forwarded as string).split(',');+ return ips[0].trim();+ }+ return request.ip || request.socket.remoteAddress || '';+ }+}diff --git a/src/modules/catalog/catalog.controller.ts b/src/modules/catalog/catalog.controller.tsnew file mode 100644index 000000000..5fece45cc--- /dev/null+++ b/src/modules/catalog/catalog.controller.ts@@ -0,0 +1,41 @@+import { Controller, Get, Post, Param, Body, Query } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';+import { CatalogService } from './catalog.service';+import { SendProductDto, SendCatalogDto, ProductQueryDto } from './dto/send-product.dto';++@ApiTags('Catalog')+@ApiBearerAuth()+@Controller('sessions/:sessionId')+export class CatalogController {+ constructor(private readonly catalogService: CatalogService) {}++ @Get('catalog')+ @ApiOperation({ summary: 'Get business catalog info' })+ async getCatalog(@Param('sessionId') sessionId: string) {+ return this.catalogService.getCatalog(sessionId);+ }++ @Get('catalog/products')+ @ApiOperation({ summary: 'List catalog products' })+ async getProducts(@Param('sessionId') sessionId: string, @Query() query: ProductQueryDto) {+ return this.catalogService.getProducts(sessionId, query.page, query.limit);+ }++ @Get('catalog/products/:productId')+ @ApiOperation({ summary: 'Get a specific product' })+ async getProduct(@Param('sessionId') sessionId: string, @Param('productId') productId: string) {+ return this.catalogService.getProduct(sessionId, productId);+ }++ @Post('messages/send-product')+ @ApiOperation({ summary: 'Send a product message' })+ async sendProduct(@Param('sessionId') sessionId: string, @Body() dto: SendProductDto) {+ return this.catalogService.sendProduct(sessionId, dto.chatId, dto.productId, dto.body);+ }++ @Post('messages/send-catalog')+ @ApiOperation({ summary: 'Send catalog link' })+ async sendCatalog(@Param('sessionId') sessionId: string, @Body() dto: SendCatalogDto) {+ return this.catalogService.sendCatalog(sessionId, dto.chatId, dto.body);+ }+}diff --git a/src/modules/catalog/catalog.module.ts b/src/modules/catalog/catalog.module.tsnew file mode 100644index 000000000..077ee1f1b--- /dev/null+++ b/src/modules/catalog/catalog.module.ts@@ -0,0 +1,12 @@+import { Module } from '@nestjs/common';+import { CatalogController } from './catalog.controller';+import { CatalogService } from './catalog.service';+import { SessionModule } from '../session/session.module';++@Module({+ imports: [SessionModule],+ controllers: [CatalogController],+ providers: [CatalogService],+ exports: [CatalogService],+})+export class CatalogModule {}diff --git a/src/modules/catalog/catalog.service.ts b/src/modules/catalog/catalog.service.tsnew file mode 100644index 000000000..8d1beef49--- /dev/null+++ b/src/modules/catalog/catalog.service.ts@@ -0,0 +1,53 @@+import { Injectable, NotFoundException } from '@nestjs/common';+import { SessionService } from '../session/session.service';+import type {+ Catalog,+ Product,+ PaginatedProducts,+ MessageResult,+} from '../../engine/interfaces/whatsapp-engine.interface';++@Injectable()+export class CatalogService {+ constructor(private readonly sessionService: SessionService) {}++ async getCatalog(sessionId: string): Promise<Catalog | null> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.getCatalog();+ }++ async getProducts(sessionId: string, page = 1, limit = 20): Promise<PaginatedProducts> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.getProducts({ page, limit });+ }++ async getProduct(sessionId: string, productId: string): Promise<Product | null> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.getProduct(productId);+ }++ async sendProduct(sessionId: string, chatId: string, productId: string, body?: string): Promise<MessageResult> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.sendProduct(chatId, productId, body);+ }++ async sendCatalog(sessionId: string, chatId: string, body?: string): Promise<MessageResult> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.sendCatalog(chatId, body);+ }+}diff --git a/src/modules/catalog/dto/send-product.dto.ts b/src/modules/catalog/dto/send-product.dto.tsnew file mode 100644index 000000000..b4594fbdb--- /dev/null+++ b/src/modules/catalog/dto/send-product.dto.ts@@ -0,0 +1,37 @@+import { IsString, IsOptional, IsInt, Min } from 'class-validator';+import { Type } from 'class-transformer';++export class SendProductDto {+ @IsString()+ chatId: string;++ @IsString()+ productId: string;++ @IsOptional()+ @IsString()+ body?: string;+}++export class SendCatalogDto {+ @IsString()+ chatId: string;++ @IsOptional()+ @IsString()+ body?: string;+}++export class ProductQueryDto {+ @IsOptional()+ @Type(() => Number)+ @IsInt()+ @Min(1)+ page?: number = 1;++ @IsOptional()+ @Type(() => Number)+ @IsInt()+ @Min(1)+ limit?: number = 20;+}diff --git a/src/modules/channel/channel.controller.ts b/src/modules/channel/channel.controller.tsnew file mode 100644index 000000000..c4c110d16--- /dev/null+++ b/src/modules/channel/channel.controller.ts@@ -0,0 +1,105 @@+import { Controller, Get, Post, Delete, Param, Body, Query } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiBody, ApiQuery } from '@nestjs/swagger';+import { SessionService } from '../session/session.service';++@ApiTags('channels')+@Controller('sessions/:sessionId/channels')+export class ChannelController {+ constructor(private readonly sessionService: SessionService) {}++ private getEngine(sessionId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ return engine;+ }++ @Get()+ @ApiOperation({ summary: 'Get all subscribed channels/newsletters' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'List of subscribed channels',+ })+ @ApiResponse({ status: 400, description: 'Session not ready' })+ async findAll(@Param('sessionId') sessionId: string) {+ const engine = this.getEngine(sessionId);+ return engine.getSubscribedChannels();+ }++ @Get(':channelId')+ @ApiOperation({ summary: 'Get a specific channel by ID' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'channelId', description: 'Channel ID' })+ @ApiResponse({+ status: 200,+ description: 'Channel details',+ })+ @ApiResponse({ status: 404, description: 'Channel not found' })+ async findOne(@Param('sessionId') sessionId: string, @Param('channelId') channelId: string) {+ const engine = this.getEngine(sessionId);+ const channel = await engine.getChannelById(channelId);+ if (!channel) {+ throw new Error(`Channel ${channelId} not found`);+ }+ return channel;+ }++ @Get(':channelId/messages')+ @ApiOperation({ summary: 'Get messages from a channel' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'channelId', description: 'Channel ID' })+ @ApiQuery({ name: 'limit', required: false, type: Number, description: 'Max messages to return (default 50)' })+ @ApiResponse({+ status: 200,+ description: 'List of channel messages',+ })+ async getMessages(+ @Param('sessionId') sessionId: string,+ @Param('channelId') channelId: string,+ @Query('limit') limit?: string,+ ) {+ const engine = this.getEngine(sessionId);+ return engine.getChannelMessages(channelId, limit ? parseInt(limit, 10) : undefined);+ }++ @Post('subscribe')+ @ApiOperation({ summary: 'Subscribe to a channel using invite code' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiBody({+ schema: {+ type: 'object',+ properties: {+ inviteCode: {+ type: 'string',+ description: 'Channel invite code (from channel link)',+ example: 'ABC123xyz',+ },+ },+ required: ['inviteCode'],+ },+ })+ @ApiResponse({+ status: 201,+ description: 'Successfully subscribed to channel',+ })+ async subscribe(@Param('sessionId') sessionId: string, @Body() body: { inviteCode: string }) {+ const engine = this.getEngine(sessionId);+ return engine.subscribeToChannel(body.inviteCode);+ }++ @Delete(':channelId')+ @ApiOperation({ summary: 'Unsubscribe from a channel' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'channelId', description: 'Channel ID to unsubscribe from' })+ @ApiResponse({+ status: 200,+ description: 'Successfully unsubscribed from channel',+ })+ async unsubscribe(@Param('sessionId') sessionId: string, @Param('channelId') channelId: string) {+ const engine = this.getEngine(sessionId);+ await engine.unsubscribeFromChannel(channelId);+ return { success: true };+ }+}diff --git a/src/modules/channel/channel.module.ts b/src/modules/channel/channel.module.tsnew file mode 100644index 000000000..543374e32--- /dev/null+++ b/src/modules/channel/channel.module.ts@@ -0,0 +1,9 @@+import { Module } from '@nestjs/common';+import { ChannelController } from './channel.controller';+import { SessionModule } from '../session/session.module';++@Module({+ imports: [SessionModule],+ controllers: [ChannelController],+})+export class ChannelModule {}diff --git a/src/modules/contact/contact.controller.ts b/src/modules/contact/contact.controller.tsnew file mode 100644index 000000000..22310f294--- /dev/null+++ b/src/modules/contact/contact.controller.ts@@ -0,0 +1,122 @@+import { Controller, Get, Post, Delete, Param, HttpCode, HttpStatus } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiParam } from '@nestjs/swagger';+import { SessionService } from '../session/session.service';++@ApiTags('contacts')+@Controller('sessions/:sessionId/contacts')+export class ContactController {+ constructor(private readonly sessionService: SessionService) {}++ @Get()+ @ApiOperation({ summary: 'Get all contacts for a session' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'List of contacts',+ })+ @ApiResponse({ status: 400, description: 'Session not ready' })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async findAll(@Param('sessionId') sessionId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ return engine.getContacts();+ }++ @Get(':contactId')+ @ApiOperation({ summary: 'Get a specific contact by ID' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'contactId', description: 'Contact ID (e.g., [email protected])' })+ @ApiResponse({+ status: 200,+ description: 'Contact details',+ })+ @ApiResponse({ status: 404, description: 'Contact not found' })+ async findOne(@Param('sessionId') sessionId: string, @Param('contactId') contactId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ const contact = await engine.getContactById(contactId);+ if (!contact) {+ throw new Error(`Contact ${contactId} not found`);+ }+ return contact;+ }++ @Get('check/:number')+ @ApiOperation({ summary: 'Check if a phone number exists on WhatsApp' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'number', description: 'Phone number to check (e.g., 628123456789)' })+ @ApiResponse({+ status: 200,+ description: 'Number existence check result',+ })+ async checkNumber(@Param('sessionId') sessionId: string, @Param('number') number: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ const exists = await engine.checkNumberExists(number);+ return {+ number,+ exists,+ whatsappId: exists ? `${number}@c.us` : null,+ };+ }++ // ========== Gap Quick Wins: Profile Picture, Block/Unblock ==========++ @Get(':contactId/profile-picture')+ @ApiOperation({ summary: 'Get profile picture URL for a contact' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'contactId', description: 'Contact ID (e.g., [email protected])' })+ @ApiResponse({+ status: 200,+ description: 'Profile picture URL',+ })+ async getProfilePicture(@Param('sessionId') sessionId: string, @Param('contactId') contactId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ const url = await engine.getProfilePicture(contactId);+ return { url };+ }++ @Post(':contactId/block')+ @HttpCode(HttpStatus.OK)+ @ApiOperation({ summary: 'Block a contact' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'contactId', description: 'Contact ID (e.g., [email protected])' })+ @ApiResponse({+ status: 200,+ description: 'Contact blocked',+ })+ async blockContact(@Param('sessionId') sessionId: string, @Param('contactId') contactId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ await engine.blockContact(contactId);+ return { success: true, message: 'Contact blocked' };+ }++ @Delete(':contactId/block')+ @ApiOperation({ summary: 'Unblock a contact' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'contactId', description: 'Contact ID (e.g., [email protected])' })+ @ApiResponse({+ status: 200,+ description: 'Contact unblocked',+ })+ async unblockContact(@Param('sessionId') sessionId: string, @Param('contactId') contactId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ await engine.unblockContact(contactId);+ return { success: true, message: 'Contact unblocked' };+ }+}diff --git a/src/modules/contact/contact.module.ts b/src/modules/contact/contact.module.tsnew file mode 100644index 000000000..820780a11--- /dev/null+++ b/src/modules/contact/contact.module.ts@@ -0,0 +1,9 @@+import { Module } from '@nestjs/common';+import { ContactController } from './contact.controller';+import { SessionModule } from '../session/session.module';++@Module({+ imports: [SessionModule],+ controllers: [ContactController],+})+export class ContactModule {}diff --git a/src/modules/docker/docker.module.ts b/src/modules/docker/docker.module.tsnew file mode 100644index 000000000..bc7d7aef6--- /dev/null+++ b/src/modules/docker/docker.module.ts@@ -0,0 +1,8 @@+import { Module } from '@nestjs/common';+import { DockerService } from './docker.service';++@Module({+ providers: [DockerService],+ exports: [DockerService],+})+export class DockerModule {}diff --git a/src/modules/docker/docker.service.ts b/src/modules/docker/docker.service.tsnew file mode 100644index 000000000..6ac95a7f8--- /dev/null+++ b/src/modules/docker/docker.service.ts@@ -0,0 +1,544 @@+import { Injectable, Logger, OnModuleInit } from '@nestjs/common';+import Docker from 'dockerode';++interface ContainerInfo {+ id: string;+ name: string;+ state: string;+ status: string;+ labels: Record<string, string>;+}++interface OrchestrationResult {+ success: boolean;+ message: string;+ containersStarted: string[];+ containersStopped: string[];+ containersRemoved: string[];+ errors: string[];+ estimatedTime: number; // Estimated restart time in seconds+}++@Injectable()+export class DockerService implements OnModuleInit {+ private readonly logger = new Logger(DockerService.name);+ private docker: Docker | null = null;+ private isAvailable = false;++ async onModuleInit() {+ await this.initializeDocker();+ // Bootstrap orchestration: start containers based on saved config+ await this.bootstrapOrchestration();+ }++ /**+ * Bootstrap orchestration: start built-in containers based on saved config+ * This runs on application startup to ensure containers match saved configuration+ */+ private async bootstrapOrchestration(): Promise<void> {+ if (!this.isAvailable) {+ this.logger.log('[Bootstrap Orchestration] Docker not available, skipping');+ return;+ }++ const profiles: string[] = [];++ // Check for built-in services from environment variables+ if (process.env.REDIS_BUILTIN === 'true') {+ profiles.push('redis');+ }+ if (process.env.POSTGRES_BUILTIN === 'true') {+ profiles.push('postgres');+ }+ if (process.env.MINIO_BUILTIN === 'true') {+ profiles.push('minio');+ }++ if (profiles.length === 0) {+ this.logger.log('[Bootstrap Orchestration] No built-in services configured');+ return;+ }++ this.logger.log(`[Bootstrap Orchestration] Starting built-in services: ${profiles.join(', ')}`);+ const result = await this.orchestrateProfiles(profiles);++ if (result.success) {+ this.logger.log(`[Bootstrap Orchestration] Started ${result.containersStarted.length} container(s)`);+ } else {+ this.logger.warn(`[Bootstrap Orchestration] Issues: ${result.errors.join('; ')}`);+ }+ }++ private async initializeDocker(): Promise<void> {+ try {+ this.docker = new Docker({ socketPath: '/var/run/docker.sock' });+ await this.docker.ping();+ this.isAvailable = true;+ this.logger.log('Docker API connected successfully');+ } catch (error) {+ this.logger.warn(+ 'Docker socket not available. Container orchestration disabled.',+ error instanceof Error ? error.message : error,+ );+ this.isAvailable = false;+ }+ }++ /**+ * Check if Docker is available+ */+ isDockerAvailable(): boolean {+ return this.isAvailable;+ }++ /**+ * List all OpenWA-related containers+ */+ async listContainers(): Promise<ContainerInfo[]> {+ if (!this.docker || !this.isAvailable) {+ return [];+ }++ try {+ const containers = await this.docker.listContainers({ all: true });+ return containers+ .filter(c => {+ // Filter by OpenWA labels or name prefix+ const labels = c.Labels || {};+ return labels['com.openwa.service'] || c.Names?.some(n => n.startsWith('/openwa-'));+ })+ .map(c => ({+ id: c.Id.substring(0, 12),+ name: c.Names?.[0]?.replace(/^\//, '') || 'unknown',+ state: c.State || 'unknown',+ status: c.Status || 'unknown',+ labels: c.Labels || {},+ }));+ } catch (error) {+ this.logger.error('Failed to list containers', error);+ return [];+ }+ }++ /**+ * Get container by service name or label+ */+ async getContainerByService(service: string): Promise<Docker.Container | null> {+ if (!this.docker || !this.isAvailable) {+ return null;+ }++ try {+ const containers = await this.docker.listContainers({+ all: true,+ filters: {+ label: [`com.openwa.service=${service}`],+ },+ });++ if (containers.length > 0) {+ return this.docker.getContainer(containers[0].Id);+ }++ // Fallback: try by name+ const allContainers = await this.docker.listContainers({ all: true });+ const match = allContainers.find(c => c.Names?.some(n => n.includes(`openwa-${service}`) || n.includes(service)));++ if (match) {+ return this.docker.getContainer(match.Id);+ }++ return null;+ } catch (error) {+ this.logger.error(`Failed to get container for service: ${service}`, error);+ return null;+ }+ }++ /**+ * Container specifications for optional services+ * Mirrors docker-compose.yml settings but uses Docker API directly+ */+ private getContainerSpec(profile: string): {+ image: string;+ name: string;+ alias: string; // DNS alias for network resolution+ env?: string[];+ cmd?: string[];+ volumes?: { name: string; path: string }[];+ healthcheck?: { test: string[]; interval: number; timeout: number; retries: number };+ labels: Record<string, string>;+ ports?: { container: number; host: number }[];+ } | null {+ const specs: Record<string, ReturnType<typeof this.getContainerSpec>> = {+ redis: {+ image: 'redis:7-alpine',+ name: 'openwa-redis',+ alias: 'redis', // DNS alias for resolution+ cmd: ['redis-server', '--appendonly', 'yes'],+ volumes: [{ name: 'openwa_redis-data', path: '/data' }],+ healthcheck: {+ test: ['CMD', 'redis-cli', 'ping'],+ interval: 5000000000, // 5s in nanoseconds+ timeout: 3000000000,+ retries: 5,+ },+ labels: {+ 'com.openwa.service': 'cache',+ 'com.openwa.builtin': 'true',+ },+ },+ postgres: {+ image: 'postgres:16-alpine',+ name: 'openwa-postgres',+ alias: 'postgres',+ // Use hardcoded defaults for built-in container (don't inherit SQLite paths)+ env: ['POSTGRES_USER=openwa', 'POSTGRES_PASSWORD=openwa', 'POSTGRES_DB=openwa'],+ volumes: [{ name: 'openwa_postgres-data', path: '/var/lib/postgresql/data' }],+ healthcheck: {+ test: ['CMD-SHELL', 'pg_isready -U openwa'],+ interval: 5000000000,+ timeout: 3000000000,+ retries: 5,+ },+ labels: {+ 'com.openwa.service': 'database',+ 'com.openwa.builtin': 'true',+ },+ },+ minio: {+ image: 'minio/minio',+ name: 'openwa-minio',+ alias: 'minio',+ cmd: ['server', '/data', '--console-address', ':9001'],+ env: [+ `MINIO_ROOT_USER=${process.env.S3_ACCESS_KEY || 'minioadmin'}`,+ `MINIO_ROOT_PASSWORD=${process.env.S3_SECRET_KEY || 'minioadmin'}`,+ ],+ volumes: [{ name: 'openwa_minio-data', path: '/data' }],+ ports: [+ { container: 9000, host: 9000 },+ { container: 9001, host: 9001 },+ ],+ healthcheck: {+ test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live'],+ interval: 10000000000,+ timeout: 5000000000,+ retries: 3,+ },+ labels: {+ 'com.openwa.service': 'storage',+ 'com.openwa.builtin': 'true',+ },+ },+ };+ return specs[profile] || null;+ }++ /**+ * Create and start a service using Docker API directly+ */+ async createService(profile: string): Promise<boolean> {+ if (!this.docker || !this.isAvailable) {+ this.logger.error('Docker not available for creating service');+ return false;+ }++ const spec = this.getContainerSpec(profile);+ if (!spec) {+ this.logger.error(`Unknown profile: ${profile}`);+ return false;+ }++ this.logger.log(`Creating service: ${profile} (image: ${spec.image})`);++ try {+ // Check if container already exists+ const existing = await this.getContainerByService(profile);+ if (existing) {+ const info = await existing.inspect();+ if (info.State.Running) {+ this.logger.log(`Container ${spec.name} already running`);+ return true;+ }+ // Start existing container+ await existing.start();+ this.logger.log(`Started existing container: ${spec.name}`);+ return true;+ }++ // Pull image first+ this.logger.log(`Pulling image: ${spec.image}`);+ await new Promise<void>((resolve, reject) => {+ this.docker!.pull(spec.image, (err: Error | null, stream: NodeJS.ReadableStream) => {+ if (err) return reject(err);+ this.docker!.modem.followProgress(stream, (err2: Error | null) => {+ if (err2) return reject(err2);+ resolve();+ });+ });+ });++ // Create volume if needed+ if (spec.volumes) {+ for (const vol of spec.volumes) {+ try {+ await this.docker.createVolume({ Name: vol.name });+ this.logger.log(`Created volume: ${vol.name}`);+ } catch {+ // Volume might already exist, that's fine+ }+ }+ }++ // Create container+ const containerConfig: Docker.ContainerCreateOptions = {+ name: spec.name,+ Image: spec.image,+ Cmd: spec.cmd,+ Env: spec.env,+ Labels: spec.labels,+ HostConfig: {+ NetworkMode: 'openwa-network',+ RestartPolicy: { Name: 'unless-stopped' },+ Binds: spec.volumes?.map(v => `${v.name}:${v.path}`),+ PortBindings: spec.ports?.reduce(+ (acc, p) => {+ acc[`${p.container}/tcp`] = [{ HostIp: '127.0.0.1', HostPort: p.host.toString() }];+ return acc;+ },+ {} as Record<string, { HostIp: string; HostPort: string }[]>,+ ),+ },+ Healthcheck: spec.healthcheck+ ? {+ Test: spec.healthcheck.test,+ Interval: spec.healthcheck.interval,+ Timeout: spec.healthcheck.timeout,+ Retries: spec.healthcheck.retries,+ }+ : undefined,+ NetworkingConfig: {+ EndpointsConfig: {+ 'openwa-network': {+ Aliases: [spec.alias, profile], // Add DNS aliases for network resolution+ },+ },+ },+ };++ const container = await this.docker.createContainer(containerConfig);+ await container.start();+ this.logger.log(`Created and started container: ${spec.name}`);+ return true;+ } catch (error) {+ this.logger.error(`Failed to create service ${profile}: ${error instanceof Error ? error.message : error}`);+ return false;+ }+ }++ /**+ * Start a container by service name - creates if not exists+ */+ async startService(service: string): Promise<boolean> {+ const container = await this.getContainerByService(service);++ if (!container) {+ // Container doesn't exist - create it using docker-compose+ this.logger.log(`Container for service '${service}' not found, creating...`);++ // Map service names to docker-compose profiles+ const serviceToProfile: Record<string, string> = {+ database: 'postgres',+ cache: 'redis',+ storage: 'minio',+ postgres: 'postgres',+ redis: 'redis',+ minio: 'minio',+ };++ const profile = serviceToProfile[service] || service;+ return this.createService(profile);+ }++ try {+ const info = await container.inspect();+ if (info.State.Running) {+ this.logger.log(`Service '${service}' is already running`);+ return true;+ }++ await container.start();+ this.logger.log(`Started service: ${service}`);+ return true;+ } catch (error) {+ this.logger.error(`Failed to start service: ${service}`, error);+ return false;+ }+ }++ /**+ * Stop and remove a container by service name to save space+ */+ async removeService(profile: string): Promise<boolean> {+ this.logger.log(`Removing service with profile: ${profile}`);++ // First try to get the container and remove via dockerode+ const serviceMap: Record<string, string> = {+ postgres: 'database',+ redis: 'cache',+ minio: 'storage',+ };++ const service = serviceMap[profile] || profile;+ const container = await this.getContainerByService(service);++ if (container) {+ try {+ const info = await container.inspect();+ if (info.State.Running) {+ await container.stop();+ this.logger.log(`Stopped container: ${profile}`);+ }+ await container.remove({ v: true }); // v: true removes volumes too+ this.logger.log(`Removed container: ${profile}`);+ return true;+ } catch (error) {+ this.logger.error(`Failed to remove container: ${error instanceof Error ? error.message : error}`);+ return false;+ }+ }++ // Container doesn't exist - that's fine for removal+ this.logger.log(`Container for service '${profile}' not found, nothing to remove`);+ return true;+ }++ /**+ * Stop a container by service name (without removing)+ */+ async stopService(service: string): Promise<boolean> {+ const container = await this.getContainerByService(service);+ if (!container) {+ this.logger.warn(`Container for service '${service}' not found`);+ return true; // Already doesn't exist+ }++ try {+ const info = await container.inspect();+ if (!info.State.Running) {+ this.logger.log(`Service '${service}' is already stopped`);+ return true;+ }++ await container.stop();+ this.logger.log(`Stopped service: ${service}`);+ return true;+ } catch (error) {+ this.logger.error(`Failed to stop service: ${service}`, error);+ return false;+ }+ }++ /**+ * Orchestrate services based on required profiles+ * This will start containers that match the profiles+ */+ async orchestrateProfiles(profiles: string[]): Promise<OrchestrationResult> {+ // Calculate estimated time based on profiles+ // Base: 15 seconds for core restart (increased for reliability)+ let estimatedTime = 15;+ if (profiles.includes('postgres')) estimatedTime += 20; // PostgreSQL takes longer+ if (profiles.includes('redis')) estimatedTime += 13;+ if (profiles.includes('minio')) estimatedTime += 15;++ const result: OrchestrationResult = {+ success: true,+ message: '',+ containersStarted: [],+ containersStopped: [],+ containersRemoved: [],+ errors: [],+ estimatedTime,+ };++ if (!this.docker || !this.isAvailable) {+ result.success = false;+ result.message = 'Docker is not available';+ return result;+ }++ this.logger.log(`Orchestrating profiles: ${profiles.join(', ')}`);++ // Map profiles to service names+ const profileToService: Record<string, string> = {+ postgres: 'database',+ redis: 'cache',+ minio: 'storage',+ };++ for (const profile of profiles) {+ const service = profileToService[profile] || profile;+ try {+ const started = await this.startService(service);+ if (started) {+ result.containersStarted.push(profile);+ } else {+ // Container might not exist yet - this is expected for first-time setup+ result.errors.push(+ `Service '${profile}' container not found. It may need to be created first with docker-compose.`,+ );+ }+ } catch (error) {+ result.errors.push(`Failed to start ${profile}: ${error instanceof Error ? error.message : 'Unknown error'}`);+ }+ }++ if (result.errors.length > 0) {+ result.success = profiles.length > 0 && result.containersStarted.length > 0;+ result.message = result.errors.join('; ');+ } else {+ result.message = `Successfully orchestrated ${result.containersStarted.length} service(s)`;+ }++ return result;+ }++ /**+ * Get Docker system info+ */+ async getSystemInfo(): Promise<{ available: boolean; info?: Record<string, unknown> }> {+ if (!this.docker || !this.isAvailable) {+ return { available: false };+ }++ try {+ const info = (await this.docker.info()) as {+ Containers: number;+ ContainersRunning: number;+ ContainersPaused: number;+ ContainersStopped: number;+ Images: number;+ ServerVersion: string;+ OperatingSystem: string;+ Architecture: string;+ };+ return {+ available: true,+ info: {+ containers: info.Containers,+ containersRunning: info.ContainersRunning,+ containersPaused: info.ContainersPaused,+ containersStopped: info.ContainersStopped,+ images: info.Images,+ serverVersion: info.ServerVersion,+ operatingSystem: info.OperatingSystem,+ architecture: info.Architecture,+ },+ };+ } catch (error) {+ this.logger.error('Failed to get Docker info', error);+ return { available: false };+ }+ }+}diff --git a/src/modules/docker/index.ts b/src/modules/docker/index.tsnew file mode 100644index 000000000..c4f16f538--- /dev/null+++ b/src/modules/docker/index.ts@@ -0,0 +1,2 @@+export * from './docker.module';+export * from './docker.service';diff --git a/src/modules/events/dto/ws-messages.dto.ts b/src/modules/events/dto/ws-messages.dto.tsnew file mode 100644index 000000000..eadd94459--- /dev/null+++ b/src/modules/events/dto/ws-messages.dto.ts@@ -0,0 +1,116 @@+// src/modules/events/dto/ws-messages.dto.ts++/**+ * WebSocket message types for subscription protocol+ */++// Client -> Server message types+export type WSClientMessageType = 'subscribe' | 'unsubscribe' | 'ping';++// Server -> Client message types+export type WSServerMessageType = 'subscribed' | 'unsubscribed' | 'event' | 'error' | 'pong';++// Valid event types that can be subscribed to+export const SUBSCRIBABLE_EVENTS = [+ 'message.received',+ 'message.sent',+ 'message.ack',+ 'message.revoked',+ 'session.status',+ 'session.qr',+ 'session.authenticated',+ 'session.disconnected',+ 'group.join',+ 'group.leave',+ 'group.update',+] as const;++export type SubscribableEvent = (typeof SUBSCRIBABLE_EVENTS)[number] | '*';++// Client -> Server: Subscribe request+export interface WSSubscribeRequest {+ type: 'subscribe';+ sessionId: string; // Session ID or '*' for all+ events: string[]; // Event types or ['*'] for all+ requestId?: string;+}++// Client -> Server: Unsubscribe request+export interface WSUnsubscribeRequest {+ type: 'unsubscribe';+ sessionId: string;+ requestId?: string;+}++// Client -> Server: Ping+export interface WSPingRequest {+ type: 'ping';+ requestId?: string;+}++// Union type for all client messages+export type WSClientMessage = WSSubscribeRequest | WSUnsubscribeRequest | WSPingRequest;++// Server -> Client: Subscription confirmed+export interface WSSubscribedResponse {+ type: 'subscribed';+ sessionId: string;+ events: string[];+ requestId?: string;+ timestamp: string;+}++// Server -> Client: Unsubscription confirmed+export interface WSUnsubscribedResponse {+ type: 'unsubscribed';+ sessionId: string;+ requestId?: string;+ timestamp: string;+}++// Server -> Client: Event payload+export interface WSEventMessage {+ type: 'event';+ payload: {+ event: string;+ sessionId: string;+ data: unknown;+ };+ timestamp: string;+}++// Server -> Client: Error+export interface WSErrorResponse {+ type: 'error';+ code: string;+ message: string;+ requestId?: string;+ timestamp: string;+}++// Server -> Client: Pong+export interface WSPongResponse {+ type: 'pong';+ requestId?: string;+ timestamp: string;+}++// Union type for all server messages+export type WSServerMessage =+ | WSSubscribedResponse+ | WSUnsubscribedResponse+ | WSEventMessage+ | WSErrorResponse+ | WSPongResponse;++// Room name builder+export function buildRoomName(sessionId: string, event: string): string {+ return `session:${sessionId}:${event}`;+}++// Parse room name back to components+export function parseRoomName(room: string): { sessionId: string; event: string } | null {+ const match = room.match(/^session:([^:]+):(.+)$/);+ if (!match) return null;+ return { sessionId: match[1], event: match[2] };+}diff --git a/src/modules/events/events.gateway.ts b/src/modules/events/events.gateway.tsnew file mode 100644index 000000000..1faa313e8--- /dev/null+++ b/src/modules/events/events.gateway.ts@@ -0,0 +1,249 @@+import {+ WebSocketGateway,+ WebSocketServer,+ OnGatewayInit,+ OnGatewayConnection,+ OnGatewayDisconnect,+ SubscribeMessage,+ MessageBody,+ ConnectedSocket,+} from '@nestjs/websockets';+import { Server, Socket } from 'socket.io';+import { Logger } from '@nestjs/common';+import { AuthService } from '../auth/auth.service';+import type {+ WSClientMessage,+ WSSubscribeRequest,+ WSUnsubscribeRequest,+ WSSubscribedResponse,+ WSUnsubscribedResponse,+ WSEventMessage,+ WSErrorResponse,+ WSPongResponse,+} from './dto/ws-messages.dto';+import { SUBSCRIBABLE_EVENTS, buildRoomName } from './dto/ws-messages.dto';++@WebSocketGateway({+ cors: {+ origin: '*', // In production, restrict this+ },+ namespace: '/events',+})+export class EventsGateway implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect {+ @WebSocketServer()+ server: Server;++ private logger = new Logger('EventsGateway');++ constructor(private readonly authService: AuthService) {}++ afterInit() {+ this.logger.log('WebSocket Gateway initialized');+ }++ async handleConnection(client: Socket) {+ // Extract API key from header or query param+ const apiKey = (client.handshake.headers['x-api-key'] as string) || (client.handshake.query.apiKey as string);++ if (!apiKey) {+ this.logger.warn(`Client ${client.id} rejected: No API key provided`);+ client.emit('message', this.createError('UNAUTHORIZED', 'API key required'));+ client.disconnect();+ return;+ }++ try {+ const validKey = await this.authService.validateApiKey(apiKey);+ if (!validKey) {+ this.logger.warn(`Client ${client.id} rejected: Invalid API key`);+ client.emit('message', this.createError('UNAUTHORIZED', 'Invalid API key'));+ client.disconnect();+ return;+ }++ // Store API key info on socket for later use+ (client.data as { apiKey: unknown }).apiKey = validKey;+ this.logger.log(`Client connected: ${client.id} (key: ${validKey.name})`);+ } catch {+ this.logger.warn(`Client ${client.id} rejected: Auth error`);+ client.emit('message', this.createError('UNAUTHORIZED', 'Authentication failed'));+ client.disconnect();+ }+ }++ handleDisconnect(client: Socket) {+ this.logger.log(`Client disconnected: ${client.id}`);+ }++ @SubscribeMessage('message')+ handleMessage(@ConnectedSocket() client: Socket, @MessageBody() message: WSClientMessage) {+ switch (message.type) {+ case 'subscribe':+ return this.handleSubscribe(client, message);+ case 'unsubscribe':+ return this.handleUnsubscribe(client, message);+ case 'ping':+ return this.handlePing(client, message.requestId);+ default:+ return this.createError(+ 'INVALID_MESSAGE',+ `Unknown message type`,+ (message as { requestId?: string }).requestId,+ );+ }+ }++ private handleSubscribe(client: Socket, message: WSSubscribeRequest): WSSubscribedResponse | WSErrorResponse {+ const { sessionId, events, requestId } = message;++ // Validate sessionId+ if (!sessionId || typeof sessionId !== 'string') {+ return this.createError('INVALID_SESSION', 'sessionId is required', requestId);+ }++ // Validate events+ if (!events || !Array.isArray(events) || events.length === 0) {+ return this.createError('INVALID_EVENTS', 'events array is required', requestId);+ }++ // Validate each event type+ const validEvents = events.filter(+ e => e === '*' || SUBSCRIBABLE_EVENTS.includes(e as (typeof SUBSCRIBABLE_EVENTS)[number]),+ );+ if (validEvents.length === 0) {+ return this.createError(+ 'INVALID_EVENTS',+ `No valid events. Valid: ${SUBSCRIBABLE_EVENTS.join(', ')}, *`,+ requestId,+ );+ }++ // Join rooms for each session/event combination+ const rooms: string[] = [];+ for (const event of validEvents) {+ const room = buildRoomName(sessionId, event);+ void client.join(room);+ rooms.push(room);+ }++ this.logger.debug(`Client ${client.id} subscribed to: ${rooms.join(', ')}`);++ return {+ type: 'subscribed',+ sessionId,+ events: validEvents,+ requestId,+ timestamp: new Date().toISOString(),+ };+ }++ private handleUnsubscribe(client: Socket, message: WSUnsubscribeRequest): WSUnsubscribedResponse {+ const { sessionId, requestId } = message;++ // Leave all rooms for this session+ const clientRooms = Array.from(client.rooms);+ const sessionPrefix = `session:${sessionId}:`;++ for (const room of clientRooms) {+ if (room.startsWith(sessionPrefix) || (sessionId === '*' && room.startsWith('session:'))) {+ void client.leave(room);+ }+ }++ this.logger.debug(`Client ${client.id} unsubscribed from session: ${sessionId}`);++ return {+ type: 'unsubscribed',+ sessionId,+ requestId,+ timestamp: new Date().toISOString(),+ };+ }++ private handlePing(_client: Socket, requestId?: string): WSPongResponse {+ return {+ type: 'pong',+ requestId,+ timestamp: new Date().toISOString(),+ };+ }++ private createError(code: string, message: string, requestId?: string): WSErrorResponse {+ return {+ type: 'error',+ code,+ message,+ requestId,+ timestamp: new Date().toISOString(),+ };+ }++ // ========== Event Emission Methods (room-based) ==========++ /**+ * Emit event to specific rooms based on sessionId and event type+ */+ private emitToRooms(sessionId: string, event: string, data: unknown): void {+ const eventMessage: WSEventMessage = {+ type: 'event',+ payload: { event, sessionId, data },+ timestamp: new Date().toISOString(),+ };++ // Emit to specific session + event room+ this.server.to(buildRoomName(sessionId, event)).emit('message', eventMessage);++ // Emit to wildcard rooms+ this.server.to(buildRoomName(sessionId, '*')).emit('message', eventMessage);+ this.server.to(buildRoomName('*', event)).emit('message', eventMessage);+ this.server.to(buildRoomName('*', '*')).emit('message', eventMessage);+ }++ /**+ * Emit session status change+ */+ emitSessionStatus(sessionId: string, status: string, data?: Record<string, unknown>) {+ this.emitToRooms(sessionId, 'session.status', { status, ...data });+ }++ /**+ * Emit QR code update for a session+ */+ emitQRCode(sessionId: string, qrCode: string) {+ this.emitToRooms(sessionId, 'session.qr', { qrCode });+ }++ /**+ * Emit new message notification+ */+ emitMessage(sessionId: string, message: Record<string, unknown>) {+ this.emitToRooms(sessionId, 'message.received', message);+ }++ /**+ * Emit message sent notification+ */+ emitMessageSent(sessionId: string, message: Record<string, unknown>) {+ this.emitToRooms(sessionId, 'message.sent', message);+ }++ /**+ * Emit message acknowledgment+ */+ emitMessageAck(sessionId: string, data: { messageId: string; ack: number; ackName: string }) {+ this.emitToRooms(sessionId, 'message.ack', data);+ }++ /**+ * Emit webhook delivery status (broadcast to all - no session context)+ */+ emitWebhookStatus(webhookId: string, success: boolean, error?: string) {+ // This one broadcasts to all since webhooks don't have session context in the same way+ this.server.emit('webhook:delivery', {+ webhookId,+ success,+ error,+ timestamp: new Date().toISOString(),+ });+ }+}diff --git a/src/modules/events/events.module.ts b/src/modules/events/events.module.tsnew file mode 100644index 000000000..5a2c2887a--- /dev/null+++ b/src/modules/events/events.module.ts@@ -0,0 +1,11 @@+import { Module, Global } from '@nestjs/common';+import { EventsGateway } from './events.gateway';+import { AuthModule } from '../auth/auth.module';++@Global()+@Module({+ imports: [AuthModule],+ providers: [EventsGateway],+ exports: [EventsGateway],+})+export class EventsModule {}diff --git a/src/modules/group/group.controller.ts b/src/modules/group/group.controller.tsnew file mode 100644index 000000000..69a063dc9--- /dev/null+++ b/src/modules/group/group.controller.ts@@ -0,0 +1,212 @@+import { Controller, Get, Post, Put, Delete, Param, Body, HttpCode, HttpStatus } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiBody } from '@nestjs/swagger';+import { SessionService } from '../session/session.service';++// DTOs+class CreateGroupDto {+ name: string;+ participants: string[];+}++class ParticipantsDto {+ participants: string[];+}++class GroupSubjectDto {+ subject: string;+}++class GroupDescriptionDto {+ description: string;+}++@ApiTags('groups')+@Controller('sessions/:sessionId/groups')+export class GroupController {+ constructor(private readonly sessionService: SessionService) {}++ @Get()+ @ApiOperation({ summary: 'Get all groups for a session' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({ status: 200, description: 'List of groups' })+ async findAll(@Param('sessionId') sessionId: string) {+ const engine = this.getEngine(sessionId);+ return engine.getGroups();+ }++ @Get(':groupId')+ @ApiOperation({ summary: 'Get detailed group info' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID (e.g., [email protected])' })+ @ApiResponse({ status: 200, description: 'Group details with participants' })+ @ApiResponse({ status: 404, description: 'Group not found' })+ async findOne(@Param('sessionId') sessionId: string, @Param('groupId') groupId: string) {+ const engine = this.getEngine(sessionId);+ const group = await engine.getGroupInfo(groupId);+ if (!group) {+ throw new Error(`Group ${groupId} not found`);+ }+ return group;+ }++ @Post()+ @ApiOperation({ summary: 'Create a new group' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiBody({ type: CreateGroupDto })+ @ApiResponse({ status: 201, description: 'Group created' })+ async create(@Param('sessionId') sessionId: string, @Body() dto: CreateGroupDto) {+ const engine = this.getEngine(sessionId);+ return engine.createGroup(dto.name, dto.participants);+ }++ @Post(':groupId/participants')+ @ApiOperation({ summary: 'Add participants to a group' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiBody({ type: ParticipantsDto })+ @ApiResponse({ status: 200, description: 'Participants added' })+ @HttpCode(HttpStatus.OK)+ async addParticipants(+ @Param('sessionId') sessionId: string,+ @Param('groupId') groupId: string,+ @Body() dto: ParticipantsDto,+ ) {+ const engine = this.getEngine(sessionId);+ await engine.addParticipants(groupId, dto.participants);+ return { success: true, message: 'Participants added' };+ }++ @Delete(':groupId/participants')+ @ApiOperation({ summary: 'Remove participants from a group' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiBody({ type: ParticipantsDto })+ @ApiResponse({ status: 200, description: 'Participants removed' })+ async removeParticipants(+ @Param('sessionId') sessionId: string,+ @Param('groupId') groupId: string,+ @Body() dto: ParticipantsDto,+ ) {+ const engine = this.getEngine(sessionId);+ await engine.removeParticipants(groupId, dto.participants);+ return { success: true, message: 'Participants removed' };+ }++ @Post(':groupId/participants/promote')+ @ApiOperation({ summary: 'Promote participants to admin' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiBody({ type: ParticipantsDto })+ @ApiResponse({ status: 200, description: 'Participants promoted' })+ @HttpCode(HttpStatus.OK)+ async promoteParticipants(+ @Param('sessionId') sessionId: string,+ @Param('groupId') groupId: string,+ @Body() dto: ParticipantsDto,+ ) {+ const engine = this.getEngine(sessionId);+ await engine.promoteParticipants(groupId, dto.participants);+ return { success: true, message: 'Participants promoted to admin' };+ }++ @Post(':groupId/participants/demote')+ @ApiOperation({ summary: 'Demote participants from admin' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiBody({ type: ParticipantsDto })+ @ApiResponse({ status: 200, description: 'Participants demoted' })+ @HttpCode(HttpStatus.OK)+ async demoteParticipants(+ @Param('sessionId') sessionId: string,+ @Param('groupId') groupId: string,+ @Body() dto: ParticipantsDto,+ ) {+ const engine = this.getEngine(sessionId);+ await engine.demoteParticipants(groupId, dto.participants);+ return { success: true, message: 'Participants demoted from admin' };+ }++ @Put(':groupId/subject')+ @ApiOperation({ summary: 'Change group name/subject' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiBody({ type: GroupSubjectDto })+ @ApiResponse({ status: 200, description: 'Subject updated' })+ async setSubject(+ @Param('sessionId') sessionId: string,+ @Param('groupId') groupId: string,+ @Body() dto: GroupSubjectDto,+ ) {+ const engine = this.getEngine(sessionId);+ await engine.setGroupSubject(groupId, dto.subject);+ return { success: true, message: 'Group subject updated' };+ }++ @Put(':groupId/description')+ @ApiOperation({ summary: 'Change group description' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiBody({ type: GroupDescriptionDto })+ @ApiResponse({ status: 200, description: 'Description updated' })+ async setDescription(+ @Param('sessionId') sessionId: string,+ @Param('groupId') groupId: string,+ @Body() dto: GroupDescriptionDto,+ ) {+ const engine = this.getEngine(sessionId);+ await engine.setGroupDescription(groupId, dto.description);+ return { success: true, message: 'Group description updated' };+ }++ @Post(':groupId/leave')+ @ApiOperation({ summary: 'Leave a group' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiResponse({ status: 200, description: 'Left the group' })+ @HttpCode(HttpStatus.OK)+ async leave(@Param('sessionId') sessionId: string, @Param('groupId') groupId: string) {+ const engine = this.getEngine(sessionId);+ await engine.leaveGroup(groupId);+ return { success: true, message: 'Left the group' };+ }++ // ========== Gap Quick Wins: Invite Link ==========++ @Get(':groupId/invite-code')+ @ApiOperation({ summary: 'Get group invite code/link' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiResponse({ status: 200, description: 'Group invite code' })+ async getInviteCode(@Param('sessionId') sessionId: string, @Param('groupId') groupId: string) {+ const engine = this.getEngine(sessionId);+ const inviteCode = await engine.getGroupInviteCode(groupId);+ return {+ inviteCode,+ inviteLink: `https://chat.whatsapp.com/${inviteCode}`,+ };+ }++ @Post(':groupId/invite-code/revoke')+ @HttpCode(HttpStatus.OK)+ @ApiOperation({ summary: 'Revoke group invite code and generate new one' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'groupId', description: 'Group ID' })+ @ApiResponse({ status: 200, description: 'New invite code generated' })+ async revokeInviteCode(@Param('sessionId') sessionId: string, @Param('groupId') groupId: string) {+ const engine = this.getEngine(sessionId);+ const newCode = await engine.revokeGroupInviteCode(groupId);+ return {+ inviteCode: newCode,+ inviteLink: `https://chat.whatsapp.com/${newCode}`,+ message: 'Invite code revoked and new one generated',+ };+ }++ private getEngine(sessionId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ return engine;+ }+}diff --git a/src/modules/group/group.module.ts b/src/modules/group/group.module.tsnew file mode 100644index 000000000..422c802ff--- /dev/null+++ b/src/modules/group/group.module.ts@@ -0,0 +1,9 @@+import { Module } from '@nestjs/common';+import { GroupController } from './group.controller';+import { SessionModule } from '../session/session.module';++@Module({+ imports: [SessionModule],+ controllers: [GroupController],+})+export class GroupModule {}diff --git a/src/modules/health/health.controller.spec.ts b/src/modules/health/health.controller.spec.tsnew file mode 100644index 000000000..f0cac40a9--- /dev/null+++ b/src/modules/health/health.controller.spec.ts@@ -0,0 +1,39 @@+import { Test, TestingModule } from '@nestjs/testing';+import { HealthController } from './health.controller';++describe('HealthController', () => {+ let controller: HealthController;++ beforeEach(async () => {+ const module: TestingModule = await Test.createTestingModule({+ controllers: [HealthController],+ }).compile();++ controller = module.get<HealthController>(HealthController);+ });++ describe('check', () => {+ it('should return ok status', () => {+ const result = controller.check();++ expect(result.status).toBe('ok');+ expect(result.timestamp).toBeDefined();+ });+ });++ describe('liveness', () => {+ it('should return ok status for liveness probe', () => {+ const result = controller.liveness();++ expect(result.status).toBe('ok');+ });+ });++ describe('readiness', () => {+ it('should return ok status for readiness probe', () => {+ const result = controller.readiness();++ expect(result.status).toBe('ok');+ });+ });+});diff --git a/src/modules/health/health.controller.ts b/src/modules/health/health.controller.tsnew file mode 100644index 000000000..0fa889440--- /dev/null+++ b/src/modules/health/health.controller.ts@@ -0,0 +1,48 @@+import { Controller, Get } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';+import { Public } from '../auth/decorators/auth.decorators';++interface HealthCheckResult {+ status: 'ok' | 'error';+ info?: Record<string, unknown>;+ error?: Record<string, unknown>;+ details?: Record<string, unknown>;+}++@ApiTags('health')+@Controller('health')+@Public()+export class HealthController {+ @Get()+ @ApiOperation({ summary: 'Basic health check' })+ @ApiResponse({ status: 200, description: 'Application is healthy' })+ check(): { status: string; timestamp: string } {+ return {+ status: 'ok',+ timestamp: new Date().toISOString(),+ };+ }++ @Get('live')+ @ApiOperation({ summary: 'Liveness probe for Kubernetes' })+ @ApiResponse({ status: 200, description: 'Application is alive' })+ liveness(): { status: string } {+ return { status: 'ok' };+ }++ @Get('ready')+ @ApiOperation({ summary: 'Readiness probe for Kubernetes' })+ @ApiResponse({+ status: 200,+ description: 'Application is ready to accept traffic',+ })+ readiness(): HealthCheckResult {+ // In the future, check database connection, Redis, etc.+ return {+ status: 'ok',+ details: {+ database: { status: 'up' },+ },+ };+ }+}diff --git a/src/modules/health/health.module.ts b/src/modules/health/health.module.tsnew file mode 100644index 000000000..7476abedd--- /dev/null+++ b/src/modules/health/health.module.ts@@ -0,0 +1,7 @@+import { Module } from '@nestjs/common';+import { HealthController } from './health.controller';++@Module({+ controllers: [HealthController],+})+export class HealthModule {}diff --git a/src/modules/infra/infra.controller.ts b/src/modules/infra/infra.controller.tsnew file mode 100644index 000000000..f0a8cb83d--- /dev/null+++ b/src/modules/infra/infra.controller.ts@@ -0,0 +1,731 @@+import { Controller, Get, Put, Post, Body } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiBody } from '@nestjs/swagger';+import { ConfigService } from '@nestjs/config';+import { DataSource } from 'typeorm';+import { InjectDataSource } from '@nestjs/typeorm';+import { Public } from '../auth/decorators/auth.decorators';+import { EngineFactory } from '../../engine/engine.factory';+import { DockerService } from '../docker';+import { CacheService } from '../../common/cache/cache.service';+import { StorageService } from '../../common/storage/storage.service';+import * as fs from 'fs';+import * as path from 'path';++interface InfraStatus {+ database: { connected: boolean; type: string; host: string };+ redis: { enabled: boolean; connected: boolean; host: string; port: number };+ queue: {+ enabled: boolean;+ messages: { pending: number; completed: number; failed: number };+ webhooks: { pending: number; completed: number; failed: number };+ };+ storage: { type: 'local' | 's3'; path?: string; bucket?: string };+ engine: { type: string; headless: boolean; sessionDataPath: string; browserArgs: string };+}++interface SaveConfigDto {+ database?: {+ type: 'sqlite' | 'postgres';+ builtIn?: boolean;+ host?: string;+ port?: string;+ username?: string;+ password?: string;+ database?: string;+ poolSize?: number;+ sslEnabled?: boolean;+ };+ redis?: {+ enabled?: boolean;+ builtIn?: boolean;+ host?: string;+ port?: string;+ password?: string;+ };+ queue?: {+ enabled?: boolean;+ };+ storage?: {+ type: 'local' | 's3';+ builtIn?: boolean;+ localPath?: string;+ s3Bucket?: string;+ s3Region?: string;+ s3AccessKey?: string;+ s3SecretKey?: string;+ s3Endpoint?: string;+ };+ engine?: {+ headless?: boolean;+ sessionDataPath?: string;+ browserArgs?: string;+ };+}++// Database migration types for export/import+interface SessionRow {+ id: string;+ name: string;+ status: string;+ phone: string | null;+ pushName: string | null;+ config: string | Record<string, unknown>;+ proxyUrl: string | null;+ proxyType: string | null;+ connectedAt: string | null;+ lastActiveAt: string | null;+ createdAt: string;+ updatedAt: string;+}++interface WebhookRow {+ id: string;+ sessionId: string;+ url: string;+ events: string | string[];+ secret: string | null;+ headers: string | Record<string, string>;+ active: boolean;+ retryCount: number;+ lastTriggeredAt: string | null;+ createdAt: string;+ updatedAt: string;+}++interface MessageRow {+ id: string;+ sessionId: string;+ messageId: string;+ chatId: string;+ direction: string;+ type: string;+ content: string | Record<string, unknown>;+ status: string;+ metadata: string | Record<string, unknown>;+ createdAt: string;+ updatedAt: string;+}++interface MessageBatchRow {+ id: string;+ batchId: string;+ sessionId: string;+ status: string;+ messages: string | unknown[];+ options: string | Record<string, unknown>;+ progress: string | Record<string, unknown>;+ results: string | unknown[];+ currentIndex: number;+ createdAt: string;+ updatedAt: string;+ startedAt: string | null;+ completedAt: string | null;+}++interface MigrationTables {+ sessions: SessionRow[];+ webhooks: WebhookRow[];+ messages: MessageRow[];+ messageBatches: MessageBatchRow[];+}++@ApiTags('infrastructure')+@Controller('infra')+export class InfraController {+ constructor(+ private readonly configService: ConfigService,+ @InjectDataSource('main')+ private readonly mainDataSource: DataSource,+ @InjectDataSource('data')+ private readonly dataDataSource: DataSource,+ private readonly engineFactory: EngineFactory,+ private readonly dockerService: DockerService,+ private readonly cacheService: CacheService,+ private readonly storageService: StorageService,+ ) {}++ @Get('status')+ @ApiOperation({ summary: 'Get infrastructure status' })+ @ApiResponse({ status: 200, description: 'Infrastructure status' })+ async getStatus(): Promise<InfraStatus> {+ // Check both database connections+ const mainDbConnected = this.mainDataSource.isInitialized;+ const dataDbConnected = this.dataDataSource.isInitialized;+ const dbConnected = mainDbConnected && dataDbConnected;+ const dbType = this.configService.get<string>('dataDatabase.type', 'sqlite');+ const dbHost = this.configService.get<string>('dataDatabase.host', 'localhost');++ const redisHost = process.env.REDIS_HOST || this.configService.get<string>('redis.host', 'localhost');+ const redisPort = parseInt(process.env.REDIS_PORT || '', 10) || this.configService.get<number>('redis.port', 6379);+ const redisEnabled = process.env.REDIS_ENABLED === 'true';+ const queueEnabled = this.configService.get<boolean>('queue.enabled', false);++ // Check actual Redis connectivity via CacheService+ const redisConnected = await this.cacheService.isAvailable();++ const storageType = this.configService.get<'local' | 's3'>('storage.type', 'local');+ const storagePath = this.configService.get<string>('storage.path', './uploads');++ const engineType = this.configService.get<string>('engine.type', 'whatsapp-web.js');+ const engineHeadless = this.configService.get<boolean>('engine.headless', true);+ const sessionDataPath = this.configService.get<string>('engine.sessionDataPath', './data/sessions');+ const browserArgs = this.configService.get<string>('engine.browserArgs', '--no-sandbox --disable-gpu');++ return {+ database: { connected: dbConnected, type: dbType, host: dbHost },+ redis: { enabled: redisEnabled, connected: redisConnected, host: redisHost, port: redisPort },+ queue: {+ enabled: queueEnabled,+ messages: { pending: 0, completed: 0, failed: 0 },+ webhooks: { pending: 0, completed: 0, failed: 0 },+ },+ storage: { type: storageType, path: storagePath },+ engine: { type: engineType, headless: engineHeadless, sessionDataPath, browserArgs },+ };+ }++ @Get('engines')+ @ApiOperation({ summary: 'Get available WhatsApp engines' })+ @ApiResponse({ status: 200, description: 'List of available engines' })+ getEngines(): Array<{ id: string; name: string; enabled: boolean; features: string[] }> {+ return this.engineFactory.getAvailableEngines();+ }++ @Get('engines/current')+ @ApiOperation({ summary: 'Get current active engine' })+ @ApiResponse({ status: 200, description: 'Current engine info' })+ getCurrentEngine(): { engineType: string } {+ return { engineType: this.engineFactory.getCurrentEngine() };+ }++ @Put('config')+ @ApiOperation({ summary: 'Save infrastructure configuration to .env file' })+ @ApiResponse({ status: 200, description: 'Configuration saved' })+ @ApiBody({ description: 'Configuration to save' })+ saveConfig(@Body() config: SaveConfigDto): { message: string; saved: boolean; envPath: string; profiles: string[] } {+ try {+ // Build .env content from config+ const envLines: string[] = [];+ const profiles: string[] = [];++ // Header+ envLines.push('# OpenWA Configuration');+ envLines.push(`# Generated at ${new Date().toISOString()}`);+ envLines.push('');++ // Database+ if (config.database) {+ envLines.push('# Database');+ envLines.push(`DATABASE_TYPE=${config.database.type || 'sqlite'}`);+ envLines.push(`POSTGRES_BUILTIN=${config.database.builtIn ? 'true' : 'false'}`);+ if (config.database.type === 'postgres') {+ if (config.database.builtIn) {+ // Built-in PostgreSQL - use container name as host+ envLines.push('DATABASE_HOST=postgres');+ envLines.push('DATABASE_PORT=5432');+ envLines.push('DATABASE_USERNAME=openwa');+ envLines.push('DATABASE_PASSWORD=openwa');+ envLines.push('DATABASE_NAME=openwa');+ profiles.push('postgres');+ } else {+ // External PostgreSQL+ envLines.push(`DATABASE_HOST=${config.database.host || 'localhost'}`);+ envLines.push(`DATABASE_PORT=${config.database.port || '5432'}`);+ envLines.push(`DATABASE_USERNAME=${config.database.username || 'postgres'}`);+ envLines.push(`DATABASE_PASSWORD=${config.database.password || ''}`);+ envLines.push(`DATABASE_NAME=${config.database.database || 'openwa'}`);+ }+ envLines.push(`DATABASE_POOL_SIZE=${config.database.poolSize || 10}`);+ envLines.push(`DATABASE_SSL=${config.database.sslEnabled ? 'true' : 'false'}`);+ }+ envLines.push('');+ }++ // Redis / Queue+ envLines.push('# Redis / Queue System');+ envLines.push(`REDIS_ENABLED=${config.redis?.enabled ? 'true' : 'false'}`);+ envLines.push(`REDIS_BUILTIN=${config.redis?.builtIn ? 'true' : 'false'}`);+ envLines.push(`QUEUE_ENABLED=${config.queue?.enabled ? 'true' : 'false'}`);+ if (config.redis?.enabled) {+ if (config.redis.builtIn) {+ // Built-in Redis - use container name as host+ envLines.push('REDIS_HOST=redis');+ envLines.push('REDIS_PORT=6379');+ profiles.push('redis');+ } else {+ // External Redis+ envLines.push(`REDIS_HOST=${config.redis.host || 'localhost'}`);+ envLines.push(`REDIS_PORT=${config.redis.port || '6379'}`);+ if (config.redis.password) {+ envLines.push(`REDIS_PASSWORD=${config.redis.password}`);+ }+ }+ }+ envLines.push('');++ // Storage+ if (config.storage) {+ envLines.push('# Storage');+ envLines.push(`STORAGE_TYPE=${config.storage.type || 'local'}`);+ envLines.push(`MINIO_BUILTIN=${config.storage.builtIn ? 'true' : 'false'}`);+ if (config.storage.type === 'local') {+ envLines.push(`STORAGE_PATH=${config.storage.localPath || './uploads'}`);+ } else if (config.storage.type === 's3') {+ if (config.storage.builtIn) {+ // Built-in MinIO - use container name as endpoint+ envLines.push('S3_ENDPOINT=http://minio:9000');+ envLines.push('S3_ACCESS_KEY=minioadmin');+ envLines.push('S3_SECRET_KEY=minioadmin');+ envLines.push('S3_BUCKET=openwa');+ envLines.push('S3_REGION=us-east-1');+ profiles.push('minio');+ } else {+ // External S3/MinIO+ envLines.push(`S3_BUCKET=${config.storage.s3Bucket || ''}`);+ envLines.push(`S3_REGION=${config.storage.s3Region || 'ap-southeast-1'}`);+ envLines.push(`S3_ACCESS_KEY=${config.storage.s3AccessKey || ''}`);+ envLines.push(`S3_SECRET_KEY=${config.storage.s3SecretKey || ''}`);+ if (config.storage.s3Endpoint) {+ envLines.push(`S3_ENDPOINT=${config.storage.s3Endpoint}`);+ }+ }+ }+ envLines.push('');+ }++ // Engine+ if (config.engine) {+ envLines.push('# WhatsApp Engine');+ envLines.push(`ENGINE_HEADLESS=${config.engine.headless !== false ? 'true' : 'false'}`);+ envLines.push(`ENGINE_SESSION_PATH=${config.engine.sessionDataPath || './data/sessions'}`);+ envLines.push(`ENGINE_BROWSER_ARGS=${config.engine.browserArgs || '--no-sandbox --disable-gpu'}`);+ envLines.push('');+ }++ // Docker Profiles (for reference)+ envLines.push('# Docker Profiles (auto-generated)');+ envLines.push(`# Required profiles: ${profiles.length > 0 ? profiles.join(', ') : 'none'}`);+ envLines.push('');++ // Write to .env file in data/ directory so it persists across container restarts+ const envPath = path.resolve(process.cwd(), 'data', '.env.generated');+ fs.writeFileSync(envPath, envLines.join('\n'), 'utf8');+ console.log('[InfraController] Configuration saved to:', envPath);++ const profileMsg = profiles.length > 0 ? ` Docker profiles required: ${profiles.join(', ')}.` : '';++ return {+ message: `Configuration saved successfully.${profileMsg} Server restart required to apply changes.`,+ saved: true,+ envPath,+ profiles,+ };+ } catch (error) {+ return {+ message: `Failed to save configuration: ${error instanceof Error ? error.message : 'Unknown error'}`,+ saved: false,+ envPath: '',+ profiles: [],+ };+ }+ }+ @Post('restart')+ @ApiOperation({ summary: 'Request server restart with Docker orchestration' })+ @ApiResponse({ status: 200, description: 'Server will restart with new profiles' })+ async requestRestart(@Body() body?: { profiles?: string[]; profilesToRemove?: string[] }): Promise<{+ message: string;+ restarting: boolean;+ profiles: string[];+ profilesToRemove: string[];+ estimatedTime: number;+ orchestration?: object;+ removal?: object;+ }> {+ const profiles = body?.profiles || [];+ const profilesToRemove = body?.profilesToRemove || [];+ let orchestrationResult: object | undefined;+ let removalResult: { removed: string[]; errors: string[] } | undefined;++ console.log('[InfraController] Restart requested with profiles:', profiles);+ console.log('[InfraController] Profiles to remove:', profilesToRemove);++ // If profiles are specified, orchestrate Docker containers+ if (this.dockerService.isDockerAvailable()) {+ // First, remove containers for disabled services+ if (profilesToRemove.length > 0) {+ console.log('[InfraController] Removing disabled profiles...');+ removalResult = { removed: [], errors: [] };++ for (const profile of profilesToRemove) {+ try {+ const success = await this.dockerService.removeService(profile);+ if (success) {+ removalResult.removed.push(profile);+ } else {+ removalResult.errors.push(`Failed to remove ${profile}`);+ }+ } catch (err) {+ removalResult.errors.push(`Error removing ${profile}: ${err}`);+ }+ }+ console.log('[InfraController] Removal result:', removalResult);+ }++ // Then, start containers for enabled services+ if (profiles.length > 0) {+ console.log('[InfraController] Orchestrating enabled profiles...');+ orchestrationResult = await this.dockerService.orchestrateProfiles(profiles);+ console.log('[InfraController] Orchestration result:', orchestrationResult);+ }+ } else {+ console.log('[InfraController] Docker not available, writing signal file instead');+ // Fallback: write signal file for host script+ try {+ const signalFile = path.resolve(process.cwd(), 'data', '.orchestration-request.json');+ const orchestrationRequest = {+ timestamp: new Date().toISOString(),+ profiles,+ profilesToRemove,+ action: 'restart-with-profiles',+ };+ fs.writeFileSync(signalFile, JSON.stringify(orchestrationRequest, null, 2), 'utf8');+ console.log('[InfraController] Orchestration request written to:', signalFile);+ } catch (err) {+ console.error('[InfraController] Failed to write orchestration request:', err);+ }+ }++ // Schedule process exit after delay to allow response and container orchestration+ setTimeout(() => {+ console.log('[InfraController] Server restart requested. Exiting process...');+ process.exit(0); // Docker restart policy will restart the container+ }, 3000); // Increased to 3s to allow more time for container operations++ // Calculate estimated time - base 15s + additional for each service (increased for reliability)+ let estimatedTime = 15;+ if (profiles.includes('postgres')) estimatedTime += 20;+ if (profiles.includes('redis')) estimatedTime += 13;+ if (profiles.includes('minio')) estimatedTime += 15;+ if (profilesToRemove.length > 0) estimatedTime += profilesToRemove.length * 5; // +5s per removal++ return {+ message:+ profiles.length > 0 || profilesToRemove.length > 0+ ? `Server is restarting. Enabling: ${profiles.join(', ') || 'none'}. Disabling: ${profilesToRemove.join(', ') || 'none'}.`+ : 'Server is restarting. Please wait...',+ restarting: true,+ profiles,+ profilesToRemove,+ estimatedTime,+ orchestration: orchestrationResult,+ removal: removalResult,+ };+ }++ @Get('health')+ @Public()+ @ApiOperation({ summary: 'Health check endpoint' })+ @ApiResponse({ status: 200, description: 'Server is healthy' })+ healthCheck(): { status: string; timestamp: string } {+ return {+ status: 'ok',+ timestamp: new Date().toISOString(),+ };+ }++ @Get('export-data')+ @ApiOperation({ summary: 'Export all data from Data DB for migration' })+ @ApiResponse({ status: 200, description: 'Exported data as JSON' })+ async exportData(): Promise<{+ exportedAt: string;+ dataDbType: string;+ tables: MigrationTables;+ counts: { sessions: number; webhooks: number; messages: number; messageBatches: number };+ }> {+ // Get all entities from Data DB+ const sessions = await this.dataDataSource.query<SessionRow[]>('SELECT * FROM sessions');+ const webhooks = await this.dataDataSource.query<WebhookRow[]>('SELECT * FROM webhooks');++ // Messages table may not exist yet or be empty+ let messages: MessageRow[] = [];+ let messageBatches: MessageBatchRow[] = [];++ try {+ messages = await this.dataDataSource.query<MessageRow[]>('SELECT * FROM messages');+ } catch {+ // Table may not exist yet+ }++ try {+ messageBatches = await this.dataDataSource.query<MessageBatchRow[]>('SELECT * FROM message_batches');+ } catch {+ // Table may not exist yet+ }++ return {+ exportedAt: new Date().toISOString(),+ dataDbType: this.configService.get<string>('dataDatabase.type', 'sqlite'),+ tables: {+ sessions,+ webhooks,+ messages,+ messageBatches,+ },+ counts: {+ sessions: sessions.length,+ webhooks: webhooks.length,+ messages: messages.length,+ messageBatches: messageBatches.length,+ },+ };+ }++ @Post('import-data')+ @ApiOperation({ summary: 'Import data to Data DB (replaces existing data)' })+ @ApiBody({+ description: 'Exported data from export-data endpoint',+ schema: {+ type: 'object',+ properties: {+ tables: {+ type: 'object',+ properties: {+ sessions: { type: 'array' },+ webhooks: { type: 'array' },+ messages: { type: 'array' },+ messageBatches: { type: 'array' },+ },+ },+ },+ },+ })+ @ApiResponse({ status: 200, description: 'Data imported successfully' })+ async importData(+ @Body()+ data: {+ tables: Partial<MigrationTables>;+ },+ ): Promise<{+ imported: boolean;+ counts: { sessions: number; webhooks: number; messages: number; messageBatches: number };+ warnings: string[];+ }> {+ const warnings: string[] = [];+ const queryRunner = this.dataDataSource.createQueryRunner();+ await queryRunner.connect();+ await queryRunner.startTransaction();++ try {+ // Clear existing data (in correct order due to foreign keys)+ await queryRunner.query('DELETE FROM webhooks');+ await queryRunner.query('DELETE FROM messages').catch(() => {});+ await queryRunner.query('DELETE FROM message_batches').catch(() => {});+ await queryRunner.query('DELETE FROM sessions');++ // Import sessions first+ let sessionsCount = 0;+ if (data.tables.sessions?.length) {+ for (const session of data.tables.sessions) {+ try {+ await queryRunner.query(+ `INSERT INTO sessions (id, name, status, phone, "pushName", config, "proxyUrl", "proxyType", "connectedAt", "lastActiveAt", "createdAt", "updatedAt")+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)`,+ [+ session.id,+ session.name,+ session.status,+ session.phone,+ session.pushName,+ typeof session.config === 'string' ? session.config : JSON.stringify(session.config || {}),+ session.proxyUrl,+ session.proxyType,+ session.connectedAt,+ session.lastActiveAt,+ session.createdAt,+ session.updatedAt,+ ],+ );+ sessionsCount++;+ } catch (err) {+ warnings.push(`Failed to import session ${session.id}: ${err}`);+ }+ }+ }++ // Import webhooks+ let webhooksCount = 0;+ if (data.tables.webhooks?.length) {+ for (const webhook of data.tables.webhooks) {+ try {+ await queryRunner.query(+ `INSERT INTO webhooks (id, "sessionId", url, events, secret, headers, active, "retryCount", "lastTriggeredAt", "createdAt", "updatedAt")+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)`,+ [+ webhook.id,+ webhook.sessionId,+ webhook.url,+ typeof webhook.events === 'string' ? webhook.events : JSON.stringify(webhook.events || []),+ webhook.secret,+ typeof webhook.headers === 'string' ? webhook.headers : JSON.stringify(webhook.headers || {}),+ webhook.active,+ webhook.retryCount,+ webhook.lastTriggeredAt,+ webhook.createdAt,+ webhook.updatedAt,+ ],+ );+ webhooksCount++;+ } catch (err) {+ warnings.push(`Failed to import webhook ${webhook.id}: ${err}`);+ }+ }+ }++ // Import messages (optional)+ let messagesCount = 0;+ if (data.tables.messages?.length) {+ for (const msg of data.tables.messages) {+ try {+ await queryRunner.query(+ `INSERT INTO messages (id, "sessionId", "messageId", "chatId", direction, type, content, status, metadata, "createdAt", "updatedAt")+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)`,+ [+ msg.id,+ msg.sessionId,+ msg.messageId,+ msg.chatId,+ msg.direction,+ msg.type,+ typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content || {}),+ msg.status,+ typeof msg.metadata === 'string' ? msg.metadata : JSON.stringify(msg.metadata || {}),+ msg.createdAt,+ msg.updatedAt,+ ],+ );+ messagesCount++;+ } catch (err) {+ warnings.push(`Failed to import message ${msg.id}: ${err}`);+ }+ }+ }++ // Import message batches (optional)+ let messageBatchesCount = 0;+ if (data.tables.messageBatches?.length) {+ for (const batch of data.tables.messageBatches) {+ try {+ await queryRunner.query(+ `INSERT INTO message_batches (id, "batchId", "sessionId", status, messages, options, progress, results, "currentIndex", "createdAt", "updatedAt", "startedAt", "completedAt")+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)`,+ [+ batch.id,+ batch.batchId,+ batch.sessionId,+ batch.status,+ typeof batch.messages === 'string' ? batch.messages : JSON.stringify(batch.messages || []),+ typeof batch.options === 'string' ? batch.options : JSON.stringify(batch.options || {}),+ typeof batch.progress === 'string' ? batch.progress : JSON.stringify(batch.progress || {}),+ typeof batch.results === 'string' ? batch.results : JSON.stringify(batch.results || []),+ batch.currentIndex,+ batch.createdAt,+ batch.updatedAt,+ batch.startedAt,+ batch.completedAt,+ ],+ );+ messageBatchesCount++;+ } catch (err) {+ warnings.push(`Failed to import message batch ${batch.id}: ${err}`);+ }+ }+ }++ await queryRunner.commitTransaction();++ return {+ imported: true,+ counts: {+ sessions: sessionsCount,+ webhooks: webhooksCount,+ messages: messagesCount,+ messageBatches: messageBatchesCount,+ },+ warnings,+ };+ } catch (error) {+ await queryRunner.rollbackTransaction();+ throw error;+ } finally {+ await queryRunner.release();+ }+ }++ // ============================================================================+ // STORAGE MIGRATION API+ // ============================================================================++ @Get('storage/files/count')+ @ApiOperation({ summary: 'Get file count in current storage' })+ @ApiResponse({ status: 200, description: 'File count and size' })+ async getStorageFileCount(): Promise<{+ storageType: string;+ count: number;+ sizeBytes: number;+ sizeMB: string;+ }> {+ const { count, sizeBytes } = await this.storageService.getFileCount();+ return {+ storageType: this.storageService.getCurrentStorageType(),+ count,+ sizeBytes,+ sizeMB: (sizeBytes / 1024 / 1024).toFixed(2),+ };+ }++ @Get('storage/export')+ @ApiOperation({ summary: 'Export all storage files as tar.gz' })+ @ApiResponse({ status: 200, description: 'Tar.gz archive stream' })+ async exportStorage(): Promise<{ message: string; download: string }> {+ // Note: In production, this would return a StreamableFile+ // For simplicity, we'll save to a temp file and return the path+ const stream = await this.storageService.createExportStream();+ const exportPath = path.join(process.cwd(), 'data', `storage-export-${Date.now()}.tar.gz`);++ const writeStream = fs.createWriteStream(exportPath);+ stream.pipe(writeStream);++ await new Promise<void>((resolve, reject) => {+ writeStream.on('finish', resolve);+ writeStream.on('error', reject);+ });++ return {+ message: 'Storage export completed',+ download: exportPath,+ };+ }++ @Post('storage/import')+ @ApiOperation({ summary: 'Import storage files from tar.gz' })+ @ApiBody({ description: 'Path to tar.gz file to import' })+ @ApiResponse({ status: 200, description: 'Import result' })+ async importStorage(+ @Body() body: { filePath: string },+ ): Promise<{ imported: boolean; count: number; storageType: string }> {+ const { filePath } = body;++ if (!fs.existsSync(filePath)) {+ throw new Error(`File not found: ${filePath}`);+ }++ const readStream = fs.createReadStream(filePath);+ const count = await this.storageService.importFromStream(readStream);++ return {+ imported: true,+ count,+ storageType: this.storageService.getCurrentStorageType(),+ };+ }+}diff --git a/src/modules/infra/infra.module.ts b/src/modules/infra/infra.module.tsnew file mode 100644index 000000000..00a0d97e2--- /dev/null+++ b/src/modules/infra/infra.module.ts@@ -0,0 +1,10 @@+import { Module } from '@nestjs/common';+import { InfraController } from './infra.controller';+import { EngineModule } from '../../engine/engine.module';+import { DockerModule } from '../docker';++@Module({+ imports: [EngineModule, DockerModule],+ controllers: [InfraController],+})+export class InfraModule {}diff --git a/src/modules/label/label.controller.ts b/src/modules/label/label.controller.tsnew file mode 100644index 000000000..b6baead5f--- /dev/null+++ b/src/modules/label/label.controller.ts@@ -0,0 +1,108 @@+import { Controller, Get, Post, Delete, Param, Body } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiBody } from '@nestjs/swagger';+import { SessionService } from '../session/session.service';++@ApiTags('labels')+@Controller('sessions/:sessionId/labels')+export class LabelController {+ constructor(private readonly sessionService: SessionService) {}++ private getEngine(sessionId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new Error('Session is not started');+ }+ return engine;+ }++ @Get()+ @ApiOperation({ summary: 'Get all labels (WhatsApp Business only)' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'List of labels',+ })+ @ApiResponse({ status: 400, description: 'Session not ready or not a business account' })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async findAll(@Param('sessionId') sessionId: string) {+ const engine = this.getEngine(sessionId);+ return engine.getLabels();+ }++ @Get(':labelId')+ @ApiOperation({ summary: 'Get a specific label by ID' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'labelId', description: 'Label ID' })+ @ApiResponse({+ status: 200,+ description: 'Label details',+ })+ @ApiResponse({ status: 404, description: 'Label not found' })+ async findOne(@Param('sessionId') sessionId: string, @Param('labelId') labelId: string) {+ const engine = this.getEngine(sessionId);+ const label = await engine.getLabelById(labelId);+ if (!label) {+ throw new Error(`Label ${labelId} not found`);+ }+ return label;+ }++ @Get('chat/:chatId')+ @ApiOperation({ summary: 'Get labels for a specific chat' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'chatId', description: 'Chat ID' })+ @ApiResponse({+ status: 200,+ description: 'List of labels for the chat',+ })+ async getChatLabels(@Param('sessionId') sessionId: string, @Param('chatId') chatId: string) {+ const engine = this.getEngine(sessionId);+ return engine.getChatLabels(chatId);+ }++ @Post('chat/:chatId')+ @ApiOperation({ summary: 'Add a label to a chat' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'chatId', description: 'Chat ID' })+ @ApiBody({+ schema: {+ type: 'object',+ properties: {+ labelId: { type: 'string', description: 'Label ID to add' },+ },+ required: ['labelId'],+ },+ })+ @ApiResponse({+ status: 200,+ description: 'Label added to chat',+ })+ async addLabelToChat(+ @Param('sessionId') sessionId: string,+ @Param('chatId') chatId: string,+ @Body() body: { labelId: string },+ ) {+ const engine = this.getEngine(sessionId);+ await engine.addLabelToChat(chatId, body.labelId);+ return { success: true };+ }++ @Delete('chat/:chatId/:labelId')+ @ApiOperation({ summary: 'Remove a label from a chat' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'chatId', description: 'Chat ID' })+ @ApiParam({ name: 'labelId', description: 'Label ID to remove' })+ @ApiResponse({+ status: 200,+ description: 'Label removed from chat',+ })+ async removeLabelFromChat(+ @Param('sessionId') sessionId: string,+ @Param('chatId') chatId: string,+ @Param('labelId') labelId: string,+ ) {+ const engine = this.getEngine(sessionId);+ await engine.removeLabelFromChat(chatId, labelId);+ return { success: true };+ }+}diff --git a/src/modules/label/label.module.ts b/src/modules/label/label.module.tsnew file mode 100644index 000000000..d89320240--- /dev/null+++ b/src/modules/label/label.module.ts@@ -0,0 +1,9 @@+import { Module } from '@nestjs/common';+import { LabelController } from './label.controller';+import { SessionModule } from '../session/session.module';++@Module({+ imports: [SessionModule],+ controllers: [LabelController],+})+export class LabelModule {}diff --git a/src/modules/message/bulk-message.service.ts b/src/modules/message/bulk-message.service.tsnew file mode 100644index 000000000..debb4a9f0--- /dev/null+++ b/src/modules/message/bulk-message.service.ts@@ -0,0 +1,299 @@+import { Injectable, Logger, BadRequestException, NotFoundException } from '@nestjs/common';+import { InjectRepository } from '@nestjs/typeorm';+import { Repository } from 'typeorm';+import { randomUUID } from 'crypto';+import {+ MessageBatch,+ BatchStatus,+ BatchMessageStatus,+ BatchProgress,+ BatchMessageResult,+} from './entities/message-batch.entity';+import { SendBulkMessageDto } from './dto/bulk-message.dto';+import { SessionService } from '../session/session.service';+import { IWhatsAppEngine } from '../../engine/interfaces/whatsapp-engine.interface';++// Type definitions for bulk message content+interface BulkMessageContent {+ text?: string;+ caption?: string;+ image?: { url?: string; base64?: string; mimetype?: string };+ video?: { url?: string; base64?: string; mimetype?: string };+ audio?: { url?: string; base64?: string; mimetype?: string };+ document?: { url?: string; base64?: string; mimetype?: string; filename?: string };+}++@Injectable()+export class BulkMessageService {+ private readonly logger = new Logger(BulkMessageService.name);+ private readonly processingBatches = new Map<string, boolean>(); // Track active batches for cancellation++ constructor(+ @InjectRepository(MessageBatch, 'data')+ private readonly batchRepository: Repository<MessageBatch>,+ private readonly sessionService: SessionService,+ ) {}++ async createBatch(sessionId: string, dto: SendBulkMessageDto): Promise<MessageBatch> {+ // Validate session exists+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new BadRequestException(`Session '${sessionId}' is not active`);+ }++ const batchId = dto.batchId || `batch_${randomUUID().split('-')[0]}`;++ // Check if batchId already exists+ const existing = await this.batchRepository.findOne({ where: { batchId } });+ if (existing) {+ throw new BadRequestException(`Batch ID '${batchId}' already exists`);+ }++ const options = {+ delayBetweenMessages: dto.options?.delayBetweenMessages ?? 3000,+ randomizeDelay: dto.options?.randomizeDelay ?? true,+ stopOnError: dto.options?.stopOnError ?? false,+ };++ const progress: BatchProgress = {+ total: dto.messages.length,+ sent: 0,+ failed: 0,+ pending: dto.messages.length,+ cancelled: 0,+ };++ const batch = this.batchRepository.create({+ batchId,+ sessionId,+ status: BatchStatus.PENDING,+ messages: dto.messages,+ options,+ progress,+ results: [],+ currentIndex: 0,+ });++ await this.batchRepository.save(batch);+ this.logger.log(`Created batch ${batchId} with ${dto.messages.length} messages`);++ // Start processing asynchronously+ this.processBatch(batch.id).catch(err => {+ this.logger.error(`Batch ${batchId} processing error: ${String(err)}`);+ });++ return batch;+ }++ async getBatchStatus(sessionId: string, batchId: string): Promise<MessageBatch> {+ const batch = await this.batchRepository.findOne({+ where: { batchId, sessionId },+ });++ if (!batch) {+ throw new NotFoundException(`Batch '${batchId}' not found`);+ }++ return batch;+ }++ async cancelBatch(sessionId: string, batchId: string): Promise<MessageBatch> {+ const batch = await this.batchRepository.findOne({+ where: { batchId, sessionId },+ });++ if (!batch) {+ throw new NotFoundException(`Batch '${batchId}' not found`);+ }++ if (batch.status === BatchStatus.COMPLETED || batch.status === BatchStatus.CANCELLED) {+ throw new BadRequestException(`Batch '${batchId}' is already ${batch.status}`);+ }++ // Signal cancellation+ this.processingBatches.set(batch.id, false);++ // Update status+ batch.status = BatchStatus.CANCELLED;+ batch.progress.cancelled = batch.progress.pending;+ batch.progress.pending = 0;+ batch.completedAt = new Date();++ await this.batchRepository.save(batch);+ this.logger.log(`Cancelled batch ${batchId}`);++ return batch;+ }++ private async processBatch(batchDbId: string): Promise<void> {+ const batch = await this.batchRepository.findOne({ where: { id: batchDbId } });+ if (!batch) return;++ this.processingBatches.set(batch.id, true);++ // Update status to processing+ batch.status = BatchStatus.PROCESSING;+ batch.startedAt = new Date();+ await this.batchRepository.save(batch);++ const engine = this.sessionService.getEngine(batch.sessionId);+ if (!engine) {+ batch.status = BatchStatus.FAILED;+ batch.completedAt = new Date();+ await this.batchRepository.save(batch);+ return;+ }++ const results: BatchMessageResult[] = batch.results || [];++ for (let i = batch.currentIndex; i < batch.messages.length; i++) {+ // Check for cancellation+ if (!this.processingBatches.get(batch.id)) {+ this.logger.log(`Batch ${batch.batchId} cancelled at index ${i}`);+ break;+ }++ const msg = batch.messages[i];+ const result: BatchMessageResult = {+ chatId: msg.chatId,+ status: BatchMessageStatus.PENDING,+ };++ try {+ // Apply template variables+ const content: BulkMessageContent = this.applyVariables(msg.content as BulkMessageContent, msg.variables);++ // Send message based on type+ const messageResult = await this.sendMessage(engine, msg.chatId, msg.type, content);++ result.status = BatchMessageStatus.SENT;+ result.messageId = messageResult.id;+ result.sentAt = new Date();+ batch.progress.sent++;+ batch.progress.pending--;++ this.logger.debug(`Batch ${batch.batchId}: Sent message ${i + 1}/${batch.messages.length} to ${msg.chatId}`);+ } catch (error) {+ result.status = BatchMessageStatus.FAILED;+ result.error = {+ code: 'SEND_FAILED',+ message: String(error),+ };+ batch.progress.failed++;+ batch.progress.pending--;++ this.logger.warn(`Batch ${batch.batchId}: Failed message ${i + 1} to ${msg.chatId}: ${String(error)}`);++ if (batch.options.stopOnError) {+ batch.status = BatchStatus.FAILED;+ results.push(result);+ break;+ }+ }++ results.push(result);+ batch.currentIndex = i + 1;+ batch.results = results;++ // Save progress periodically (every 10 messages or last message)+ if (i % 10 === 0 || i === batch.messages.length - 1) {+ await this.batchRepository.save(batch);+ }++ // Delay before next message (except for last)+ if (i < batch.messages.length - 1 && this.processingBatches.get(batch.id)) {+ const delay = this.calculateDelay(batch.options);+ await this.sleep(delay);+ }+ }++ // Final update+ if (this.processingBatches.get(batch.id)) {+ batch.status =+ batch.progress.failed > 0 && batch.progress.sent === 0 ? BatchStatus.FAILED : BatchStatus.COMPLETED;+ }+ batch.completedAt = new Date();+ batch.results = results;+ await this.batchRepository.save(batch);++ this.processingBatches.delete(batch.id);+ this.logger.log(`Batch ${batch.batchId} completed: ${batch.progress.sent} sent, ${batch.progress.failed} failed`);+ }++ private applyVariables(content: BulkMessageContent, variables?: Record<string, string>): BulkMessageContent {+ if (!variables) return content;++ const replaceVars = (str: string): string => {+ return str.replace(/\{(\w+)\}/g, (_, key: string) => variables[key] || `{${key}}`);+ };++ const processValue = (value: unknown): unknown => {+ if (typeof value === 'string') {+ return replaceVars(value);+ }+ if (Array.isArray(value)) {+ return value.map(processValue);+ }+ if (typeof value === 'object' && value !== null) {+ const result: Record<string, unknown> = {};+ for (const [k, v] of Object.entries(value as Record<string, unknown>)) {+ result[k] = processValue(v);+ }+ return result;+ }+ return value;+ };++ return processValue(content) as BulkMessageContent;+ }++ private sendMessage(+ engine: IWhatsAppEngine,+ chatId: string,+ type: string,+ content: BulkMessageContent,+ ): Promise<{ id: string }> {+ switch (type) {+ case 'text':+ return engine.sendTextMessage(chatId, content.text || '');+ case 'image':+ return engine.sendImageMessage(chatId, {+ mimetype: content.image?.mimetype || 'image/jpeg',+ data: content.image?.url || content.image?.base64 || '',+ caption: content.caption,+ });+ case 'video':+ return engine.sendVideoMessage(chatId, {+ mimetype: content.video?.mimetype || 'video/mp4',+ data: content.video?.url || content.video?.base64 || '',+ caption: content.caption,+ });+ case 'audio':+ return engine.sendAudioMessage(chatId, {+ mimetype: content.audio?.mimetype || 'audio/mpeg',+ data: content.audio?.url || content.audio?.base64 || '',+ });+ case 'document':+ return engine.sendDocumentMessage(chatId, {+ mimetype: content.document?.mimetype || 'application/octet-stream',+ data: content.document?.url || content.document?.base64 || '',+ filename: content.document?.filename,+ caption: content.caption,+ });+ default:+ return Promise.reject(new Error(`Unsupported message type: ${type}`));+ }+ }++ private calculateDelay(options: { delayBetweenMessages: number; randomizeDelay: boolean }): number {+ let delay = options.delayBetweenMessages;+ if (options.randomizeDelay) {+ delay += Math.random() * 2000; // Add 0-2 seconds random+ }+ return delay;+ }++ private sleep(ms: number): Promise<void> {+ return new Promise(resolve => setTimeout(resolve, ms));+ }+}diff --git a/src/modules/message/dto/bulk-message.dto.ts b/src/modules/message/dto/bulk-message.dto.tsnew file mode 100644index 000000000..5659de3dd--- /dev/null+++ b/src/modules/message/dto/bulk-message.dto.ts@@ -0,0 +1,112 @@+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';+import {+ IsString,+ IsArray,+ IsOptional,+ IsNumber,+ IsBoolean,+ ValidateNested,+ Min,+ Max,+ ArrayMaxSize,+} from 'class-validator';+import { Type } from 'class-transformer';++class BulkMessageContentDto {+ @ApiPropertyOptional({ description: 'Text content for text messages' })+ @IsOptional()+ @IsString()+ text?: string;++ @ApiPropertyOptional({ description: 'Image URL or base64' })+ image?: { url?: string; base64?: string; mimetype?: string };++ @ApiPropertyOptional({ description: 'Video URL or base64' })+ video?: { url?: string; base64?: string; mimetype?: string };++ @ApiPropertyOptional({ description: 'Audio URL or base64' })+ audio?: { url?: string; base64?: string; mimetype?: string };++ @ApiPropertyOptional({ description: 'Document URL or base64' })+ document?: { url?: string; base64?: string; mimetype?: string; filename?: string };++ @ApiPropertyOptional({ description: 'Caption for media messages' })+ @IsOptional()+ @IsString()+ caption?: string;+}++class BulkMessageItemDto {+ @ApiProperty({ description: 'Recipient chat ID', example: '[email protected]' })+ @IsString()+ chatId: string;++ @ApiProperty({ description: 'Message type', enum: ['text', 'image', 'video', 'audio', 'document'] })+ @IsString()+ type: 'text' | 'image' | 'video' | 'audio' | 'document';++ @ApiProperty({ description: 'Message content based on type' })+ @ValidateNested()+ @Type(() => BulkMessageContentDto)+ content: BulkMessageContentDto;++ @ApiPropertyOptional({ description: 'Variables for template substitution' })+ @IsOptional()+ variables?: Record<string, string>;+}++class BulkMessageOptionsDto {+ @ApiPropertyOptional({ description: 'Delay between messages in ms (min: 1000, default: 3000)', default: 3000 })+ @IsOptional()+ @IsNumber()+ @Min(1000)+ @Max(60000)+ delayBetweenMessages?: number;++ @ApiPropertyOptional({ description: 'Add random 0-2s to delay', default: true })+ @IsOptional()+ @IsBoolean()+ randomizeDelay?: boolean;++ @ApiPropertyOptional({ description: 'Stop batch on first error', default: false })+ @IsOptional()+ @IsBoolean()+ stopOnError?: boolean;+}++export class SendBulkMessageDto {+ @ApiPropertyOptional({ description: 'Custom batch ID (auto-generated if not provided)' })+ @IsOptional()+ @IsString()+ batchId?: string;++ @ApiProperty({ description: 'Array of messages (max 100 per request)', type: [BulkMessageItemDto] })+ @IsArray()+ @ArrayMaxSize(100)+ @ValidateNested({ each: true })+ @Type(() => BulkMessageItemDto)+ messages: BulkMessageItemDto[];++ @ApiPropertyOptional({ description: 'Batch processing options' })+ @IsOptional()+ @ValidateNested()+ @Type(() => BulkMessageOptionsDto)+ options?: BulkMessageOptionsDto;+}++export class BulkMessageResponseDto {+ @ApiProperty()+ batchId: string;++ @ApiProperty()+ status: string;++ @ApiProperty()+ totalMessages: number;++ @ApiPropertyOptional()+ estimatedCompletionTime?: string;++ @ApiProperty()+ statusUrl: string;+}diff --git a/src/modules/message/dto/index.ts b/src/modules/message/dto/index.tsnew file mode 100644index 000000000..d19dd5eaf--- /dev/null+++ b/src/modules/message/dto/index.ts@@ -0,0 +1 @@+export * from './send-message.dto';diff --git a/src/modules/message/dto/send-message.dto.ts b/src/modules/message/dto/send-message.dto.tsnew file mode 100644index 000000000..387435fad--- /dev/null+++ b/src/modules/message/dto/send-message.dto.ts@@ -0,0 +1,84 @@+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';+import { IsString, IsNotEmpty, IsOptional, MaxLength, IsUrl, ValidateIf } from 'class-validator';++export class SendTextMessageDto {+ @ApiProperty({+ description: 'WhatsApp chat ID ([email protected] for individual, [email protected] for groups)',+ example: '[email protected]',+ })+ @IsString()+ @IsNotEmpty()+ chatId: string;++ @ApiProperty({+ description: 'Text message content',+ example: 'Hello from OpenWA!',+ maxLength: 4096,+ })+ @IsString()+ @IsNotEmpty()+ @MaxLength(4096)+ text: string;+}++export class SendMediaMessageDto {+ @ApiProperty({+ description: 'WhatsApp chat ID',+ example: '[email protected]',+ })+ @IsString()+ @IsNotEmpty()+ chatId: string;++ @ApiPropertyOptional({+ description: 'Media URL (http/https)',+ example: 'https://example.com/image.jpg',+ })+ @IsOptional()+ @IsUrl()+ @ValidateIf((o: SendMediaMessageDto) => !o.base64)+ url?: string;++ @ApiPropertyOptional({+ description: 'Base64 encoded media data',+ })+ @IsOptional()+ @IsString()+ @ValidateIf((o: SendMediaMessageDto) => !o.url)+ base64?: string;++ @ApiPropertyOptional({+ description: 'Media MIME type (required when using base64)',+ example: 'image/jpeg',+ })+ @IsOptional()+ @IsString()+ mimetype?: string;++ @ApiPropertyOptional({+ description: 'Filename for the media',+ example: 'image.jpg',+ })+ @IsOptional()+ @IsString()+ @MaxLength(255)+ filename?: string;++ @ApiPropertyOptional({+ description: 'Caption for the media',+ example: 'Check out this image!',+ maxLength: 1024,+ })+ @IsOptional()+ @IsString()+ @MaxLength(1024)+ caption?: string;+}++export class MessageResponseDto {+ @ApiProperty({ example: '[email protected]_3EB0123456789' })+ messageId: string;++ @ApiProperty({ example: 1706868000 })+ timestamp: number;+}diff --git a/src/modules/message/entities/message-batch.entity.ts b/src/modules/message/entities/message-batch.entity.tsnew file mode 100644index 000000000..e22d376c0--- /dev/null+++ b/src/modules/message/entities/message-batch.entity.ts@@ -0,0 +1,87 @@+import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';+import { DateTransformer } from '../../../common/transformers/date.transformer';++export enum BatchStatus {+ PENDING = 'pending',+ PROCESSING = 'processing',+ COMPLETED = 'completed',+ CANCELLED = 'cancelled',+ FAILED = 'failed',+}++export enum BatchMessageStatus {+ PENDING = 'pending',+ SENT = 'sent',+ FAILED = 'failed',+ CANCELLED = 'cancelled',+}++export interface BatchMessageResult {+ chatId: string;+ status: BatchMessageStatus;+ messageId?: string;+ error?: {+ code: string;+ message: string;+ };+ sentAt?: Date;+}++export interface BatchProgress {+ total: number;+ sent: number;+ failed: number;+ pending: number;+ cancelled: number;+}++@Entity('message_batches')+export class MessageBatch {+ @PrimaryGeneratedColumn('uuid')+ id: string;++ @Column({ name: 'batch_id', unique: true })+ batchId: string;++ @Column({ name: 'session_id' })+ sessionId: string;++ @Column({ type: 'varchar', default: BatchStatus.PENDING })+ status: BatchStatus;++ @Column({ type: 'simple-json' })+ messages: Array<{+ chatId: string;+ type: string;+ content: any;+ variables?: Record<string, string>;+ }>;++ @Column({ type: 'simple-json', nullable: true })+ options: {+ delayBetweenMessages: number;+ randomizeDelay: boolean;+ stopOnError: boolean;+ };++ @Column({ type: 'simple-json', nullable: true })+ progress: BatchProgress;++ @Column({ type: 'simple-json', nullable: true })+ results: BatchMessageResult[];++ @Column({ name: 'current_index', default: 0 })+ currentIndex: number;++ @CreateDateColumn({ name: 'created_at' })+ createdAt: Date;++ @UpdateDateColumn({ name: 'updated_at' })+ updatedAt: Date;++ @Column({ name: 'started_at', type: 'text', nullable: true, transformer: DateTransformer })+ startedAt: Date | null;++ @Column({ name: 'completed_at', type: 'text', nullable: true, transformer: DateTransformer })+ completedAt: Date | null;+}diff --git a/src/modules/message/entities/message.entity.ts b/src/modules/message/entities/message.entity.tsnew file mode 100644index 000000000..51f352910--- /dev/null+++ b/src/modules/message/entities/message.entity.ts@@ -0,0 +1,66 @@+import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, Index } from 'typeorm';++export enum MessageDirection {+ INCOMING = 'incoming',+ OUTGOING = 'outgoing',+}++export enum MessageStatus {+ PENDING = 'pending',+ SENT = 'sent',+ DELIVERED = 'delivered',+ READ = 'read',+ FAILED = 'failed',+}++@Entity('messages')+@Index(['sessionId', 'createdAt'])+@Index(['chatId'])+export class Message {+ @PrimaryGeneratedColumn('uuid')+ id: string;++ @Column()+ @Index()+ sessionId: string;++ @Column({ nullable: true })+ waMessageId: string;++ @Column()+ chatId: string;++ @Column()+ from: string;++ @Column()+ to: string;++ @Column({ type: 'text', nullable: true })+ body: string;++ @Column({ default: 'text' })+ type: string;++ @Column({+ type: 'varchar',+ default: MessageDirection.OUTGOING,+ })+ direction: MessageDirection;++ @Column({ type: 'bigint', nullable: true })+ timestamp: number;++ @Column({ type: 'simple-json', nullable: true })+ metadata: Record<string, unknown>;++ @Column({+ type: 'varchar',+ default: MessageStatus.SENT,+ })+ @Index()+ status: MessageStatus;++ @CreateDateColumn()+ createdAt: Date;+}diff --git a/src/modules/message/message.controller.ts b/src/modules/message/message.controller.tsnew file mode 100644index 000000000..8c84eed6a--- /dev/null+++ b/src/modules/message/message.controller.ts@@ -0,0 +1,364 @@+import { Controller, Post, Get, Param, Body, Query, HttpCode, HttpStatus } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiParam, ApiQuery } from '@nestjs/swagger';+import { MessageService } from './message.service';+import { BulkMessageService } from './bulk-message.service';+import { SendTextMessageDto, SendMediaMessageDto, MessageResponseDto } from './dto';+import { SendBulkMessageDto, BulkMessageResponseDto } from './dto/bulk-message.dto';+import { RequireRole } from '../auth/decorators/auth.decorators';+import { ApiKeyRole } from '../auth/entities/api-key.entity';++@ApiTags('messages')+@Controller('sessions/:sessionId/messages')+export class MessageController {+ constructor(+ private readonly messageService: MessageService,+ private readonly bulkMessageService: BulkMessageService,+ ) {}++ @Get()+ @ApiOperation({ summary: 'Get message history for a session' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiQuery({ name: 'chatId', required: false, description: 'Filter by chat ID' })+ @ApiQuery({ name: 'limit', required: false, type: Number, description: 'Max messages to return (default 50)' })+ @ApiQuery({ name: 'offset', required: false, type: Number, description: 'Offset for pagination' })+ @ApiResponse({+ status: 200,+ description: 'Message history',+ })+ async getMessages(+ @Param('sessionId') sessionId: string,+ @Query('chatId') chatId?: string,+ @Query('limit') limit?: string,+ @Query('offset') offset?: string,+ ) {+ return this.messageService.getMessages(sessionId, {+ chatId,+ limit: limit ? parseInt(limit, 10) : undefined,+ offset: offset ? parseInt(offset, 10) : undefined,+ });+ }++ @Post('send-text')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Send a text message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Message sent',+ type: MessageResponseDto,+ })+ @ApiResponse({+ status: 400,+ description: 'Session not active or invalid request',+ })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async sendText(@Param('sessionId') sessionId: string, @Body() dto: SendTextMessageDto): Promise<MessageResponseDto> {+ return this.messageService.sendText(sessionId, dto);+ }++ @Post('send-image')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Send an image message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Image sent',+ type: MessageResponseDto,+ })+ @ApiResponse({+ status: 400,+ description: 'Session not active or invalid request',+ })+ async sendImage(+ @Param('sessionId') sessionId: string,+ @Body() dto: SendMediaMessageDto,+ ): Promise<MessageResponseDto> {+ return this.messageService.sendImage(sessionId, dto);+ }++ @Post('send-video')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Send a video message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Video sent',+ type: MessageResponseDto,+ })+ @ApiResponse({+ status: 400,+ description: 'Session not active or invalid request',+ })+ async sendVideo(+ @Param('sessionId') sessionId: string,+ @Body() dto: SendMediaMessageDto,+ ): Promise<MessageResponseDto> {+ return this.messageService.sendVideo(sessionId, dto);+ }++ @Post('send-audio')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Send an audio/voice message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Audio sent',+ type: MessageResponseDto,+ })+ @ApiResponse({+ status: 400,+ description: 'Session not active or invalid request',+ })+ async sendAudio(+ @Param('sessionId') sessionId: string,+ @Body() dto: SendMediaMessageDto,+ ): Promise<MessageResponseDto> {+ return this.messageService.sendAudio(sessionId, dto);+ }++ @Post('send-document')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Send a document/file' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Document sent',+ type: MessageResponseDto,+ })+ @ApiResponse({+ status: 400,+ description: 'Session not active or invalid request',+ })+ async sendDocument(+ @Param('sessionId') sessionId: string,+ @Body() dto: SendMediaMessageDto,+ ): Promise<MessageResponseDto> {+ return this.messageService.sendDocument(sessionId, dto);+ }++ // ========== Phase 3: Extended Messaging ==========++ @Post('send-location')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Send a location message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Location sent',+ type: MessageResponseDto,+ })+ async sendLocation(+ @Param('sessionId') sessionId: string,+ @Body() dto: { chatId: string; latitude: number; longitude: number; description?: string; address?: string },+ ): Promise<MessageResponseDto> {+ return this.messageService.sendLocation(sessionId, dto);+ }++ @Post('send-contact')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Send a contact card message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Contact sent',+ type: MessageResponseDto,+ })+ async sendContact(+ @Param('sessionId') sessionId: string,+ @Body() dto: { chatId: string; contactName: string; contactNumber: string },+ ): Promise<MessageResponseDto> {+ return this.messageService.sendContact(sessionId, dto);+ }++ @Post('send-sticker')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Send a sticker message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Sticker sent',+ type: MessageResponseDto,+ })+ async sendSticker(+ @Param('sessionId') sessionId: string,+ @Body() dto: SendMediaMessageDto,+ ): Promise<MessageResponseDto> {+ return this.messageService.sendSticker(sessionId, dto);+ }++ @Post('reply')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Reply to a message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Reply sent',+ type: MessageResponseDto,+ })+ async reply(+ @Param('sessionId') sessionId: string,+ @Body() dto: { chatId: string; quotedMessageId: string; text: string },+ ): Promise<MessageResponseDto> {+ return this.messageService.reply(sessionId, dto);+ }++ @Post('forward')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Forward a message to another chat' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Message forwarded',+ type: MessageResponseDto,+ })+ async forward(+ @Param('sessionId') sessionId: string,+ @Body() dto: { fromChatId: string; toChatId: string; messageId: string },+ ): Promise<MessageResponseDto> {+ return this.messageService.forward(sessionId, dto);+ }++ // ========== Phase 3: Reactions ==========++ @Post('react')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Add or remove a reaction to a message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'Reaction added or removed. Send empty emoji to remove reaction.',+ })+ @ApiResponse({+ status: 400,+ description: 'Session not active or message not found',+ })+ async react(+ @Param('sessionId') sessionId: string,+ @Body() dto: { chatId: string; messageId: string; emoji: string },+ ): Promise<{ success: boolean }> {+ await this.messageService.reactToMessage(sessionId, dto);+ return { success: true };+ }++ @Get(':chatId/:messageId/reactions')+ @ApiOperation({ summary: 'Get reactions for a specific message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'chatId', description: 'Chat ID containing the message' })+ @ApiParam({ name: 'messageId', description: 'Message ID to get reactions for' })+ @ApiResponse({+ status: 200,+ description: 'List of reactions with senders',+ })+ async getReactions(+ @Param('sessionId') sessionId: string,+ @Param('chatId') chatId: string,+ @Param('messageId') messageId: string,+ ) {+ return this.messageService.getMessageReactions(sessionId, chatId, messageId);+ }++ // ========== Delete Message ==========++ @Post('delete')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Delete a message' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'Message deleted',+ })+ @ApiResponse({+ status: 400,+ description: 'Session not active or message not found',+ })+ async deleteMessage(+ @Param('sessionId') sessionId: string,+ @Body() dto: { chatId: string; messageId: string; forEveryone?: boolean },+ ): Promise<{ success: boolean }> {+ await this.messageService.deleteMessage(sessionId, dto);+ return { success: true };+ }++ // ========== Bulk Messaging ==========++ @Post('send-bulk')+ @RequireRole(ApiKeyRole.OPERATOR)+ @HttpCode(HttpStatus.ACCEPTED)+ @ApiOperation({ summary: 'Send messages to multiple recipients (async batch processing)' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 202,+ description: 'Batch created and processing started',+ type: BulkMessageResponseDto,+ })+ @ApiResponse({+ status: 400,+ description: 'Session not active or invalid request',+ })+ async sendBulk(+ @Param('sessionId') sessionId: string,+ @Body() dto: SendBulkMessageDto,+ ): Promise<BulkMessageResponseDto> {+ const batch = await this.bulkMessageService.createBatch(sessionId, dto);+ const estimatedTime = new Date(Date.now() + batch.messages.length * (batch.options?.delayBetweenMessages || 3000));++ return {+ batchId: batch.batchId,+ status: batch.status,+ totalMessages: batch.messages.length,+ estimatedCompletionTime: estimatedTime.toISOString(),+ statusUrl: `/api/sessions/${sessionId}/messages/batch/${batch.batchId}`,+ };+ }++ @Get('batch/:batchId')+ @ApiOperation({ summary: 'Get batch processing status' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'batchId', description: 'Batch ID' })+ @ApiResponse({+ status: 200,+ description: 'Batch status and progress',+ })+ @ApiResponse({+ status: 404,+ description: 'Batch not found',+ })+ async getBatchStatus(@Param('sessionId') sessionId: string, @Param('batchId') batchId: string) {+ const batch = await this.bulkMessageService.getBatchStatus(sessionId, batchId);+ return {+ batchId: batch.batchId,+ status: batch.status,+ progress: batch.progress,+ results: batch.results,+ startedAt: batch.startedAt,+ completedAt: batch.completedAt,+ };+ }++ @Post('batch/:batchId/cancel')+ @RequireRole(ApiKeyRole.OPERATOR)+ @HttpCode(HttpStatus.OK)+ @ApiOperation({ summary: 'Cancel a running batch' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'batchId', description: 'Batch ID' })+ @ApiResponse({+ status: 200,+ description: 'Batch cancelled',+ })+ @ApiResponse({+ status: 400,+ description: 'Batch already completed or cancelled',+ })+ @ApiResponse({+ status: 404,+ description: 'Batch not found',+ })+ async cancelBatch(@Param('sessionId') sessionId: string, @Param('batchId') batchId: string) {+ const batch = await this.bulkMessageService.cancelBatch(sessionId, batchId);+ return {+ batchId: batch.batchId,+ status: batch.status,+ progress: batch.progress,+ };+ }+}diff --git a/src/modules/message/message.module.ts b/src/modules/message/message.module.tsnew file mode 100644index 000000000..8051f3a39--- /dev/null+++ b/src/modules/message/message.module.ts@@ -0,0 +1,16 @@+import { Module } from '@nestjs/common';+import { TypeOrmModule } from '@nestjs/typeorm';+import { MessageService } from './message.service';+import { BulkMessageService } from './bulk-message.service';+import { MessageController } from './message.controller';+import { SessionModule } from '../session/session.module';+import { Message } from './entities/message.entity';+import { MessageBatch } from './entities/message-batch.entity';++@Module({+ imports: [TypeOrmModule.forFeature([Message, MessageBatch], 'data'), SessionModule],+ controllers: [MessageController],+ providers: [MessageService, BulkMessageService],+ exports: [MessageService, BulkMessageService],+})+export class MessageModule {}diff --git a/src/modules/message/message.service.ts b/src/modules/message/message.service.tsnew file mode 100644index 000000000..ed848b374--- /dev/null+++ b/src/modules/message/message.service.ts@@ -0,0 +1,374 @@+import { Injectable, BadRequestException } from '@nestjs/common';+import { InjectRepository } from '@nestjs/typeorm';+import { Repository } from 'typeorm';+import { SessionService } from '../session/session.service';+import { SendTextMessageDto, SendMediaMessageDto, MessageResponseDto } from './dto';+import { MediaInput } from '../../engine/interfaces/whatsapp-engine.interface';+import { Message, MessageDirection } from './entities/message.entity';+import { HookManager } from '../../core/hooks';++export interface GetMessagesOptions {+ chatId?: string;+ limit?: number;+ offset?: number;+}++@Injectable()+export class MessageService {+ constructor(+ @InjectRepository(Message, 'data')+ private readonly messageRepository: Repository<Message>,+ private readonly sessionService: SessionService,+ private readonly hookManager: HookManager,+ ) {}++ async sendText(sessionId: string, dto: SendTextMessageDto): Promise<MessageResponseDto> {+ // Execute hook before sending - plugins can modify or block+ const { continue: shouldContinue, data: hookData } = await this.hookManager.execute(+ 'message:sending',+ { sessionId, input: dto, type: 'text' },+ { sessionId, source: 'MessageService' },+ );++ if (!shouldContinue) {+ throw new BadRequestException('Message sending blocked by plugin');+ }++ // Use potentially modified input+ const finalDto = (hookData as { input: SendTextMessageDto }).input;++ const engine = this.getEngine(sessionId);++ try {+ const result = await engine.sendTextMessage(finalDto.chatId, finalDto.text);++ // Save to history+ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: finalDto.chatId,+ body: finalDto.text,+ type: 'text',+ timestamp: result.timestamp,+ });++ // Execute hook after successful send+ await this.hookManager.execute(+ 'message:sent',+ { sessionId, result, input: finalDto },+ { sessionId, source: 'MessageService' },+ );++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ } catch (error) {+ // Execute hook on failure+ await this.hookManager.execute(+ 'message:failed',+ { sessionId, error: error instanceof Error ? error.message : String(error), input: finalDto },+ { sessionId, source: 'MessageService' },+ );++ throw error;+ }+ }++ async sendImage(sessionId: string, dto: SendMediaMessageDto): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const media = this.buildMediaInput(dto);+ const result = await engine.sendImageMessage(dto.chatId, media);++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.chatId,+ body: dto.caption || '',+ type: 'image',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ async sendVideo(sessionId: string, dto: SendMediaMessageDto): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const media = this.buildMediaInput(dto);+ const result = await engine.sendVideoMessage(dto.chatId, media);++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.chatId,+ body: dto.caption || '',+ type: 'video',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ async sendAudio(sessionId: string, dto: SendMediaMessageDto): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const media = this.buildMediaInput(dto);+ const result = await engine.sendAudioMessage(dto.chatId, media);++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.chatId,+ type: 'audio',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ async sendDocument(sessionId: string, dto: SendMediaMessageDto): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const media = this.buildMediaInput(dto);+ const result = await engine.sendDocumentMessage(dto.chatId, media);++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.chatId,+ body: dto.filename || '',+ type: 'document',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ /**+ * Get message history for a session+ */+ async getMessages(+ sessionId: string,+ options: GetMessagesOptions = {},+ ): Promise<{ messages: Message[]; total: number }> {+ const { chatId, limit = 50, offset = 0 } = options;++ const query = this.messageRepository+ .createQueryBuilder('message')+ .where('message.sessionId = :sessionId', { sessionId })+ .orderBy('message.createdAt', 'DESC')+ .skip(offset)+ .take(limit);++ if (chatId) {+ query.andWhere('message.chatId = :chatId', { chatId });+ }++ const [messages, total] = await query.getManyAndCount();+ return { messages, total };+ }++ // ========== Phase 3: Extended Messaging ==========++ async sendLocation(+ sessionId: string,+ dto: { chatId: string; latitude: number; longitude: number; description?: string; address?: string },+ ): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const result = await engine.sendLocationMessage(dto.chatId, {+ latitude: dto.latitude,+ longitude: dto.longitude,+ description: dto.description,+ address: dto.address,+ });++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.chatId,+ body: `📍 ${dto.description || 'Location'}`,+ type: 'location',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ async sendContact(+ sessionId: string,+ dto: { chatId: string; contactName: string; contactNumber: string },+ ): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const result = await engine.sendContactMessage(dto.chatId, {+ name: dto.contactName,+ number: dto.contactNumber,+ });++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.chatId,+ body: `📇 ${dto.contactName}`,+ type: 'contact',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ async sendSticker(sessionId: string, dto: SendMediaMessageDto): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const media = this.buildMediaInput(dto);+ const result = await engine.sendStickerMessage(dto.chatId, media);++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.chatId,+ type: 'sticker',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ async reply(+ sessionId: string,+ dto: { chatId: string; quotedMessageId: string; text: string },+ ): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const result = await engine.replyToMessage(dto.chatId, dto.quotedMessageId, dto.text);++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.chatId,+ body: dto.text,+ type: 'text',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ async forward(+ sessionId: string,+ dto: { fromChatId: string; toChatId: string; messageId: string },+ ): Promise<MessageResponseDto> {+ const engine = this.getEngine(sessionId);+ const result = await engine.forwardMessage(dto.fromChatId, dto.toChatId, dto.messageId);++ await this.saveOutgoingMessage(sessionId, {+ waMessageId: result.id,+ chatId: dto.toChatId,+ body: '[Forwarded]',+ type: 'forward',+ timestamp: result.timestamp,+ });++ return {+ messageId: result.id,+ timestamp: result.timestamp,+ };+ }++ /**+ * Save incoming message (called from session webhook dispatch)+ */+ async saveIncomingMessage(sessionId: string, data: Partial<Message>): Promise<Message> {+ const message = this.messageRepository.create({+ ...data,+ sessionId,+ direction: MessageDirection.INCOMING,+ });+ return this.messageRepository.save(message);+ }++ /**+ * Save outgoing message after successful send+ */+ private async saveOutgoingMessage(+ sessionId: string,+ data: {+ waMessageId: string;+ chatId: string;+ body?: string;+ type: string;+ timestamp: number;+ },+ ): Promise<Message> {+ const session = await this.sessionService.findOne(sessionId);+ const message = this.messageRepository.create({+ sessionId,+ waMessageId: data.waMessageId,+ chatId: data.chatId,+ from: session?.phone || 'me',+ to: data.chatId,+ body: data.body,+ type: data.type,+ direction: MessageDirection.OUTGOING,+ timestamp: data.timestamp,+ });+ return this.messageRepository.save(message);+ }++ // ========== Phase 3: Reactions ==========++ async reactToMessage(sessionId: string, dto: { chatId: string; messageId: string; emoji: string }): Promise<void> {+ const engine = this.getEngine(sessionId);+ await engine.reactToMessage(dto.chatId, dto.messageId, dto.emoji);+ }++ async getMessageReactions(sessionId: string, chatId: string, messageId: string) {+ const engine = this.getEngine(sessionId);+ return engine.getMessageReactions(chatId, messageId);+ }++ // ========== Delete Message ==========++ async deleteMessage(+ sessionId: string,+ dto: { chatId: string; messageId: string; forEveryone?: boolean },+ ): Promise<void> {+ const engine = this.getEngine(sessionId);+ await engine.deleteMessage(dto.chatId, dto.messageId, dto.forEveryone ?? true);+ }++ private getEngine(sessionId: string) {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new BadRequestException(`Session '${sessionId}' is not active. Start the session first.`);+ }+ return engine;+ }++ private buildMediaInput(dto: SendMediaMessageDto): MediaInput {+ if (!dto.url && !dto.base64) {+ throw new BadRequestException('Either url or base64 must be provided');+ }++ if (dto.base64 && !dto.mimetype) {+ throw new BadRequestException('mimetype is required when using base64 data');+ }++ return {+ mimetype: dto.mimetype || 'application/octet-stream',+ data: dto.url || dto.base64!,+ filename: dto.filename,+ caption: dto.caption,+ };+ }+}diff --git a/src/modules/plugins/dto/index.ts b/src/modules/plugins/dto/index.tsnew file mode 100644index 000000000..f7a871100--- /dev/null+++ b/src/modules/plugins/dto/index.ts@@ -0,0 +1 @@+export * from './plugin.dto';diff --git a/src/modules/plugins/dto/plugin.dto.ts b/src/modules/plugins/dto/plugin.dto.tsnew file mode 100644index 000000000..4ea813642--- /dev/null+++ b/src/modules/plugins/dto/plugin.dto.ts@@ -0,0 +1,54 @@+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';+import { IsObject } from 'class-validator';+import type { PluginConfigSchema } from '../../../core/plugins';+import { PluginType, PluginStatus } from '../../../core/plugins';++export class PluginDto {+ @ApiProperty({ description: 'Plugin ID' })+ id!: string;++ @ApiProperty({ description: 'Plugin name' })+ name!: string;++ @ApiProperty({ description: 'Plugin version' })+ version!: string;++ @ApiProperty({ enum: PluginType, description: 'Plugin type' })+ type!: PluginType;++ @ApiPropertyOptional({ description: 'Plugin description' })+ description?: string;++ @ApiPropertyOptional({ description: 'Plugin author' })+ author?: string;++ @ApiProperty({ enum: PluginStatus, description: 'Plugin status' })+ status!: PluginStatus;++ @ApiProperty({ description: 'Plugin configuration' })+ config!: Record<string, unknown>;++ @ApiProperty({ description: 'Whether this is a built-in plugin' })+ builtIn!: boolean;++ @ApiProperty({ description: 'Features provided by this plugin' })+ provides!: string[];++ @ApiPropertyOptional({ description: 'Configuration schema' })+ configSchema?: PluginConfigSchema;++ @ApiPropertyOptional({ description: 'When the plugin was loaded' })+ loadedAt?: string;++ @ApiPropertyOptional({ description: 'When the plugin was enabled' })+ enabledAt?: string;++ @ApiPropertyOptional({ description: 'Error message if plugin is in error state' })+ error?: string;+}++export class PluginConfigDto {+ @ApiProperty({ description: 'Plugin configuration object' })+ @IsObject()+ config!: Record<string, unknown>;+}diff --git a/src/modules/plugins/plugins.controller.ts b/src/modules/plugins/plugins.controller.tsnew file mode 100644index 000000000..870bccecd--- /dev/null+++ b/src/modules/plugins/plugins.controller.ts@@ -0,0 +1,56 @@+import { Controller, Get, Post, Put, Param, Body, HttpCode, HttpStatus } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';+import { PluginsService } from './plugins.service';+import { PluginDto, PluginConfigDto } from './dto/plugin.dto';++@ApiTags('plugins')+@ApiBearerAuth()+@Controller('plugins')+export class PluginsController {+ constructor(private readonly pluginsService: PluginsService) {}++ @Get()+ @ApiOperation({ summary: 'List all plugins' })+ @ApiResponse({ status: 200, description: 'List of all plugins' })+ findAll(): PluginDto[] {+ return this.pluginsService.findAll();+ }++ @Get(':id')+ @ApiOperation({ summary: 'Get plugin by ID' })+ @ApiResponse({ status: 200, description: 'Plugin details' })+ @ApiResponse({ status: 404, description: 'Plugin not found' })+ findOne(@Param('id') id: string): PluginDto {+ return this.pluginsService.findOne(id);+ }++ @Post(':id/enable')+ @HttpCode(HttpStatus.OK)+ @ApiOperation({ summary: 'Enable a plugin' })+ @ApiResponse({ status: 200, description: 'Plugin enabled successfully' })+ async enable(@Param('id') id: string): Promise<{ success: boolean; message: string }> {+ return await this.pluginsService.enable(id);+ }++ @Post(':id/disable')+ @HttpCode(HttpStatus.OK)+ @ApiOperation({ summary: 'Disable a plugin' })+ @ApiResponse({ status: 200, description: 'Plugin disabled successfully' })+ async disable(@Param('id') id: string): Promise<{ success: boolean; message: string }> {+ return await this.pluginsService.disable(id);+ }++ @Put(':id/config')+ @ApiOperation({ summary: 'Update plugin configuration' })+ @ApiResponse({ status: 200, description: 'Plugin configuration updated' })+ updateConfig(@Param('id') id: string, @Body() configDto: PluginConfigDto): { success: boolean; message: string } {+ return this.pluginsService.updateConfig(id, configDto.config);+ }++ @Get(':id/health')+ @ApiOperation({ summary: 'Check plugin health' })+ @ApiResponse({ status: 200, description: 'Plugin health status' })+ async healthCheck(@Param('id') id: string): Promise<{ healthy: boolean; message?: string }> {+ return await this.pluginsService.healthCheck(id);+ }+}diff --git a/src/modules/plugins/plugins.module.ts b/src/modules/plugins/plugins.module.tsnew file mode 100644index 000000000..dc3b35daf--- /dev/null+++ b/src/modules/plugins/plugins.module.ts@@ -0,0 +1,10 @@+import { Module } from '@nestjs/common';+import { PluginsController } from './plugins.controller';+import { PluginsService } from './plugins.service';++@Module({+ controllers: [PluginsController],+ providers: [PluginsService],+ exports: [PluginsService],+})+export class PluginsApiModule {}diff --git a/src/modules/plugins/plugins.service.ts b/src/modules/plugins/plugins.service.tsnew file mode 100644index 000000000..6376c1f83--- /dev/null+++ b/src/modules/plugins/plugins.service.ts@@ -0,0 +1,137 @@+import { Injectable, NotFoundException } from '@nestjs/common';+import { PluginLoaderService, PluginStatus } from '../../core/plugins';+import { PluginDto } from './dto/plugin.dto';++@Injectable()+export class PluginsService {+ constructor(private readonly pluginLoader: PluginLoaderService) {}++ findAll(): PluginDto[] {+ const plugins = this.pluginLoader.getAllPlugins();++ return plugins.map(plugin => ({+ id: plugin.manifest.id,+ name: plugin.manifest.name,+ version: plugin.manifest.version,+ type: plugin.manifest.type,+ description: plugin.manifest.description,+ author: plugin.manifest.author,+ status: plugin.status,+ config: plugin.config,+ builtIn: plugin.manifest.id === 'whatsapp-web.js', // Built-in engines+ provides: plugin.manifest.provides ?? [],+ configSchema: plugin.manifest.configSchema,+ loadedAt: plugin.loadedAt?.toISOString(),+ enabledAt: plugin.enabledAt?.toISOString(),+ error: plugin.error,+ }));+ }++ findOne(id: string): PluginDto {+ const plugin = this.pluginLoader.getPlugin(id);++ if (!plugin) {+ throw new NotFoundException(`Plugin ${id} not found`);+ }++ return {+ id: plugin.manifest.id,+ name: plugin.manifest.name,+ version: plugin.manifest.version,+ type: plugin.manifest.type,+ description: plugin.manifest.description,+ author: plugin.manifest.author,+ status: plugin.status,+ config: plugin.config,+ builtIn: plugin.manifest.id === 'whatsapp-web.js',+ provides: plugin.manifest.provides ?? [],+ configSchema: plugin.manifest.configSchema,+ loadedAt: plugin.loadedAt?.toISOString(),+ enabledAt: plugin.enabledAt?.toISOString(),+ error: plugin.error,+ };+ }++ async enable(id: string): Promise<{ success: boolean; message: string }> {+ const plugin = this.pluginLoader.getPlugin(id);++ if (!plugin) {+ throw new NotFoundException(`Plugin ${id} not found`);+ }++ if (plugin.status === PluginStatus.ENABLED) {+ return { success: true, message: `Plugin ${id} is already enabled` };+ }++ try {+ await this.pluginLoader.enablePlugin(id);+ return { success: true, message: `Plugin ${id} enabled successfully` };+ } catch (error) {+ return {+ success: false,+ message: error instanceof Error ? error.message : String(error),+ };+ }+ }++ async disable(id: string): Promise<{ success: boolean; message: string }> {+ const plugin = this.pluginLoader.getPlugin(id);++ if (!plugin) {+ throw new NotFoundException(`Plugin ${id} not found`);+ }++ if (plugin.status !== PluginStatus.ENABLED) {+ return { success: true, message: `Plugin ${id} is not enabled` };+ }++ try {+ await this.pluginLoader.disablePlugin(id);+ return { success: true, message: `Plugin ${id} disabled successfully` };+ } catch (error) {+ return {+ success: false,+ message: error instanceof Error ? error.message : String(error),+ };+ }+ }++ updateConfig(id: string, config: Record<string, unknown>): { success: boolean; message: string } {+ const plugin = this.pluginLoader.getPlugin(id);++ if (!plugin) {+ throw new NotFoundException(`Plugin ${id} not found`);+ }++ try {+ this.pluginLoader.updatePluginConfig(id, config);+ return { success: true, message: `Plugin ${id} configuration updated` };+ } catch (error) {+ return {+ success: false,+ message: error instanceof Error ? error.message : String(error),+ };+ }+ }++ async healthCheck(id: string): Promise<{ healthy: boolean; message?: string }> {+ const plugin = this.pluginLoader.getPlugin(id);++ if (!plugin) {+ throw new NotFoundException(`Plugin ${id} not found`);+ }++ if (!plugin.instance?.healthCheck) {+ return { healthy: true, message: 'Plugin does not implement health check' };+ }++ try {+ return await plugin.instance.healthCheck();+ } catch (error) {+ return {+ healthy: false,+ message: error instanceof Error ? error.message : String(error),+ };+ }+ }+}diff --git a/src/modules/queue/processors/message.processor.ts b/src/modules/queue/processors/message.processor.tsnew file mode 100644index 000000000..257d9e2e1--- /dev/null+++ b/src/modules/queue/processors/message.processor.ts@@ -0,0 +1,54 @@+import { Processor, WorkerHost } from '@nestjs/bullmq';+import { Job } from 'bullmq';+import { createLogger } from '../../../common/services/logger.service';+import { QUEUE_NAMES } from '../queue-names';++export interface MessageJobData {+ sessionId: string;+ to: string;+ content: string;+ type: 'text' | 'media';+ mediaUrl?: string;+ mediaType?: string;+}++export interface MessageJobResult {+ messageId: string;+ timestamp: Date;+ status: 'sent' | 'failed';+ error?: string;+}++/**+ * @deprecated This processor is a placeholder and NOT IMPLEMENTED.+ * Message queue is not yet functional. Using this will result in an error.+ *+ * TODO: Implement actual message delivery via SessionService/MessageService+ * - Inject SessionService to get active session+ * - Use MessageService.send() for actual delivery+ * - Handle session not found, not ready, etc.+ */+@Processor(QUEUE_NAMES.MESSAGE)+export class MessageProcessor extends WorkerHost {+ private readonly logger = createLogger('MessageProcessor');++ async process(job: Job<MessageJobData>): Promise<never> {+ this.logger.log(`Processing message job ${job.id}`, {+ sessionId: job.data.sessionId,+ to: job.data.to,+ action: 'message_process_start',+ });++ // FAIL FAST: Throw error so BullMQ marks job as failed+ const errorMessage =+ 'MessageProcessor is not implemented. Message queue is disabled. ' + 'Use direct MessageService.send() instead.';++ this.logger.error(`Message job ${job.id} failed: ${errorMessage}`, undefined, {+ sessionId: job.data.sessionId,+ action: 'message_process_not_implemented',+ });++ // Throw error to make BullMQ mark job as failed (not completed)+ return Promise.reject(new Error(errorMessage));+ }+}diff --git a/src/modules/queue/processors/webhook.processor.ts b/src/modules/queue/processors/webhook.processor.tsnew file mode 100644index 000000000..669fbc4ec--- /dev/null+++ b/src/modules/queue/processors/webhook.processor.ts@@ -0,0 +1,138 @@+import { Processor, WorkerHost } from '@nestjs/bullmq';+import { Job } from 'bullmq';+import { InjectRepository } from '@nestjs/typeorm';+import { Repository } from 'typeorm';+import { createLogger } from '../../../common/services/logger.service';+import { QUEUE_NAMES } from '../queue-names';+import { WebhookJobData } from '../../webhook/webhook.service';+import { Webhook } from '../../webhook/entities/webhook.entity';+import { HookManager } from '../../../core/hooks';++export interface WebhookJobResult {+ statusCode: number;+ success: boolean;+ error?: string;+ responseTime: number;+}++@Processor(QUEUE_NAMES.WEBHOOK)+export class WebhookProcessor extends WorkerHost {+ private readonly logger = createLogger('WebhookProcessor');++ constructor(+ @InjectRepository(Webhook, 'data')+ private readonly webhookRepository: Repository<Webhook>,+ private readonly hookManager: HookManager,+ ) {+ super();+ }++ async process(job: Job<WebhookJobData>): Promise<WebhookJobResult> {+ const { webhookId, url, event, payload, headers, maxRetries } = job.data;+ const startTime = Date.now();+ const sessionId = payload.sessionId;++ this.logger.log(`Processing webhook job ${job.id}`, {+ webhookId,+ event,+ deliveryId: payload.deliveryId,+ idempotencyKey: payload.idempotencyKey,+ attempt: job.attemptsMade + 1,+ action: 'webhook_process_start',+ });++ // Update retry count in headers+ const requestHeaders = {+ ...headers,+ 'X-OpenWA-Retry-Count': String(job.attemptsMade),+ };++ try {+ const response = await fetch(url, {+ method: 'POST',+ headers: requestHeaders,+ body: JSON.stringify(payload),+ signal: AbortSignal.timeout(10000),+ });++ const responseTime = Date.now() - startTime;+ const success = response.ok;++ if (!success) {+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);+ }++ // Update lastTriggeredAt on successful delivery+ await this.webhookRepository.update(webhookId, {+ lastTriggeredAt: new Date(),+ });++ // Execute hook after successful delivery+ await this.hookManager.execute(+ 'webhook:delivered',+ {+ sessionId,+ event,+ webhookId,+ deliveryId: payload.deliveryId,+ statusCode: response.status,+ responseTime,+ attempt: job.attemptsMade + 1,+ },+ { sessionId, source: 'WebhookProcessor' },+ );++ this.logger.log(`Webhook delivered successfully`, {+ webhookId,+ event,+ deliveryId: payload.deliveryId,+ idempotencyKey: payload.idempotencyKey,+ statusCode: response.status,+ responseTime,+ attempt: job.attemptsMade + 1,+ action: 'webhook_delivered',+ });++ return {+ statusCode: response.status,+ success: true,+ responseTime,+ };+ } catch (error) {+ const responseTime = Date.now() - startTime;+ const errorMessage = error instanceof Error ? error.message : String(error);+ const isFinalAttempt = job.attemptsMade + 1 >= maxRetries;++ this.logger.error(`Webhook delivery failed`, errorMessage, {+ webhookId,+ event,+ deliveryId: payload.deliveryId,+ idempotencyKey: payload.idempotencyKey,+ responseTime,+ attempt: job.attemptsMade + 1,+ maxRetries,+ isFinalAttempt,+ action: 'webhook_failed',+ });++ // Execute error hook only on final failure (all retries exhausted)+ if (isFinalAttempt) {+ await this.hookManager.execute(+ 'webhook:error',+ {+ sessionId,+ event,+ webhookId,+ deliveryId: payload.deliveryId,+ error: errorMessage,+ attempt: job.attemptsMade + 1,+ },+ { sessionId, source: 'WebhookProcessor' },+ );+ }++ // Re-throw to trigger BullMQ retry+ throw error;+ }+ }+}diff --git a/src/modules/queue/queue-names.ts b/src/modules/queue/queue-names.tsnew file mode 100644index 000000000..05e7fd9d9--- /dev/null+++ b/src/modules/queue/queue-names.ts@@ -0,0 +1,6 @@+// Queue names used across the application+// Extracted to separate file to avoid circular dependency with processors+export const QUEUE_NAMES = {+ MESSAGE: 'message-queue',+ WEBHOOK: 'webhook-queue',+} as const;diff --git a/src/modules/queue/queue.module.ts b/src/modules/queue/queue.module.tsnew file mode 100644index 000000000..292b43c37--- /dev/null+++ b/src/modules/queue/queue.module.ts@@ -0,0 +1,51 @@+import { Module } from '@nestjs/common';+import { ConfigModule, ConfigService } from '@nestjs/config';+import { BullModule } from '@nestjs/bullmq';+import { BullBoardModule } from '@bull-board/nestjs';+import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';+import { ExpressAdapter } from '@bull-board/express';+import { TypeOrmModule } from '@nestjs/typeorm';+import { MessageProcessor } from './processors/message.processor';+import { WebhookProcessor } from './processors/webhook.processor';+import { QUEUE_NAMES } from './queue-names';+import { Webhook } from '../webhook/entities/webhook.entity';+import { HooksModule } from '../../core/hooks/hooks.module';++// Re-export for backward compatibility+export { QUEUE_NAMES } from './queue-names';++@Module({+ imports: [+ // Required for WebhookProcessor to inject Repository<Webhook>+ TypeOrmModule.forFeature([Webhook], 'data'),+ // Required for WebhookProcessor to inject HookManager+ HooksModule,+ BullModule.forRootAsync({+ imports: [ConfigModule],+ inject: [ConfigService],+ useFactory: (configService: ConfigService) => ({+ connection: {+ host: configService.get<string>('redis.host', 'localhost'),+ port: configService.get<number>('redis.port', 6379),+ password: configService.get<string>('redis.password'),+ },+ }),+ }),+ BullModule.registerQueue({ name: QUEUE_NAMES.MESSAGE }, { name: QUEUE_NAMES.WEBHOOK }),+ BullBoardModule.forRoot({+ route: '/admin/queues',+ adapter: ExpressAdapter,+ }),+ BullBoardModule.forFeature({+ name: QUEUE_NAMES.MESSAGE,+ adapter: BullMQAdapter,+ }),+ BullBoardModule.forFeature({+ name: QUEUE_NAMES.WEBHOOK,+ adapter: BullMQAdapter,+ }),+ ],+ providers: [MessageProcessor, WebhookProcessor],+ exports: [BullModule],+})+export class QueueModule {}diff --git a/src/modules/session/dto/create-session.dto.ts b/src/modules/session/dto/create-session.dto.tsnew file mode 100644index 000000000..f4c7f03bf--- /dev/null+++ b/src/modules/session/dto/create-session.dto.ts@@ -0,0 +1,44 @@+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';+import { IsString, IsOptional, MaxLength, MinLength, Matches, IsIn } from 'class-validator';++export class CreateSessionDto {+ @ApiProperty({+ description: 'Unique name for the session (alphanumeric and hyphens only)',+ example: 'my-bot',+ minLength: 3,+ maxLength: 50,+ })+ @IsString()+ @MinLength(3)+ @MaxLength(50)+ @Matches(/^[a-zA-Z0-9-]+$/, {+ message: 'Session name can only contain letters, numbers, and hyphens',+ })+ name: string;++ @ApiPropertyOptional({+ description: 'Session configuration options',+ example: { autoReconnect: true },+ })+ @IsOptional()+ config?: Record<string, any>;++ // Phase 3: Proxy per session+ @ApiPropertyOptional({+ description: 'Proxy URL for this session (e.g., http://user:[email protected]:8080)',+ example: 'http://proxy.example.com:8080',+ })+ @IsOptional()+ @IsString()+ @MaxLength(255)+ proxyUrl?: string;++ @ApiPropertyOptional({+ description: 'Proxy type',+ enum: ['http', 'https', 'socks4', 'socks5'],+ example: 'http',+ })+ @IsOptional()+ @IsIn(['http', 'https', 'socks4', 'socks5'])+ proxyType?: 'http' | 'https' | 'socks4' | 'socks5';+}diff --git a/src/modules/session/dto/index.ts b/src/modules/session/dto/index.tsnew file mode 100644index 000000000..c9099abe2--- /dev/null+++ b/src/modules/session/dto/index.ts@@ -0,0 +1,2 @@+export * from './create-session.dto';+export * from './session-response.dto';diff --git a/src/modules/session/dto/session-response.dto.ts b/src/modules/session/dto/session-response.dto.tsnew file mode 100644index 000000000..0ca1bac3e--- /dev/null+++ b/src/modules/session/dto/session-response.dto.ts@@ -0,0 +1,42 @@+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';+import { SessionStatus } from '../entities/session.entity';++export class SessionResponseDto {+ @ApiProperty({ example: 'sess_123e4567-e89b-12d3-a456-426614174000' })+ id: string;++ @ApiProperty({ example: 'my-bot' })+ name: string;++ @ApiProperty({ enum: SessionStatus, example: SessionStatus.READY })+ status: SessionStatus;++ @ApiPropertyOptional({ example: '628123456789' })+ phone?: string | null;++ @ApiPropertyOptional({ example: 'John Doe' })+ pushName?: string | null;++ @ApiPropertyOptional({ example: '2025-02-02T10:00:00Z' })+ connectedAt?: Date | null;++ @ApiPropertyOptional({ example: '2025-02-02T10:30:00Z' })+ lastActive?: Date | null;++ @ApiProperty({ example: '2025-02-02T09:00:00Z' })+ createdAt: Date;++ @ApiProperty({ example: '2025-02-02T10:00:00Z' })+ updatedAt: Date;+}++export class QRCodeResponseDto {+ @ApiProperty({+ description: 'QR code as data URL',+ example: 'data:image/png;base64,...',+ })+ qrCode: string;++ @ApiProperty({ enum: SessionStatus, example: SessionStatus.QR_READY })+ status: SessionStatus;+}diff --git a/src/modules/session/entities/session.entity.ts b/src/modules/session/entities/session.entity.tsnew file mode 100644index 000000000..f5d1ecea6--- /dev/null+++ b/src/modules/session/entities/session.entity.ts@@ -0,0 +1,56 @@+import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';+import { DateTransformer } from '../../../common/transformers/date.transformer';++export enum SessionStatus {+ CREATED = 'created',+ INITIALIZING = 'initializing',+ QR_READY = 'qr_ready',+ AUTHENTICATING = 'authenticating',+ READY = 'ready',+ DISCONNECTED = 'disconnected',+ FAILED = 'failed',+}++@Entity('sessions')+export class Session {+ @PrimaryGeneratedColumn('uuid')+ id: string;++ @Column({ type: 'varchar', length: 100, unique: true })+ name: string;++ @Column({+ type: 'varchar',+ length: 50,+ default: SessionStatus.CREATED,+ })+ status: SessionStatus;++ @Column({ type: 'varchar', length: 20, nullable: true })+ phone: string | null;++ @Column({ type: 'varchar', length: 100, nullable: true })+ pushName: string | null;++ @Column({ type: 'simple-json', default: '{}' })+ config: Record<string, any>;++ // Phase 3: Proxy per session+ @Column({ type: 'varchar', length: 255, nullable: true })+ proxyUrl: string | null;++ @Column({ type: 'varchar', length: 10, nullable: true })+ proxyType: 'http' | 'https' | 'socks4' | 'socks5' | null;++ @Column({ type: 'text', nullable: true, transformer: DateTransformer })+ connectedAt: Date | null;++ @Column({ type: 'text', nullable: true, transformer: DateTransformer })+ lastActiveAt: Date | null;++ @CreateDateColumn()+ createdAt: Date;++ @UpdateDateColumn()+ updatedAt: Date;+}diff --git a/src/modules/session/session.controller.ts b/src/modules/session/session.controller.tsnew file mode 100644index 000000000..5003c9aaa--- /dev/null+++ b/src/modules/session/session.controller.ts@@ -0,0 +1,187 @@+import { Controller, Get, Post, Delete, Param, Body, HttpCode, HttpStatus } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiParam } from '@nestjs/swagger';+import { SessionService } from './session.service';+import { CreateSessionDto, SessionResponseDto, QRCodeResponseDto } from './dto';+import { Session } from './entities/session.entity';+import { AuditService } from '../audit/audit.service';+import { AuditAction } from '../audit/entities/audit-log.entity';+import { RequireRole } from '../auth/decorators/auth.decorators';+import { ApiKeyRole } from '../auth/entities/api-key.entity';++@ApiTags('sessions')+@Controller('sessions')+export class SessionController {+ constructor(+ private readonly sessionService: SessionService,+ private readonly auditService: AuditService,+ ) {}++ // Transform entity to DTO with lastActive field name+ private transformSession(session: Session): SessionResponseDto {+ return {+ id: session.id,+ name: session.name,+ status: session.status,+ phone: session.phone,+ pushName: session.pushName,+ connectedAt: session.connectedAt,+ lastActive: session.lastActiveAt,+ createdAt: session.createdAt,+ updatedAt: session.updatedAt,+ };+ }++ @Post()+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Create a new WhatsApp session' })+ @ApiResponse({+ status: 201,+ description: 'Session created',+ type: SessionResponseDto,+ })+ @ApiResponse({ status: 409, description: 'Session name already exists' })+ async create(@Body() dto: CreateSessionDto): Promise<Session> {+ const session = await this.sessionService.create(dto);+ await this.auditService.logInfo(AuditAction.SESSION_CREATED, {+ sessionId: session.id,+ sessionName: session.name,+ });+ return session;+ }++ @Get()+ @ApiOperation({ summary: 'List all sessions' })+ @ApiResponse({+ status: 200,+ description: 'List of sessions',+ type: [SessionResponseDto],+ })+ async findAll(): Promise<SessionResponseDto[]> {+ const sessions = await this.sessionService.findAll();+ return sessions.map(s => this.transformSession(s));+ }++ @Get(':id')+ @ApiOperation({ summary: 'Get session by ID' })+ @ApiParam({ name: 'id', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'Session details',+ type: SessionResponseDto,+ })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async findOne(@Param('id') id: string): Promise<SessionResponseDto> {+ const session = await this.sessionService.findOne(id);+ return this.transformSession(session);+ }++ @Delete(':id')+ @RequireRole(ApiKeyRole.OPERATOR)+ @HttpCode(HttpStatus.NO_CONTENT)+ @ApiOperation({ summary: 'Delete a session' })+ @ApiParam({ name: 'id', description: 'Session ID' })+ @ApiResponse({ status: 204, description: 'Session deleted' })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async delete(@Param('id') id: string): Promise<void> {+ const session = await this.sessionService.findOne(id);+ await this.sessionService.delete(id);+ await this.auditService.logInfo(AuditAction.SESSION_DELETED, {+ sessionId: id,+ sessionName: session.name,+ });+ }++ @Post(':id/start')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({+ summary: 'Start a session and initialize WhatsApp connection',+ })+ @ApiParam({ name: 'id', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'Session started',+ type: SessionResponseDto,+ })+ @ApiResponse({ status: 400, description: 'Session already started' })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async start(@Param('id') id: string): Promise<SessionResponseDto> {+ const session = await this.sessionService.start(id);+ await this.auditService.logInfo(AuditAction.SESSION_STARTED, {+ sessionId: session.id,+ sessionName: session.name,+ });+ return this.transformSession(session);+ }++ @Post(':id/stop')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Stop a session and disconnect WhatsApp' })+ @ApiParam({ name: 'id', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'Session stopped',+ type: SessionResponseDto,+ })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async stop(@Param('id') id: string): Promise<SessionResponseDto> {+ const session = await this.sessionService.stop(id);+ await this.auditService.logInfo(AuditAction.SESSION_STOPPED, {+ sessionId: session.id,+ sessionName: session.name,+ });+ return this.transformSession(session);+ }++ @Get(':id/qr')+ @ApiOperation({ summary: 'Get QR code for session authentication' })+ @ApiParam({ name: 'id', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'QR code data',+ type: QRCodeResponseDto,+ })+ @ApiResponse({+ status: 400,+ description: 'QR code not ready or session already authenticated',+ })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async getQRCode(@Param('id') id: string): Promise<QRCodeResponseDto> {+ const qrCode = await this.sessionService.getQRCode(id);+ await this.auditService.logInfo(AuditAction.SESSION_QR_GENERATED, {+ sessionId: id,+ });+ return qrCode;+ }++ @Get(':id/groups')+ @ApiOperation({ summary: 'Get all groups for a session' })+ @ApiParam({ name: 'id', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'List of groups the session is a member of',+ })+ @ApiResponse({ status: 400, description: 'Session not ready' })+ @ApiResponse({ status: 404, description: 'Session not found' })+ async getGroups(@Param('id') id: string): Promise<{ id: string; name: string }[]> {+ return this.sessionService.getGroups(id);+ }++ @Get('stats/overview')+ @ApiOperation({+ summary: 'Get session statistics for multi-session monitoring',+ })+ @ApiResponse({+ status: 200,+ description: 'Session statistics including counts and memory usage',+ })+ async getStats(): Promise<{+ total: number;+ active: number;+ ready: number;+ disconnected: number;+ byStatus: Record<string, number>;+ memoryUsage: { heapUsed: number; heapTotal: number; rss: number };+ }> {+ return this.sessionService.getStats();+ }+}diff --git a/src/modules/session/session.module.ts b/src/modules/session/session.module.tsnew file mode 100644index 000000000..d358ad681--- /dev/null+++ b/src/modules/session/session.module.ts@@ -0,0 +1,14 @@+import { Module, forwardRef } from '@nestjs/common';+import { TypeOrmModule } from '@nestjs/typeorm';+import { Session } from './entities/session.entity';+import { SessionService } from './session.service';+import { SessionController } from './session.controller';+import { WebhookModule } from '../webhook/webhook.module';++@Module({+ imports: [TypeOrmModule.forFeature([Session], 'data'), forwardRef(() => WebhookModule)],+ controllers: [SessionController],+ providers: [SessionService],+ exports: [SessionService],+})+export class SessionModule {}diff --git a/src/modules/session/session.service.ts b/src/modules/session/session.service.tsnew file mode 100644index 000000000..ed80b84da--- /dev/null+++ b/src/modules/session/session.service.ts@@ -0,0 +1,529 @@+import {+ Injectable,+ NotFoundException,+ ConflictException,+ BadRequestException,+ OnModuleDestroy,+ OnModuleInit,+} from '@nestjs/common';+import { InjectRepository } from '@nestjs/typeorm';+import { Repository, In } from 'typeorm';+import { Session, SessionStatus } from './entities/session.entity';+import { CreateSessionDto } from './dto';+import { EngineFactory } from '../../engine/engine.factory';+import { IWhatsAppEngine, EngineStatus } from '../../engine/interfaces/whatsapp-engine.interface';+import { createLogger } from '../../common/services/logger.service';+import { EventsGateway } from '../events/events.gateway';+import { WebhookService } from '../webhook/webhook.service';+import { HookManager } from '../../core/hooks';++interface ReconnectState {+ attempts: number;+ timer: NodeJS.Timeout | null;+ maxAttempts: number;+ baseDelay: number;+}++@Injectable()+export class SessionService implements OnModuleDestroy, OnModuleInit {+ private readonly logger = createLogger('SessionService');++ // In-memory map of active engine instances+ private engines: Map<string, IWhatsAppEngine> = new Map();++ // Reconnection state per session+ private reconnectStates: Map<string, ReconnectState> = new Map();++ constructor(+ @InjectRepository(Session, 'data')+ private readonly sessionRepository: Repository<Session>,+ private readonly engineFactory: EngineFactory,+ private readonly eventsGateway: EventsGateway,+ private readonly webhookService: WebhookService,+ private readonly hookManager: HookManager,+ ) {}++ /**+ * On backend startup, reset all active session statuses to disconnected+ * because the engines are not running yet after restart+ */+ async onModuleInit(): Promise<void> {+ const activeStatuses = [+ SessionStatus.READY,+ SessionStatus.INITIALIZING,+ SessionStatus.QR_READY,+ SessionStatus.AUTHENTICATING,+ ];++ const result = await this.sessionRepository.update(+ { status: In(activeStatuses) },+ { status: SessionStatus.DISCONNECTED },+ );++ if (result.affected && result.affected > 0) {+ this.logger.log(`Reset ${result.affected} session(s) to disconnected on startup`, {+ action: 'startup_reset',+ affected: result.affected,+ });+ }+ }++ async onModuleDestroy(): Promise<void> {+ // Clean up all engines on shutdown+ for (const [sessionId, engine] of this.engines) {+ this.logger.log(`Destroying engine for session ${sessionId}`, {+ sessionId,+ action: 'shutdown',+ });+ await engine.destroy();+ }+ this.engines.clear();++ // Clear all reconnect timers+ for (const [, state] of this.reconnectStates) {+ if (state.timer) {+ clearTimeout(state.timer);+ }+ }+ this.reconnectStates.clear();+ }++ async create(dto: CreateSessionDto): Promise<Session> {+ // Check if session with same name exists+ const existing = await this.sessionRepository.findOne({+ where: { name: dto.name },+ });++ if (existing) {+ throw new ConflictException(`Session with name '${dto.name}' already exists`);+ }++ const session = this.sessionRepository.create({+ name: dto.name,+ config: dto.config || {},+ proxyUrl: dto.proxyUrl || null,+ proxyType: dto.proxyType || null,+ status: SessionStatus.CREATED,+ });++ const saved = await this.sessionRepository.save(session);+ this.logger.log(`Session created: ${saved.name}`, {+ sessionId: saved.id,+ action: 'create',+ });++ // Execute hook after session created+ await this.hookManager.execute('session:created', saved, {+ sessionId: saved.id,+ source: 'SessionService',+ });++ return saved;+ }++ async findAll(): Promise<Session[]> {+ return this.sessionRepository.find({+ order: { createdAt: 'DESC' },+ });+ }++ async findOne(id: string): Promise<Session> {+ const session = await this.sessionRepository.findOne({ where: { id } });+ if (!session) {+ throw new NotFoundException(`Session with id '${id}' not found`);+ }+ return session;+ }++ async findByName(name: string): Promise<Session> {+ const session = await this.sessionRepository.findOne({ where: { name } });+ if (!session) {+ throw new NotFoundException(`Session with name '${name}' not found`);+ }+ return session;+ }++ async delete(id: string): Promise<void> {+ const session = await this.findOne(id);++ // Cancel any reconnection attempts+ this.cancelReconnect(id);++ // Stop engine if running+ const engine = this.engines.get(id);+ if (engine) {+ await engine.destroy();+ this.engines.delete(id);+ }++ await this.sessionRepository.remove(session);+ this.logger.log(`Session deleted: ${session.name}`, {+ sessionId: id,+ action: 'delete',+ });++ // Execute hook after session deleted+ await this.hookManager.execute(+ 'session:deleted',+ { sessionId: id },+ {+ sessionId: id,+ source: 'SessionService',+ },+ );+ }++ async start(id: string): Promise<Session> {+ const session = await this.findOne(id);++ if (this.engines.has(id)) {+ throw new BadRequestException('Session is already started');+ }++ // Execute hook before starting+ await this.hookManager.execute(+ 'session:starting',+ { sessionId: id },+ {+ sessionId: id,+ source: 'SessionService',+ },+ );++ // Initialize reconnect state+ const config = session.config as {+ maxReconnectAttempts?: number;+ reconnectBaseDelay?: number;+ } | null;+ this.reconnectStates.set(id, {+ attempts: 0,+ timer: null,+ maxAttempts: config?.maxReconnectAttempts ?? 5,+ baseDelay: config?.reconnectBaseDelay ?? 5000,+ });++ await this.initializeEngine(id, session);+ return this.findOne(id);+ }++ private async initializeEngine(id: string, session: Session): Promise<void> {+ this.logger.log(`Initializing engine for session: ${session.name}`, {+ sessionId: id,+ action: 'engine_init',+ proxyEnabled: !!session.proxyUrl,+ });++ const engine = this.engineFactory.create({+ sessionId: session.name,+ proxyUrl: session.proxyUrl || undefined,+ proxyType: session.proxyType || undefined,+ });+ this.engines.set(id, engine);++ await engine.initialize({+ onQRCode: (): void => {+ this.logger.log('QR code generated', {+ sessionId: id,+ action: 'qr_generated',+ });++ // Execute hook for QR event+ void this.hookManager.execute(+ 'session:qr',+ { sessionId: id },+ {+ sessionId: id,+ source: 'Engine',+ },+ );++ void this.updateStatus(id, SessionStatus.QR_READY);+ },+ onReady: (phone: string, pushName: string): void => {+ this.logger.log(`Session ready: ${phone}`, {+ sessionId: id,+ phone,+ pushName,+ action: 'ready',+ });++ // Execute hook for ready event+ void this.hookManager.execute(+ 'session:ready',+ { phone, pushName },+ {+ sessionId: id,+ source: 'Engine',+ },+ );++ // Reset reconnect attempts on successful connection+ const reconnectState = this.reconnectStates.get(id);+ if (reconnectState) {+ reconnectState.attempts = 0;+ }++ void this.sessionRepository.update(id, {+ status: SessionStatus.READY,+ phone,+ pushName,+ connectedAt: new Date(),+ lastActiveAt: new Date(),+ });+ },+ onMessage: (message): void => {+ this.logger.debug(`Message received from ${message.from}`, {+ sessionId: id,+ messageId: message.id,+ from: message.from,+ action: 'message_received',+ });+ // Update last active timestamp+ void this.sessionRepository.update(id, { lastActiveAt: new Date() });+ // Convert IncomingMessage to plain object for dispatch+ const messageData = { ...message };++ // Execute hook for message received - plugins can modify or stop processing+ void this.hookManager+ .execute('message:received', messageData, {+ sessionId: id,+ source: 'Engine',+ })+ .then(({ continue: shouldContinue, data: finalMessage }) => {+ if (!shouldContinue) {+ // Plugin stopped processing (e.g., auto-reply handled it)+ return;+ }++ // Dispatch to webhooks with potentially modified message+ void this.webhookService.dispatch(id, 'message.received', finalMessage as Record<string, unknown>);+ // Emit real-time event to WebSocket clients+ this.eventsGateway.emitMessage(id, finalMessage as Record<string, unknown>);+ });+ },+ onDisconnected: (reason: string): void => {+ this.logger.warn(`Session disconnected: ${reason}`, {+ sessionId: id,+ reason,+ action: 'disconnected',+ });++ // Execute hook for disconnected event+ void this.hookManager.execute(+ 'session:disconnected',+ { reason },+ {+ sessionId: id,+ source: 'Engine',+ },+ );++ void this.updateStatus(id, SessionStatus.DISCONNECTED);++ // Attempt to reconnect+ this.scheduleReconnect(id, session);+ },+ onStateChanged: (engineState: EngineStatus): void => {+ const statusMap: Record<EngineStatus, SessionStatus> = {+ [EngineStatus.DISCONNECTED]: SessionStatus.DISCONNECTED,+ [EngineStatus.INITIALIZING]: SessionStatus.INITIALIZING,+ [EngineStatus.QR_READY]: SessionStatus.QR_READY,+ [EngineStatus.AUTHENTICATING]: SessionStatus.AUTHENTICATING,+ [EngineStatus.READY]: SessionStatus.READY,+ [EngineStatus.FAILED]: SessionStatus.FAILED,+ };+ const newStatus = statusMap[engineState];+ if (newStatus) {+ void this.updateStatus(id, newStatus);+ }+ },+ });++ await this.updateStatus(id, SessionStatus.INITIALIZING);+ }++ private scheduleReconnect(id: string, session: Session): void {+ const state = this.reconnectStates.get(id);+ if (!state) return;++ if (state.attempts >= state.maxAttempts) {+ this.logger.error(`Max reconnect attempts reached for session: ${session.name}`, undefined, {+ sessionId: id,+ attempts: state.attempts,+ action: 'reconnect_failed',+ });+ return;+ }++ // Exponential backoff: baseDelay * 2^attempts (with jitter)+ const delay = state.baseDelay * Math.pow(2, state.attempts) + Math.random() * 1000;+ state.attempts++;++ this.logger.log(+ `Scheduling reconnect attempt ${state.attempts}/${state.maxAttempts} in ${Math.round(delay / 1000)}s`,+ {+ sessionId: id,+ attempt: state.attempts,+ delayMs: delay,+ action: 'reconnect_scheduled',+ },+ );++ state.timer = setTimeout(() => {+ void this.executeReconnect(id, session, state);+ }, delay);+ }++ private async executeReconnect(id: string, session: Session, state: ReconnectState): Promise<void> {+ try {+ // Clean up old engine+ const oldEngine = this.engines.get(id);+ if (oldEngine) {+ await oldEngine.destroy();+ this.engines.delete(id);+ }++ // Re-initialize+ await this.initializeEngine(id, session);+ } catch (error: unknown) {+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';+ this.logger.error(`Reconnect attempt ${state.attempts} failed`, errorMessage, {+ sessionId: id,+ action: 'reconnect_error',+ });+ // Schedule another attempt+ this.scheduleReconnect(id, session);+ }+ }++ private cancelReconnect(id: string): void {+ const state = this.reconnectStates.get(id);+ if (state?.timer) {+ clearTimeout(state.timer);+ state.timer = null;+ }+ this.reconnectStates.delete(id);+ }++ async stop(id: string): Promise<Session> {+ const session = await this.findOne(id);++ // Cancel any reconnection attempts+ this.cancelReconnect(id);++ const engine = this.engines.get(id);++ if (engine) {+ await engine.disconnect();+ this.engines.delete(id);+ }++ this.logger.log(`Session stopped: ${session.name}`, {+ sessionId: id,+ action: 'stop',+ });+ await this.updateStatus(id, SessionStatus.DISCONNECTED);+ return this.findOne(id);+ }++ async getQRCode(id: string): Promise<{ qrCode: string; status: SessionStatus }> {+ const session = await this.findOne(id);+ const engine = this.engines.get(id);++ if (!engine) {+ throw new BadRequestException('Session is not started. Call POST /sessions/:id/start first.');+ }++ const qrCode = engine.getQRCode();++ if (!qrCode) {+ if (session.status === SessionStatus.READY) {+ throw new BadRequestException('Session is already authenticated, no QR code needed');+ }+ throw new BadRequestException('QR code is not ready yet. Please wait...');+ }++ return {+ qrCode,+ status: session.status,+ };+ }++ getEngine(id: string): IWhatsAppEngine | undefined {+ return this.engines.get(id);+ }++ async getGroups(id: string): Promise<{ id: string; name: string }[]> {+ await this.findOne(id); // Verify session exists+ const engine = this.engines.get(id);++ if (!engine) {+ throw new BadRequestException('Session is not started');+ }++ const groups = await engine.getGroups();+ return groups.map(g => ({+ id: g.id,+ name: g.name,+ }));+ }++ private async updateStatus(id: string, status: SessionStatus): Promise<void> {+ await this.sessionRepository.update(id, { status });+ this.logger.debug(`Session status updated to ${status}`, {+ sessionId: id,+ status,+ action: 'status_update',+ });+ // Emit real-time event to connected WebSocket clients+ this.eventsGateway.emitSessionStatus(id, status);+ }++ /**+ * Get overall session statistics for multi-session monitoring+ */+ async getStats(): Promise<{+ total: number;+ active: number;+ ready: number;+ disconnected: number;+ byStatus: Record<string, number>;+ memoryUsage: { heapUsed: number; heapTotal: number; rss: number };+ }> {+ const sessions = await this.findAll();+ const byStatus: Record<string, number> = {};++ for (const session of sessions) {+ byStatus[session.status] = (byStatus[session.status] || 0) + 1;+ }++ const memory = process.memoryUsage();++ return {+ total: sessions.length,+ active: this.engines.size,+ ready: byStatus[SessionStatus.READY] || 0,+ disconnected: byStatus[SessionStatus.DISCONNECTED] || 0,+ byStatus,+ memoryUsage: {+ heapUsed: Math.round(memory.heapUsed / 1024 / 1024),+ heapTotal: Math.round(memory.heapTotal / 1024 / 1024),+ rss: Math.round(memory.rss / 1024 / 1024),+ },+ };+ }++ /**+ * Get count of currently active (running) sessions+ */+ getActiveCount(): number {+ return this.engines.size;+ }++ /**+ * Check if session is currently active (engine running)+ */+ isActive(id: string): boolean {+ return this.engines.has(id);+ }+}diff --git a/src/modules/settings/settings.controller.ts b/src/modules/settings/settings.controller.tsnew file mode 100644index 000000000..d0c13cb9d--- /dev/null+++ b/src/modules/settings/settings.controller.ts@@ -0,0 +1,84 @@+import { Controller, Get, Put, Body } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';+import { ConfigService } from '@nestjs/config';+import { RequireRole } from '../auth/decorators/auth.decorators';+import { ApiKeyRole } from '../auth/entities/api-key.entity';++interface Settings {+ general: {+ apiBaseUrl: string;+ sessionTimeout: number;+ autoReconnect: boolean;+ debugMode: boolean;+ };+ api: {+ rateLimit: number;+ rateLimitWindow: number;+ enableDocs: boolean;+ };+ notifications: {+ emailEnabled: boolean;+ notificationEmail: string;+ webhookAlerts: boolean;+ };+}++@ApiTags('settings')+@Controller('settings')+export class SettingsController {+ private settings: Settings;++ constructor(private readonly configService: ConfigService) {+ // Initialize with values from configuration (reads from .env)+ const port = this.configService.get<number>('port', 2785);++ this.settings = {+ general: {+ apiBaseUrl: `http://localhost:${port}`,+ sessionTimeout: Math.floor(this.configService.get<number>('webhook.timeout', 300000) / 60000),+ autoReconnect: this.configService.get<boolean>('engine.autoReconnect', false),+ debugMode: this.configService.get<boolean>('database.logging', false),+ },+ api: {+ rateLimit: this.configService.get<number>('api.rateLimit.mediumLimit', 100),+ rateLimitWindow: this.configService.get<number>('api.rateLimit.mediumTtl', 60000),+ enableDocs: true, // Swagger docs always enabled+ },+ notifications: {+ emailEnabled: false,+ notificationEmail: '',+ webhookAlerts: true,+ },+ };+ }++ @Get()+ @ApiOperation({ summary: 'Get application settings' })+ @ApiResponse({ status: 200, description: 'Current settings' })+ get(): Settings {+ return this.settings;+ }++ @Put()+ @RequireRole(ApiKeyRole.ADMIN)+ @ApiOperation({ summary: 'Update application settings' })+ @ApiResponse({ status: 200, description: 'Settings updated' })+ update(@Body() newSettings: Partial<Settings>): Settings {+ if (newSettings.general) {+ this.settings.general = {+ ...this.settings.general,+ ...newSettings.general,+ };+ }+ if (newSettings.api) {+ this.settings.api = { ...this.settings.api, ...newSettings.api };+ }+ if (newSettings.notifications) {+ this.settings.notifications = {+ ...this.settings.notifications,+ ...newSettings.notifications,+ };+ }+ return this.settings;+ }+}diff --git a/src/modules/settings/settings.module.ts b/src/modules/settings/settings.module.tsnew file mode 100644index 000000000..7ba2fa072--- /dev/null+++ b/src/modules/settings/settings.module.ts@@ -0,0 +1,7 @@+import { Module } from '@nestjs/common';+import { SettingsController } from './settings.controller';++@Module({+ controllers: [SettingsController],+})+export class SettingsModule {}diff --git a/src/modules/stats/dto/stats-query.dto.ts b/src/modules/stats/dto/stats-query.dto.tsnew file mode 100644index 000000000..68771ab83--- /dev/null+++ b/src/modules/stats/dto/stats-query.dto.ts@@ -0,0 +1,7 @@+import { IsOptional, IsIn } from 'class-validator';++export class StatsQueryDto {+ @IsOptional()+ @IsIn(['24h', '7d', '30d'])+ period?: '24h' | '7d' | '30d' = '24h';+}diff --git a/src/modules/stats/stats.controller.ts b/src/modules/stats/stats.controller.tsnew file mode 100644index 000000000..803e50703--- /dev/null+++ b/src/modules/stats/stats.controller.ts@@ -0,0 +1,29 @@+import { Controller, Get, Param, Query } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';+import { StatsService } from './stats.service';+import { StatsQueryDto } from './dto/stats-query.dto';++@ApiTags('Statistics')+@ApiBearerAuth()+@Controller('stats')+export class StatsController {+ constructor(private readonly statsService: StatsService) {}++ @Get('overview')+ @ApiOperation({ summary: 'Get overall statistics' })+ async getOverview() {+ return this.statsService.getOverview();+ }++ @Get('messages')+ @ApiOperation({ summary: 'Get message statistics with time series' })+ async getMessageStats(@Query() query: StatsQueryDto) {+ return this.statsService.getMessageStats(query.period || '24h');+ }++ @Get('sessions/:sessionId')+ @ApiOperation({ summary: 'Get statistics for a specific session' })+ async getSessionStats(@Param('sessionId') sessionId: string) {+ return this.statsService.getSessionStats(sessionId);+ }+}diff --git a/src/modules/stats/stats.module.ts b/src/modules/stats/stats.module.tsnew file mode 100644index 000000000..05d4c1ec9--- /dev/null+++ b/src/modules/stats/stats.module.ts@@ -0,0 +1,14 @@+import { Module } from '@nestjs/common';+import { TypeOrmModule } from '@nestjs/typeorm';+import { StatsController } from './stats.controller';+import { StatsService } from './stats.service';+import { Session } from '../session/entities/session.entity';+import { Message } from '../message/entities/message.entity';++@Module({+ imports: [TypeOrmModule.forFeature([Session, Message], 'data')],+ controllers: [StatsController],+ providers: [StatsService],+ exports: [StatsService],+})+export class StatsModule {}diff --git a/src/modules/stats/stats.service.ts b/src/modules/stats/stats.service.tsnew file mode 100644index 000000000..4c12de6fb--- /dev/null+++ b/src/modules/stats/stats.service.ts@@ -0,0 +1,308 @@+import { Injectable, NotFoundException } from '@nestjs/common';+import { InjectRepository } from '@nestjs/typeorm';+import { Repository } from 'typeorm';+import { Session, SessionStatus } from '../session/entities/session.entity';+import { Message, MessageStatus } from '../message/entities/message.entity';+import { CacheService } from '../../common/cache';++export interface OverviewStats {+ sessions: {+ active: number;+ total: number;+ byStatus: Record<string, number>;+ };+ messages: {+ sent: number;+ received: number;+ failed: number;+ today: { sent: number; received: number };+ };+}++export interface TimeSeriesPoint {+ timestamp: string;+ sent: number;+ received: number;+}++export interface MessageStats {+ timeSeries: TimeSeriesPoint[];+ byType: Record<string, number>;+ bySession: Array<{ sessionId: string; name: string; sent: number; received: number }>;+ topChats: Array<{ chatId: string; messageCount: number }>;+}++export interface SessionStats {+ session: { id: string; name: string; status: string };+ messages: { sent: number; received: number; today: number; failed: number };+ topChats: Array<{ chatId: string; count: number; lastActive: string }>;+ hourlyActivity: Array<{ hour: number; sent: number; received: number }>;+}++@Injectable()+export class StatsService {+ constructor(+ @InjectRepository(Session, 'data')+ private readonly sessionRepo: Repository<Session>,+ @InjectRepository(Message, 'data')+ private readonly messageRepo: Repository<Message>,+ private readonly cacheService: CacheService,+ ) {}++ async getOverview(): Promise<OverviewStats> {+ // Get session stats+ const sessions = await this.sessionRepo.find();+ const byStatus: Record<string, number> = {};+ let active = 0;++ for (const session of sessions) {+ byStatus[session.status] = (byStatus[session.status] || 0) + 1;+ if (session.status === SessionStatus.READY) active++;+ }++ // Get message stats+ const todayStart = new Date();+ todayStart.setHours(0, 0, 0, 0);++ const messageStats = await this.messageRepo+ .createQueryBuilder('m')+ .select('m.direction', 'direction')+ .addSelect('COUNT(*)', 'count')+ .groupBy('m.direction')+ .getRawMany<{ direction: string; count: string }>();++ const todayStats = await this.messageRepo+ .createQueryBuilder('m')+ .select('m.direction', 'direction')+ .addSelect('COUNT(*)', 'count')+ .where('m.createdAt >= :todayStart', { todayStart })+ .groupBy('m.direction')+ .getRawMany<{ direction: string; count: string }>();++ const sent = parseInt(messageStats.find(m => m.direction === 'outgoing')?.count || '0');+ const received = parseInt(messageStats.find(m => m.direction === 'incoming')?.count || '0');+ const todaySent = parseInt(todayStats.find(m => m.direction === 'outgoing')?.count || '0');+ const todayReceived = parseInt(todayStats.find(m => m.direction === 'incoming')?.count || '0');++ // Count failed messages+ const failed = await this.messageRepo.count({+ where: { status: MessageStatus.FAILED },+ });++ // Cache session stats+ await this.cacheService.setSessionsStats({+ active,+ total: sessions.length,+ byStatus,+ });++ return {+ sessions: {+ active,+ total: sessions.length,+ byStatus,+ },+ messages: {+ sent,+ received,+ failed,+ today: { sent: todaySent, received: todayReceived },+ },+ };+ }++ async getMessageStats(period: '24h' | '7d' | '30d'): Promise<MessageStats> {+ const since = this.getPeriodStart(period);+ const interval = period === '24h' ? 'hour' : 'day';++ // Time series - using raw query for SQLite compatibility+ const timeSeries = await this.getTimeSeries(since, interval);++ // By type+ const byTypeRaw = await this.messageRepo+ .createQueryBuilder('m')+ .select('m.type', 'type')+ .addSelect('COUNT(*)', 'count')+ .where('m.createdAt >= :since', { since })+ .groupBy('m.type')+ .getRawMany<{ type: string; count: string }>();++ const byType: Record<string, number> = {};+ for (const row of byTypeRaw) {+ byType[row.type || 'unknown'] = parseInt(row.count);+ }++ // By session+ const bySessionRaw = await this.messageRepo+ .createQueryBuilder('m')+ .select('m.sessionId', 'sessionId')+ .addSelect('m.direction', 'direction')+ .addSelect('COUNT(*)', 'count')+ .where('m.createdAt >= :since', { since })+ .groupBy('m.sessionId')+ .addGroupBy('m.direction')+ .getRawMany<{ sessionId: string; direction: string; count: string }>();++ const sessionMap = new Map<string, { sent: number; received: number }>();+ for (const row of bySessionRaw) {+ if (!sessionMap.has(row.sessionId)) {+ sessionMap.set(row.sessionId, { sent: 0, received: 0 });+ }+ const entry = sessionMap.get(row.sessionId)!;+ if (row.direction === 'outgoing') entry.sent = parseInt(row.count);+ else entry.received = parseInt(row.count);+ }++ const sessions = await this.sessionRepo.find();+ const sessionNames = new Map(sessions.map(s => [s.id, s.name]));++ const bySession = Array.from(sessionMap.entries()).map(([sessionId, stats]) => ({+ sessionId,+ name: sessionNames.get(sessionId) || 'Unknown',+ ...stats,+ }));++ // Top chats+ const topChats = await this.messageRepo+ .createQueryBuilder('m')+ .select('m.chatId', 'chatId')+ .addSelect('COUNT(*)', 'messageCount')+ .where('m.createdAt >= :since', { since })+ .groupBy('m.chatId')+ .orderBy('messageCount', 'DESC')+ .limit(10)+ .getRawMany<{ chatId: string; messageCount: string }>();++ return {+ timeSeries,+ byType,+ bySession,+ topChats: topChats.map(c => ({+ chatId: c.chatId,+ messageCount: parseInt(c.messageCount),+ })),+ };+ }++ async getSessionStats(sessionId: string): Promise<SessionStats> {+ const session = await this.sessionRepo.findOne({ where: { id: sessionId } });+ if (!session) {+ throw new NotFoundException('Session not found');+ }++ const todayStart = new Date();+ todayStart.setHours(0, 0, 0, 0);++ // Message counts+ const stats = await this.messageRepo+ .createQueryBuilder('m')+ .select('m.direction', 'direction')+ .addSelect('COUNT(*)', 'count')+ .where('m.sessionId = :sessionId', { sessionId })+ .groupBy('m.direction')+ .getRawMany<{ direction: string; count: string }>();++ const todayCount = await this.messageRepo+ .createQueryBuilder('m')+ .where('m.sessionId = :sessionId', { sessionId })+ .andWhere('m.createdAt >= :todayStart', { todayStart })+ .getCount();++ const sent = parseInt(stats.find(s => s.direction === 'outgoing')?.count || '0');+ const received = parseInt(stats.find(s => s.direction === 'incoming')?.count || '0');++ // Count failed messages for this session+ const failed = await this.messageRepo.count({+ where: { sessionId, status: MessageStatus.FAILED },+ });++ // Top chats for this session+ const topChats = await this.messageRepo+ .createQueryBuilder('m')+ .select('m.chatId', 'chatId')+ .addSelect('COUNT(*)', 'count')+ .addSelect('MAX(m.createdAt)', 'lastActive')+ .where('m.sessionId = :sessionId', { sessionId })+ .groupBy('m.chatId')+ .orderBy('count', 'DESC')+ .limit(10)+ .getRawMany<{ chatId: string; count: string; lastActive: string }>();++ // Hourly activity (last 24h)+ const hourlyActivity = await this.getHourlyActivity(sessionId);++ return {+ session: { id: session.id, name: session.name, status: session.status },+ messages: { sent, received, today: todayCount, failed },+ topChats: topChats.map(c => ({+ chatId: c.chatId,+ count: parseInt(c.count),+ lastActive: c.lastActive,+ })),+ hourlyActivity,+ };+ }++ private getPeriodStart(period: '24h' | '7d' | '30d'): Date {+ const now = new Date();+ switch (period) {+ case '24h':+ return new Date(now.getTime() - 24 * 60 * 60 * 1000);+ case '7d':+ return new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);+ case '30d':+ return new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);+ }+ }++ private async getTimeSeries(since: Date, interval: 'hour' | 'day'): Promise<TimeSeriesPoint[]> {+ // SQLite-compatible time series query+ const formatStr = interval === 'hour' ? '%Y-%m-%d %H:00:00' : '%Y-%m-%d';++ const raw = await this.messageRepo+ .createQueryBuilder('m')+ .select(`strftime('${formatStr}', m.createdAt)`, 'timestamp')+ .addSelect(`SUM(CASE WHEN m.direction = 'outgoing' THEN 1 ELSE 0 END)`, 'sent')+ .addSelect(`SUM(CASE WHEN m.direction = 'incoming' THEN 1 ELSE 0 END)`, 'received')+ .where('m.createdAt >= :since', { since })+ .groupBy('timestamp')+ .orderBy('timestamp', 'ASC')+ .getRawMany<{ timestamp: string; sent: string; received: string }>();++ return raw.map(r => ({+ timestamp: r.timestamp,+ sent: parseInt(r.sent || '0'),+ received: parseInt(r.received || '0'),+ }));+ }++ private async getHourlyActivity(sessionId: string): Promise<Array<{ hour: number; sent: number; received: number }>> {+ const since = new Date(Date.now() - 24 * 60 * 60 * 1000);++ const raw = await this.messageRepo+ .createQueryBuilder('m')+ .select(`CAST(strftime('%H', m.createdAt) AS INTEGER)`, 'hour')+ .addSelect(`SUM(CASE WHEN m.direction = 'outgoing' THEN 1 ELSE 0 END)`, 'sent')+ .addSelect(`SUM(CASE WHEN m.direction = 'incoming' THEN 1 ELSE 0 END)`, 'received')+ .where('m.sessionId = :sessionId', { sessionId })+ .andWhere('m.createdAt >= :since', { since })+ .groupBy('hour')+ .orderBy('hour', 'ASC')+ .getRawMany<{ hour: string; sent: string; received: string }>();++ // Fill in missing hours+ const result: Array<{ hour: number; sent: number; received: number }> = [];+ const hourMap = new Map(raw.map(r => [parseInt(r.hour), r]));++ for (let h = 0; h < 24; h++) {+ const data = hourMap.get(h);+ result.push({+ hour: h,+ sent: data ? parseInt(data.sent || '0') : 0,+ received: data ? parseInt(data.received || '0') : 0,+ });+ }++ return result;+ }+}diff --git a/src/modules/status/dto/send-media-status.dto.ts b/src/modules/status/dto/send-media-status.dto.tsnew file mode 100644index 000000000..a031ab4d9--- /dev/null+++ b/src/modules/status/dto/send-media-status.dto.ts@@ -0,0 +1,32 @@+import { IsString, IsOptional, ValidateNested } from 'class-validator';+import { Type } from 'class-transformer';++class MediaInput {+ @IsOptional()+ @IsString()+ url?: string;++ @IsOptional()+ @IsString()+ base64?: string;+}++export class SendImageStatusDto {+ @ValidateNested()+ @Type(() => MediaInput)+ image: MediaInput;++ @IsOptional()+ @IsString()+ caption?: string;+}++export class SendVideoStatusDto {+ @ValidateNested()+ @Type(() => MediaInput)+ video: MediaInput;++ @IsOptional()+ @IsString()+ caption?: string;+}diff --git a/src/modules/status/dto/send-text-status.dto.ts b/src/modules/status/dto/send-text-status.dto.tsnew file mode 100644index 000000000..d5f8ac3c2--- /dev/null+++ b/src/modules/status/dto/send-text-status.dto.ts@@ -0,0 +1,17 @@+import { IsString, IsOptional, IsInt, Min, Max, Matches } from 'class-validator';++export class SendTextStatusDto {+ @IsString()+ text: string;++ @IsOptional()+ @IsString()+ @Matches(/^#[0-9A-Fa-f]{6}$/, { message: 'backgroundColor must be a hex color (e.g., #25D366)' })+ backgroundColor?: string;++ @IsOptional()+ @IsInt()+ @Min(0)+ @Max(4)+ font?: number;+}diff --git a/src/modules/status/status.controller.ts b/src/modules/status/status.controller.tsnew file mode 100644index 000000000..34574b1e3--- /dev/null+++ b/src/modules/status/status.controller.ts@@ -0,0 +1,52 @@+import { Controller, Get, Post, Delete, Param, Body } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';+import { StatusService } from './status.service';+import { SendTextStatusDto } from './dto/send-text-status.dto';+import { SendImageStatusDto, SendVideoStatusDto } from './dto/send-media-status.dto';++@ApiTags('Status')+@ApiBearerAuth()+@Controller('sessions/:sessionId/status')+export class StatusController {+ constructor(private readonly statusService: StatusService) {}++ @Get()+ @ApiOperation({ summary: 'Get all contact status updates' })+ async getStatuses(@Param('sessionId') sessionId: string) {+ return { statuses: await this.statusService.getStatuses(sessionId) };+ }++ @Get(':contactId')+ @ApiOperation({ summary: 'Get status updates from a specific contact' })+ async getContactStatus(@Param('sessionId') sessionId: string, @Param('contactId') contactId: string) {+ return { statuses: await this.statusService.getContactStatus(sessionId, contactId) };+ }++ @Post('send-text')+ @ApiOperation({ summary: 'Post a text status' })+ async sendTextStatus(@Param('sessionId') sessionId: string, @Body() dto: SendTextStatusDto) {+ return this.statusService.postTextStatus(sessionId, dto.text, {+ backgroundColor: dto.backgroundColor,+ font: dto.font,+ });+ }++ @Post('send-image')+ @ApiOperation({ summary: 'Post an image status' })+ async sendImageStatus(@Param('sessionId') sessionId: string, @Body() dto: SendImageStatusDto) {+ return this.statusService.postImageStatus(sessionId, dto.image, dto.caption);+ }++ @Post('send-video')+ @ApiOperation({ summary: 'Post a video status' })+ async sendVideoStatus(@Param('sessionId') sessionId: string, @Body() dto: SendVideoStatusDto) {+ return this.statusService.postVideoStatus(sessionId, dto.video, dto.caption);+ }++ @Delete(':statusId')+ @ApiOperation({ summary: 'Delete own status' })+ async deleteStatus(@Param('sessionId') sessionId: string, @Param('statusId') statusId: string) {+ await this.statusService.deleteStatus(sessionId, statusId);+ return { message: 'Status deleted successfully' };+ }+}diff --git a/src/modules/status/status.module.ts b/src/modules/status/status.module.tsnew file mode 100644index 000000000..ecbc80f56--- /dev/null+++ b/src/modules/status/status.module.ts@@ -0,0 +1,12 @@+import { Module } from '@nestjs/common';+import { StatusController } from './status.controller';+import { StatusService } from './status.service';+import { SessionModule } from '../session/session.module';++@Module({+ imports: [SessionModule],+ controllers: [StatusController],+ providers: [StatusService],+ exports: [StatusService],+})+export class StatusModule {}diff --git a/src/modules/status/status.service.ts b/src/modules/status/status.service.tsnew file mode 100644index 000000000..692396641--- /dev/null+++ b/src/modules/status/status.service.ts@@ -0,0 +1,76 @@+import { Injectable, NotFoundException } from '@nestjs/common';+import { SessionService } from '../session/session.service';+import type { Status, StatusResult, TextStatusOptions } from '../../engine/interfaces/whatsapp-engine.interface';++@Injectable()+export class StatusService {+ constructor(private readonly sessionService: SessionService) {}++ async getStatuses(sessionId: string): Promise<Status[]> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.getContactStatuses();+ }++ async getContactStatus(sessionId: string, contactId: string): Promise<Status[]> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.getContactStatus(contactId);+ }++ async postTextStatus(sessionId: string, text: string, options?: TextStatusOptions): Promise<StatusResult> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.postTextStatus(text, options);+ }++ async postImageStatus(+ sessionId: string,+ media: { url?: string; base64?: string },+ caption?: string,+ ): Promise<StatusResult> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.postImageStatus(+ {+ mimetype: 'image/jpeg',+ data: media.url || media.base64 || '',+ },+ caption,+ );+ }++ async postVideoStatus(+ sessionId: string,+ media: { url?: string; base64?: string },+ caption?: string,+ ): Promise<StatusResult> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.postVideoStatus(+ {+ mimetype: 'video/mp4',+ data: media.url || media.base64 || '',+ },+ caption,+ );+ }++ async deleteStatus(sessionId: string, statusId: string): Promise<void> {+ const engine = this.sessionService.getEngine(sessionId);+ if (!engine) {+ throw new NotFoundException(`Session ${sessionId} not found or not connected`);+ }+ return engine.deleteStatus(statusId);+ }+}diff --git a/src/modules/webhook/dto/index.ts b/src/modules/webhook/dto/index.tsnew file mode 100644index 000000000..db2029601--- /dev/null+++ b/src/modules/webhook/dto/index.ts@@ -0,0 +1 @@+export * from './webhook.dto';diff --git a/src/modules/webhook/dto/webhook.dto.ts b/src/modules/webhook/dto/webhook.dto.tsnew file mode 100644index 000000000..e25b0760d--- /dev/null+++ b/src/modules/webhook/dto/webhook.dto.ts@@ -0,0 +1,126 @@+import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';+import { IsString, IsUrl, IsArray, IsOptional, IsBoolean, IsInt, Min, Max, ArrayMinSize } from 'class-validator';++export const WEBHOOK_EVENTS = [+ 'message.received',+ 'message.sent',+ 'message.ack',+ 'message.revoked',+ 'session.status',+ 'session.qr',+ 'session.authenticated',+ 'session.disconnected',+ 'group.join',+ 'group.leave',+ 'group.update',+] as const;++export type WebhookEventType = (typeof WEBHOOK_EVENTS)[number];++export class CreateWebhookDto {+ @ApiProperty({+ description: 'Webhook URL to receive events',+ example: 'https://your-server.com/webhook',+ })+ @IsUrl()+ url: string;++ @ApiPropertyOptional({+ description: 'Event types to subscribe to',+ example: ['message.received', 'session.status'],+ enum: WEBHOOK_EVENTS,+ })+ @IsOptional()+ @IsArray()+ @ArrayMinSize(1)+ events?: string[];++ @ApiPropertyOptional({+ description: 'Secret key for HMAC signature verification',+ example: 'your-secret-key',+ })+ @IsOptional()+ @IsString()+ secret?: string;++ @ApiPropertyOptional({+ description: 'Custom headers to include in webhook requests',+ example: { 'X-Custom-Header': 'value' },+ })+ @IsOptional()+ headers?: Record<string, string>;++ @ApiPropertyOptional({+ description: 'Number of retry attempts on failure',+ example: 3,+ minimum: 0,+ maximum: 5,+ })+ @IsOptional()+ @IsInt()+ @Min(0)+ @Max(5)+ retryCount?: number;+}++export class UpdateWebhookDto {+ @ApiPropertyOptional({ description: 'Webhook URL' })+ @IsOptional()+ @IsUrl()+ url?: string;++ @ApiPropertyOptional({ description: 'Event types to subscribe to' })+ @IsOptional()+ @IsArray()+ events?: string[];++ @ApiPropertyOptional({ description: 'Secret key for HMAC signature' })+ @IsOptional()+ @IsString()+ secret?: string;++ @ApiPropertyOptional({ description: 'Custom headers' })+ @IsOptional()+ headers?: Record<string, string>;++ @ApiPropertyOptional({ description: 'Enable/disable webhook' })+ @IsOptional()+ @IsBoolean()+ active?: boolean;++ @ApiPropertyOptional({ description: 'Retry count' })+ @IsOptional()+ @IsInt()+ @Min(0)+ @Max(5)+ retryCount?: number;+}++export class WebhookResponseDto {+ @ApiProperty()+ id: string;++ @ApiProperty()+ sessionId: string;++ @ApiProperty()+ url: string;++ @ApiProperty()+ events: string[];++ @ApiProperty()+ active: boolean;++ @ApiProperty()+ retryCount: number;++ @ApiPropertyOptional()+ lastTriggeredAt?: Date | null;++ @ApiProperty()+ createdAt: Date;++ @ApiProperty()+ updatedAt: Date;+}diff --git a/src/modules/webhook/entities/webhook.entity.ts b/src/modules/webhook/entities/webhook.entity.tsnew file mode 100644index 000000000..f35aca1b6--- /dev/null+++ b/src/modules/webhook/entities/webhook.entity.ts@@ -0,0 +1,51 @@+import {+ Entity,+ Column,+ PrimaryGeneratedColumn,+ CreateDateColumn,+ UpdateDateColumn,+ ManyToOne,+ JoinColumn,+} from 'typeorm';+import { Session } from '../../session/entities/session.entity';+import { DateTransformer } from '../../../common/transformers/date.transformer';++@Entity('webhooks')+export class Webhook {+ @PrimaryGeneratedColumn('uuid')+ id: string;++ @Column({ type: 'uuid' })+ sessionId: string;++ @ManyToOne(() => Session, { onDelete: 'CASCADE' })+ @JoinColumn({ name: 'sessionId' })+ session: Session;++ @Column({ type: 'varchar', length: 2048 })+ url: string;++ @Column({ type: 'simple-json', default: '["message.received"]' })+ events: string[];++ @Column({ type: 'varchar', length: 255, nullable: true })+ secret: string | null;++ @Column({ type: 'simple-json', default: '{}' })+ headers: Record<string, string>;++ @Column({ type: 'boolean', default: true })+ active: boolean;++ @Column({ type: 'int', default: 3 })+ retryCount: number;++ @Column({ type: 'text', nullable: true, transformer: DateTransformer })+ lastTriggeredAt: Date | null;++ @CreateDateColumn()+ createdAt: Date;++ @UpdateDateColumn()+ updatedAt: Date;+}diff --git a/src/modules/webhook/utils/idempotency.util.spec.ts b/src/modules/webhook/utils/idempotency.util.spec.tsnew file mode 100644index 000000000..b57e410c0--- /dev/null+++ b/src/modules/webhook/utils/idempotency.util.spec.ts@@ -0,0 +1,47 @@+import { generateIdempotencyKey, generateDeliveryId } from './idempotency.util';++describe('Idempotency Utils', () => {+ describe('generateIdempotencyKey', () => {+ it('should generate key for message.received', () => {+ const key = generateIdempotencyKey('message.received', { messageId: 'ABC123' });+ expect(key).toBe('msg_ABC123');+ });++ it('should generate key for message.ack', () => {+ const key = generateIdempotencyKey('message.ack', { messageId: 'ABC123', ack: 3 });+ expect(key).toBe('ack_ABC123_3');+ });++ it('should generate key for session.status', () => {+ const key = generateIdempotencyKey('session.status', {+ sessionId: 'sess_1',+ status: 'CONNECTED',+ });+ expect(key).toBe('sess_sess_1_CONNECTED');+ });++ it('should generate key for group.join', () => {+ const key = generateIdempotencyKey('group.join', {+ groupId: 'grp_1',+ participantId: 'user_1',+ });+ expect(key).toBe('grp_grp_1_user_1_join');+ });++ it('should generate fallback key for unknown events', () => {+ const key = generateIdempotencyKey('custom.event', {});+ expect(key).toMatch(/^evt_custom_event_[a-f0-9]{12}$/);+ });+ });++ describe('generateDeliveryId', () => {+ it('should generate unique delivery IDs', () => {+ const id1 = generateDeliveryId();+ const id2 = generateDeliveryId();++ expect(id1).toMatch(/^dlv_[a-f0-9-]{36}$/);+ expect(id2).toMatch(/^dlv_[a-f0-9-]{36}$/);+ expect(id1).not.toBe(id2);+ });+ });+});diff --git a/src/modules/webhook/utils/idempotency.util.ts b/src/modules/webhook/utils/idempotency.util.tsnew file mode 100644index 000000000..f96f40a02--- /dev/null+++ b/src/modules/webhook/utils/idempotency.util.ts@@ -0,0 +1,82 @@+import { randomUUID, createHash } from 'crypto';++/**+ * Safely convert an unknown value to a string for use in idempotency keys+ */+function toStr(value: unknown, fallback = 'unknown'): string {+ if (value === null || value === undefined) return fallback;+ if (typeof value === 'string') return value;+ if (typeof value === 'number' || typeof value === 'boolean') return String(value);+ return fallback;+}++/**+ * Generate a short hash from data for use in idempotency keys.+ * Used when no unique identifier is available in the payload.+ */+function hashData(data: Record<string, unknown>): string {+ const str = JSON.stringify(data, Object.keys(data).sort());+ return createHash('sha256').update(str).digest('hex').substring(0, 12);+}++/**+ * Generate an idempotency key based on event type and data.+ * Same event with same data will produce the same key (deterministic).+ *+ * @remarks+ * Keys are content-based and do NOT include timestamps.+ * This ensures that replayed/retried events with identical payloads+ * produce the same key for proper deduplication.+ */+export function generateIdempotencyKey(event: string, data: Record<string, unknown>): string {+ switch (event) {+ case 'message.received':+ case 'message.sent':+ // Message ID is unique per message+ return `msg_${toStr(data.messageId) || toStr(data.id)}`;++ case 'message.ack':+ // Message ID + ack status together are unique+ return `ack_${toStr(data.messageId)}_${toStr(data.ack, '0')}`;++ case 'message.revoked':+ return `rev_${toStr(data.messageId)}`;++ case 'session.status':+ // Session + status combo (same status emitted once per transition)+ return `sess_${toStr(data.sessionId)}_${toStr(data.status)}`;++ case 'session.qr':+ // QR changes each time, use the QR data hash for uniqueness+ return `qr_${toStr(data.sessionId)}_${hashData({ qr: data.qr })}`;++ case 'session.authenticated':+ // Auth only happens once per session lifecycle+ return `auth_${toStr(data.sessionId)}_${hashData(data)}`;++ case 'session.disconnected':+ // Disconnect with reason for uniqueness+ return `disc_${toStr(data.sessionId)}_${hashData({ reason: data.reason })}`;++ case 'group.join':+ return `grp_${toStr(data.groupId)}_${toStr(data.participantId)}_join`;++ case 'group.leave':+ return `grp_${toStr(data.groupId)}_${toStr(data.participantId)}_leave`;++ case 'group.update':+ // Include what changed for uniqueness+ return `grp_${toStr(data.groupId)}_update_${hashData(data)}`;++ default:+ // Fallback: hash entire payload for determinism+ return `evt_${event.replace(/\./g, '_')}_${hashData(data)}`;+ }+}++/**+ * Generate a unique delivery ID for each webhook delivery attempt+ */+export function generateDeliveryId(): string {+ return `dlv_${randomUUID()}`;+}diff --git a/src/modules/webhook/webhook.controller.ts b/src/modules/webhook/webhook.controller.tsnew file mode 100644index 000000000..471d5db0e--- /dev/null+++ b/src/modules/webhook/webhook.controller.ts@@ -0,0 +1,93 @@+import { Controller, Get, Post, Put, Delete, Param, Body, HttpCode, HttpStatus } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse, ApiParam } from '@nestjs/swagger';+import { WebhookService } from './webhook.service';+import { CreateWebhookDto, UpdateWebhookDto, WebhookResponseDto } from './dto';+import { Webhook } from './entities/webhook.entity';+import { RequireRole } from '../auth/decorators/auth.decorators';+import { ApiKeyRole } from '../auth/entities/api-key.entity';++@ApiTags('webhooks')+@Controller('sessions/:sessionId/webhooks')+export class WebhookController {+ constructor(private readonly webhookService: WebhookService) {}++ @Post()+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Create a webhook for the session' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 201,+ description: 'Webhook created',+ type: WebhookResponseDto,+ })+ async create(@Param('sessionId') sessionId: string, @Body() dto: CreateWebhookDto): Promise<Webhook> {+ return this.webhookService.create(sessionId, dto);+ }++ @Get()+ @ApiOperation({ summary: 'List all webhooks for a session' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiResponse({+ status: 200,+ description: 'List of webhooks',+ type: [WebhookResponseDto],+ })+ async findBySession(@Param('sessionId') sessionId: string): Promise<Webhook[]> {+ return this.webhookService.findBySession(sessionId);+ }++ @Get(':id')+ @ApiOperation({ summary: 'Get a webhook by ID' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'id', description: 'Webhook ID' })+ @ApiResponse({+ status: 200,+ description: 'Webhook details',+ type: WebhookResponseDto,+ })+ @ApiResponse({ status: 404, description: 'Webhook not found' })+ async findOne(@Param('id') id: string): Promise<Webhook> {+ return this.webhookService.findOne(id);+ }++ @Put(':id')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Update a webhook' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'id', description: 'Webhook ID' })+ @ApiResponse({+ status: 200,+ description: 'Webhook updated',+ type: WebhookResponseDto,+ })+ @ApiResponse({ status: 404, description: 'Webhook not found' })+ async update(@Param('id') id: string, @Body() dto: UpdateWebhookDto): Promise<Webhook> {+ return this.webhookService.update(id, dto);+ }++ @Post(':id/test')+ @RequireRole(ApiKeyRole.OPERATOR)+ @ApiOperation({ summary: 'Test a webhook by sending a test payload' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'id', description: 'Webhook ID' })+ @ApiResponse({ status: 200, description: 'Test result' })+ @ApiResponse({ status: 404, description: 'Webhook not found' })+ async test(+ @Param('sessionId') sessionId: string,+ @Param('id') id: string,+ ): Promise<{ success: boolean; statusCode?: number; error?: string }> {+ return this.webhookService.test(sessionId, id);+ }++ @Delete(':id')+ @RequireRole(ApiKeyRole.OPERATOR)+ @HttpCode(HttpStatus.NO_CONTENT)+ @ApiOperation({ summary: 'Delete a webhook' })+ @ApiParam({ name: 'sessionId', description: 'Session ID' })+ @ApiParam({ name: 'id', description: 'Webhook ID' })+ @ApiResponse({ status: 204, description: 'Webhook deleted' })+ @ApiResponse({ status: 404, description: 'Webhook not found' })+ async delete(@Param('id') id: string): Promise<void> {+ return this.webhookService.delete(id);+ }+}diff --git a/src/modules/webhook/webhook.module.ts b/src/modules/webhook/webhook.module.tsnew file mode 100644index 000000000..34bfc85f1--- /dev/null+++ b/src/modules/webhook/webhook.module.ts@@ -0,0 +1,24 @@+import { Module, DynamicModule, Type } from '@nestjs/common';+import { TypeOrmModule } from '@nestjs/typeorm';+import { Webhook } from './entities/webhook.entity';+import { WebhookService } from './webhook.service';+import { WebhookController } from './webhook.controller';+import { WebhooksListController } from './webhooks-list.controller';++// Only import QueueModule if explicitly enabled to avoid Redis connection errors+const queueModules: Array<Type | DynamicModule> = [];+if (process.env.QUEUE_ENABLED === 'true') {+ // eslint-disable-next-line @typescript-eslint/no-require-imports+ const queueModule = require('../queue/queue.module') as {+ QueueModule: Type;+ };+ queueModules.push(queueModule.QueueModule);+}++@Module({+ imports: [TypeOrmModule.forFeature([Webhook], 'data'), ...queueModules],+ controllers: [WebhookController, WebhooksListController],+ providers: [WebhookService],+ exports: [WebhookService],+})+export class WebhookModule {}diff --git a/src/modules/webhook/webhook.service.ts b/src/modules/webhook/webhook.service.tsnew file mode 100644index 000000000..1455338f9--- /dev/null+++ b/src/modules/webhook/webhook.service.ts@@ -0,0 +1,365 @@+import { Injectable, NotFoundException, Optional } from '@nestjs/common';+import { InjectRepository } from '@nestjs/typeorm';+import { Repository } from 'typeorm';+import { ConfigService } from '@nestjs/config';+import { InjectQueue } from '@nestjs/bullmq';+import { Queue } from 'bullmq';+import * as crypto from 'crypto';+import { Webhook } from './entities/webhook.entity';+import { CreateWebhookDto, UpdateWebhookDto } from './dto';+import { createLogger } from '../../common/services/logger.service';+import { QUEUE_NAMES } from '../queue/queue-names';+import { generateIdempotencyKey, generateDeliveryId } from './utils/idempotency.util';+import { HookManager } from '../../core/hooks';++export interface WebhookPayload {+ event: string;+ timestamp: string;+ sessionId: string;+ idempotencyKey: string;+ deliveryId: string;+ data: any;+}++export interface WebhookJobData {+ webhookId: string;+ url: string;+ event: string;+ payload: WebhookPayload;+ signature: string;+ headers: Record<string, string>;+ attempt: number;+ maxRetries: number;+}++@Injectable()+export class WebhookService {+ private readonly logger = createLogger('WebhookService');+ private readonly queueEnabled: boolean;++ constructor(+ @InjectRepository(Webhook, 'data')+ private readonly webhookRepository: Repository<Webhook>,+ private readonly configService: ConfigService,+ private readonly hookManager: HookManager,+ @Optional()+ @InjectQueue(QUEUE_NAMES.WEBHOOK)+ private readonly webhookQueue?: Queue<WebhookJobData>,+ ) {+ this.queueEnabled = configService.get<boolean>('queue.enabled', false);+ }++ async create(sessionId: string, dto: CreateWebhookDto): Promise<Webhook> {+ const webhook = this.webhookRepository.create({+ sessionId,+ url: dto.url,+ events: dto.events || ['message.received'],+ secret: dto.secret || null,+ headers: dto.headers || {},+ retryCount: dto.retryCount ?? 3,+ });++ return this.webhookRepository.save(webhook);+ }++ async findBySession(sessionId: string): Promise<Webhook[]> {+ return this.webhookRepository.find({+ where: { sessionId },+ order: { createdAt: 'DESC' },+ });+ }++ async findAll(): Promise<Webhook[]> {+ return this.webhookRepository.find({+ order: { createdAt: 'DESC' },+ });+ }++ async findOne(id: string): Promise<Webhook> {+ const webhook = await this.webhookRepository.findOne({ where: { id } });+ if (!webhook) {+ throw new NotFoundException(`Webhook with id '${id}' not found`);+ }+ return webhook;+ }++ async update(id: string, dto: UpdateWebhookDto): Promise<Webhook> {+ const webhook = await this.findOne(id);++ if (dto.url !== undefined) webhook.url = dto.url;+ if (dto.events !== undefined) webhook.events = dto.events;+ if (dto.secret !== undefined) webhook.secret = dto.secret;+ if (dto.headers !== undefined) webhook.headers = dto.headers;+ if (dto.active !== undefined) webhook.active = dto.active;+ if (dto.retryCount !== undefined) webhook.retryCount = dto.retryCount;++ return this.webhookRepository.save(webhook);+ }++ async delete(id: string): Promise<void> {+ const webhook = await this.findOne(id);+ await this.webhookRepository.remove(webhook);+ }++ async test(sessionId: string, webhookId: string): Promise<{ success: boolean; statusCode?: number; error?: string }> {+ const webhook = await this.findOne(webhookId);++ const testPayload: WebhookPayload = {+ event: 'test',+ timestamp: new Date().toISOString(),+ sessionId,+ idempotencyKey: generateIdempotencyKey('test', { webhookId: webhook.id }),+ deliveryId: generateDeliveryId(),+ data: {+ message: 'This is a test webhook from OpenWA',+ webhookId: webhook.id,+ url: webhook.url,+ },+ };++ const body = JSON.stringify(testPayload);+ const headers: Record<string, string> = {+ 'Content-Type': 'application/json',+ 'User-Agent': 'OpenWA-Webhook/1.0.0',+ 'X-OpenWA-Event': 'test',+ 'X-OpenWA-Idempotency-Key': testPayload.idempotencyKey,+ 'X-OpenWA-Delivery-Id': testPayload.deliveryId,+ 'X-OpenWA-Retry-Count': '0',+ ...webhook.headers,+ };++ if (webhook.secret) {+ headers['X-OpenWA-Signature'] = this.generateSignature(body, webhook.secret);+ }++ try {+ const response = await fetch(webhook.url, {+ method: 'POST',+ headers,+ body,+ signal: AbortSignal.timeout(10000),+ });++ return {+ success: response.ok,+ statusCode: response.status,+ };+ } catch (error) {+ return {+ success: false,+ error: error instanceof Error ? error.message : 'Unknown error',+ };+ }+ }++ async dispatch(sessionId: string, event: string, data: Record<string, unknown>): Promise<void> {+ const webhooks = await this.webhookRepository.find({+ where: { sessionId, active: true },+ });++ const matchingWebhooks = webhooks.filter(w => w.events.includes(event) || w.events.includes('*'));++ // Generate idempotency key (same for all webhooks receiving this event)+ const idempotencyKey = generateIdempotencyKey(event, { ...data, sessionId });++ // Dispatch to all matching webhooks+ for (const webhook of matchingWebhooks) {+ // Generate unique delivery ID for each webhook+ const deliveryId = generateDeliveryId();++ const payload: WebhookPayload = {+ event,+ timestamp: new Date().toISOString(),+ sessionId,+ idempotencyKey,+ deliveryId,+ data,+ };++ // Execute hook before webhook dispatch - plugins can modify payload+ const { continue: shouldContinue, data: hookResult } = await this.hookManager.execute(+ 'webhook:before',+ { sessionId, event, payload },+ { sessionId, source: 'WebhookService' },+ );++ if (!shouldContinue) {+ this.logger.debug(`Webhook dispatch cancelled by plugin for ${event}`, {+ webhookId: webhook.id,+ action: 'webhook_cancelled_by_plugin',+ });+ continue;+ }++ // Use potentially modified payload+ const finalPayload = (hookResult as { payload: WebhookPayload }).payload;++ // Build headers+ const headers: Record<string, string> = {+ 'Content-Type': 'application/json',+ 'User-Agent': 'OpenWA-Webhook/1.0.0',+ 'X-OpenWA-Event': event,+ 'X-OpenWA-Idempotency-Key': idempotencyKey,+ 'X-OpenWA-Delivery-Id': deliveryId,+ 'X-OpenWA-Retry-Count': '0',+ ...webhook.headers,+ };++ // Use queue if available, otherwise fallback to direct delivery+ if (this.queueEnabled && this.webhookQueue) {+ const signature = webhook.secret ? this.generateSignature(JSON.stringify(finalPayload), webhook.secret) : '';++ if (webhook.secret) {+ headers['X-OpenWA-Signature'] = signature;+ }++ const jobData: WebhookJobData = {+ webhookId: webhook.id,+ url: webhook.url,+ event,+ payload: finalPayload,+ signature,+ headers,+ attempt: 1,+ maxRetries: webhook.retryCount,+ };++ try {+ await this.webhookQueue.add(`webhook-${webhook.id}`, jobData, {+ attempts: webhook.retryCount,+ backoff: {+ type: 'exponential',+ delay: this.configService.get<number>('webhook.retryDelay', 5000),+ },+ });++ // Execute hook after successful queue (NOT delivery - that happens in processor)+ await this.hookManager.execute(+ 'webhook:queued',+ { sessionId, event, webhookId: webhook.id, deliveryId },+ { sessionId, source: 'WebhookService' },+ );++ this.logger.debug(`Webhook job queued for ${webhook.id}`, {+ webhookId: webhook.id,+ event,+ idempotencyKey,+ deliveryId,+ action: 'webhook_queued',+ });+ } catch (error) {+ // Execute hook on queue error (not delivery error - that happens in processor)+ await this.hookManager.execute(+ 'webhook:error',+ { sessionId, event, webhookId: webhook.id, error: `Queue failed: ${String(error)}` },+ { sessionId, source: 'WebhookService' },+ );++ this.logger.error(`Failed to queue webhook ${webhook.id}`, String(error), {+ webhookId: webhook.id,+ action: 'webhook_queue_failed',+ });+ }+ } else {+ // Direct delivery when queue is disabled+ try {+ await this.deliverWebhook(webhook, finalPayload, headers);++ // Execute hook after successful delivery+ await this.hookManager.execute(+ 'webhook:delivered',+ { sessionId, event, webhookId: webhook.id, deliveryId },+ { sessionId, source: 'WebhookService' },+ );++ // Legacy hook for backward compatibility+ await this.hookManager.execute(+ 'webhook:after',+ { sessionId, event, webhookId: webhook.id, success: true },+ { sessionId, source: 'WebhookService' },+ );+ } catch (error) {+ // Execute hook on error+ await this.hookManager.execute(+ 'webhook:error',+ { sessionId, event, webhookId: webhook.id, error: String(error) },+ { sessionId, source: 'WebhookService' },+ );++ this.logger.error(`Failed to deliver webhook ${webhook.id}`, String(error), {+ webhookId: webhook.id,+ action: 'webhook_delivery_failed',+ });+ }+ }+ }+ }++ /**+ * @deprecated Use job queue dispatch instead. This is kept for fallback.+ */+ private async deliverWebhook(+ webhook: Webhook,+ payload: WebhookPayload,+ headers: Record<string, string>,+ attempt = 1,+ ): Promise<void> {+ const body = JSON.stringify(payload);++ // Update retry count header+ headers['X-OpenWA-Retry-Count'] = String(attempt - 1);++ // Add signature if secret is configured and not already present+ if (webhook.secret && !headers['X-OpenWA-Signature']) {+ headers['X-OpenWA-Signature'] = this.generateSignature(body, webhook.secret);+ }++ try {+ const response = await fetch(webhook.url, {+ method: 'POST',+ headers,+ body,+ signal: AbortSignal.timeout(this.configService.get<number>('webhook.timeout', 10000)),+ });++ if (!response.ok) {+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);+ }++ // Update last triggered timestamp+ await this.webhookRepository.update(webhook.id, {+ lastTriggeredAt: new Date(),+ });++ this.logger.debug(`Webhook delivered to ${webhook.id}`, {+ webhookId: webhook.id,+ deliveryId: payload.deliveryId,+ action: 'webhook_delivered',+ });+ } catch (error) {+ this.logger.error(`Webhook delivery failed for ${webhook.id}`, String(error), {+ webhookId: webhook.id,+ attempt,+ deliveryId: payload.deliveryId,+ action: 'webhook_delivery_failed',+ });++ if (attempt < webhook.retryCount) {+ const delay = this.configService.get<number>('webhook.retryDelay', 5000);+ await this.delay(delay * attempt);+ return this.deliverWebhook(webhook, payload, headers, attempt + 1);+ }+ throw error;+ }+ }++ private generateSignature(payload: string, secret: string): string {+ const hmac = crypto.createHmac('sha256', secret);+ hmac.update(payload);+ return `sha256=${hmac.digest('hex')}`;+ }++ private delay(ms: number): Promise<void> {+ return new Promise(resolve => setTimeout(resolve, ms));+ }+}diff --git a/src/modules/webhook/webhooks-list.controller.ts b/src/modules/webhook/webhooks-list.controller.tsnew file mode 100644index 000000000..a7252ad02--- /dev/null+++ b/src/modules/webhook/webhooks-list.controller.ts@@ -0,0 +1,20 @@+import { Controller, Get } from '@nestjs/common';+import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';+import { WebhookService } from './webhook.service';+import { Webhook } from './entities/webhook.entity';++@ApiTags('webhooks')+@Controller('webhooks')+export class WebhooksListController {+ constructor(private readonly webhookService: WebhookService) {}++ @Get()+ @ApiOperation({ summary: 'List all webhooks across all sessions' })+ @ApiResponse({+ status: 200,+ description: 'List of all webhooks',+ })+ async findAll(): Promise<Webhook[]> {+ return this.webhookService.findAll();+ }+}diff --git a/src/plugins/engines/whatsapp-web-js/index.ts b/src/plugins/engines/whatsapp-web-js/index.tsnew file mode 100644index 000000000..a2420c51e--- /dev/null+++ b/src/plugins/engines/whatsapp-web-js/index.ts@@ -0,0 +1,89 @@+/**+ * WhatsApp-web.js Engine Plugin+ * Built-in engine plugin that wraps the whatsapp-web.js library+ */++import { PluginContext, PluginType, IEnginePlugin } from '../../../core/plugins';+import { IWhatsAppEngine } from '../../../engine/interfaces/whatsapp-engine.interface';+import { WhatsAppWebJsAdapter } from '../../../engine/adapters/whatsapp-web-js.adapter';++export interface WhatsAppWebJsConfig {+ sessionDataPath?: string;+ headless?: boolean;+ puppeteerArgs?: string[];+}++export class WhatsAppWebJsPlugin implements IEnginePlugin {+ type = PluginType.ENGINE as const;+ private context?: PluginContext;++ onLoad(context: PluginContext): Promise<void> {+ this.context = context;+ context.logger.log('WhatsApp-web.js engine plugin loaded');+ return Promise.resolve();+ }++ onEnable(context: PluginContext): Promise<void> {+ context.logger.log('WhatsApp-web.js engine plugin enabled');+ return Promise.resolve();+ }++ onDisable(context: PluginContext): Promise<void> {+ context.logger.log('WhatsApp-web.js engine plugin disabled');+ return Promise.resolve();+ }++ createEngine(config: Record<string, unknown>): IWhatsAppEngine {+ const sessionId = config.sessionId as string;+ const sessionDataPath = (this.context?.config.sessionDataPath as string) ?? './data/sessions';+ const headless = (this.context?.config.headless as boolean) ?? true;+ const puppeteerArgs = (this.context?.config.puppeteerArgs as string[]) ?? [+ '--no-sandbox',+ '--disable-setuid-sandbox',+ ];++ const proxyUrl = config.proxyUrl as string | undefined;+ const proxyType = config.proxyType as 'http' | 'https' | 'socks4' | 'socks5' | undefined;++ return new WhatsAppWebJsAdapter({+ sessionId,+ sessionDataPath,+ puppeteer: {+ headless,+ args: puppeteerArgs,+ },+ proxy: proxyUrl+ ? {+ url: proxyUrl,+ type: proxyType ?? 'http',+ }+ : undefined,+ });+ }++ getFeatures(): string[] {+ return [+ 'text-messages',+ 'media-messages',+ 'location-messages',+ 'contact-messages',+ 'group-management',+ 'message-reactions',+ 'message-replies',+ 'message-forwarding',+ 'message-deletion',+ 'read-receipts',+ 'typing-indicator',+ 'labels',+ 'channels',+ 'status-updates',+ 'catalog',+ ];+ }++ healthCheck(): Promise<{ healthy: boolean; message?: string }> {+ return Promise.resolve({ healthy: true, message: 'WhatsApp-web.js engine is available' });+ }+}++export default WhatsAppWebJsPlugin;diff --git a/src/plugins/engines/whatsapp-web-js/manifest.json b/src/plugins/engines/whatsapp-web-js/manifest.jsonnew file mode 100644index 000000000..60f69516f--- /dev/null+++ b/src/plugins/engines/whatsapp-web-js/manifest.json@@ -0,0 +1,41 @@+{+ "id": "whatsapp-web.js",+ "name": "WhatsApp Web.js Engine",+ "version": "1.0.0",+ "type": "engine",+ "description": "Official WhatsApp-web.js engine adapter for OpenWA",+ "author": "OpenWA Team",+ "main": "index.ts",+ "provides": [+ "whatsapp-engine",+ "text-messages",+ "media-messages",+ "group-management"+ ],+ "configSchema": {+ "type": "object",+ "properties": {+ "sessionDataPath": {+ "type": "string",+ "title": "Session Data Path",+ "description": "Path to store session data",+ "default": "./data/sessions"+ },+ "headless": {+ "type": "boolean",+ "title": "Headless Mode",+ "description": "Run Puppeteer in headless mode",+ "default": true+ },+ "puppeteerArgs": {+ "type": "array",+ "title": "Puppeteer Arguments",+ "description": "Additional arguments for Puppeteer",+ "default": [+ "--no-sandbox",+ "--disable-setuid-sandbox"+ ]+ }+ }+ }+}\ No newline at end of filediff --git a/test/app.e2e-spec.ts b/test/app.e2e-spec.tsnew file mode 100644index 000000000..5c64fac01--- /dev/null+++ b/test/app.e2e-spec.ts@@ -0,0 +1,22 @@+import { Test, TestingModule } from '@nestjs/testing';+import { INestApplication } from '@nestjs/common';+import request from 'supertest';+import { App } from 'supertest/types';+import { AppModule } from './../src/app.module';++describe('AppController (e2e)', () => {+ let app: INestApplication<App>;++ beforeEach(async () => {+ const moduleFixture: TestingModule = await Test.createTestingModule({+ imports: [AppModule],+ }).compile();++ app = moduleFixture.createNestApplication();+ await app.init();+ });++ it('/ (GET)', () => {+ return request(app.getHttpServer()).get('/').expect(200).expect('Hello World!');+ });+});diff --git a/test/jest-e2e.json b/test/jest-e2e.jsonnew file mode 100644index 000000000..e9d912f3e--- /dev/null+++ b/test/jest-e2e.json@@ -0,0 +1,9 @@+{+ "moduleFileExtensions": ["js", "json", "ts"],+ "rootDir": ".",+ "testEnvironment": "node",+ "testRegex": ".e2e-spec.ts$",+ "transform": {+ "^.+\\.(t|j)s$": "ts-jest"+ }+}diff --git a/traefik/dynamic.yml b/traefik/dynamic.ymlnew file mode 100644index 000000000..8f85f6db9--- /dev/null+++ b/traefik/dynamic.yml@@ -0,0 +1,37 @@+# Traefik Dynamic Configuration+http:+ routers:+ # API Router - highest priority for /api paths+ api:+ rule: 'PathPrefix(`/api/`)'+ entryPoints:+ - web+ service: api+ priority: 100++ # WebSocket Router - highest priority for socket.io+ websocket:+ rule: 'PathPrefix(`/socket.io`)'+ entryPoints:+ - web+ service: api+ priority: 100++ # Dashboard Router - catch-all for frontend (lowest priority)+ dashboard:+ rule: 'PathPrefix(`/`)'+ entryPoints:+ - web+ service: dashboard+ priority: 1++ services:+ api:+ loadBalancer:+ servers:+ - url: 'http://openwa-api:2785'++ dashboard:+ loadBalancer:+ servers:+ - url: 'http://openwa-dashboard:80'diff --git a/traefik/traefik.yml b/traefik/traefik.ymlnew file mode 100644index 000000000..9ad1d71dc--- /dev/null+++ b/traefik/traefik.yml@@ -0,0 +1,16 @@+# Traefik Static Configuration+api:+ dashboard: true+ insecure: true++entryPoints:+ web:+ address: ':80'++providers:+ file:+ filename: /etc/traefik/dynamic.yml+ watch: true++log:+ level: INFOdiff --git a/tsconfig.build.json b/tsconfig.build.jsonnew file mode 100644index 000000000..8ae3ca79e--- /dev/null+++ b/tsconfig.build.json@@ -0,0 +1,5 @@+{+ "extends": "./tsconfig.json",+ "exclude": ["node_modules", "test", "dist", "**/*spec.ts", "dashboard"],+ "include": ["src"]+}diff --git a/tsconfig.json b/tsconfig.jsonnew file mode 100644index 000000000..6e339204f--- /dev/null+++ b/tsconfig.json@@ -0,0 +1,27 @@+{+ "compilerOptions": {+ "module": "nodenext",+ "moduleResolution": "nodenext",+ "resolvePackageJsonExports": true,+ "esModuleInterop": true,+ "isolatedModules": true,+ "declaration": true,+ "removeComments": true,+ "emitDecoratorMetadata": true,+ "experimentalDecorators": true,+ "allowSyntheticDefaultImports": true,+ "target": "ES2023",+ "sourceMap": true,+ "outDir": "./dist",+ "baseUrl": "./",+ "incremental": true,+ "skipLibCheck": true,+ "strictNullChecks": true,+ "forceConsistentCasingInFileNames": true,+ "noImplicitAny": true,+ "strictBindCallApply": true,+ "noFallthroughCasesInSwitch": true+ },+ "exclude": ["node_modules", "dist", "dashboard"],+ "include": ["src", "test"]+}