diff --git a/.dockerignore b/.dockerignore old mode 100644 new mode 100755 diff --git a/.env.example b/.env.example new file mode 100755 index 0000000..354e24c --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +# RabbitMQ Configuration +RABBITMQ_URL=amqps://your-cloudamqp-url + +# Database Configuration +DATABASE_URL=your-database-url + +# Communication Service Configuration +COMMUNICATION_SERVICE_URL=http://localhost:3001 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/CATAGORY_API.md b/CATAGORY_API.md deleted file mode 100644 index 3cf41e9..0000000 --- a/CATAGORY_API.md +++ /dev/null @@ -1,577 +0,0 @@ -# Categories API Documentation - -## Overview -This API provides endpoints for managing categories in the application. Categories are used to organize services hierarchically and can have parent-child relationships for better organization. - -## Base URL -``` -http://localhost:3000/api/categories -``` - -## Endpoints - -### 1. Create a Category -**POST** `/api/categories` - -Creates a new category. ~~Requires authentication~~ **Public for testing**. - -#### Request Body: -```json -{ - "name": "Web Development", - "slug": "web-development", - "description": "Professional web development and programming services", - "parentId": "cuid_parent_category_id" -} -``` - -#### Response (201): -```json -{ - "success": true, - "message": "Category created successfully", - "data": { - "id": "cuid_category_id", - "name": "Web Development", - "slug": "web-development", - "description": "Professional web development and programming services", - "parentId": "cuid_parent_category_id", - "parent": { - "id": "cuid_parent_category_id", - "name": "Technology", - "slug": "technology" - }, - "children": [], - "_count": { - "services": 0 - } - } -} -``` - -### 2. Get All Categories -**GET** `/api/categories` - -Retrieves all categories with optional filtering. - -#### Query Parameters: -- `parentId` (optional): Filter by parent category ID (use `null` for root categories) -- `includeChildren` (optional): Include children categories (`true` or `false`, default: `true`) -- `includeParent` (optional): Include parent category info (`true` or `false`, default: `true`) -- `includeServices` (optional): Include services count (`true` or `false`, default: `false`) - -#### Example: -``` -GET /api/categories?parentId=cuid_parent_id&includeChildren=true&includeServices=true -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Categories retrieved successfully", - "data": [ - { - "id": "cuid_category_id", - "name": "Web Development", - "slug": "web-development", - "description": "Professional web development services", - "parentId": "cuid_parent_category_id", - "parent": { - "id": "cuid_parent_category_id", - "name": "Technology", - "slug": "technology" - }, - "children": [ - { - "id": "cuid_child_category_id", - "name": "Frontend Development", - "slug": "frontend-development", - "description": "Frontend web development services" - } - ], - "_count": { - "services": 5 - } - } - ] -} -``` - -### 3. Get Root Categories -**GET** `/api/categories/roots` - -Retrieves all root categories (categories with no parent). - -#### Query Parameters: -- `includeChildren` (optional): Include children categories (`true` or `false`, default: `true`) - -#### Example: -``` -GET /api/categories/roots?includeChildren=true -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Root categories retrieved successfully", - "data": [ - { - "id": "cuid_category_id", - "name": "Technology", - "slug": "technology", - "description": "Technology related services", - "parentId": null, - "children": [ - { - "id": "cuid_child_category_id", - "name": "Web Development", - "slug": "web-development", - "description": "Web development services" - } - ], - "_count": { - "services": 15 - } - } - ] -} -``` - -### 4. Search Categories -**GET** `/api/categories/search` - -Search categories by name or description. - -#### Query Parameters: -- `q` (required): Search term -- `includeChildren` (optional): Include children categories (`true` or `false`, default: `true`) -- `includeParent` (optional): Include parent category info (`true` or `false`, default: `true`) - -#### Example: -``` -GET /api/categories/search?q=web&includeChildren=true -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Search completed successfully", - "data": [ - { - "id": "cuid_category_id", - "name": "Web Development", - "slug": "web-development", - "description": "Professional web development services", - "parentId": "cuid_parent_category_id", - "parent": { - "id": "cuid_parent_category_id", - "name": "Technology", - "slug": "technology" - }, - "children": [], - "_count": { - "services": 8 - } - } - ], - "searchTerm": "web" -} -``` - -### 5. Get Category by ID -**GET** `/api/categories/id/:id` - -Retrieves a specific category by its ID. - -#### Query Parameters: -- `includeChildren` (optional): Include children categories (`true` or `false`, default: `true`) -- `includeParent` (optional): Include parent category info (`true` or `false`, default: `true`) -- `includeServices` (optional): Include associated services (`true` or `false`, default: `false`) - -#### Example: -``` -GET /api/categories/id/cuid_category_id?includeServices=true -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Category retrieved successfully", - "data": { - "id": "cuid_category_id", - "name": "Web Development", - "slug": "web-development", - "description": "Professional web development services", - "parentId": "cuid_parent_category_id", - "parent": { - "id": "cuid_parent_category_id", - "name": "Technology", - "slug": "technology", - "description": "Technology related services" - }, - "children": [ - { - "id": "cuid_child_category_id", - "name": "Frontend Development", - "slug": "frontend-development", - "description": "Frontend web development services" - } - ], - "services": [ - { - "id": "cuid_service_id", - "title": "React Development Service", - "description": "Professional React development", - "price": 99.99, - "currency": "USD", - "isActive": true - } - ], - "_count": { - "services": 8 - } - } -} -``` - -### 6. Get Category by Slug -**GET** `/api/categories/slug/:slug` - -Retrieves a specific category by its slug. - -#### Query Parameters: -- `includeChildren` (optional): Include children categories (`true` or `false`, default: `true`) -- `includeParent` (optional): Include parent category info (`true` or `false`, default: `true`) -- `includeServices` (optional): Include associated services (`true` or `false`, default: `false`) - -#### Example: -``` -GET /api/categories/slug/web-development?includeChildren=true -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Category retrieved successfully", - "data": { - "id": "cuid_category_id", - "name": "Web Development", - "slug": "web-development", - "description": "Professional web development services", - "parentId": "cuid_parent_category_id", - "parent": { - "id": "cuid_parent_category_id", - "name": "Technology", - "slug": "technology", - "description": "Technology related services" - }, - "children": [ - { - "id": "cuid_child_category_id", - "name": "Frontend Development", - "slug": "frontend-development", - "description": "Frontend web development services" - } - ], - "_count": { - "services": 8 - } - } -} -``` - -### 7. Get Category Hierarchy -**GET** `/api/categories/:id/hierarchy` - -Gets the full hierarchy tree starting from a specific category (up to 3 levels up and down). - -#### Example: -``` -GET /api/categories/cuid_category_id/hierarchy -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Category hierarchy retrieved successfully", - "data": { - "id": "cuid_category_id", - "name": "Web Development", - "slug": "web-development", - "description": "Professional web development services", - "parentId": "cuid_parent_category_id", - "parent": { - "id": "cuid_parent_category_id", - "name": "Technology", - "slug": "technology", - "parent": { - "id": "cuid_grandparent_id", - "name": "Services", - "slug": "services", - "parent": null - } - }, - "children": [ - { - "id": "cuid_child_category_id", - "name": "Frontend Development", - "slug": "frontend-development", - "children": [ - { - "id": "cuid_grandchild_id", - "name": "React Development", - "slug": "react-development", - "children": [] - } - ] - } - ] - } -} -``` - -### 8. Update Category -**PUT** `/api/categories/:id` - -Updates an existing category. Requires authentication. - -#### Request Body (all fields optional): -```json -{ - "name": "Updated Web Development", - "slug": "updated-web-development", - "description": "Updated description for web development services", - "parentId": "new_parent_category_id" -} -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Category updated successfully", - "data": { - "id": "cuid_category_id", - "name": "Updated Web Development", - "slug": "updated-web-development", - "description": "Updated description for web development services", - "parentId": "new_parent_category_id", - "parent": { - "id": "new_parent_category_id", - "name": "Technology", - "slug": "technology" - }, - "children": [], - "_count": { - "services": 8 - } - } -} -``` - -### 9. Delete Category -**DELETE** `/api/categories/:id` - -Deletes a category. Requires authentication. - -#### Query Parameters: -- `force` (optional): Force delete even if category has children or services (`true` or `false`, default: `false`) - -#### Example: -``` -DELETE /api/categories/cuid_category_id?force=true -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Category deleted successfully", - "data": { - "id": "cuid_category_id", - "name": "Web Development", - "slug": "web-development", - "description": "Professional web development services", - "parentId": "cuid_parent_category_id" - } -} -``` - -## Error Responses - -### Validation Error (400): -```json -{ - "success": false, - "message": "Validation failed", - "errors": [ - { - "field": "slug", - "message": "Slug is required" - } - ] -} -``` - -### Duplicate Slug Error (400): -```json -{ - "success": false, - "message": "Category with this slug already exists" -} -``` - -### Not Found Error (404): -```json -{ - "success": false, - "message": "Category not found" -} -``` - -### Circular Reference Error (400): -```json -{ - "success": false, - "message": "Cannot create circular reference in category hierarchy" -} -``` - -### Delete Restriction Error (400): -```json -{ - "success": false, - "message": "Cannot delete category with child categories. Use force option or delete children first." -} -``` - -### Server Error (500): -```json -{ - "success": false, - "message": "Failed to create category: Parent category not found" -} -``` - -## Field Validations - -### Required Fields (for creation): -- `slug`: Must be unique, 2-100 characters, lowercase letters, numbers, and hyphens only - -### Optional Fields: -- `name`: 2-100 characters -- `description`: 10-500 characters -- `parentId`: Must be a valid category ID or null - -### Slug Format Rules: -- Must be lowercase -- Can contain letters (a-z), numbers (0-9), and hyphens (-) -- Cannot start or end with a hyphen -- Must be unique across all categories - -Examples of valid slugs: -- `web-development` -- `mobile-apps` -- `digital-marketing` -- `graphic-design` - -## Hierarchy Rules - -1. **No Circular References**: A category cannot be its own ancestor -2. **Parent Validation**: Parent category must exist before assigning children -3. **Depth Limit**: Recommended maximum depth of 4-5 levels for performance -4. **Deletion Rules**: - - Cannot delete categories with children unless `force=true` - - Cannot delete categories with associated services unless `force=true` - - When force deleting, children become root categories - -## Testing with curl - -### Create a root category: -```bash -curl -X POST http://localhost:3000/api/categories \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer your_jwt_token" \ - -d '{ - "name": "Technology", - "slug": "technology", - "description": "Technology related services" - }' -``` - -### Create a subcategory: -```bash -curl -X POST http://localhost:3000/api/categories \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer your_jwt_token" \ - -d '{ - "name": "Web Development", - "slug": "web-development", - "description": "Web development services", - "parentId": "your_parent_category_id" - }' -``` - -### Get all root categories: -```bash -curl http://localhost:3000/api/categories/roots -``` - -### Search categories: -```bash -curl "http://localhost:3000/api/categories/search?q=web" -``` - -### Get category by slug: -```bash -curl http://localhost:3000/api/categories/slug/web-development -``` - -### Update a category: -```bash -curl -X PUT http://localhost:3000/api/categories/your_category_id \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer your_jwt_token" \ - -d '{ - "name": "Updated Category Name", - "description": "Updated description" - }' -``` - -### Delete a category: -```bash -curl -X DELETE http://localhost:3000/api/categories/your_category_id \ - -H "Authorization: Bearer your_jwt_token" -``` - -## Common Use Cases - -### 1. Building a Category Tree for UI: -```bash -# Get all root categories with their children -curl http://localhost:3000/api/categories/roots?includeChildren=true -``` - -### 2. Category Navigation Breadcrumbs: -```bash -# Get full hierarchy for a category -curl http://localhost:3000/api/categories/your_category_id/hierarchy -``` - -### 3. Service Filtering by Category: -```bash -# Get category with service count -curl "http://localhost:3000/api/categories/id/your_category_id?includeServices=false" -``` - -### 4. Admin Category Management: -```bash -# Get all categories with full details -curl "http://localhost:3000/api/categories?includeChildren=true&includeServices=true" -``` diff --git a/EMBEDDING_FIX_GUIDE.md b/EMBEDDING_FIX_GUIDE.md new file mode 100755 index 0000000..3b583a2 --- /dev/null +++ b/EMBEDDING_FIX_GUIDE.md @@ -0,0 +1,188 @@ +# Service Embeddings Fix - Implementation Guide + +## Problem Solved + +The issue was that when creating services in the database, the embedding fields (`titleEmbedding`, `descriptionEmbedding`, `tagsEmbedding`, `combinedEmbedding`) were remaining null. This prevented the semantic search functionality from working properly. + +## Changes Made + +### 1. Fixed Service Creation Flow + +**File: `src/services/services.service.ts`** + +- Added import for `embeddingService` +- Modified `createService()` function to automatically generate and store embeddings after service creation +- Added error handling to ensure service creation doesn't fail if embedding generation fails + +### 2. Fixed Service Update Flow + +**File: `src/services/services.service.ts`** + +- Modified `updateService()` function to detect when content changes (title, description, or tags) +- Automatically regenerates embeddings when content affecting search relevance is updated +- Added error handling to ensure service updates don't fail if embedding regeneration fails + +### 3. Created Migration Scripts + +**Files: `scripts/generate-missing-embeddings.js` and `scripts/generate-missing-embeddings.ts`** + +- Comprehensive migration script to generate embeddings for all existing services that don't have them +- Includes progress tracking, error handling, and rate limiting for API quotas +- Supports both JavaScript and TypeScript execution +- Added prerequisites checking to ensure the system is ready + +### 4. Updated Package.json + +Added convenient npm scripts: +- `npm run generate-embeddings` - Run JavaScript version (requires build first) +- `npm run generate-embeddings:ts` - Run TypeScript version directly + +## How to Use + +### For New Services +No action needed! When you create a new service through the API, embeddings will be automatically generated and stored. + +### For Existing Services Without Embeddings + +#### Option 1: Run Migration Script (Recommended) +```bash +# Navigate to backend directory +cd backend + +# Option A: Run TypeScript version directly +npm run generate-embeddings:ts + +# Option B: Build and run JavaScript version +npm run generate-embeddings +``` + +#### Option 2: Use API Endpoints +```bash +# Update embeddings for a specific service +POST /api/services/:serviceId/embeddings + +# Update embeddings for all services (batch) +POST /api/services/embeddings/batch +``` + +## Migration Script Features + +### ✅ Safety Features +- **Prerequisites Check**: Verifies database connection, pgvector extension, and embedding service +- **Graceful Handling**: Continues processing even if individual services fail +- **Rate Limiting**: Respects API quotas with 5-second delays between requests +- **Progress Tracking**: Shows detailed progress with estimated completion time +- **Graceful Shutdown**: Handles Ctrl+C interruption safely + +### ⚠️ Important Notes +- **API Quotas**: Uses Gemini API for embeddings - free tier has daily limits +- **Time Required**: Processes 5 services per batch with 5-second delays (rate limiting) +- **Resumable**: Can be stopped and restarted - only processes services without embeddings +- **Production Safety**: Asks for confirmation in production environments + +### 📊 Migration Output Example +``` +🚀 Starting migration: Generate missing embeddings for services +================================================ +📊 Found 25 services without embeddings +⚠️ This process will take time due to API rate limits (15 requests/minute) +⏱️ Estimated time: 7 minutes + +📦 Processing batch 1... + +⏳ [1/25] Processing: "Web Development Services" + Service ID: clx1abc... + ✅ Success! Embeddings generated and saved. + ⏱️ Waiting 5 seconds (rate limit)... + +📈 Progress: 5/25 services processed +✅ Successful: 5 | ❌ Failed: 0 +⏱️ Estimated time remaining: 5 minutes +``` + +## How Embeddings Work + +1. **Title Embedding**: Generated from service title +2. **Description Embedding**: Generated from service description +3. **Tags Embedding**: Generated from combined tags +4. **Combined Embedding**: Weighted combination of all three for optimal search + +## API Integration + +The embedding generation is now seamlessly integrated into: + +- ✅ **Service Creation**: `POST /api/services` +- ✅ **Service Updates**: `PUT /api/services/:id` +- ✅ **Semantic Search**: `GET /api/services/search` +- ✅ **Similar Services**: `GET /api/services/:id/similar` +- ✅ **Manual Embedding Updates**: `POST /api/services/:id/embeddings` + +## Database Schema + +The following fields are now automatically populated: + +```sql +-- Service table embedding fields +titleEmbedding vector(768) -- From service title +descriptionEmbedding vector(768) -- From service description +tagsEmbedding vector(768) -- From service tags +combinedEmbedding vector(768) -- Weighted combination +embeddingUpdatedAt DateTime -- Last update timestamp +``` + +## Troubleshooting + +### Common Issues + +1. **API Quota Exceeded** + ``` + Error: Daily API limit reached + ``` + **Solution**: Wait 24 hours or upgrade to paid tier + +2. **Database Connection Issues** + ``` + Error: Database connection failed + ``` + **Solution**: Check DATABASE_URL and database status + +3. **pgvector Extension Missing** + ``` + Error: pgvector extension is not installed + ``` + **Solution**: Install pgvector in PostgreSQL + +### Monitoring Migration Progress + +The migration script provides detailed logging: +- Individual service processing status +- Batch progress updates +- Error details for failed services +- Overall completion statistics + +### Rerunning Migration + +The script is safe to run multiple times: +- Only processes services without embeddings +- Skips services that already have embeddings +- Can resume after interruption + +## Performance Considerations + +- **Rate Limiting**: 5-second delays between API calls +- **Batch Processing**: 5 services per batch (free tier optimized) +- **Memory Efficient**: Processes services in small batches +- **Error Recovery**: Continues processing even if individual services fail + +## Next Steps + +1. **Run Migration**: Execute the migration script for existing services +2. **Monitor Performance**: Check search quality improvement +3. **Optimize**: Fine-tune similarity thresholds based on search results +4. **Scale**: Consider upgrading to paid API tier for higher quotas + +--- + +🎉 **Your semantic search functionality should now work perfectly!** + +All new services will automatically have embeddings, and the migration script will handle existing services. The vector search will now return relevant results based on semantic similarity rather than simple text matching. \ No newline at end of file diff --git a/GEOLOCATION_API_REFERENCE.md b/GEOLOCATION_API_REFERENCE.md new file mode 100755 index 0000000..8c545c5 --- /dev/null +++ b/GEOLOCATION_API_REFERENCE.md @@ -0,0 +1,113 @@ +# 📍 Geolocation API Endpoints Reference + +This document summarizes all backend API endpoints related to geolocation and location-based service features. + +--- + +## 1. Service Creation & Update + +### **POST `/api/services`** +- **Purpose:** Create a new service (supports optional location fields). +- **Body Example:** + ```json + { + "title": "Plumbing Service", + "description": "Fix leaks and more", + "latitude": 6.9271, + "longitude": 79.8612, + "address": "123 Main St, Colombo", + "city": "Colombo", + "state": "Western", + "country": "Sri Lanka", + "postalCode": "10000", + "serviceRadiusKm": 15 + // ...other fields + } + ``` + +### **PUT `/api/services/:id`** +- **Purpose:** Update an existing service, including location fields. + +--- + +## 2. Service Search with Location + +### **GET `/api/services/search`** +- **Purpose:** Search for services by keyword and/or location. +- **Query Parameters:** + - `lat`, `lng` (or `latitude`, `longitude`): User coordinates + - `radius`: Search radius in km (default: 10) + - `address`: (optional) Address to geocode and use as search center + - `keyword`: (optional) Service search keyword +- **Behavior:** + - If no location is provided, returns all services matching the keyword. + - Services without location are considered available everywhere. + +--- + +## 3. Geocoding & Reverse Geocoding + +### **POST `/api/services/location/geocode`** +- **Purpose:** Convert an address to latitude/longitude and structured address fields. +- **Body:** + ```json + { "address": "123 Main St, Colombo" } + ``` +- **Response:** + ```json + { + "latitude": 6.9271, + "longitude": 79.8612, + "address": "123 Main St, Colombo", + "city": "Colombo", + "state": "Western", + "country": "Sri Lanka", + "postalCode": "10000" + } + ``` + +### **POST `/api/services/location/reverse-geocode`** +- **Purpose:** Convert latitude/longitude to a structured address. +- **Body:** + ```json + { "lat": 6.9271, "lng": 79.8612 } + ``` +- **Response:** Same as above. + +--- + +## 4. IP-based Location Detection + +### **GET `/api/services/location/ip`** +- **Purpose:** Detect approximate user location based on IP address. +- **Response:** + ```json + { + "latitude": 6.9271, + "longitude": 79.8612, + "city": "Colombo", + "country": "Sri Lanka", + "accuracy": "approximate" + } + ``` + +--- + +## 5. Other Related Endpoints + +### **GET `/api/services/:id`** +- **Purpose:** Fetch a single service, including its location fields. + +### **GET `/api/services`** +- **Purpose:** List all services (optionally filtered), including location fields. + +--- + +## Notes + +- **Services without location**: Treated as available everywhere and always included in search results. +- **Location fields are optional**: If not provided, the service is not location-restricted. + +--- + +**Keep this section for quick reference when developing or debugging location-based features!** diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/SERVICES_API.md b/SERVICES_API.md deleted file mode 100644 index 253e97c..0000000 --- a/SERVICES_API.md +++ /dev/null @@ -1,286 +0,0 @@ -# Services API Documentation - -## Overview -This API provides endpoints for managing services in the application. Services are offerings provided by service providers and can be booked by users. - -## Base URL -``` -http://localhost:3000/api/services -``` - -## Endpoints - -### 1. Create a Service -**POST** `/api/services` - -Creates a new service. - -#### Request Body: -```json -{ - "providerId": "cuid_provider_id", - "categoryId": "cuid_category_id", - "title": "Web Development Service", - "description": "Professional web development services for modern businesses", - "price": 99.99, - "currency": "USD", - "tags": ["web", "development", "react", "nodejs"], - "images": [ - "https://example.com/image1.jpg", - "https://example.com/image2.jpg" - ], - "isActive": true, - "workingTime": [ - "Monday: 9:00 AM - 5:00 PM", - "Tuesday: 9:00 AM - 5:00 PM", - "Wednesday: 9:00 AM - 5:00 PM", - "Thursday: 9:00 AM - 5:00 PM", - "Friday: 9:00 AM - 5:00 PM" - ] -} -``` - -#### Response (201): -```json -{ - "success": true, - "message": "Service created successfully", - "data": { - "id": "cuid_service_id", - "providerId": "cuid_provider_id", - "categoryId": "cuid_category_id", - "title": "Web Development Service", - "description": "Professional web development services for modern businesses", - "price": 99.99, - "currency": "USD", - "tags": ["web", "development", "react", "nodejs"], - "images": ["https://example.com/image1.jpg"], - "isActive": true, - "workingTime": ["Monday: 9:00 AM - 5:00 PM"], - "createdAt": "2025-08-04T12:00:00.000Z", - "updatedAt": "2025-08-04T12:00:00.000Z", - "provider": { - "id": "cuid_provider_id", - "user": { - "firstName": "John", - "lastName": "Doe", - "email": "john@example.com" - } - }, - "category": { - "id": "cuid_category_id", - "name": "Web Development" - } - } -} -``` - -### 2. Get All Services -**GET** `/api/services` - -Retrieves all services with optional filtering and pagination. - -#### Query Parameters: -- `providerId` (optional): Filter by provider ID -- `categoryId` (optional): Filter by category ID -- `isActive` (optional): Filter by active status (`true` or `false`) -- `skip` (optional): Number of records to skip (default: 0) -- `take` (optional): Number of records to return (default: 10, max: 100) - -#### Example: -``` -GET /api/services?categoryId=cuid_category_id&isActive=true&skip=0&take=5 -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Services retrieved successfully", - "data": [ - { - "id": "cuid_service_id", - "title": "Web Development Service", - "price": 99.99, - "provider": { - "user": { - "firstName": "John", - "lastName": "Doe" - } - }, - "category": { - "name": "Web Development" - } - } - ], - "pagination": { - "skip": 0, - "take": 10 - } -} -``` - -### 3. Get Service by ID -**GET** `/api/services/:id` - -Retrieves a specific service by its ID. - -#### Example: -``` -GET /api/services/cuid_service_id -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Service retrieved successfully", - "data": { - "id": "cuid_service_id", - "title": "Web Development Service", - "description": "Professional web development services", - "price": 99.99, - "provider": { - "user": { - "firstName": "John", - "lastName": "Doe", - "email": "john@example.com", - "phone": "+1234567890" - } - }, - "category": { - "name": "Web Development" - }, - "reviews": [], - "schedules": [] - } -} -``` - -### 4. Update Service -**PUT** `/api/services/:id` - -Updates an existing service. - -#### Request Body (all fields optional): -```json -{ - "title": "Updated Web Development Service", - "description": "Updated description", - "price": 149.99, - "tags": ["web", "development", "react", "nodejs", "typescript"], - "isActive": false -} -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Service updated successfully", - "data": { - // Updated service object - } -} -``` - -### 5. Delete Service -**DELETE** `/api/services/:id` - -Deletes a service. - -#### Example: -``` -DELETE /api/services/cuid_service_id -``` - -#### Response (200): -```json -{ - "success": true, - "message": "Service deleted successfully" -} -``` - -## Error Responses - -### Validation Error (400): -```json -{ - "success": false, - "message": "Validation failed", - "errors": [ - { - "field": "price", - "message": "Price is required" - } - ] -} -``` - -### Not Found Error (404): -```json -{ - "success": false, - "message": "Service not found" -} -``` - -### Server Error (500): -```json -{ - "success": false, - "message": "Failed to create service: Provider not found" -} -``` - -## Field Validations - -### Required Fields (for creation): -- `providerId`: Must be a valid provider ID -- `categoryId`: Must be a valid category ID -- `price`: Must be a positive number - -### Optional Fields: -- `title`: 3-100 characters -- `description`: 10-1000 characters -- `currency`: 3-character uppercase code (default: "USD") -- `tags`: Array of strings, max 10 items, each 2-30 characters -- `images`: Array of valid URLs, max 5 items -- `isActive`: Boolean (default: true) -- `workingTime`: Array of formatted time slots, max 7 items - -### Working Time Format: -``` -"Day: HH:MM AM/PM - HH:MM AM/PM" -``` -Examples: -- "Monday: 9:00 AM - 5:00 PM" -- "Saturday: 10:00 AM - 2:00 PM" - -## Testing with curl - -### Create a service: -```bash -curl -X POST http://localhost:3000/api/services \ - -H "Content-Type: application/json" \ - -d '{ - "providerId": "your_provider_id", - "categoryId": "your_category_id", - "title": "Test Service", - "description": "This is a test service description", - "price": 50.00, - "tags": ["test", "service"], - "workingTime": ["Monday: 9:00 AM - 5:00 PM"] - }' -``` - -### Get all services: -```bash -curl http://localhost:3000/api/services -``` - -### Get a specific service: -```bash -curl http://localhost:3000/api/services/your_service_id -``` diff --git a/add-location-support.sql b/add-location-support.sql new file mode 100755 index 0000000..1367a49 --- /dev/null +++ b/add-location-support.sql @@ -0,0 +1,46 @@ +-- Enable PostGIS extension +CREATE EXTENSION IF NOT EXISTS postgis; + +-- Add location columns to services table +ALTER TABLE "Service" +ADD COLUMN IF NOT EXISTS latitude DOUBLE PRECISION, +ADD COLUMN IF NOT EXISTS longitude DOUBLE PRECISION, +ADD COLUMN IF NOT EXISTS address TEXT, +ADD COLUMN IF NOT EXISTS city VARCHAR(100), +ADD COLUMN IF NOT EXISTS state VARCHAR(100), +ADD COLUMN IF NOT EXISTS country VARCHAR(100), +ADD COLUMN IF NOT EXISTS "postalCode" VARCHAR(20), +ADD COLUMN IF NOT EXISTS "serviceRadiusKm" DOUBLE PRECISION DEFAULT 10, +ADD COLUMN IF NOT EXISTS "locationLastUpdated" TIMESTAMP(3); + +-- Create location column using PostGIS POINT type +ALTER TABLE "Service" +ADD COLUMN IF NOT EXISTS location GEOGRAPHY(POINT, 4326); + +-- Create spatial index for faster queries +CREATE INDEX IF NOT EXISTS idx_services_location ON "Service" USING GIST(location); + +-- Create regular indexes for location fields +CREATE INDEX IF NOT EXISTS idx_services_lat_lng ON "Service" (latitude, longitude); +CREATE INDEX IF NOT EXISTS idx_services_city ON "Service" (city); +CREATE INDEX IF NOT EXISTS idx_services_state ON "Service" (state); + +-- Function to update geography column when lat/lng changes +CREATE OR REPLACE FUNCTION update_service_location() +RETURNS TRIGGER AS $$ +BEGIN + IF NEW.latitude IS NOT NULL AND NEW.longitude IS NOT NULL THEN + NEW.location = ST_SetSRID(ST_MakePoint(NEW.longitude, NEW.latitude), 4326)::geography; + NEW."locationLastUpdated" = NOW(); + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +-- Create trigger to automatically update location column +DROP TRIGGER IF EXISTS trigger_update_service_location ON "Service"; +CREATE TRIGGER trigger_update_service_location + BEFORE INSERT OR UPDATE OF latitude, longitude + ON "Service" + FOR EACH ROW + EXECUTE FUNCTION update_service_location(); \ No newline at end of file diff --git a/add-vector-columns.sql b/add-vector-columns.sql new file mode 100755 index 0000000..5297e96 --- /dev/null +++ b/add-vector-columns.sql @@ -0,0 +1,19 @@ +-- Enable pgvector extension (safe - does nothing if already exists) +CREATE EXTENSION IF NOT EXISTS vector; + +-- Add vector embedding columns to Service table (safe - only adds if missing) +ALTER TABLE "Service" +ADD COLUMN IF NOT EXISTS "titleEmbedding" vector(768), +ADD COLUMN IF NOT EXISTS "descriptionEmbedding" vector(768), +ADD COLUMN IF NOT EXISTS "tagsEmbedding" vector(768), +ADD COLUMN IF NOT EXISTS "combinedEmbedding" vector(768), +ADD COLUMN IF NOT EXISTS "embeddingUpdatedAt" TIMESTAMP(3); + +-- Create index for vector similarity search (safe - only creates if missing) +CREATE INDEX IF NOT EXISTS "Service_combinedEmbedding_idx" +ON "Service" USING ivfflat ("combinedEmbedding" vector_cosine_ops) +WITH (lists = 100); + +-- Alternative: Simple index for smaller datasets +-- CREATE INDEX IF NOT EXISTS "Service_combinedEmbedding_simple_idx" +-- ON "Service" ("combinedEmbedding"); diff --git a/category_dataset.json b/category_dataset.json old mode 100644 new mode 100755 index 911d0fe..2b0e89f --- a/category_dataset.json +++ b/category_dataset.json @@ -291,4 +291,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml old mode 100644 new mode 100755 diff --git a/dockerfile b/dockerfile old mode 100644 new mode 100755 index 74638c3..7ba1329 --- a/dockerfile +++ b/dockerfile @@ -1,5 +1,3 @@ - - FROM node:18-alpine # App directory @@ -17,8 +15,14 @@ RUN npx prisma generate # Rest of the source COPY . . +# Install TypeScript globally +RUN npm install -g typescript + +# Transpile TypeScript to JavaScript +RUN npx tsc + # Expose the service port EXPOSE 3000 -# Start the API -CMD ["npm", "start"] +# Run the transpiled JavaScript file +CMD ["node", "dist/index.js"] diff --git a/index.js b/index.js deleted file mode 100644 index 5be8525..0000000 --- a/index.js +++ /dev/null @@ -1,43 +0,0 @@ - -import 'dotenv/config'; -import { execSync } from 'node:child_process'; - -try { - console.log('Running `prisma generate` …'); - execSync('npx prisma generate', { stdio: 'inherit' }); -} catch (err) { - console.error('Could not run `prisma generate`:', err); - process.exit(1); -} - -import { PrismaClient } from '@prisma/client'; -import { withAccelerate } from '@prisma/extension-accelerate'; -import express from 'express'; -import cors from 'cors'; -import userRoutes from './src/routes/user.route.js'; -import providerRoutes from './src/routes/provider.route.js'; -import companyRoutes from './src/routes/company.route.js'; -import servicesRoutes from './src/routes/services.route.js'; -import categoryRoutes from './src/routes/catagory.route.js'; - -const prisma = new PrismaClient().$extends(withAccelerate()); - -const app = express(); - -// CORS configuration -app.use(cors({ - origin: ['http://localhost:5173', 'http://localhost:3000'], // Allow both frontend and backend origins - methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], - allowedHeaders: ['Content-Type', 'Authorization'], - credentials: true // Allow cookies if needed -})); - -app.use(express.json()); -app.use('/api/users', userRoutes); -app.use('/api/providers', providerRoutes); -app.use('/api/companies', companyRoutes); -app.use('/api/services', servicesRoutes); -app.use('/api/categories', categoryRoutes); - -const PORT = process.env.PORT || 3000; -app.listen(PORT, () => console.log(`Server running on port ${PORT}`)); diff --git a/index.ts b/index.ts new file mode 100755 index 0000000..2845c50 --- /dev/null +++ b/index.ts @@ -0,0 +1,113 @@ +import 'dotenv/config'; +import { execSync } from 'node:child_process'; + +try { + console.log('Running `prisma generate` …'); + execSync('npx prisma generate', { stdio: 'inherit' }); +} catch (err) { + console.error('Could not run `prisma generate`:', err); + process.exit(1); +} + +import { prisma } from './src/utils/database.js'; +import { queueService } from './src/services/queue.service.js'; +import express, { type Application } from 'express'; +import cors, { type CorsOptions } from 'cors'; +import rateLimit from 'express-rate-limit'; +import userRoutes from './src/routes/user.route.js'; +import providerRoutes from './src/routes/provider.route.js'; +import companyRoutes from './src/routes/company.route.js'; +import servicesRoutes from './src/routes/services.route.js'; +import categoryRoutes from './src/routes/category.route.js'; +import adminRoutes from './src/routes/admin.route.js'; +import confirmationRoutes from './src/routes/confirmation.route.js'; +import reviewRoutes from './src/routes/review.route.js'; +import serviceReviewRoutes from './src/routes/serviceReview.route.js'; +import { chatbotRoutes, CHATBOT_MODULE_INFO } from './src/modules/chatbot/index.js'; + +// Simple database test function +async function testDatabaseConnection() { + try { + await prisma.$queryRaw`SELECT 1 as test`; + console.log('✅ Database connection successful'); + return true; + } catch (error: any) { + console.error('❌ Database connection failed:', error.message); + return false; + } +} + +const app: Application = express(); + +// CORS configuration (must run before any rate limiting or routes) +const corsOptions: CorsOptions = { + origin: ['http://localhost:5173', 'http://localhost:3000'], + methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], + allowedHeaders: ['Content-Type', 'Authorization'], + credentials: true, +}; +app.use(cors(corsOptions)); + +// Rate limiting +const limiter = rateLimit({ + windowMs: 30 * 60 * 1000, // 30 minutes + max: 10000, // increased limit for development + message: 'Too many requests from this IP, please try again later.', + standardHeaders: true, + legacyHeaders: false, + // Do not rate-limit CORS preflight requests + skip: (req) => req.method === 'OPTIONS', +}); + +// Apply rate limiting to all routes +app.use(limiter); + +// Increase JSON payload limit for file uploads +app.use(express.json({ limit: '10mb' })); +app.use(express.urlencoded({ extended: true, limit: '10mb' })); +app.use('/api/users', userRoutes); +app.use('/api/providers', providerRoutes); +app.use('/api/companies', companyRoutes); +app.use('/api/services', servicesRoutes); +app.use('/api/categories', categoryRoutes); +app.use('/api/admin', adminRoutes); +app.use('/api/confirmations', confirmationRoutes); +app.use('/api/reviews', reviewRoutes); +app.use('/api/service-reviews', serviceReviewRoutes); +app.use('/api/chatbot', chatbotRoutes); + +console.log(`🤖 ${CHATBOT_MODULE_INFO.name} loaded with endpoints:`, CHATBOT_MODULE_INFO.endpoints); + +const PORT: number = parseInt(process.env.PORT || '3000', 10); + +// Start server with basic database test +async function startServer() { + console.log('🚀 Starting server...'); + + const dbConnected = await testDatabaseConnection(); + + if (!dbConnected) { + console.error('💥 Server startup aborted due to database connection failure'); + process.exit(1); + } + + // Initialize queue service + try { + await queueService.connect(); + queueService.setupGracefulShutdown(); + console.log('✅ RabbitMQ connection established'); + } catch (error) { + console.error('⚠️ RabbitMQ connection failed, emails will not be sent:', error); + // Don't exit - continue without email functionality + } + + app.listen(PORT, () => { + console.log(`🎯 Server running on port ${PORT}`); + }); +} + +// Start the server +startServer().catch((error) => { + console.error('💥 Failed to start server:', error); + process.exit(1); +}); diff --git a/package-lock.json b/package-lock.json old mode 100644 new mode 100755 index 036a584..728a71f --- a/package-lock.json +++ b/package-lock.json @@ -9,20 +9,1322 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@prisma/client": "^6.12.0", - "@prisma/extension-accelerate": "^2.0.2", + "@aws-sdk/client-s3": "^3.873.0", + "@aws-sdk/client-ses": "^3.872.0", + "@aws-sdk/s3-request-presigner": "^3.873.0", + "@googlemaps/google-maps-services-js": "^3.4.2", + "@prisma/client": "6.15.0", + "@types/amqplib": "^0.10.7", + "@types/aws-sdk": "^2.7.4", + "@types/multer": "^2.0.0", + "@types/pg": "^8.15.5", + "amqplib": "^0.10.9", + "aws-sdk": "^2.1692.0", + "axios": "^1.12.2", "bcrypt": "^6.0.0", "cors": "^2.8.5", "dotenv": "^17.2.1", "express": "^5.1.0", + "express-rate-limit": "^8.0.1", "joi": "^17.13.3", "jsonwebtoken": "^9.0.2", + "multer": "^2.0.2", "nodemon": "^3.1.10", - "prisma": "^6.12.0" + "pg": "^8.16.3", + "prisma": "^6.12.0", + "socket.io-client": "^4.8.1" }, "devDependencies": { + "@types/bcrypt": "^6.0.0", + "@types/cors": "^2.8.19", + "@types/express": "^5.0.3", + "@types/joi": "^17.2.2", + "@types/jsonwebtoken": "^9.0.10", + "@types/node": "^24.2.0", "ts-node": "^10.9.2", - "typescript": "^5.8.3" + "typescript": "^5.9.2" + } + }, + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.873.0.tgz", + "integrity": "sha512-b+1lSEf+obcC508blw5qEDR1dyTiHViZXbf8G6nFospyqLJS0Vu2py+e+LG2VDVdAouZ8+RvW+uAi73KgsWl0w==", + "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.873.0", + "@aws-sdk/credential-provider-node": "3.873.0", + "@aws-sdk/middleware-bucket-endpoint": "3.873.0", + "@aws-sdk/middleware-expect-continue": "3.873.0", + "@aws-sdk/middleware-flexible-checksums": "3.873.0", + "@aws-sdk/middleware-host-header": "3.873.0", + "@aws-sdk/middleware-location-constraint": "3.873.0", + "@aws-sdk/middleware-logger": "3.873.0", + "@aws-sdk/middleware-recursion-detection": "3.873.0", + "@aws-sdk/middleware-sdk-s3": "3.873.0", + "@aws-sdk/middleware-ssec": "3.873.0", + "@aws-sdk/middleware-user-agent": "3.873.0", + "@aws-sdk/region-config-resolver": "3.873.0", + "@aws-sdk/signature-v4-multi-region": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-endpoints": "3.873.0", + "@aws-sdk/util-user-agent-browser": "3.873.0", + "@aws-sdk/util-user-agent-node": "3.873.0", + "@aws-sdk/xml-builder": "3.873.0", + "@smithy/config-resolver": "^4.1.5", + "@smithy/core": "^3.8.0", + "@smithy/eventstream-serde-browser": "^4.0.5", + "@smithy/eventstream-serde-config-resolver": "^4.1.3", + "@smithy/eventstream-serde-node": "^4.0.5", + "@smithy/fetch-http-handler": "^5.1.1", + "@smithy/hash-blob-browser": "^4.0.5", + "@smithy/hash-node": "^4.0.5", + "@smithy/hash-stream-node": "^4.0.5", + "@smithy/invalid-dependency": "^4.0.5", + "@smithy/md5-js": "^4.0.5", + "@smithy/middleware-content-length": "^4.0.5", + "@smithy/middleware-endpoint": "^4.1.18", + "@smithy/middleware-retry": "^4.1.19", + "@smithy/middleware-serde": "^4.0.9", + "@smithy/middleware-stack": "^4.0.5", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/node-http-handler": "^4.1.1", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.4.10", + "@smithy/types": "^4.3.2", + "@smithy/url-parser": "^4.0.5", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.26", + "@smithy/util-defaults-mode-node": "^4.0.26", + "@smithy/util-endpoints": "^3.0.7", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-retry": "^4.0.7", + "@smithy/util-stream": "^4.2.4", + "@smithy/util-utf8": "^4.0.0", + "@smithy/util-waiter": "^4.0.7", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-s3/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" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@aws-sdk/client-ses": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-ses/-/client-ses-3.886.0.tgz", + "integrity": "sha512-nZ+HNMfhHI0WvXzE7n/LQNgQdKGjL49uKuDd5GxpgOsM5I4sPfU6M+o4Ghrpepca4aynsL9xq+rqQ1+stAEILg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.883.0", + "@aws-sdk/credential-provider-node": "3.886.0", + "@aws-sdk/middleware-host-header": "3.873.0", + "@aws-sdk/middleware-logger": "3.876.0", + "@aws-sdk/middleware-recursion-detection": "3.886.0", + "@aws-sdk/middleware-user-agent": "3.883.0", + "@aws-sdk/region-config-resolver": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-endpoints": "3.879.0", + "@aws-sdk/util-user-agent-browser": "3.873.0", + "@aws-sdk/util-user-agent-node": "3.883.0", + "@smithy/config-resolver": "^4.1.5", + "@smithy/core": "^3.9.2", + "@smithy/fetch-http-handler": "^5.1.1", + "@smithy/hash-node": "^4.0.5", + "@smithy/invalid-dependency": "^4.0.5", + "@smithy/middleware-content-length": "^4.0.5", + "@smithy/middleware-endpoint": "^4.1.21", + "@smithy/middleware-retry": "^4.1.22", + "@smithy/middleware-serde": "^4.0.9", + "@smithy/middleware-stack": "^4.0.5", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/node-http-handler": "^4.1.1", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.5.2", + "@smithy/types": "^4.3.2", + "@smithy/url-parser": "^4.0.5", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.29", + "@smithy/util-defaults-mode-node": "^4.0.29", + "@smithy/util-endpoints": "^3.0.7", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-retry": "^4.0.7", + "@smithy/util-utf8": "^4.0.0", + "@smithy/util-waiter": "^4.0.7", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/client-sso": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.886.0.tgz", + "integrity": "sha512-CwpPZBlONsUO6OvMzNNP9PETZ3dPCQum3nUisk5VuzLTvNd80w2aWeSN/TpcAAbNvcRYbM+FsC4gBm4Q4VWn0g==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.883.0", + "@aws-sdk/middleware-host-header": "3.873.0", + "@aws-sdk/middleware-logger": "3.876.0", + "@aws-sdk/middleware-recursion-detection": "3.886.0", + "@aws-sdk/middleware-user-agent": "3.883.0", + "@aws-sdk/region-config-resolver": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-endpoints": "3.879.0", + "@aws-sdk/util-user-agent-browser": "3.873.0", + "@aws-sdk/util-user-agent-node": "3.883.0", + "@smithy/config-resolver": "^4.1.5", + "@smithy/core": "^3.9.2", + "@smithy/fetch-http-handler": "^5.1.1", + "@smithy/hash-node": "^4.0.5", + "@smithy/invalid-dependency": "^4.0.5", + "@smithy/middleware-content-length": "^4.0.5", + "@smithy/middleware-endpoint": "^4.1.21", + "@smithy/middleware-retry": "^4.1.22", + "@smithy/middleware-serde": "^4.0.9", + "@smithy/middleware-stack": "^4.0.5", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/node-http-handler": "^4.1.1", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.5.2", + "@smithy/types": "^4.3.2", + "@smithy/url-parser": "^4.0.5", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.29", + "@smithy/util-defaults-mode-node": "^4.0.29", + "@smithy/util-endpoints": "^3.0.7", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-retry": "^4.0.7", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/core": { + "version": "3.883.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.883.0.tgz", + "integrity": "sha512-FmkqnqBLkXi4YsBPbF6vzPa0m4XKUuvgKDbamfw4DZX2CzfBZH6UU4IwmjNV3ZM38m0xraHarK8KIbGSadN3wg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@aws-sdk/xml-builder": "3.873.0", + "@smithy/core": "^3.9.2", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/property-provider": "^4.0.5", + "@smithy/protocol-http": "^5.1.3", + "@smithy/signature-v4": "^5.1.3", + "@smithy/smithy-client": "^4.5.2", + "@smithy/types": "^4.3.2", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-utf8": "^4.0.0", + "fast-xml-parser": "5.2.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.883.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.883.0.tgz", + "integrity": "sha512-Z6tPBXPCodfhIF1rvQKoeRGMkwL6TK0xdl1UoMIA1x4AfBpPICAF77JkFBExk/pdiFYq1d04Qzddd/IiujSlLg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.883.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.883.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.883.0.tgz", + "integrity": "sha512-P589ug1lMOOEYLTaQJjSP+Gee34za8Kk2LfteNQfO9SpByHFgGj++Sg8VyIe30eZL8Q+i4qTt24WDCz1c+dgYg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.883.0", + "@aws-sdk/types": "3.862.0", + "@smithy/fetch-http-handler": "^5.1.1", + "@smithy/node-http-handler": "^4.1.1", + "@smithy/property-provider": "^4.0.5", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.5.2", + "@smithy/types": "^4.3.2", + "@smithy/util-stream": "^4.2.4", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.886.0.tgz", + "integrity": "sha512-86ZuuUGLzzYqxkglFBUMCsvb7vSr+IeIPkXD/ERuX9wX0xPxBK961UG7pygO7yaAVzcHSWbWArAXOcEWVlk+7Q==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.883.0", + "@aws-sdk/credential-provider-env": "3.883.0", + "@aws-sdk/credential-provider-http": "3.883.0", + "@aws-sdk/credential-provider-process": "3.883.0", + "@aws-sdk/credential-provider-sso": "3.886.0", + "@aws-sdk/credential-provider-web-identity": "3.886.0", + "@aws-sdk/nested-clients": "3.886.0", + "@aws-sdk/types": "3.862.0", + "@smithy/credential-provider-imds": "^4.0.7", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.886.0.tgz", + "integrity": "sha512-hyXQrUW6bXkSWOZlNWnNcbXsjM0CBIOfutDFd3tS7Ilhqkx8P3eptT0fVR8GFxNg/ruq5PvnybGK83brUmD7tw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.883.0", + "@aws-sdk/credential-provider-http": "3.883.0", + "@aws-sdk/credential-provider-ini": "3.886.0", + "@aws-sdk/credential-provider-process": "3.883.0", + "@aws-sdk/credential-provider-sso": "3.886.0", + "@aws-sdk/credential-provider-web-identity": "3.886.0", + "@aws-sdk/types": "3.862.0", + "@smithy/credential-provider-imds": "^4.0.7", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.883.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.883.0.tgz", + "integrity": "sha512-m1shbHY/Vppy4EdddG9r8x64TO/9FsCjokp5HbKcZvVoTOTgUJrdT8q2TAQJ89+zYIJDqsKbqfrmfwJ1zOdnGQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.883.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.886.0.tgz", + "integrity": "sha512-KxNgGcT/2ec7XBhiYGBYlk+UyiMqosi5LzLjq2qR4nYf8Deo/lCtbqXSQplwSQ0JIV2kNDcnMQiSafSS9TrL/A==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.886.0", + "@aws-sdk/core": "3.883.0", + "@aws-sdk/token-providers": "3.886.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.886.0.tgz", + "integrity": "sha512-pilcy1GUOr4lIWApTcgJLGL+t79SOoe66pzmranQhbn+HGAp2VgiZizeID9P3HLmZObStVal4yTaJur0hWb5ZQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.883.0", + "@aws-sdk/nested-clients": "3.886.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/middleware-logger": { + "version": "3.876.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.876.0.tgz", + "integrity": "sha512-cpWJhOuMSyz9oV25Z/CMHCBTgafDCbv7fHR80nlRrPdPZ8ETNsahwRgltXP1QJJ8r3X/c1kwpOR7tc+RabVzNA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.886.0.tgz", + "integrity": "sha512-yMMlPqiX1SXFwQ0L1a/U19rdXx7eYseHsJEC9F9M5LUUPBI7k117nA0vXxvsvODVQ6JKtY7nTiPrc98GcVKgnw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@aws/lambda-invoke-store": "^0.0.1", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.883.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.883.0.tgz", + "integrity": "sha512-q58uLYnGLg7hsnWpdj7Cd1Ulsq1/PUJOHvAfgcBuiDE/+Fwh0DZxZZyjrU+Cr+dbeowIdUaOO8BEDDJ0CUenJw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.883.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-endpoints": "3.879.0", + "@smithy/core": "^3.9.2", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/nested-clients": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.886.0.tgz", + "integrity": "sha512-CqeRdkNyJ7LlKLQtMTzK11WIiryEK8JbSL5LCia0B1Lp22OByDUiUSFZZ3FZq9poD5qHQI63pHkzAr5WkLGS5A==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.883.0", + "@aws-sdk/middleware-host-header": "3.873.0", + "@aws-sdk/middleware-logger": "3.876.0", + "@aws-sdk/middleware-recursion-detection": "3.886.0", + "@aws-sdk/middleware-user-agent": "3.883.0", + "@aws-sdk/region-config-resolver": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-endpoints": "3.879.0", + "@aws-sdk/util-user-agent-browser": "3.873.0", + "@aws-sdk/util-user-agent-node": "3.883.0", + "@smithy/config-resolver": "^4.1.5", + "@smithy/core": "^3.9.2", + "@smithy/fetch-http-handler": "^5.1.1", + "@smithy/hash-node": "^4.0.5", + "@smithy/invalid-dependency": "^4.0.5", + "@smithy/middleware-content-length": "^4.0.5", + "@smithy/middleware-endpoint": "^4.1.21", + "@smithy/middleware-retry": "^4.1.22", + "@smithy/middleware-serde": "^4.0.9", + "@smithy/middleware-stack": "^4.0.5", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/node-http-handler": "^4.1.1", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.5.2", + "@smithy/types": "^4.3.2", + "@smithy/url-parser": "^4.0.5", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.29", + "@smithy/util-defaults-mode-node": "^4.0.29", + "@smithy/util-endpoints": "^3.0.7", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-retry": "^4.0.7", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/token-providers": { + "version": "3.886.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.886.0.tgz", + "integrity": "sha512-dYS3apmGcldFglpAiAajcdDKtKjBw/NkG6nRYIC2q7+OZsxeyzunT1EUSxV4xphLoqiuhuCg/fTnBI3WVtb3IQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.883.0", + "@aws-sdk/nested-clients": "3.886.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/util-endpoints": { + "version": "3.879.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.879.0.tgz", + "integrity": "sha512-aVAJwGecYoEmbEFju3127TyJDF9qJsKDUUTRMDuS8tGn+QiWQFnfInmbt+el9GU1gEJupNTXV+E3e74y51fb7A==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/types": "^4.3.2", + "@smithy/url-parser": "^4.0.5", + "@smithy/util-endpoints": "^3.0.7", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.883.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.883.0.tgz", + "integrity": "sha512-28cQZqC+wsKUHGpTBr+afoIdjS6IoEJkMqcZsmo2Ag8LzmTa6BUWQenFYB0/9BmDy4PZFPUn+uX+rJgWKB+jzA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.883.0", + "@aws-sdk/types": "3.862.0", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.873.0.tgz", + "integrity": "sha512-EmcrOgFODWe7IsLKFTeSXM9TlQ80/BO1MBISlr7w2ydnOaUYIiPGRRJnDpeIgMaNqT4Rr2cRN2RiMrbFO7gDdA==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.873.0", + "@aws-sdk/middleware-host-header": "3.873.0", + "@aws-sdk/middleware-logger": "3.873.0", + "@aws-sdk/middleware-recursion-detection": "3.873.0", + "@aws-sdk/middleware-user-agent": "3.873.0", + "@aws-sdk/region-config-resolver": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-endpoints": "3.873.0", + "@aws-sdk/util-user-agent-browser": "3.873.0", + "@aws-sdk/util-user-agent-node": "3.873.0", + "@smithy/config-resolver": "^4.1.5", + "@smithy/core": "^3.8.0", + "@smithy/fetch-http-handler": "^5.1.1", + "@smithy/hash-node": "^4.0.5", + "@smithy/invalid-dependency": "^4.0.5", + "@smithy/middleware-content-length": "^4.0.5", + "@smithy/middleware-endpoint": "^4.1.18", + "@smithy/middleware-retry": "^4.1.19", + "@smithy/middleware-serde": "^4.0.9", + "@smithy/middleware-stack": "^4.0.5", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/node-http-handler": "^4.1.1", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.4.10", + "@smithy/types": "^4.3.2", + "@smithy/url-parser": "^4.0.5", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.26", + "@smithy/util-defaults-mode-node": "^4.0.26", + "@smithy/util-endpoints": "^3.0.7", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-retry": "^4.0.7", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/core": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.873.0.tgz", + "integrity": "sha512-WrROjp8X1VvmnZ4TBzwM7RF+EB3wRaY9kQJLXw+Aes0/3zRjUXvGIlseobGJMqMEGnM0YekD2F87UaVfot1xeQ==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@aws-sdk/xml-builder": "3.873.0", + "@smithy/core": "^3.8.0", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/property-provider": "^4.0.5", + "@smithy/protocol-http": "^5.1.3", + "@smithy/signature-v4": "^5.1.3", + "@smithy/smithy-client": "^4.4.10", + "@smithy/types": "^4.3.2", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-utf8": "^4.0.0", + "fast-xml-parser": "5.2.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.873.0.tgz", + "integrity": "sha512-FWj1yUs45VjCADv80JlGshAttUHBL2xtTAbJcAxkkJZzLRKVkdyrepFWhv/95MvDyzfbT6PgJiWMdW65l/8ooA==", + "dependencies": { + "@aws-sdk/core": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.873.0.tgz", + "integrity": "sha512-0sIokBlXIsndjZFUfr3Xui8W6kPC4DAeBGAXxGi9qbFZ9PWJjn1vt2COLikKH3q2snchk+AsznREZG8NW6ezSg==", + "dependencies": { + "@aws-sdk/core": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/fetch-http-handler": "^5.1.1", + "@smithy/node-http-handler": "^4.1.1", + "@smithy/property-provider": "^4.0.5", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.4.10", + "@smithy/types": "^4.3.2", + "@smithy/util-stream": "^4.2.4", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.873.0.tgz", + "integrity": "sha512-bQdGqh47Sk0+2S3C+N46aNQsZFzcHs7ndxYLARH/avYXf02Nl68p194eYFaAHJSQ1re5IbExU1+pbums7FJ9fA==", + "dependencies": { + "@aws-sdk/core": "3.873.0", + "@aws-sdk/credential-provider-env": "3.873.0", + "@aws-sdk/credential-provider-http": "3.873.0", + "@aws-sdk/credential-provider-process": "3.873.0", + "@aws-sdk/credential-provider-sso": "3.873.0", + "@aws-sdk/credential-provider-web-identity": "3.873.0", + "@aws-sdk/nested-clients": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/credential-provider-imds": "^4.0.7", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.873.0.tgz", + "integrity": "sha512-+v/xBEB02k2ExnSDL8+1gD6UizY4Q/HaIJkNSkitFynRiiTQpVOSkCkA0iWxzksMeN8k1IHTE5gzeWpkEjNwbA==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.873.0", + "@aws-sdk/credential-provider-http": "3.873.0", + "@aws-sdk/credential-provider-ini": "3.873.0", + "@aws-sdk/credential-provider-process": "3.873.0", + "@aws-sdk/credential-provider-sso": "3.873.0", + "@aws-sdk/credential-provider-web-identity": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/credential-provider-imds": "^4.0.7", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.873.0.tgz", + "integrity": "sha512-ycFv9WN+UJF7bK/ElBq1ugWA4NMbYS//1K55bPQZb2XUpAM2TWFlEjG7DIyOhLNTdl6+CbHlCdhlKQuDGgmm0A==", + "dependencies": { + "@aws-sdk/core": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.873.0.tgz", + "integrity": "sha512-SudkAOZmjEEYgUrqlUUjvrtbWJeI54/0Xo87KRxm4kfBtMqSx0TxbplNUAk8Gkg4XQNY0o7jpG8tK7r2Wc2+uw==", + "dependencies": { + "@aws-sdk/client-sso": "3.873.0", + "@aws-sdk/core": "3.873.0", + "@aws-sdk/token-providers": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.873.0.tgz", + "integrity": "sha512-Gw2H21+VkA6AgwKkBtTtlGZ45qgyRZPSKWs0kUwXVlmGOiPz61t/lBX0vG6I06ZIz2wqeTJ5OA1pWZLqw1j0JQ==", + "dependencies": { + "@aws-sdk/core": "3.873.0", + "@aws-sdk/nested-clients": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-bucket-endpoint": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.873.0.tgz", + "integrity": "sha512-b4bvr0QdADeTUs+lPc9Z48kXzbKHXQKgTvxx/jXDgSW9tv4KmYPO1gIj6Z9dcrBkRWQuUtSW3Tu2S5n6pe+zeg==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-arn-parser": "3.873.0", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "@smithy/util-config-provider": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-expect-continue": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.873.0.tgz", + "integrity": "sha512-GIqoc8WgRcf/opBOZXFLmplJQKwOMjiOMmDz9gQkaJ8FiVJoAp8EGVmK2TOWZMQUYsavvHYsHaor5R2xwPoGVg==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.873.0.tgz", + "integrity": "sha512-NNiy2Y876P5cgIhsDlHopbPZS3ugdfBW1va0WdpVBviwAs6KT4irPNPAOyF1/33N/niEDKx0fKQV7ROB70nNPA==", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@aws-crypto/crc32c": "5.2.0", + "@aws-crypto/util": "5.2.0", + "@aws-sdk/core": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-stream": "^4.2.4", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.873.0.tgz", + "integrity": "sha512-KZ/W1uruWtMOs7D5j3KquOxzCnV79KQW9MjJFZM/M0l6KI8J6V3718MXxFHsTjUE4fpdV6SeCNLV1lwGygsjJA==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-location-constraint": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.873.0.tgz", + "integrity": "sha512-r+hIaORsW/8rq6wieDordXnA/eAu7xAPLue2InhoEX6ML7irP52BgiibHLpt9R0psiCzIHhju8qqKa4pJOrmiw==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.873.0.tgz", + "integrity": "sha512-QhNZ8X7pW68kFez9QxUSN65Um0Feo18ZmHxszQZNUhKDsXew/EG9NPQE/HgYcekcon35zHxC4xs+FeNuPurP2g==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.873.0.tgz", + "integrity": "sha512-OtgY8EXOzRdEWR//WfPkA/fXl0+WwE8hq0y9iw2caNyKPtca85dzrrZWnPqyBK/cpImosrpR1iKMYr41XshsCg==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.873.0.tgz", + "integrity": "sha512-bOoWGH57ORK2yKOqJMmxBV4b3yMK8Pc0/K2A98MNPuQedXaxxwzRfsT2Qw+PpfYkiijrrNFqDYmQRGntxJ2h8A==", + "dependencies": { + "@aws-sdk/core": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-arn-parser": "3.873.0", + "@smithy/core": "^3.8.0", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/protocol-http": "^5.1.3", + "@smithy/signature-v4": "^5.1.3", + "@smithy/smithy-client": "^4.4.10", + "@smithy/types": "^4.3.2", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-stream": "^4.2.4", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-ssec": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.873.0.tgz", + "integrity": "sha512-AF55J94BoiuzN7g3hahy0dXTVZahVi8XxRBLgzNp6yQf0KTng+hb/V9UQZVYY1GZaDczvvvnqC54RGe9OZZ9zQ==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.873.0.tgz", + "integrity": "sha512-gHqAMYpWkPhZLwqB3Yj83JKdL2Vsb64sryo8LN2UdpElpS+0fT4yjqSxKTfp7gkhN6TCIxF24HQgbPk5FMYJWw==", + "dependencies": { + "@aws-sdk/core": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-endpoints": "3.873.0", + "@smithy/core": "^3.8.0", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.873.0.tgz", + "integrity": "sha512-yg8JkRHuH/xO65rtmLOWcd9XQhxX1kAonp2CliXT44eA/23OBds6XoheY44eZeHfCTgutDLTYitvy3k9fQY6ZA==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.873.0", + "@aws-sdk/middleware-host-header": "3.873.0", + "@aws-sdk/middleware-logger": "3.873.0", + "@aws-sdk/middleware-recursion-detection": "3.873.0", + "@aws-sdk/middleware-user-agent": "3.873.0", + "@aws-sdk/region-config-resolver": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-endpoints": "3.873.0", + "@aws-sdk/util-user-agent-browser": "3.873.0", + "@aws-sdk/util-user-agent-node": "3.873.0", + "@smithy/config-resolver": "^4.1.5", + "@smithy/core": "^3.8.0", + "@smithy/fetch-http-handler": "^5.1.1", + "@smithy/hash-node": "^4.0.5", + "@smithy/invalid-dependency": "^4.0.5", + "@smithy/middleware-content-length": "^4.0.5", + "@smithy/middleware-endpoint": "^4.1.18", + "@smithy/middleware-retry": "^4.1.19", + "@smithy/middleware-serde": "^4.0.9", + "@smithy/middleware-stack": "^4.0.5", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/node-http-handler": "^4.1.1", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.4.10", + "@smithy/types": "^4.3.2", + "@smithy/url-parser": "^4.0.5", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.26", + "@smithy/util-defaults-mode-node": "^4.0.26", + "@smithy/util-endpoints": "^3.0.7", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-retry": "^4.0.7", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.873.0.tgz", + "integrity": "sha512-q9sPoef+BBG6PJnc4x60vK/bfVwvRWsPgcoQyIra057S/QGjq5VkjvNk6H8xedf6vnKlXNBwq9BaANBXnldUJg==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/types": "^4.3.2", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/s3-request-presigner": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.873.0.tgz", + "integrity": "sha512-DiVlfCpdR7EaZSNPQwBB1jq8INWezKMWb3BUOWxrOcIcS3p2WpKbYl0H76D6TCHvQzXRVgKSSM6tHuWPoJtUHA==", + "dependencies": { + "@aws-sdk/signature-v4-multi-region": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@aws-sdk/util-format-url": "3.873.0", + "@smithy/middleware-endpoint": "^4.1.18", + "@smithy/protocol-http": "^5.1.3", + "@smithy/smithy-client": "^4.4.10", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/signature-v4-multi-region": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.873.0.tgz", + "integrity": "sha512-FQ5OIXw1rmDud7f/VO9y2Mg9rX1o4MnngRKUOD8mS9ALK4uxKrTczb4jA+uJLSLwTqMGs3bcB1RzbMW1zWTMwQ==", + "dependencies": { + "@aws-sdk/middleware-sdk-s3": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/protocol-http": "^5.1.3", + "@smithy/signature-v4": "^5.1.3", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.873.0.tgz", + "integrity": "sha512-BWOCeFeV/Ba8fVhtwUw/0Hz4wMm9fjXnMb4Z2a5he/jFlz5mt1/rr6IQ4MyKgzOaz24YrvqsJW2a0VUKOaYDvg==", + "dependencies": { + "@aws-sdk/core": "3.873.0", + "@aws-sdk/nested-clients": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/property-provider": "^4.0.5", + "@smithy/shared-ini-file-loader": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.862.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.862.0.tgz", + "integrity": "sha512-Bei+RL0cDxxV+lW2UezLbCYYNeJm6Nzee0TpW0FfyTRBhH9C1XQh4+x+IClriXvgBnRquTMMYsmJfvx8iyLKrg==", + "dependencies": { + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-arn-parser": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.873.0.tgz", + "integrity": "sha512-qag+VTqnJWDn8zTAXX4wiVioa0hZDQMtbZcGRERVnLar4/3/VIKBhxX2XibNQXFu1ufgcRn4YntT/XEPecFWcg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.873.0.tgz", + "integrity": "sha512-YByHrhjxYdjKRf/RQygRK1uh0As1FIi9+jXTcIEX/rBgN8mUByczr2u4QXBzw7ZdbdcOBMOkPnLRjNOWW1MkFg==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/types": "^4.3.2", + "@smithy/url-parser": "^4.0.5", + "@smithy/util-endpoints": "^3.0.7", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-format-url": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-format-url/-/util-format-url-3.873.0.tgz", + "integrity": "sha512-v//b9jFnhzTKKV3HFTw2MakdM22uBAs2lBov51BWmFXuFtSTdBLrR7zgfetQPE3PVkFai0cmtJQPdc3MX+T/cQ==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/querystring-builder": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.873.0.tgz", + "integrity": "sha512-xcVhZF6svjM5Rj89T1WzkjQmrTF6dpR2UvIHPMTnSZoNe6CixejPZ6f0JJ2kAhO8H+dUHwNBlsUgOTIKiK/Syg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.873.0.tgz", + "integrity": "sha512-AcRdbK6o19yehEcywI43blIBhOCSo6UgyWcuOJX5CFF8k39xm1ILCjQlRRjchLAxWrm0lU0Q7XV90RiMMFMZtA==", + "dependencies": { + "@aws-sdk/types": "3.862.0", + "@smithy/types": "^4.3.2", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.873.0.tgz", + "integrity": "sha512-9MivTP+q9Sis71UxuBaIY3h5jxH0vN3/ZWGxO8ADL19S2OIfknrYSAfzE5fpoKROVBu0bS4VifHOFq4PY1zsxw==", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.873.0", + "@aws-sdk/types": "3.862.0", + "@smithy/node-config-provider": "^4.1.4", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/xml-builder": { + "version": "3.873.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.873.0.tgz", + "integrity": "sha512-kLO7k7cGJ6KaHiExSJWojZurF7SnGMDHXRuQunFnEoD0n1yB6Lqy/S/zHiQ7oJnBhPr9q0TW9qFkrsZb1Uc54w==", + "dependencies": { + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws/lambda-invoke-store": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.0.1.tgz", + "integrity": "sha512-ORHRQ2tmvnBXc8t/X9Z8IcSbBA4xTLKuN873FopzklHMeqBst7YG0d+AX97inkvDX+NChYtSr+qGfcqGFaI8Zw==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" } }, "node_modules/@cspotcode/source-map-support": { @@ -32,162 +1334,908 @@ "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@googlemaps/google-maps-services-js": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@googlemaps/google-maps-services-js/-/google-maps-services-js-3.4.2.tgz", + "integrity": "sha512-QjxiJSt8woyPaaQIUUDNL1nRfCEXTiv8KfJSNq/YzKEUVXABT75GLG+Zo267UwOcq70n8OsZbaro5VrY962mJg==", + "license": "Apache-2.0", + "dependencies": { + "@googlemaps/url-signature": "^1.0.4", + "agentkeepalive": "^4.1.0", + "axios": "^1.5.1", + "query-string": "<8.x", + "retry-axios": "<3.x" + } + }, + "node_modules/@googlemaps/url-signature": { + "version": "1.0.40", + "resolved": "https://registry.npmjs.org/@googlemaps/url-signature/-/url-signature-1.0.40.tgz", + "integrity": "sha512-Gme3JxGZWQ4NVpATajSpS2/inQzhUxRvr/FK6IFpcC7AHOAmx8blI0y1/Qi2jqil+WoQ3TkEqq/MaKVtuV68RQ==", + "license": "Apache-2.0", + "dependencies": { + "crypto-js": "^4.2.0" + } + }, + "node_modules/@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "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.4", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", + "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@prisma/client": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.15.0.tgz", + "integrity": "sha512-wR2LXUbOH4cL/WToatI/Y2c7uzni76oNFND7+23ypLllBmIS8e3ZHhO+nud9iXSXKFt1SoM3fTZvHawg63emZw==", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "prisma": "*", + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/@prisma/config": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.12.0.tgz", + "integrity": "sha512-HovZWzhWEMedHxmjefQBRZa40P81N7/+74khKFz9e1AFjakcIQdXgMWKgt20HaACzY+d1LRBC+L4tiz71t9fkg==", + "license": "Apache-2.0", + "dependencies": { + "jiti": "2.4.2" + } + }, + "node_modules/@prisma/debug": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.12.0.tgz", + "integrity": "sha512-plbz6z72orcqr0eeio7zgUrZj5EudZUpAeWkFTA/DDdXEj28YHDXuiakvR6S7sD6tZi+jiwQEJAPeV6J6m/tEQ==", + "license": "Apache-2.0" + }, + "node_modules/@prisma/engines": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.12.0.tgz", + "integrity": "sha512-4BRZZUaAuB4p0XhTauxelvFs7IllhPmNLvmla0bO1nkECs8n/o1pUvAVbQ/VOrZR5DnF4HED0PrGai+rIOVePA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.12.0", + "@prisma/engines-version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", + "@prisma/fetch-engine": "6.12.0", + "@prisma/get-platform": "6.12.0" + } + }, + "node_modules/@prisma/engines-version": { + "version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc.tgz", + "integrity": "sha512-70vhecxBJlRr06VfahDzk9ow4k1HIaSfVUT3X0/kZoHCMl9zbabut4gEXAyzJZxaCGi5igAA7SyyfBI//mmkbQ==", + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.12.0.tgz", + "integrity": "sha512-EamoiwrK46rpWaEbLX9aqKDPOd8IyLnZAkiYXFNuq0YsU0Z8K09/rH8S7feOWAVJ3xzeSgcEJtBlVDrajM9Sag==", + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.12.0", + "@prisma/engines-version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", + "@prisma/get-platform": "6.12.0" + } + }, + "node_modules/@prisma/get-platform": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.12.0.tgz", + "integrity": "sha512-nRerTGhTlgyvcBlyWgt8OLNIV7QgJS2XYXMJD1hysorMCuLAjuDDuoxmVt7C2nLxbuxbWPp7OuFRHC23HqD9dA==", + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.12.0" + } + }, + "node_modules/@sideway/address": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", + "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", + "license": "BSD-3-Clause" + }, + "node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@smithy/abort-controller": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.1.1.tgz", + "integrity": "sha512-vkzula+IwRvPR6oKQhMYioM3A/oX/lFCZiwuxkQbRhqJS2S4YRY2k7k/SyR2jMf3607HLtbEwlRxi0ndXHMjRg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/chunked-blob-reader": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.0.0.tgz", + "integrity": "sha512-+sKqDBQqb036hh4NPaUiEkYFkTUGYzRsn3EuFhyfQfMy6oGHEUJDurLP9Ufb5dasr/XiAmPNMr6wa9afjQB+Gw==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/chunked-blob-reader-native": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.0.0.tgz", + "integrity": "sha512-R9wM2yPmfEMsUmlMlIgSzOyICs0x9uu7UTHoccMyt7BWw8shcGM8HqB355+BZCPBcySvbTYMs62EgEQkNxz2ig==", + "dependencies": { + "@smithy/util-base64": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.2.1.tgz", + "integrity": "sha512-FXil8q4QN7mgKwU2hCLm0ltab8NyY/1RiqEf25Jnf6WLS3wmb11zGAoLETqg1nur2Aoibun4w4MjeN9CMJ4G6A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.2.1", + "@smithy/types": "^4.5.0", + "@smithy/util-config-provider": "^4.1.0", + "@smithy/util-middleware": "^4.1.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/core": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.11.0.tgz", + "integrity": "sha512-Abs5rdP1o8/OINtE49wwNeWuynCu0kme1r4RI3VXVrHr4odVDG7h7mTnw1WXXfN5Il+c25QOnrdL2y56USfxkA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-serde": "^4.1.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", + "@smithy/util-base64": "^4.1.0", + "@smithy/util-body-length-browser": "^4.1.0", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-stream": "^4.3.1", + "@smithy/util-utf8": "^4.1.0", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/core/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" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.1.1.tgz", + "integrity": "sha512-1WdBfM9DwA59pnpIizxnUvBf/de18p4GP+6zP2AqrlFzoW3ERpZaT4QueBR0nS9deDMaQRkBlngpVlnkuuTisQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.2.1", + "@smithy/property-provider": "^4.1.1", + "@smithy/types": "^4.5.0", + "@smithy/url-parser": "^4.1.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-codec": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.0.5.tgz", + "integrity": "sha512-miEUN+nz2UTNoRYRhRqVTJCx7jMeILdAurStT2XoS+mhokkmz1xAPp95DFW9Gxt4iF2VBqpeF9HbTQ3kY1viOA==", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@smithy/types": "^4.3.2", + "@smithy/util-hex-encoding": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.0.5.tgz", + "integrity": "sha512-LCUQUVTbM6HFKzImYlSB9w4xafZmpdmZsOh9rIl7riPC3osCgGFVP+wwvYVw6pXda9PPT9TcEZxaq3XE81EdJQ==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.1.3.tgz", + "integrity": "sha512-yTTzw2jZjn/MbHu1pURbHdpjGbCuMHWncNBpJnQAPxOVnFUAbSIUSwafiphVDjNV93TdBJWmeVAds7yl5QCkcA==", + "dependencies": { + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.0.5.tgz", + "integrity": "sha512-lGS10urI4CNzz6YlTe5EYG0YOpsSp3ra8MXyco4aqSkQDuyZPIw2hcaxDU82OUVtK7UY9hrSvgWtpsW5D4rb4g==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.0.5.tgz", + "integrity": "sha512-JFnmu4SU36YYw3DIBVao3FsJh4Uw65vVDIqlWT4LzR6gXA0F3KP0IXFKKJrhaVzCBhAuMsrUUaT5I+/4ZhF7aw==", + "dependencies": { + "@smithy/eventstream-codec": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.2.1.tgz", + "integrity": "sha512-5/3wxKNtV3wO/hk1is+CZUhL8a1yy/U+9u9LKQ9kZTkMsHaQjJhc3stFfiujtMnkITjzWfndGA2f7g9Uh9vKng==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.2.1", + "@smithy/querystring-builder": "^4.1.1", + "@smithy/types": "^4.5.0", + "@smithy/util-base64": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-blob-browser": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.0.5.tgz", + "integrity": "sha512-F7MmCd3FH/Q2edhcKd+qulWkwfChHbc9nhguBlVjSUE6hVHhec3q6uPQ+0u69S6ppvLtR3eStfCuEKMXBXhvvA==", + "dependencies": { + "@smithy/chunked-blob-reader": "^5.0.0", + "@smithy/chunked-blob-reader-native": "^4.0.0", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-node": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.5.tgz", + "integrity": "sha512-cv1HHkKhpyRb6ahD8Vcfb2Hgz67vNIXEp2vnhzfxLFGRukLCNEA5QdsorbUEzXma1Rco0u3rx5VTqbM06GcZqQ==", + "dependencies": { + "@smithy/types": "^4.3.2", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-stream-node": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.0.5.tgz", + "integrity": "sha512-IJuDS3+VfWB67UC0GU0uYBG/TA30w+PlOaSo0GPm9UHS88A6rCP6uZxNjNYiyRtOcjv7TXn/60cW8ox1yuZsLg==", + "dependencies": { + "@smithy/types": "^4.3.2", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.5.tgz", + "integrity": "sha512-IVnb78Qtf7EJpoEVo7qJ8BEXQwgC4n3igeJNNKEj/MLYtapnx8A67Zt/J3RXAj2xSO1910zk0LdFiygSemuLow==", + "dependencies": { + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/is-array-buffer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.1.0.tgz", + "integrity": "sha512-ePTYUOV54wMogio+he4pBybe8fwg4sDvEVDBU8ZlHOZXbXK3/C0XfJgUCu6qAZcawv05ZhZzODGUerFBPsPUDQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/md5-js": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.0.5.tgz", + "integrity": "sha512-8n2XCwdUbGr8W/XhMTaxILkVlw2QebkVTn5tm3HOcbPbOpWg89zr6dPXsH8xbeTsbTXlJvlJNTQsKAIoqQGbdA==", + "dependencies": { + "@smithy/types": "^4.3.2", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.5.tgz", + "integrity": "sha512-l1jlNZoYzoCC7p0zCtBDE5OBXZ95yMKlRlftooE5jPWQn4YBPLgsp+oeHp7iMHaTGoUdFqmHOPa8c9G3gBsRpQ==", + "dependencies": { + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.2.1.tgz", + "integrity": "sha512-fUTMmQvQQZakXOuKizfu7fBLDpwvWZjfH6zUK2OLsoNZRZGbNUdNSdLJHpwk1vS208jtDjpUIskh+JoA8zMzZg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.11.0", + "@smithy/middleware-serde": "^4.1.1", + "@smithy/node-config-provider": "^4.2.1", + "@smithy/shared-ini-file-loader": "^4.1.1", + "@smithy/types": "^4.5.0", + "@smithy/url-parser": "^4.1.1", + "@smithy/util-middleware": "^4.1.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.2.1.tgz", + "integrity": "sha512-JzfvjwSJXWRl7LkLgIRTUTd2Wj639yr3sQGpViGNEOjtb0AkAuYqRAHs+jSOI/LPC0ZTjmFVVtfrCICMuebexw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.2.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/service-error-classification": "^4.1.1", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", + "@smithy/util-middleware": "^4.1.1", + "@smithy/util-retry": "^4.1.1", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-retry/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" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.1.1.tgz", + "integrity": "sha512-lh48uQdbCoj619kRouev5XbWhCwRKLmphAif16c4J6JgJ4uXjub1PI6RL38d3BLliUvSso6klyB/LTNpWSNIyg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.1.1.tgz", + "integrity": "sha512-ygRnniqNcDhHzs6QAPIdia26M7e7z9gpkIMUe/pK0RsrQ7i5MblwxY8078/QCnGq6AmlUUWgljK2HlelsKIb/A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.2.1.tgz", + "integrity": "sha512-AIA0BJZq2h295J5NeCTKhg1WwtdTA/GqBCaVjk30bDgMHwniUETyh5cP9IiE9VrId7Kt8hS7zvREVMTv1VfA6g==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^4.1.1", + "@smithy/shared-ini-file-loader": "^4.1.1", + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.2.1.tgz", + "integrity": "sha512-REyybygHlxo3TJICPF89N2pMQSf+p+tBJqpVe1+77Cfi9HBPReNjTgtZ1Vg73exq24vkqJskKDpfF74reXjxfw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^4.1.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/querystring-builder": "^4.1.1", + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.1.1.tgz", + "integrity": "sha512-gm3ZS7DHxUbzC2wr8MUCsAabyiXY0gaj3ROWnhSx/9sPMc6eYLMM4rX81w1zsMaObj2Lq3PZtNCC1J6lpEY7zg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.2.1.tgz", + "integrity": "sha512-T8SlkLYCwfT/6m33SIU/JOVGNwoelkrvGjFKDSDtVvAXj/9gOT78JVJEas5a+ETjOu4SVvpCstKgd0PxSu/aHw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.1.1.tgz", + "integrity": "sha512-J9b55bfimP4z/Jg1gNo+AT84hr90p716/nvxDkPGCD4W70MPms0h8KF50RDRgBGZeL83/u59DWNqJv6tEP/DHA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0", + "@smithy/util-uri-escape": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.1.1.tgz", + "integrity": "sha512-63TEp92YFz0oQ7Pj9IuI3IgnprP92LrZtRAkE3c6wLWJxfy/yOPRt39IOKerVr0JS770olzl0kGafXlAXZ1vng==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.1.1.tgz", + "integrity": "sha512-Iam75b/JNXyDE41UvrlM6n8DNOa/r1ylFyvgruTUx7h2Uk7vDNV9AAwP1vfL1fOL8ls0xArwEGVcGZVd7IO/Cw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.1.1.tgz", + "integrity": "sha512-YkpikhIqGc4sfXeIbzSj10t2bJI/sSoP5qxLue6zG+tEE3ngOBSm8sO3+djacYvS/R5DfpxN/L9CyZsvwjWOAQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.1.3.tgz", + "integrity": "sha512-mARDSXSEgllNzMw6N+mC+r1AQlEBO3meEAkR/UlfAgnMzJUB3goRBWgip1EAMG99wh36MDqzo86SfIX5Y+VEaw==", + "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.1.3", + "@smithy/types": "^4.3.2", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.5", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/smithy-client": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.6.1.tgz", + "integrity": "sha512-WolVLDb9UTPMEPPOncrCt6JmAMCSC/V2y5gst2STWJ5r7+8iNac+EFYQnmvDCYMfOLcilOSEpm5yXZXwbLak1Q==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.11.0", + "@smithy/middleware-endpoint": "^4.2.1", + "@smithy/middleware-stack": "^4.1.1", + "@smithy/protocol-http": "^5.2.1", + "@smithy/types": "^4.5.0", + "@smithy/util-stream": "^4.3.1", + "tslib": "^2.6.2" }, "engines": { - "node": ">=12" + "node": ">=18.0.0" } }, - "node_modules/@hapi/hoek": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", - "license": "BSD-3-Clause" + "node_modules/@smithy/types": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.5.0.tgz", + "integrity": "sha512-RkUpIOsVlAwUIZXO1dsz8Zm+N72LClFfsNqf173catVlvRZiwPy0x2u0JLEA4byreOPKDZPGjmPDylMoP8ZJRg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } }, - "node_modules/@hapi/topo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", - "license": "BSD-3-Clause", + "node_modules/@smithy/url-parser": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.1.1.tgz", + "integrity": "sha512-bx32FUpkhcaKlEoOMbScvc93isaSiRM75pQ5IgIBaMkT7qMlIibpPRONyx/0CvrXHzJLpOn/u6YiDX2hcvs7Dg==", + "license": "Apache-2.0", "dependencies": { - "@hapi/hoek": "^9.0.0" + "@smithy/querystring-parser": "^4.1.1", + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "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", + "node_modules/@smithy/util-base64": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.1.0.tgz", + "integrity": "sha512-RUGd4wNb8GeW7xk+AY5ghGnIwM96V0l2uzvs/uVHf+tIuVX2WSvynk5CxNoBCsM2rQRSZElAo9rt3G5mJ/gktQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.1.0", + "@smithy/util-utf8": "^4.1.0", + "tslib": "^2.6.2" + }, "engines": { - "node": ">=6.0.0" + "node": ">=18.0.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", - "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==", - "dev": true, - "license": "MIT" + "node_modules/@smithy/util-body-length-browser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.1.0.tgz", + "integrity": "sha512-V2E2Iez+bo6bUMOTENPr6eEmepdY8Hbs+Uc1vkDKgKNA/brTJqOW/ai3JO1BGj9GbCeLqw90pbbH7HFQyFotGQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "license": "MIT", + "node_modules/@smithy/util-body-length-node": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", + "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@prisma/client": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.12.0.tgz", - "integrity": "sha512-wn98bJ3Cj6edlF4jjpgXwbnQIo/fQLqqQHPk2POrZPxTlhY3+n90SSIF3LMRVa8VzRFC/Gec3YKJRxRu+AIGVA==", - "hasInstallScript": true, + "node_modules/@smithy/util-buffer-from": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.1.0.tgz", + "integrity": "sha512-N6yXcjfe/E+xKEccWEKzK6M+crMrlwaCepKja0pNnlSkm6SjAeLKKA++er5Ba0I17gvKfN/ThV+ZOx/CntKTVw==", "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^4.1.0", + "tslib": "^2.6.2" + }, "engines": { - "node": ">=18.18" + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-config-provider": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.1.0.tgz", + "integrity": "sha512-swXz2vMjrP1ZusZWVTB/ai5gK+J8U0BWvP10v9fpcFvg+Xi/87LHvHfst2IgCs1i0v4qFZfGwCmeD/KNCdJZbQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" }, - "peerDependencies": { - "prisma": "*", - "typescript": ">=5.1.0" + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.1.1.tgz", + "integrity": "sha512-hA1AKIHFUMa9Tl6q6y8p0pJ9aWHCCG8s57flmIyLE0W7HcJeYrYtnqXDcGnftvXEhdQnSexyegXnzzTGk8bKLA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^4.1.1", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" }, - "peerDependenciesMeta": { - "prisma": { - "optional": true - }, - "typescript": { - "optional": true - } + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@prisma/config": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.12.0.tgz", - "integrity": "sha512-HovZWzhWEMedHxmjefQBRZa40P81N7/+74khKFz9e1AFjakcIQdXgMWKgt20HaACzY+d1LRBC+L4tiz71t9fkg==", + "node_modules/@smithy/util-defaults-mode-node": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.1.1.tgz", + "integrity": "sha512-RGSpmoBrA+5D2WjwtK7tto6Pc2wO9KSXKLpLONhFZ8VyuCbqlLdiDAfuDTNY9AJe4JoE+Cx806cpTQQoQ71zPQ==", "license": "Apache-2.0", "dependencies": { - "jiti": "2.4.2" + "@smithy/config-resolver": "^4.2.1", + "@smithy/credential-provider-imds": "^4.1.1", + "@smithy/node-config-provider": "^4.2.1", + "@smithy/property-provider": "^4.1.1", + "@smithy/smithy-client": "^4.6.1", + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@prisma/debug": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.12.0.tgz", - "integrity": "sha512-plbz6z72orcqr0eeio7zgUrZj5EudZUpAeWkFTA/DDdXEj28YHDXuiakvR6S7sD6tZi+jiwQEJAPeV6J6m/tEQ==", - "license": "Apache-2.0" + "node_modules/@smithy/util-endpoints": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.7.tgz", + "integrity": "sha512-klGBP+RpBp6V5JbrY2C/VKnHXn3d5V2YrifZbmMY8os7M6m8wdYFoO6w/fe5VkP+YVwrEktW3IWYaSQVNZJ8oQ==", + "dependencies": { + "@smithy/node-config-provider": "^4.1.4", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } }, - "node_modules/@prisma/engines": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.12.0.tgz", - "integrity": "sha512-4BRZZUaAuB4p0XhTauxelvFs7IllhPmNLvmla0bO1nkECs8n/o1pUvAVbQ/VOrZR5DnF4HED0PrGai+rIOVePA==", - "hasInstallScript": true, + "node_modules/@smithy/util-hex-encoding": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.1.0.tgz", + "integrity": "sha512-1LcueNN5GYC4tr8mo14yVYbh/Ur8jHhWOxniZXii+1+ePiIbsLZ5fEI0QQGtbRRP5mOhmooos+rLmVASGGoq5w==", "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.12.0", - "@prisma/engines-version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", - "@prisma/fetch-engine": "6.12.0", - "@prisma/get-platform": "6.12.0" + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@prisma/engines-version": { - "version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc.tgz", - "integrity": "sha512-70vhecxBJlRr06VfahDzk9ow4k1HIaSfVUT3X0/kZoHCMl9zbabut4gEXAyzJZxaCGi5igAA7SyyfBI//mmkbQ==", - "license": "Apache-2.0" - }, - "node_modules/@prisma/extension-accelerate": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@prisma/extension-accelerate/-/extension-accelerate-2.0.2.tgz", - "integrity": "sha512-yZK6/k7uOEFpEsKoZezQS1CKDboPtBCQ0NyI70e1Un8tDiRgg80iWGyjsJmRpps2ZIut3MroHP+dyR3wVKh8lA==", + "node_modules/@smithy/util-middleware": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.1.1.tgz", + "integrity": "sha512-CGmZ72mL29VMfESz7S6dekqzCh8ZISj3B+w0g1hZFXaOjGTVaSqfAEFAq8EGp8fUL+Q2l8aqNmt8U1tglTikeg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" + }, "engines": { - "node": ">=18" + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-retry": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.1.1.tgz", + "integrity": "sha512-jGeybqEZ/LIordPLMh5bnmnoIgsqnp4IEimmUp5c5voZ8yx+5kAlN5+juyr7p+f7AtZTgvhmInQk4Q0UVbrZ0Q==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/service-error-classification": "^4.1.1", + "@smithy/types": "^4.5.0", + "tslib": "^2.6.2" }, - "peerDependencies": { - "@prisma/client": ">=4.16.1" + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@prisma/fetch-engine": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.12.0.tgz", - "integrity": "sha512-EamoiwrK46rpWaEbLX9aqKDPOd8IyLnZAkiYXFNuq0YsU0Z8K09/rH8S7feOWAVJ3xzeSgcEJtBlVDrajM9Sag==", + "node_modules/@smithy/util-stream": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.3.1.tgz", + "integrity": "sha512-khKkW/Jqkgh6caxMWbMuox9+YfGlsk9OnHOYCGVEdYQb/XVzcORXHLYUubHmmda0pubEDncofUrPNniS9d+uAA==", "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.12.0", - "@prisma/engines-version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", - "@prisma/get-platform": "6.12.0" + "@smithy/fetch-http-handler": "^5.2.1", + "@smithy/node-http-handler": "^4.2.1", + "@smithy/types": "^4.5.0", + "@smithy/util-base64": "^4.1.0", + "@smithy/util-buffer-from": "^4.1.0", + "@smithy/util-hex-encoding": "^4.1.0", + "@smithy/util-utf8": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@prisma/get-platform": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.12.0.tgz", - "integrity": "sha512-nRerTGhTlgyvcBlyWgt8OLNIV7QgJS2XYXMJD1hysorMCuLAjuDDuoxmVt7C2nLxbuxbWPp7OuFRHC23HqD9dA==", + "node_modules/@smithy/util-uri-escape": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.1.0.tgz", + "integrity": "sha512-b0EFQkq35K5NHUYxU72JuoheM6+pytEVUGlTwiFxWFpmddA+Bpz3LgsPRIpBk8lnPE47yT7AF2Egc3jVnKLuPg==", "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.12.0" + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@sideway/address": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", - "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", - "license": "BSD-3-Clause", + "node_modules/@smithy/util-utf8": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.1.0.tgz", + "integrity": "sha512-mEu1/UIXAdNYuBcyEPbjScKi/+MQVXNIuY/7Cm5XLIWe319kDrT5SizBE95jqtmEXoDbGoZxKLCMttdZdqTZKQ==", + "license": "Apache-2.0", "dependencies": { - "@hapi/hoek": "^9.0.0" + "@smithy/util-buffer-from": "^4.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@sideway/formula": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", - "license": "BSD-3-Clause" + "node_modules/@smithy/util-waiter": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.0.7.tgz", + "integrity": "sha512-mYqtQXPmrwvUljaHyGxYUIIRI3qjBTEb/f5QFi3A6VlxhpmZd5mWXn9W+qUkf2pVE1Hv3SqxefiZOPGdxmO64A==", + "dependencies": { + "@smithy/abort-controller": "^4.0.5", + "@smithy/types": "^4.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } }, - "node_modules/@sideway/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", - "license": "BSD-3-Clause" + "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/@tsconfig/node10": { "version": "1.0.11", @@ -196,38 +2244,214 @@ "dev": 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==", - "dev": true, + "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==", + "dev": 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==", + "dev": 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==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/amqplib": { + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.10.7.tgz", + "integrity": "sha512-IVj3avf9AQd2nXCx0PGk/OYq7VmHiyNxWFSb5HhU9ATh+i+gHWvVcljFTcTWQ/dyHJCTrzCixde+r/asL2ErDA==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/aws-sdk": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/@types/aws-sdk/-/aws-sdk-2.7.4.tgz", + "integrity": "sha512-BdGaQDSow2hYmHbn7RV/Lg9rvh/JBD6gFRKAeCh3eqjc2eAjaz5m+cjuX1lpaWOisMeb0ep8sZBhtOLHHZ8qAA==", + "deprecated": "This is a stub types definition. aws-sdk provides its own type definitions, so you do not need this installed.", + "dependencies": { + "aws-sdk": "*" + } + }, + "node_modules/@types/bcrypt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@types/bcrypt/-/bcrypt-6.0.0.tgz", + "integrity": "sha512-/oJGukuH3D2+D+3H4JWLaAsJ/ji86dhRidzZ/Od7H/i8g+aCmvkeCc6Ni/f9uxGLSQVCRZkX2/lqEFG2BvWtlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "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==", + "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==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.3.tgz", + "integrity": "sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^5.0.0", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.7.tgz", + "integrity": "sha512-R+33OsgWw7rOhD1emjU7dzCDHucJrgJXMA5PYCzJxVil0dsyx5iBEPHqpPfiKNJQb7lZ1vxwoLR4Z87bBUpeGQ==", + "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==", + "license": "MIT" + }, + "node_modules/@types/joi": { + "version": "17.2.2", + "resolved": "https://registry.npmjs.org/@types/joi/-/joi-17.2.2.tgz", + "integrity": "sha512-vPvPwxn0Y4pQyqkEcMCJYxXCMYcrHqdfFX4SpF4zcqYioYexmDyxtM3OK+m/ZwGBS8/dooJ0il9qCwAdd6KFtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "joi": "*" + } + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.10", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz", + "integrity": "sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/ms": "*", + "@types/node": "*" + } + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/multer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/multer/-/multer-2.0.0.tgz", + "integrity": "sha512-C3Z9v9Evij2yST3RSBktxP9STm6OdMc5uR1xF1SGr98uv8dUlAL2hqwrZ3GVB3uyMyiegnscEK6PGtYvNrjTjw==", + "license": "MIT", + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/node": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.2.0.tgz", + "integrity": "sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.10.0" + } + }, + "node_modules/@types/pg": { + "version": "8.15.5", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.5.tgz", + "integrity": "sha512-LF7lF6zWEKxuT3/OR8wAZGzkg4ENGXFNyiV/JeOt9z5B+0ZVwbql9McqX5c/WStFq1GaGso7H1AzP/qSzmlCKQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^2.2.0" + } + }, + "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==", "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==", - "dev": true, + "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==", "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==", - "dev": true, - "license": "MIT" + "node_modules/@types/send": { + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", + "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } }, - "node_modules/@types/node": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", - "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", - "dev": true, + "node_modules/@types/serve-static": { + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", + "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", "license": "MIT", - "peer": true, "dependencies": { - "undici-types": "~7.8.0" + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" } }, + "node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==" + }, "node_modules/accepts": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", @@ -267,6 +2491,31 @@ "node": ">=0.4.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", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/amqplib": { + "version": "0.10.9", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.9.tgz", + "integrity": "sha512-jwSftI4QjS3mizvnSnOrPGYiUnm1vI2OP1iXeOUz5pb74Ua0nbf6nPyyTzuiCLEE3fMpaJORXh2K/TQ08H5xGA==", + "license": "MIT", + "dependencies": { + "buffer-more-ints": "~1.0.0", + "url-parse": "~1.5.10" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -280,6 +2529,12 @@ "node": ">= 8" } }, + "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/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -287,12 +2542,85 @@ "dev": true, "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==", + "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/aws-sdk": { + "version": "2.1692.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1692.0.tgz", + "integrity": "sha512-x511uiJ/57FIsbgUe5csJ13k3uzu25uWQE+XqfBis/sB0SFoiElJWXRkgEAUh0U6n40eT3ay5Ue4oPkRMu1LYw==", + "hasInstallScript": true, + "dependencies": { + "buffer": "4.9.2", + "events": "1.1.1", + "ieee754": "1.1.13", + "jmespath": "0.16.0", + "querystring": "0.2.0", + "sax": "1.2.1", + "url": "0.10.3", + "util": "^0.12.4", + "uuid": "8.0.0", + "xml2js": "0.6.2" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/axios": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", + "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.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==", "license": "MIT" }, + "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/bcrypt": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-6.0.0.tgz", @@ -339,6 +2667,11 @@ "node": ">=18" } }, + "node_modules/bowser": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.12.0.tgz", + "integrity": "sha512-HcOcTudTeEWgbHh0Y1Tyb6fdeR71m4b/QACf0D4KswGTsNeIJQmg38mRENZPAYPZvGFN3fk3604XbQEPdxXdKg==" + }, "node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -361,12 +2694,46 @@ "node": ">=8" } }, + "node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", "license": "BSD-3-Clause" }, + "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-more-ints": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==", + "license": "MIT" + }, + "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", @@ -376,6 +2743,24 @@ "node": ">= 0.8" } }, + "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", @@ -429,12 +2814,39 @@ "fsevents": "~2.3.2" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "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/content-disposition": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", @@ -494,6 +2906,12 @@ "dev": true, "license": "MIT" }, + "node_modules/crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==", + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", @@ -511,6 +2929,41 @@ } } }, + "node_modules/decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "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/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -580,6 +3033,45 @@ "node": ">= 0.8" } }, + "node_modules/engine.io-client": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.3.tgz", + "integrity": "sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1", + "xmlhttprequest-ssl": "~2.1.1" + } + }, + "node_modules/engine.io-client/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "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/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -610,6 +3102,21 @@ "node": ">= 0.4" } }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -625,6 +3132,15 @@ "node": ">= 0.6" } }, + "node_modules/events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==", + "license": "MIT", + "engines": { + "node": ">=0.4.x" + } + }, "node_modules/express": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", @@ -663,37 +3179,152 @@ "node": ">= 18" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.0.1.tgz", + "integrity": "sha512-aZVCnybn7TVmxO4BtlmnvX+nuz8qHW124KKJ8dumsBsmv5ZLxE0pYu7S2nwyRBGHHCAzdmnGyrc5U/rksSPO7Q==", + "dependencies": { + "ip-address": "10.0.1" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/fast-xml-parser": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", + "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "dependencies": { + "strnum": "^2.1.0" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "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==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "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": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "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/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "node_modules/form-data": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "license": "MIT", "dependencies": { - "to-regex-range": "^5.0.1" + "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": ">=8" + "node": ">= 6" } }, - "node_modules/finalhandler": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", - "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "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==", + "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==", "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" + "mime-db": "1.52.0" }, "engines": { - "node": ">= 0.8" + "node": ">= 0.6" } }, "node_modules/forwarded": { @@ -714,20 +3345,6 @@ "node": ">= 0.8" } }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -807,6 +3424,18 @@ "node": ">=4" } }, + "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", @@ -819,6 +3448,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -856,6 +3500,15 @@ "node": ">= 0.8" } }, + "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", + "dependencies": { + "ms": "^2.0.0" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -868,6 +3521,12 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "license": "BSD-3-Clause" + }, "node_modules/ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", @@ -880,6 +3539,14 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, + "node_modules/ip-address": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", + "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", + "engines": { + "node": ">= 12" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -889,6 +3556,22 @@ "node": ">= 0.10" } }, + "node_modules/is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -901,6 +3584,18 @@ "node": ">=8" } }, + "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", @@ -910,6 +3605,24 @@ "node": ">=0.10.0" } }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -937,6 +3650,45 @@ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", "license": "MIT" }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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/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/jiti": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", @@ -946,6 +3698,15 @@ "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/jmespath": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", + "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/joi": { "version": "17.13.3", "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", @@ -1114,12 +3875,94 @@ "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/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/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/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/negotiator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", @@ -1201,61 +4044,198 @@ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "license": "MIT", "engines": { - "node": ">= 0.4" + "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/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-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/pg": { + "version": "8.16.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", + "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", + "license": "MIT", + "dependencies": { + "pg-connection-string": "^2.9.1", + "pg-pool": "^3.10.1", + "pg-protocol": "^1.10.3", + "pg-types": "2.2.0", + "pgpass": "1.0.5" + }, + "engines": { + "node": ">= 16.0.0" + }, + "optionalDependencies": { + "pg-cloudflare": "^1.2.7" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-cloudflare": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz", + "integrity": "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==", + "license": "MIT", + "optional": true + }, + "node_modules/pg-connection-string": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.9.1.tgz", + "integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==", + "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.10.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.10.1.tgz", + "integrity": "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==", + "license": "MIT", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.10.3.tgz", + "integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==", + "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/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/jonschlinkert" } }, - "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==", + "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", - "dependencies": { - "ee-first": "1.1.1" - }, "engines": { - "node": ">= 0.8" + "node": ">= 0.4" } }, - "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/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/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">=0.10.0" } }, - "node_modules/path-to-regexp": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", - "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "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": ">=16" + "node": ">=0.10.0" } }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "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", - "engines": { - "node": ">=8.6" + "dependencies": { + "xtend": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "engines": { + "node": ">=0.10.0" } }, "node_modules/prisma": { @@ -1296,12 +4276,24 @@ "node": ">= 0.10" } }, + "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/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "license": "MIT" }, + "node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", + "license": "MIT" + }, "node_modules/qs": { "version": "6.14.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", @@ -1317,6 +4309,39 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/query-string": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", + "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.2.2", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "license": "MIT" + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -1341,6 +4366,20 @@ "node": ">= 0.8" } }, + "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/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -1353,6 +4392,24 @@ "node": ">=8.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" + }, + "node_modules/retry-axios": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-2.6.0.tgz", + "integrity": "sha512-pOLi+Gdll3JekwuFjXO3fTq+L9lzMQGcSq7M5gIjExcl3Gu1hd4XXuf5o3+LuSBsaULQH7DiNbsqPd1chVpQGQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=10.7.0" + }, + "peerDependencies": { + "axios": "*" + } + }, "node_modules/router": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", @@ -1389,12 +4446,35 @@ ], "license": "MIT" }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "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/sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", + "license": "ISC" + }, "node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", @@ -1444,6 +4524,23 @@ "node": ">= 18" } }, + "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/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -1534,6 +4631,86 @@ "node": ">=10" } }, + "node_modules/socket.io-client": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz", + "integrity": "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.6.1", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-client/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "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/statuses": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", @@ -1543,6 +4720,43 @@ "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/strict-uri-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", + "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "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/strnum": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", + "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ] + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -1629,6 +4843,11 @@ } } }, + "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==" + }, "node_modules/type-is": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", @@ -1643,10 +4862,16 @@ "node": ">= 0.6" } }, + "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/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "devOptional": true, "license": "Apache-2.0", "bin": { @@ -1664,12 +4889,10 @@ "license": "MIT" }, "node_modules/undici-types": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", - "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", - "dev": true, - "license": "MIT", - "peer": true + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", + "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", + "license": "MIT" }, "node_modules/unpipe": { "version": "1.0.0", @@ -1680,6 +4903,54 @@ "node": ">= 0.8" } }, + "node_modules/url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==", + "license": "MIT", + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "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": "8.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", + "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", + "license": "MIT", + "bin": { + "uuid": "dist/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", @@ -1696,12 +4967,93 @@ "node": ">= 0.8" } }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "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/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/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "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/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, + "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/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/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 47de208..53d90e4 --- a/package.json +++ b/package.json @@ -1,19 +1,22 @@ { "name": "backend", "version": "1.0.0", - "main": "index.js", + "main": "index.ts", "type": "module", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "dev": "nodemon index.js", - "start": "nodemon index.js" + "build": "tsc", + "start": "ts-node index.ts", + "dev": "npm run build && node dist/index.js", + "seed": "npm run build && node dist/prisma/seed.js", + "generate-embeddings": "npm run build && node scripts/generate-missing-embeddings.js", + "generate-embeddings:ts": "npx ts-node --esm scripts/generate-missing-embeddings.ts" }, "repository": { "type": "git", "url": "git+https://github.com/CS3203-Project/backend.git" }, "prisma": { - "seed": "node prisma/seed.js" + "seed": "node --loader ts-node/esm prisma/seed.ts" }, "author": "", "license": "ISC", @@ -23,19 +26,39 @@ "homepage": "https://github.com/CS3203-Project/backend#readme", "description": "", "dependencies": { - "@prisma/client": "^6.12.0", - "@prisma/extension-accelerate": "^2.0.2", + "@aws-sdk/client-s3": "^3.873.0", + "@aws-sdk/client-ses": "^3.872.0", + "@aws-sdk/s3-request-presigner": "^3.873.0", + "@googlemaps/google-maps-services-js": "^3.4.2", + "@prisma/client": "6.15.0", + "@types/amqplib": "^0.10.7", + "@types/aws-sdk": "^2.7.4", + "@types/multer": "^2.0.0", + "@types/pg": "^8.15.5", + "amqplib": "^0.10.9", + "aws-sdk": "^2.1692.0", + "axios": "^1.12.2", "bcrypt": "^6.0.0", "cors": "^2.8.5", "dotenv": "^17.2.1", "express": "^5.1.0", + "express-rate-limit": "^8.0.1", "joi": "^17.13.3", "jsonwebtoken": "^9.0.2", + "multer": "^2.0.2", "nodemon": "^3.1.10", - "prisma": "^6.12.0" + "pg": "^8.16.3", + "prisma": "^6.12.0", + "socket.io-client": "^4.8.1" }, "devDependencies": { + "@types/bcrypt": "^6.0.0", + "@types/cors": "^2.8.19", + "@types/express": "^5.0.3", + "@types/joi": "^17.2.2", + "@types/jsonwebtoken": "^9.0.10", + "@types/node": "^24.2.0", "ts-node": "^10.9.2", - "typescript": "^5.8.3" + "typescript": "^5.9.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100755 index 0000000..5e2db63 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,3770 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@aws-sdk/client-s3': + specifier: ^3.873.0 + version: 3.878.0 + '@aws-sdk/client-ses': + specifier: ^3.872.0 + version: 3.879.0 + '@aws-sdk/s3-request-presigner': + specifier: ^3.873.0 + version: 3.878.0 + '@prisma/client': + specifier: 6.15.0 + version: 6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2) + '@types/amqplib': + specifier: ^0.10.7 + version: 0.10.7 + '@types/aws-sdk': + specifier: ^2.7.4 + version: 2.7.4 + '@types/multer': + specifier: ^2.0.0 + version: 2.0.0 + '@types/pg': + specifier: ^8.15.5 + version: 8.15.5 + amqplib: + specifier: ^0.10.9 + version: 0.10.9 + aws-sdk: + specifier: ^2.1692.0 + version: 2.1692.0 + bcrypt: + specifier: ^6.0.0 + version: 6.0.0 + cors: + specifier: ^2.8.5 + version: 2.8.5 + dotenv: + specifier: ^17.2.1 + version: 17.2.1 + express: + specifier: ^5.1.0 + version: 5.1.0 + express-rate-limit: + specifier: ^8.0.1 + version: 8.0.1(express@5.1.0) + joi: + specifier: ^17.13.3 + version: 17.13.3 + jsonwebtoken: + specifier: ^9.0.2 + version: 9.0.2 + multer: + specifier: ^2.0.2 + version: 2.0.2 + nodemon: + specifier: ^3.1.10 + version: 3.1.10 + pg: + specifier: ^8.16.3 + version: 8.16.3 + prisma: + specifier: ^6.12.0 + version: 6.15.0(typescript@5.9.2) + socket.io-client: + specifier: ^4.8.1 + version: 4.8.1 + devDependencies: + '@types/bcrypt': + specifier: ^6.0.0 + version: 6.0.0 + '@types/cors': + specifier: ^2.8.19 + version: 2.8.19 + '@types/express': + specifier: ^5.0.3 + version: 5.0.3 + '@types/joi': + specifier: ^17.2.2 + version: 17.2.3 + '@types/jsonwebtoken': + specifier: ^9.0.10 + version: 9.0.10 + '@types/node': + specifier: ^24.2.0 + version: 24.3.0 + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@24.3.0)(typescript@5.9.2) + typescript: + specifier: ^5.9.2 + version: 5.9.2 + +packages: + + '@aws-crypto/crc32@5.2.0': + resolution: {integrity: sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==} + engines: {node: '>=16.0.0'} + + '@aws-crypto/crc32c@5.2.0': + resolution: {integrity: sha512-+iWb8qaHLYKrNvGRbiYRHSdKRWhto5XlZUEBwDjYNf+ly5SVYG6zEoYIdxvf5R3zyeP16w4PLBn3rH1xc74Rag==} + + '@aws-crypto/sha1-browser@5.2.0': + resolution: {integrity: sha512-OH6lveCFfcDjX4dbAvCFSYUjJZjDr/3XJ3xHtjn3Oj5b9RjojQo8npoLeA/bNwkOkrSQ0wgrHzXk4tDRxGKJeg==} + + '@aws-crypto/sha256-browser@5.2.0': + resolution: {integrity: sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==} + + '@aws-crypto/sha256-js@5.2.0': + resolution: {integrity: sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==} + engines: {node: '>=16.0.0'} + + '@aws-crypto/supports-web-crypto@5.2.0': + resolution: {integrity: sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==} + + '@aws-crypto/util@5.2.0': + resolution: {integrity: sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==} + + '@aws-sdk/client-s3@3.878.0': + resolution: {integrity: sha512-hcHAX56qN5o7fYCxNsKNu+7AMgEmJN1EoUVBr4dDtqP6HebUuRF+XaF1iHNEDZC7Ucd/eimJZquxVDQFb9IMZA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/client-ses@3.879.0': + resolution: {integrity: sha512-6yydcKf01tXAIsya5YBOcznvGN4DN8crLEuYC0jwG+67loCeq2HZMO1rL3ouaIllCSgmO0l7KHDK62BQr3Z3Zg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/client-sso@3.876.0': + resolution: {integrity: sha512-Vf0PMF7HVpvllrfPODnBZmlz6kT/y2AvOt1RQG3+qD0VrHWzShc5nwgRZ+yyP3xkKVhZsQ3sJapfZTFnjqMOYA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/client-sso@3.879.0': + resolution: {integrity: sha512-+Pc3OYFpRYpKLKRreovPM63FPPud1/SF9vemwIJfz6KwsBCJdvg7vYD1xLSIp5DVZLeetgf4reCyAA5ImBfZuw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/core@3.876.0': + resolution: {integrity: sha512-sVFBFkdoPOPyY13NaXO1E/R9O5J6ixzHnnRbqrbXYM2QQgLNPTKIiRtmVEuVoFV9YULg+/aKm7caix8m468y9w==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/core@3.879.0': + resolution: {integrity: sha512-AhNmLCrx980LsK+SfPXGh7YqTyZxsK0Qmy18mWmkfY0TSq7WLaSDB5zdQbgbnQCACCHy8DUYXbi4KsjlIhv3PA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-env@3.876.0': + resolution: {integrity: sha512-cof7lwp2AlrAfRs0pt4W2KMS2VMBvEmpcti1UOFfSJIqkn+cyJliMJ8LHg22GI+kUexjvxdAqSbf3M7OHvEW+w==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-env@3.879.0': + resolution: {integrity: sha512-JgG7A8SSbr5IiCYL8kk39Y9chdSB5GPwBorDW8V8mr19G9L+qd6ohED4fAocoNFaDnYJ5wGAHhCfSJjzcsPBVQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-http@3.876.0': + resolution: {integrity: sha512-wzmef2NBp2+X1l8D4Q8hx1G8oI3+WdvLdPev9VnVpRYZxYGRWVPl++wvCBsCn/ZL0mdWopPkhHA3kFexQhMzvg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-http@3.879.0': + resolution: {integrity: sha512-2hM5ByLpyK+qORUexjtYyDZsgxVCCUiJQZRMGkNXFEGz6zTpbjfTIWoh3zRgWHEBiqyPIyfEy50eIF69WshcuA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-ini@3.876.0': + resolution: {integrity: sha512-JHbW6fqnJsVjGHCyko7B0NVPT1nEAPxkM3CGjUcVGsHgJBkxOLVCMQqTRyHcDdeHR2qeojlLoOHRz97xIHQjYw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-ini@3.879.0': + resolution: {integrity: sha512-07M8zfb73KmMBqVO5/V3Ea9kqDspMX0fO0kaI1bsjWI6ngnMye8jCE0/sIhmkVAI0aU709VA0g+Bzlopnw9EoQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-node@3.876.0': + resolution: {integrity: sha512-eHbNt1+Hi43e8ANnwf6toapLSxfMiyGq459y3Uh6i7NBOiWWKEsOVcgOfUC3RCoqeikxovt1tFM2cEElWUIOhg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-node@3.879.0': + resolution: {integrity: sha512-FYaAqJbnSTrVL2iZkNDj2hj5087yMv2RN2GA8DJhe7iOJjzhzRojrtlfpWeJg6IhK0sBKDH+YXbdeexCzUJvtA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-process@3.876.0': + resolution: {integrity: sha512-SMX4OlHvspu3gF4hxe7WAnZFhxpiCye+WlBSVoWfW/i9XNhtrZS1JMr29MK34GlCTk9qO7FlRwds/Z5k7xPpHg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-process@3.879.0': + resolution: {integrity: sha512-7r360x1VyEt35Sm1JFOzww2WpnfJNBbvvnzoyLt7WRfK0S/AfsuWhu5ltJ80QvJ0R3AiSNbG+q/btG2IHhDYPQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-sso@3.876.0': + resolution: {integrity: sha512-iP5dz9XqwePbgnh7Bdrq5e1319JpCRKLyomUfHH1XVeXkIHmwIJdmTj1Upeo1J8L/5cLHmhXAN6CTN11bLo8SA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-sso@3.879.0': + resolution: {integrity: sha512-gd27B0NsgtKlaPNARj4IX7F7US5NuU691rGm0EUSkDsM7TctvJULighKoHzPxDQlrDbVI11PW4WtKS/Zg5zPlQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-web-identity@3.876.0': + resolution: {integrity: sha512-q/XSCP1uae5aB9veM8zcm6Gqu6A4ckX9ZbhHgCzURXVJDwp+nINW1hM9vppMjGw3ND9Ibx/adR+KfTI0TDMzqw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/credential-provider-web-identity@3.879.0': + resolution: {integrity: sha512-Jy4uPFfGzHk1Mxy+/Wr43vuw9yXsE2yiF4e4598vc3aJfO0YtA2nSfbKD3PNKRORwXbeKqWPfph9SCKQpWoxEg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-bucket-endpoint@3.873.0': + resolution: {integrity: sha512-b4bvr0QdADeTUs+lPc9Z48kXzbKHXQKgTvxx/jXDgSW9tv4KmYPO1gIj6Z9dcrBkRWQuUtSW3Tu2S5n6pe+zeg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-expect-continue@3.873.0': + resolution: {integrity: sha512-GIqoc8WgRcf/opBOZXFLmplJQKwOMjiOMmDz9gQkaJ8FiVJoAp8EGVmK2TOWZMQUYsavvHYsHaor5R2xwPoGVg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-flexible-checksums@3.878.0': + resolution: {integrity: sha512-EQiA7CML75UWoDH7+9NTIX8+U6mA9ZaLv0a8AoCbem+mqPXRHnOnALc76IRTyKpQNhKkBb/kiItXAl6OcrOGZQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-host-header@3.873.0': + resolution: {integrity: sha512-KZ/W1uruWtMOs7D5j3KquOxzCnV79KQW9MjJFZM/M0l6KI8J6V3718MXxFHsTjUE4fpdV6SeCNLV1lwGygsjJA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-location-constraint@3.873.0': + resolution: {integrity: sha512-r+hIaORsW/8rq6wieDordXnA/eAu7xAPLue2InhoEX6ML7irP52BgiibHLpt9R0psiCzIHhju8qqKa4pJOrmiw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-logger@3.876.0': + resolution: {integrity: sha512-cpWJhOuMSyz9oV25Z/CMHCBTgafDCbv7fHR80nlRrPdPZ8ETNsahwRgltXP1QJJ8r3X/c1kwpOR7tc+RabVzNA==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-recursion-detection@3.873.0': + resolution: {integrity: sha512-OtgY8EXOzRdEWR//WfPkA/fXl0+WwE8hq0y9iw2caNyKPtca85dzrrZWnPqyBK/cpImosrpR1iKMYr41XshsCg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-sdk-s3@3.876.0': + resolution: {integrity: sha512-h+TDs9EKAfXnrkogQpQz3o11zvs6Vh9+ehxyd35OcM7evnDeoV4GFjjnAKq+MxbBk/5Ewnvng+d6/WQDvMbj7Q==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-ssec@3.873.0': + resolution: {integrity: sha512-AF55J94BoiuzN7g3hahy0dXTVZahVi8XxRBLgzNp6yQf0KTng+hb/V9UQZVYY1GZaDczvvvnqC54RGe9OZZ9zQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-user-agent@3.876.0': + resolution: {integrity: sha512-FR+8INfnbNv32QDQ5szxkWX6mB/QgezfNyx8LnAh1ErISZMmEFBxXXir+ZOfuV8vsmal1a6cy9qmnMNDaNnaNQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/middleware-user-agent@3.879.0': + resolution: {integrity: sha512-DDSV8228lQxeMAFKnigkd0fHzzn5aauZMYC3CSj6e5/qE7+9OwpkUcjHfb7HZ9KWG6L2/70aKZXHqiJ4xKhOZw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/nested-clients@3.876.0': + resolution: {integrity: sha512-R4TZrkM2gUElTsotk8mt3y7iLG8TNi1LL1wgVdEEWSLOYTaFyglGdoNBMtEeP7lmXilaTy00AbYF6BakJvSTHg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/nested-clients@3.879.0': + resolution: {integrity: sha512-7+n9NpIz9QtKYnxmw1fHi9C8o0GrX8LbBR4D50c7bH6Iq5+XdSuL5AFOWWQ5cMD0JhqYYJhK/fJsVau3nUtC4g==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/region-config-resolver@3.873.0': + resolution: {integrity: sha512-q9sPoef+BBG6PJnc4x60vK/bfVwvRWsPgcoQyIra057S/QGjq5VkjvNk6H8xedf6vnKlXNBwq9BaANBXnldUJg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/s3-request-presigner@3.878.0': + resolution: {integrity: sha512-i90yClfuaaPERnmCGb+yAmBtCrbHssIgVMQsnz9Q5RUBEcgRObKDAXe/pBQowEvNeObPYSUzgLjVHcv/FGhpyw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/signature-v4-multi-region@3.876.0': + resolution: {integrity: sha512-OMDcuaVlC2rbze92w4QcNfuEA0IeT2GsT1ByZCwe+Y9tZwxzj7fCiOOU0UmJfa+juuQ/YBzVYxnkrkz3Rg6DEw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/token-providers@3.876.0': + resolution: {integrity: sha512-iU08kaQbhXnY0CC2TBcr7y/2PqPwZP2CTWX/Rbq0NvhOyteikfh7ASC+bRfLUp0XMSHKvSb+w2dh8a0lvx4oHg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/token-providers@3.879.0': + resolution: {integrity: sha512-47J7sCwXdnw9plRZNAGVkNEOlSiLb/kR2slnDIHRK9NB/ECKsoqgz5OZQJ9E2f0yqOs8zSNJjn3T01KxpgW8Qw==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/types@3.862.0': + resolution: {integrity: sha512-Bei+RL0cDxxV+lW2UezLbCYYNeJm6Nzee0TpW0FfyTRBhH9C1XQh4+x+IClriXvgBnRquTMMYsmJfvx8iyLKrg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-arn-parser@3.873.0': + resolution: {integrity: sha512-qag+VTqnJWDn8zTAXX4wiVioa0hZDQMtbZcGRERVnLar4/3/VIKBhxX2XibNQXFu1ufgcRn4YntT/XEPecFWcg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-endpoints@3.873.0': + resolution: {integrity: sha512-YByHrhjxYdjKRf/RQygRK1uh0As1FIi9+jXTcIEX/rBgN8mUByczr2u4QXBzw7ZdbdcOBMOkPnLRjNOWW1MkFg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-endpoints@3.879.0': + resolution: {integrity: sha512-aVAJwGecYoEmbEFju3127TyJDF9qJsKDUUTRMDuS8tGn+QiWQFnfInmbt+el9GU1gEJupNTXV+E3e74y51fb7A==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-format-url@3.873.0': + resolution: {integrity: sha512-v//b9jFnhzTKKV3HFTw2MakdM22uBAs2lBov51BWmFXuFtSTdBLrR7zgfetQPE3PVkFai0cmtJQPdc3MX+T/cQ==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-locate-window@3.873.0': + resolution: {integrity: sha512-xcVhZF6svjM5Rj89T1WzkjQmrTF6dpR2UvIHPMTnSZoNe6CixejPZ6f0JJ2kAhO8H+dUHwNBlsUgOTIKiK/Syg==} + engines: {node: '>=18.0.0'} + + '@aws-sdk/util-user-agent-browser@3.873.0': + resolution: {integrity: sha512-AcRdbK6o19yehEcywI43blIBhOCSo6UgyWcuOJX5CFF8k39xm1ILCjQlRRjchLAxWrm0lU0Q7XV90RiMMFMZtA==} + + '@aws-sdk/util-user-agent-node@3.876.0': + resolution: {integrity: sha512-/ZIaeUt60JBdI0mNc7sZ8v3Tuzp8Pbe4gIAYnppGyF4KV8QA+Yu8tp2bGHfkKn150t1uvQ6P/4CwFfoGF34dzg==} + engines: {node: '>=18.0.0'} + peerDependencies: + aws-crt: '>=1.0.0' + peerDependenciesMeta: + aws-crt: + optional: true + + '@aws-sdk/util-user-agent-node@3.879.0': + resolution: {integrity: sha512-A5KGc1S+CJRzYnuxJQQmH1BtGsz46AgyHkqReKfGiNQA8ET/9y9LQ5t2ABqnSBHHIh3+MiCcQSkUZ0S3rTodrQ==} + engines: {node: '>=18.0.0'} + peerDependencies: + aws-crt: '>=1.0.0' + peerDependenciesMeta: + aws-crt: + optional: true + + '@aws-sdk/xml-builder@3.873.0': + resolution: {integrity: sha512-kLO7k7cGJ6KaHiExSJWojZurF7SnGMDHXRuQunFnEoD0n1yB6Lqy/S/zHiQ7oJnBhPr9q0TW9qFkrsZb1Uc54w==} + engines: {node: '>=18.0.0'} + + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + + '@hapi/hoek@9.3.0': + resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} + + '@hapi/topo@5.1.0': + resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + + '@prisma/client@6.15.0': + resolution: {integrity: sha512-wR2LXUbOH4cL/WToatI/Y2c7uzni76oNFND7+23ypLllBmIS8e3ZHhO+nud9iXSXKFt1SoM3fTZvHawg63emZw==} + engines: {node: '>=18.18'} + peerDependencies: + prisma: '*' + typescript: '>=5.1.0' + peerDependenciesMeta: + prisma: + optional: true + typescript: + optional: true + + '@prisma/config@6.15.0': + resolution: {integrity: sha512-KMEoec9b2u6zX0EbSEx/dRpx1oNLjqJEBZYyK0S3TTIbZ7GEGoVyGyFRk4C72+A38cuPLbfQGQvgOD+gBErKlA==} + + '@prisma/debug@6.15.0': + resolution: {integrity: sha512-y7cSeLuQmyt+A3hstAs6tsuAiVXSnw9T55ra77z0nbNkA8Lcq9rNcQg6PI00by/+WnE/aMRJ/W7sZWn2cgIy1g==} + + '@prisma/engines-version@6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb': + resolution: {integrity: sha512-a/46aK5j6L3ePwilZYEgYDPrhBQ/n4gYjLxT5YncUTJJNRnTCVjPF86QdzUOLRdYjCLfhtZp9aum90W0J+trrg==} + + '@prisma/engines@6.15.0': + resolution: {integrity: sha512-opITiR5ddFJ1N2iqa7mkRlohCZqVSsHhRcc29QXeldMljOf4FSellLT0J5goVb64EzRTKcIDeIsJBgmilNcKxA==} + + '@prisma/fetch-engine@6.15.0': + resolution: {integrity: sha512-xcT5f6b+OWBq6vTUnRCc7qL+Im570CtwvgSj+0MTSGA1o9UDSKZ/WANvwtiRXdbYWECpyC3CukoG3A04VTAPHw==} + + '@prisma/get-platform@6.15.0': + resolution: {integrity: sha512-Jbb+Xbxyp05NSR1x2epabetHiXvpO8tdN2YNoWoA/ZsbYyxxu/CO/ROBauIFuMXs3Ti+W7N7SJtWsHGaWte9Rg==} + + '@sideway/address@4.1.5': + resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} + + '@sideway/formula@3.0.1': + resolution: {integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==} + + '@sideway/pinpoint@2.0.0': + resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} + + '@smithy/abort-controller@4.0.5': + resolution: {integrity: sha512-jcrqdTQurIrBbUm4W2YdLVMQDoL0sA9DTxYd2s+R/y+2U9NLOP7Xf/YqfSg1FZhlZIYEnvk2mwbyvIfdLEPo8g==} + engines: {node: '>=18.0.0'} + + '@smithy/chunked-blob-reader-native@4.0.0': + resolution: {integrity: sha512-R9wM2yPmfEMsUmlMlIgSzOyICs0x9uu7UTHoccMyt7BWw8shcGM8HqB355+BZCPBcySvbTYMs62EgEQkNxz2ig==} + engines: {node: '>=18.0.0'} + + '@smithy/chunked-blob-reader@5.0.0': + resolution: {integrity: sha512-+sKqDBQqb036hh4NPaUiEkYFkTUGYzRsn3EuFhyfQfMy6oGHEUJDurLP9Ufb5dasr/XiAmPNMr6wa9afjQB+Gw==} + engines: {node: '>=18.0.0'} + + '@smithy/config-resolver@4.1.5': + resolution: {integrity: sha512-viuHMxBAqydkB0AfWwHIdwf/PRH2z5KHGUzqyRtS/Wv+n3IHI993Sk76VCA7dD/+GzgGOmlJDITfPcJC1nIVIw==} + engines: {node: '>=18.0.0'} + + '@smithy/core@3.9.0': + resolution: {integrity: sha512-B/GknvCfS3llXd/b++hcrwIuqnEozQDnRL4sBmOac5/z/dr0/yG1PURNPOyU4Lsiy1IyTj8scPxVqRs5dYWf6A==} + engines: {node: '>=18.0.0'} + + '@smithy/credential-provider-imds@4.0.7': + resolution: {integrity: sha512-dDzrMXA8d8riFNiPvytxn0mNwR4B3h8lgrQ5UjAGu6T9z/kRg/Xncf4tEQHE/+t25sY8IH3CowcmWi+1U5B1Gw==} + engines: {node: '>=18.0.0'} + + '@smithy/eventstream-codec@4.0.5': + resolution: {integrity: sha512-miEUN+nz2UTNoRYRhRqVTJCx7jMeILdAurStT2XoS+mhokkmz1xAPp95DFW9Gxt4iF2VBqpeF9HbTQ3kY1viOA==} + engines: {node: '>=18.0.0'} + + '@smithy/eventstream-serde-browser@4.0.5': + resolution: {integrity: sha512-LCUQUVTbM6HFKzImYlSB9w4xafZmpdmZsOh9rIl7riPC3osCgGFVP+wwvYVw6pXda9PPT9TcEZxaq3XE81EdJQ==} + engines: {node: '>=18.0.0'} + + '@smithy/eventstream-serde-config-resolver@4.1.3': + resolution: {integrity: sha512-yTTzw2jZjn/MbHu1pURbHdpjGbCuMHWncNBpJnQAPxOVnFUAbSIUSwafiphVDjNV93TdBJWmeVAds7yl5QCkcA==} + engines: {node: '>=18.0.0'} + + '@smithy/eventstream-serde-node@4.0.5': + resolution: {integrity: sha512-lGS10urI4CNzz6YlTe5EYG0YOpsSp3ra8MXyco4aqSkQDuyZPIw2hcaxDU82OUVtK7UY9hrSvgWtpsW5D4rb4g==} + engines: {node: '>=18.0.0'} + + '@smithy/eventstream-serde-universal@4.0.5': + resolution: {integrity: sha512-JFnmu4SU36YYw3DIBVao3FsJh4Uw65vVDIqlWT4LzR6gXA0F3KP0IXFKKJrhaVzCBhAuMsrUUaT5I+/4ZhF7aw==} + engines: {node: '>=18.0.0'} + + '@smithy/fetch-http-handler@5.1.1': + resolution: {integrity: sha512-61WjM0PWmZJR+SnmzaKI7t7G0UkkNFboDpzIdzSoy7TByUzlxo18Qlh9s71qug4AY4hlH/CwXdubMtkcNEb/sQ==} + engines: {node: '>=18.0.0'} + + '@smithy/hash-blob-browser@4.0.5': + resolution: {integrity: sha512-F7MmCd3FH/Q2edhcKd+qulWkwfChHbc9nhguBlVjSUE6hVHhec3q6uPQ+0u69S6ppvLtR3eStfCuEKMXBXhvvA==} + engines: {node: '>=18.0.0'} + + '@smithy/hash-node@4.0.5': + resolution: {integrity: sha512-cv1HHkKhpyRb6ahD8Vcfb2Hgz67vNIXEp2vnhzfxLFGRukLCNEA5QdsorbUEzXma1Rco0u3rx5VTqbM06GcZqQ==} + engines: {node: '>=18.0.0'} + + '@smithy/hash-stream-node@4.0.5': + resolution: {integrity: sha512-IJuDS3+VfWB67UC0GU0uYBG/TA30w+PlOaSo0GPm9UHS88A6rCP6uZxNjNYiyRtOcjv7TXn/60cW8ox1yuZsLg==} + engines: {node: '>=18.0.0'} + + '@smithy/invalid-dependency@4.0.5': + resolution: {integrity: sha512-IVnb78Qtf7EJpoEVo7qJ8BEXQwgC4n3igeJNNKEj/MLYtapnx8A67Zt/J3RXAj2xSO1910zk0LdFiygSemuLow==} + engines: {node: '>=18.0.0'} + + '@smithy/is-array-buffer@2.2.0': + resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==} + engines: {node: '>=14.0.0'} + + '@smithy/is-array-buffer@4.0.0': + resolution: {integrity: sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==} + engines: {node: '>=18.0.0'} + + '@smithy/md5-js@4.0.5': + resolution: {integrity: sha512-8n2XCwdUbGr8W/XhMTaxILkVlw2QebkVTn5tm3HOcbPbOpWg89zr6dPXsH8xbeTsbTXlJvlJNTQsKAIoqQGbdA==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-content-length@4.0.5': + resolution: {integrity: sha512-l1jlNZoYzoCC7p0zCtBDE5OBXZ95yMKlRlftooE5jPWQn4YBPLgsp+oeHp7iMHaTGoUdFqmHOPa8c9G3gBsRpQ==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-endpoint@4.1.19': + resolution: {integrity: sha512-EAlEPncqo03siNZJ9Tm6adKCQ+sw5fNU8ncxWwaH0zTCwMPsgmERTi6CEKaermZdgJb+4Yvh0NFm36HeO4PGgQ==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-retry@4.1.20': + resolution: {integrity: sha512-T3maNEm3Masae99eFdx1Q7PIqBBEVOvRd5hralqKZNeIivnoGNx5OFtI3DiZ5gCjUkl0mNondlzSXeVxkinh7Q==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-serde@4.0.9': + resolution: {integrity: sha512-uAFFR4dpeoJPGz8x9mhxp+RPjo5wW0QEEIPPPbLXiRRWeCATf/Km3gKIVR5vaP8bN1kgsPhcEeh+IZvUlBv6Xg==} + engines: {node: '>=18.0.0'} + + '@smithy/middleware-stack@4.0.5': + resolution: {integrity: sha512-/yoHDXZPh3ocRVyeWQFvC44u8seu3eYzZRveCMfgMOBcNKnAmOvjbL9+Cp5XKSIi9iYA9PECUuW2teDAk8T+OQ==} + engines: {node: '>=18.0.0'} + + '@smithy/node-config-provider@4.1.4': + resolution: {integrity: sha512-+UDQV/k42jLEPPHSn39l0Bmc4sB1xtdI9Gd47fzo/0PbXzJ7ylgaOByVjF5EeQIumkepnrJyfx86dPa9p47Y+w==} + engines: {node: '>=18.0.0'} + + '@smithy/node-http-handler@4.1.1': + resolution: {integrity: sha512-RHnlHqFpoVdjSPPiYy/t40Zovf3BBHc2oemgD7VsVTFFZrU5erFFe0n52OANZZ/5sbshgD93sOh5r6I35Xmpaw==} + engines: {node: '>=18.0.0'} + + '@smithy/property-provider@4.0.5': + resolution: {integrity: sha512-R/bswf59T/n9ZgfgUICAZoWYKBHcsVDurAGX88zsiUtOTA/xUAPyiT+qkNCPwFn43pZqN84M4MiUsbSGQmgFIQ==} + engines: {node: '>=18.0.0'} + + '@smithy/protocol-http@5.1.3': + resolution: {integrity: sha512-fCJd2ZR7D22XhDY0l+92pUag/7je2BztPRQ01gU5bMChcyI0rlly7QFibnYHzcxDvccMjlpM/Q1ev8ceRIb48w==} + engines: {node: '>=18.0.0'} + + '@smithy/querystring-builder@4.0.5': + resolution: {integrity: sha512-NJeSCU57piZ56c+/wY+AbAw6rxCCAOZLCIniRE7wqvndqxcKKDOXzwWjrY7wGKEISfhL9gBbAaWWgHsUGedk+A==} + engines: {node: '>=18.0.0'} + + '@smithy/querystring-parser@4.0.5': + resolution: {integrity: sha512-6SV7md2CzNG/WUeTjVe6Dj8noH32r4MnUeFKZrnVYsQxpGSIcphAanQMayi8jJLZAWm6pdM9ZXvKCpWOsIGg0w==} + engines: {node: '>=18.0.0'} + + '@smithy/service-error-classification@4.0.7': + resolution: {integrity: sha512-XvRHOipqpwNhEjDf2L5gJowZEm5nsxC16pAZOeEcsygdjv9A2jdOh3YoDQvOXBGTsaJk6mNWtzWalOB9976Wlg==} + engines: {node: '>=18.0.0'} + + '@smithy/shared-ini-file-loader@4.0.5': + resolution: {integrity: sha512-YVVwehRDuehgoXdEL4r1tAAzdaDgaC9EQvhK0lEbfnbrd0bd5+CTQumbdPryX3J2shT7ZqQE+jPW4lmNBAB8JQ==} + engines: {node: '>=18.0.0'} + + '@smithy/signature-v4@5.1.3': + resolution: {integrity: sha512-mARDSXSEgllNzMw6N+mC+r1AQlEBO3meEAkR/UlfAgnMzJUB3goRBWgip1EAMG99wh36MDqzo86SfIX5Y+VEaw==} + engines: {node: '>=18.0.0'} + + '@smithy/smithy-client@4.5.0': + resolution: {integrity: sha512-ZSdE3vl0MuVbEwJBxSftm0J5nL/gw76xp5WF13zW9cN18MFuFXD5/LV0QD8P+sCU5bSWGyy6CTgUupE1HhOo1A==} + engines: {node: '>=18.0.0'} + + '@smithy/types@4.3.2': + resolution: {integrity: sha512-QO4zghLxiQ5W9UZmX2Lo0nta2PuE1sSrXUYDoaB6HMR762C0P7v/HEPHf6ZdglTVssJG1bsrSBxdc3quvDSihw==} + engines: {node: '>=18.0.0'} + + '@smithy/url-parser@4.0.5': + resolution: {integrity: sha512-j+733Um7f1/DXjYhCbvNXABV53NyCRRA54C7bNEIxNPs0YjfRxeMKjjgm2jvTYrciZyCjsicHwQ6Q0ylo+NAUw==} + engines: {node: '>=18.0.0'} + + '@smithy/util-base64@4.0.0': + resolution: {integrity: sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==} + engines: {node: '>=18.0.0'} + + '@smithy/util-body-length-browser@4.0.0': + resolution: {integrity: sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==} + engines: {node: '>=18.0.0'} + + '@smithy/util-body-length-node@4.0.0': + resolution: {integrity: sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==} + engines: {node: '>=18.0.0'} + + '@smithy/util-buffer-from@2.2.0': + resolution: {integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==} + engines: {node: '>=14.0.0'} + + '@smithy/util-buffer-from@4.0.0': + resolution: {integrity: sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==} + engines: {node: '>=18.0.0'} + + '@smithy/util-config-provider@4.0.0': + resolution: {integrity: sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==} + engines: {node: '>=18.0.0'} + + '@smithy/util-defaults-mode-browser@4.0.27': + resolution: {integrity: sha512-i/Fu6AFT5014VJNgWxKomBJP/GB5uuOsM4iHdcmplLm8B1eAqnRItw4lT2qpdO+mf+6TFmf6dGcggGLAVMZJsQ==} + engines: {node: '>=18.0.0'} + + '@smithy/util-defaults-mode-node@4.0.27': + resolution: {integrity: sha512-3W0qClMyxl/ELqTA39aNw1N+pN0IjpXT7lPFvZ8zTxqVFP7XCpACB9QufmN4FQtd39xbgS7/Lekn7LmDa63I5w==} + engines: {node: '>=18.0.0'} + + '@smithy/util-endpoints@3.0.7': + resolution: {integrity: sha512-klGBP+RpBp6V5JbrY2C/VKnHXn3d5V2YrifZbmMY8os7M6m8wdYFoO6w/fe5VkP+YVwrEktW3IWYaSQVNZJ8oQ==} + engines: {node: '>=18.0.0'} + + '@smithy/util-hex-encoding@4.0.0': + resolution: {integrity: sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==} + engines: {node: '>=18.0.0'} + + '@smithy/util-middleware@4.0.5': + resolution: {integrity: sha512-N40PfqsZHRSsByGB81HhSo+uvMxEHT+9e255S53pfBw/wI6WKDI7Jw9oyu5tJTLwZzV5DsMha3ji8jk9dsHmQQ==} + engines: {node: '>=18.0.0'} + + '@smithy/util-retry@4.0.7': + resolution: {integrity: sha512-TTO6rt0ppK70alZpkjwy+3nQlTiqNfoXja+qwuAchIEAIoSZW8Qyd76dvBv3I5bCpE38APafG23Y/u270NspiQ==} + engines: {node: '>=18.0.0'} + + '@smithy/util-stream@4.2.4': + resolution: {integrity: sha512-vSKnvNZX2BXzl0U2RgCLOwWaAP9x/ddd/XobPK02pCbzRm5s55M53uwb1rl/Ts7RXZvdJZerPkA+en2FDghLuQ==} + engines: {node: '>=18.0.0'} + + '@smithy/util-uri-escape@4.0.0': + resolution: {integrity: sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==} + engines: {node: '>=18.0.0'} + + '@smithy/util-utf8@2.3.0': + resolution: {integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==} + engines: {node: '>=14.0.0'} + + '@smithy/util-utf8@4.0.0': + resolution: {integrity: sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==} + engines: {node: '>=18.0.0'} + + '@smithy/util-waiter@4.0.7': + resolution: {integrity: sha512-mYqtQXPmrwvUljaHyGxYUIIRI3qjBTEb/f5QFi3A6VlxhpmZd5mWXn9W+qUkf2pVE1Hv3SqxefiZOPGdxmO64A==} + engines: {node: '>=18.0.0'} + + '@socket.io/component-emitter@3.1.2': + resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==} + + '@standard-schema/spec@1.0.0': + resolution: {integrity: sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==} + + '@tsconfig/node10@1.0.11': + resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + + '@types/amqplib@0.10.7': + resolution: {integrity: sha512-IVj3avf9AQd2nXCx0PGk/OYq7VmHiyNxWFSb5HhU9ATh+i+gHWvVcljFTcTWQ/dyHJCTrzCixde+r/asL2ErDA==} + + '@types/aws-sdk@2.7.4': + resolution: {integrity: sha512-BdGaQDSow2hYmHbn7RV/Lg9rvh/JBD6gFRKAeCh3eqjc2eAjaz5m+cjuX1lpaWOisMeb0ep8sZBhtOLHHZ8qAA==} + deprecated: This is a stub types definition. aws-sdk provides its own type definitions, so you do not need this installed. + + '@types/bcrypt@6.0.0': + resolution: {integrity: sha512-/oJGukuH3D2+D+3H4JWLaAsJ/ji86dhRidzZ/Od7H/i8g+aCmvkeCc6Ni/f9uxGLSQVCRZkX2/lqEFG2BvWtlQ==} + + '@types/body-parser@1.19.6': + resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==} + + '@types/connect@3.4.38': + resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} + + '@types/cors@2.8.19': + resolution: {integrity: sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==} + + '@types/express-serve-static-core@5.0.7': + resolution: {integrity: sha512-R+33OsgWw7rOhD1emjU7dzCDHucJrgJXMA5PYCzJxVil0dsyx5iBEPHqpPfiKNJQb7lZ1vxwoLR4Z87bBUpeGQ==} + + '@types/express@5.0.3': + resolution: {integrity: sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw==} + + '@types/http-errors@2.0.5': + resolution: {integrity: sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==} + + '@types/joi@17.2.3': + resolution: {integrity: sha512-dGjs/lhrWOa+eO0HwgxCSnDm5eMGCsXuvLglMghJq32F6q5LyyNuXb41DHzrg501CKNOSSAHmfB7FDGeUnDmzw==} + deprecated: This is a stub types definition. joi provides its own type definitions, so you do not need this installed. + + '@types/jsonwebtoken@9.0.10': + resolution: {integrity: sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA==} + + '@types/mime@1.3.5': + resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} + + '@types/ms@2.1.0': + resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + + '@types/multer@2.0.0': + resolution: {integrity: sha512-C3Z9v9Evij2yST3RSBktxP9STm6OdMc5uR1xF1SGr98uv8dUlAL2hqwrZ3GVB3uyMyiegnscEK6PGtYvNrjTjw==} + + '@types/node@24.3.0': + resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==} + + '@types/pg@8.15.5': + resolution: {integrity: sha512-LF7lF6zWEKxuT3/OR8wAZGzkg4ENGXFNyiV/JeOt9z5B+0ZVwbql9McqX5c/WStFq1GaGso7H1AzP/qSzmlCKQ==} + + '@types/qs@6.14.0': + resolution: {integrity: sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==} + + '@types/range-parser@1.2.7': + resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} + + '@types/send@0.17.5': + resolution: {integrity: sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==} + + '@types/serve-static@1.15.8': + resolution: {integrity: sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==} + + '@types/uuid@9.0.8': + resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==} + + accepts@2.0.0: + resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} + engines: {node: '>= 0.6'} + + acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} + engines: {node: '>=0.4.0'} + + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + engines: {node: '>=0.4.0'} + hasBin: true + + amqplib@0.10.9: + resolution: {integrity: sha512-jwSftI4QjS3mizvnSnOrPGYiUnm1vI2OP1iXeOUz5pb74Ua0nbf6nPyyTzuiCLEE3fMpaJORXh2K/TQ08H5xGA==} + engines: {node: '>=10'} + + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + append-field@1.0.0: + resolution: {integrity: sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==} + + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + + aws-sdk@2.1692.0: + resolution: {integrity: sha512-x511uiJ/57FIsbgUe5csJ13k3uzu25uWQE+XqfBis/sB0SFoiElJWXRkgEAUh0U6n40eT3ay5Ue4oPkRMu1LYw==} + engines: {node: '>= 10.0.0'} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + bcrypt@6.0.0: + resolution: {integrity: sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg==} + engines: {node: '>= 18'} + + binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + + body-parser@2.2.0: + resolution: {integrity: sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==} + engines: {node: '>=18'} + + bowser@2.12.1: + resolution: {integrity: sha512-z4rE2Gxh7tvshQ4hluIT7XcFrgLIQaw9X3A+kTTRdovCz5PMukm/0QC/BKSYPj3omF5Qfypn9O/c5kgpmvYUCw==} + + brace-expansion@1.1.12: + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + buffer-equal-constant-time@1.0.1: + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} + + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + + buffer-more-ints@1.0.0: + resolution: {integrity: sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==} + + buffer@4.9.2: + resolution: {integrity: sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==} + + busboy@1.6.0: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + + c12@3.1.0: + resolution: {integrity: sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==} + peerDependencies: + magicast: ^0.3.5 + peerDependenciesMeta: + magicast: + optional: true + + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + + chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} + + citty@0.1.6: + resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + concat-stream@2.0.0: + resolution: {integrity: sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==} + engines: {'0': node >= 6.0} + + confbox@0.2.2: + resolution: {integrity: sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==} + + consola@3.4.2: + resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} + engines: {node: ^14.18.0 || >=16.10.0} + + content-disposition@1.0.0: + resolution: {integrity: sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==} + engines: {node: '>= 0.6'} + + content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + + cookie-signature@1.2.2: + resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} + engines: {node: '>=6.6.0'} + + cookie@0.7.2: + resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} + engines: {node: '>= 0.6'} + + cors@2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + + debug@4.3.7: + resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + debug@4.4.1: + resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deepmerge-ts@7.1.5: + resolution: {integrity: sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==} + engines: {node: '>=16.0.0'} + + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + + diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + + dotenv@16.6.1: + resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==} + engines: {node: '>=12'} + + dotenv@17.2.1: + resolution: {integrity: sha512-kQhDYKZecqnM0fCnzI5eIv5L4cAe/iRI+HqMbO/hbRdTAeXDG+M9FjipUxNfbARuEg4iHIbhnhs78BCHNbSxEQ==} + engines: {node: '>=12'} + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + ecdsa-sig-formatter@1.0.11: + resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + effect@3.16.12: + resolution: {integrity: sha512-N39iBk0K71F9nb442TLbTkjl24FLUzuvx2i1I2RsEAQsdAdUTuUoW0vlfUXgkMTUOnYqKnWcFfqw4hK4Pw27hg==} + + empathic@2.0.0: + resolution: {integrity: sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==} + engines: {node: '>=14'} + + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + + engine.io-client@6.6.3: + resolution: {integrity: sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==} + + engine.io-parser@5.2.3: + resolution: {integrity: sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==} + engines: {node: '>=10.0.0'} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + + etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + + events@1.1.1: + resolution: {integrity: sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==} + engines: {node: '>=0.4.x'} + + express-rate-limit@8.0.1: + resolution: {integrity: sha512-aZVCnybn7TVmxO4BtlmnvX+nuz8qHW124KKJ8dumsBsmv5ZLxE0pYu7S2nwyRBGHHCAzdmnGyrc5U/rksSPO7Q==} + engines: {node: '>= 16'} + peerDependencies: + express: '>= 4.11' + + express@5.1.0: + resolution: {integrity: sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==} + engines: {node: '>= 18'} + + exsolve@1.0.7: + resolution: {integrity: sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==} + + fast-check@3.23.2: + resolution: {integrity: sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==} + engines: {node: '>=8.0.0'} + + fast-xml-parser@5.2.5: + resolution: {integrity: sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==} + hasBin: true + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + finalhandler@2.1.0: + resolution: {integrity: sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==} + engines: {node: '>= 0.8'} + + for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} + + forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + + fresh@2.0.0: + resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} + engines: {node: '>= 0.8'} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + giget@2.0.0: + resolution: {integrity: sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==} + hasBin: true + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + + iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + + ieee754@1.1.13: + resolution: {integrity: sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==} + + ignore-by-default@1.0.1: + resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + ip-address@10.0.1: + resolution: {integrity: sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==} + engines: {node: '>= 12'} + + ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + + is-arguments@1.2.0: + resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==} + engines: {node: '>= 0.4'} + + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-generator-function@1.1.0: + resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==} + engines: {node: '>= 0.4'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-promise@4.0.0: + resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} + + is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} + engines: {node: '>= 0.4'} + + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + + isarray@1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + + jiti@2.5.1: + resolution: {integrity: sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==} + hasBin: true + + jmespath@0.16.0: + resolution: {integrity: sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==} + engines: {node: '>= 0.6.0'} + + joi@17.13.3: + resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} + + jsonwebtoken@9.0.2: + resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} + engines: {node: '>=12', npm: '>=6'} + + jwa@1.4.2: + resolution: {integrity: sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==} + + jws@3.2.2: + resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} + + lodash.includes@4.3.0: + resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} + + lodash.isboolean@3.0.3: + resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} + + lodash.isinteger@4.0.4: + resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==} + + lodash.isnumber@3.0.3: + resolution: {integrity: sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==} + + lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + + lodash.isstring@4.0.1: + resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} + + lodash.once@4.1.1: + resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} + + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + + media-typer@1.1.0: + resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} + engines: {node: '>= 0.8'} + + merge-descriptors@2.0.0: + resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} + engines: {node: '>=18'} + + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + mime-types@3.0.1: + resolution: {integrity: sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==} + engines: {node: '>= 0.6'} + + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + multer@2.0.2: + resolution: {integrity: sha512-u7f2xaZ/UG8oLXHvtF/oWTRvT44p9ecwBBqTwgJVq0+4BW1g8OW01TyMEGWBHbyMOYVHXslaut7qEQ1meATXgw==} + engines: {node: '>= 10.16.0'} + + negotiator@1.0.0: + resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} + engines: {node: '>= 0.6'} + + node-addon-api@8.5.0: + resolution: {integrity: sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==} + engines: {node: ^18 || ^20 || >= 21} + + node-fetch-native@1.6.7: + resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==} + + node-gyp-build@4.8.4: + resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} + hasBin: true + + nodemon@3.1.10: + resolution: {integrity: sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==} + engines: {node: '>=10'} + hasBin: true + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + nypm@0.6.1: + resolution: {integrity: sha512-hlacBiRiv1k9hZFiphPUkfSQ/ZfQzZDzC+8z0wL3lvDAOUu/2NnChkKuMoMjNur/9OpKuz2QsIeiPVN0xM5Q0w==} + engines: {node: ^14.16.0 || >=16.10.0} + hasBin: true + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + ohash@2.0.11: + resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + + path-to-regexp@8.2.0: + resolution: {integrity: sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==} + engines: {node: '>=16'} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + + pg-cloudflare@1.2.7: + resolution: {integrity: sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==} + + pg-connection-string@2.9.1: + resolution: {integrity: sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==} + + pg-int8@1.0.1: + resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} + engines: {node: '>=4.0.0'} + + pg-pool@3.10.1: + resolution: {integrity: sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==} + peerDependencies: + pg: '>=8.0' + + pg-protocol@1.10.3: + resolution: {integrity: sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==} + + pg-types@2.2.0: + resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} + engines: {node: '>=4'} + + pg@8.16.3: + resolution: {integrity: sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==} + engines: {node: '>= 16.0.0'} + peerDependencies: + pg-native: '>=3.0.1' + peerDependenciesMeta: + pg-native: + optional: true + + pgpass@1.0.5: + resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + pkg-types@2.3.0: + resolution: {integrity: sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==} + + possible-typed-array-names@1.1.0: + resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} + engines: {node: '>= 0.4'} + + postgres-array@2.0.0: + resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} + engines: {node: '>=4'} + + postgres-bytea@1.0.0: + resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} + engines: {node: '>=0.10.0'} + + postgres-date@1.0.7: + resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} + engines: {node: '>=0.10.0'} + + postgres-interval@1.2.0: + resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} + engines: {node: '>=0.10.0'} + + prisma@6.15.0: + resolution: {integrity: sha512-E6RCgOt+kUVtjtZgLQDBJ6md2tDItLJNExwI0XJeBc1FKL+Vwb+ovxXxuok9r8oBgsOXBA33fGDuE/0qDdCWqQ==} + engines: {node: '>=18.18'} + hasBin: true + peerDependencies: + typescript: '>=5.1.0' + peerDependenciesMeta: + typescript: + optional: true + + proxy-addr@2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + + pstree.remy@1.1.8: + resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==} + + punycode@1.3.2: + resolution: {integrity: sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==} + + pure-rand@6.1.0: + resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + + qs@6.14.0: + resolution: {integrity: sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==} + engines: {node: '>=0.6'} + + querystring@0.2.0: + resolution: {integrity: sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==} + engines: {node: '>=0.4.x'} + deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. + + querystringify@2.2.0: + resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} + + range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + + raw-body@3.0.0: + resolution: {integrity: sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==} + engines: {node: '>= 0.8'} + + rc9@2.1.2: + resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} + + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + readdirp@4.1.2: + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} + engines: {node: '>= 14.18.0'} + + requires-port@1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + + router@2.2.0: + resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} + engines: {node: '>= 18'} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + safe-regex-test@1.1.0: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} + engines: {node: '>= 0.4'} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + sax@1.2.1: + resolution: {integrity: sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==} + + semver@7.7.2: + resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} + engines: {node: '>=10'} + hasBin: true + + send@1.2.0: + resolution: {integrity: sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==} + engines: {node: '>= 18'} + + serve-static@2.2.0: + resolution: {integrity: sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==} + engines: {node: '>= 18'} + + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + side-channel-list@1.0.0: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + engines: {node: '>= 0.4'} + + simple-update-notifier@2.0.0: + resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} + engines: {node: '>=10'} + + socket.io-client@4.8.1: + resolution: {integrity: sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==} + engines: {node: '>=10.0.0'} + + socket.io-parser@4.2.4: + resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==} + engines: {node: '>=10.0.0'} + + split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + + statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + + streamsearch@1.1.0: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + + strnum@2.1.1: + resolution: {integrity: sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==} + + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + + tinyexec@1.0.1: + resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + + touch@3.1.1: + resolution: {integrity: sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==} + hasBin: true + + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + 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 + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + + type-is@2.0.1: + resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} + engines: {node: '>= 0.6'} + + typedarray@0.0.6: + resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} + engines: {node: '>=14.17'} + hasBin: true + + undefsafe@2.0.5: + resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==} + + undici-types@7.10.0: + resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} + + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + + url-parse@1.5.10: + resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + + url@0.10.3: + resolution: {integrity: sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==} + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + util@0.12.5: + resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + + uuid@8.0.0: + resolution: {integrity: sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==} + hasBin: true + + uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + + which-typed-array@1.1.19: + resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} + engines: {node: '>= 0.4'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + ws@8.17.1: + resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} + 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 + + xml2js@0.6.2: + resolution: {integrity: sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==} + engines: {node: '>=4.0.0'} + + xmlbuilder@11.0.1: + resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==} + engines: {node: '>=4.0'} + + xmlhttprequest-ssl@2.1.2: + resolution: {integrity: sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==} + engines: {node: '>=0.4.0'} + + xtend@4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + +snapshots: + + '@aws-crypto/crc32@5.2.0': + dependencies: + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.862.0 + tslib: 2.8.1 + + '@aws-crypto/crc32c@5.2.0': + dependencies: + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.862.0 + tslib: 2.8.1 + + '@aws-crypto/sha1-browser@5.2.0': + dependencies: + '@aws-crypto/supports-web-crypto': 5.2.0 + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-locate-window': 3.873.0 + '@smithy/util-utf8': 2.3.0 + tslib: 2.8.1 + + '@aws-crypto/sha256-browser@5.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.862.0 + '@aws-sdk/util-locate-window': 3.873.0 + '@smithy/util-utf8': 2.3.0 + tslib: 2.8.1 + + '@aws-crypto/sha256-js@5.2.0': + dependencies: + '@aws-crypto/util': 5.2.0 + '@aws-sdk/types': 3.862.0 + tslib: 2.8.1 + + '@aws-crypto/supports-web-crypto@5.2.0': + dependencies: + tslib: 2.8.1 + + '@aws-crypto/util@5.2.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/util-utf8': 2.3.0 + tslib: 2.8.1 + + '@aws-sdk/client-s3@3.878.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.876.0 + '@aws-sdk/credential-provider-node': 3.876.0 + '@aws-sdk/middleware-bucket-endpoint': 3.873.0 + '@aws-sdk/middleware-expect-continue': 3.873.0 + '@aws-sdk/middleware-flexible-checksums': 3.878.0 + '@aws-sdk/middleware-host-header': 3.873.0 + '@aws-sdk/middleware-location-constraint': 3.873.0 + '@aws-sdk/middleware-logger': 3.876.0 + '@aws-sdk/middleware-recursion-detection': 3.873.0 + '@aws-sdk/middleware-sdk-s3': 3.876.0 + '@aws-sdk/middleware-ssec': 3.873.0 + '@aws-sdk/middleware-user-agent': 3.876.0 + '@aws-sdk/region-config-resolver': 3.873.0 + '@aws-sdk/signature-v4-multi-region': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-endpoints': 3.873.0 + '@aws-sdk/util-user-agent-browser': 3.873.0 + '@aws-sdk/util-user-agent-node': 3.876.0 + '@aws-sdk/xml-builder': 3.873.0 + '@smithy/config-resolver': 4.1.5 + '@smithy/core': 3.9.0 + '@smithy/eventstream-serde-browser': 4.0.5 + '@smithy/eventstream-serde-config-resolver': 4.1.3 + '@smithy/eventstream-serde-node': 4.0.5 + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/hash-blob-browser': 4.0.5 + '@smithy/hash-node': 4.0.5 + '@smithy/hash-stream-node': 4.0.5 + '@smithy/invalid-dependency': 4.0.5 + '@smithy/md5-js': 4.0.5 + '@smithy/middleware-content-length': 4.0.5 + '@smithy/middleware-endpoint': 4.1.19 + '@smithy/middleware-retry': 4.1.20 + '@smithy/middleware-serde': 4.0.9 + '@smithy/middleware-stack': 4.0.5 + '@smithy/node-config-provider': 4.1.4 + '@smithy/node-http-handler': 4.1.1 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.27 + '@smithy/util-defaults-mode-node': 4.0.27 + '@smithy/util-endpoints': 3.0.7 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-retry': 4.0.7 + '@smithy/util-stream': 4.2.4 + '@smithy/util-utf8': 4.0.0 + '@smithy/util-waiter': 4.0.7 + '@types/uuid': 9.0.8 + tslib: 2.8.1 + uuid: 9.0.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/client-ses@3.879.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.879.0 + '@aws-sdk/credential-provider-node': 3.879.0 + '@aws-sdk/middleware-host-header': 3.873.0 + '@aws-sdk/middleware-logger': 3.876.0 + '@aws-sdk/middleware-recursion-detection': 3.873.0 + '@aws-sdk/middleware-user-agent': 3.879.0 + '@aws-sdk/region-config-resolver': 3.873.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-endpoints': 3.879.0 + '@aws-sdk/util-user-agent-browser': 3.873.0 + '@aws-sdk/util-user-agent-node': 3.879.0 + '@smithy/config-resolver': 4.1.5 + '@smithy/core': 3.9.0 + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/hash-node': 4.0.5 + '@smithy/invalid-dependency': 4.0.5 + '@smithy/middleware-content-length': 4.0.5 + '@smithy/middleware-endpoint': 4.1.19 + '@smithy/middleware-retry': 4.1.20 + '@smithy/middleware-serde': 4.0.9 + '@smithy/middleware-stack': 4.0.5 + '@smithy/node-config-provider': 4.1.4 + '@smithy/node-http-handler': 4.1.1 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.27 + '@smithy/util-defaults-mode-node': 4.0.27 + '@smithy/util-endpoints': 3.0.7 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-retry': 4.0.7 + '@smithy/util-utf8': 4.0.0 + '@smithy/util-waiter': 4.0.7 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/client-sso@3.876.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.876.0 + '@aws-sdk/middleware-host-header': 3.873.0 + '@aws-sdk/middleware-logger': 3.876.0 + '@aws-sdk/middleware-recursion-detection': 3.873.0 + '@aws-sdk/middleware-user-agent': 3.876.0 + '@aws-sdk/region-config-resolver': 3.873.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-endpoints': 3.873.0 + '@aws-sdk/util-user-agent-browser': 3.873.0 + '@aws-sdk/util-user-agent-node': 3.876.0 + '@smithy/config-resolver': 4.1.5 + '@smithy/core': 3.9.0 + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/hash-node': 4.0.5 + '@smithy/invalid-dependency': 4.0.5 + '@smithy/middleware-content-length': 4.0.5 + '@smithy/middleware-endpoint': 4.1.19 + '@smithy/middleware-retry': 4.1.20 + '@smithy/middleware-serde': 4.0.9 + '@smithy/middleware-stack': 4.0.5 + '@smithy/node-config-provider': 4.1.4 + '@smithy/node-http-handler': 4.1.1 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.27 + '@smithy/util-defaults-mode-node': 4.0.27 + '@smithy/util-endpoints': 3.0.7 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-retry': 4.0.7 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/client-sso@3.879.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.879.0 + '@aws-sdk/middleware-host-header': 3.873.0 + '@aws-sdk/middleware-logger': 3.876.0 + '@aws-sdk/middleware-recursion-detection': 3.873.0 + '@aws-sdk/middleware-user-agent': 3.879.0 + '@aws-sdk/region-config-resolver': 3.873.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-endpoints': 3.879.0 + '@aws-sdk/util-user-agent-browser': 3.873.0 + '@aws-sdk/util-user-agent-node': 3.879.0 + '@smithy/config-resolver': 4.1.5 + '@smithy/core': 3.9.0 + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/hash-node': 4.0.5 + '@smithy/invalid-dependency': 4.0.5 + '@smithy/middleware-content-length': 4.0.5 + '@smithy/middleware-endpoint': 4.1.19 + '@smithy/middleware-retry': 4.1.20 + '@smithy/middleware-serde': 4.0.9 + '@smithy/middleware-stack': 4.0.5 + '@smithy/node-config-provider': 4.1.4 + '@smithy/node-http-handler': 4.1.1 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.27 + '@smithy/util-defaults-mode-node': 4.0.27 + '@smithy/util-endpoints': 3.0.7 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-retry': 4.0.7 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/core@3.876.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@aws-sdk/xml-builder': 3.873.0 + '@smithy/core': 3.9.0 + '@smithy/node-config-provider': 4.1.4 + '@smithy/property-provider': 4.0.5 + '@smithy/protocol-http': 5.1.3 + '@smithy/signature-v4': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-utf8': 4.0.0 + fast-xml-parser: 5.2.5 + tslib: 2.8.1 + + '@aws-sdk/core@3.879.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@aws-sdk/xml-builder': 3.873.0 + '@smithy/core': 3.9.0 + '@smithy/node-config-provider': 4.1.4 + '@smithy/property-provider': 4.0.5 + '@smithy/protocol-http': 5.1.3 + '@smithy/signature-v4': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-utf8': 4.0.0 + fast-xml-parser: 5.2.5 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-env@3.876.0': + dependencies: + '@aws-sdk/core': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-env@3.879.0': + dependencies: + '@aws-sdk/core': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-http@3.876.0': + dependencies: + '@aws-sdk/core': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/node-http-handler': 4.1.1 + '@smithy/property-provider': 4.0.5 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/util-stream': 4.2.4 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-http@3.879.0': + dependencies: + '@aws-sdk/core': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/node-http-handler': 4.1.1 + '@smithy/property-provider': 4.0.5 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/util-stream': 4.2.4 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-ini@3.876.0': + dependencies: + '@aws-sdk/core': 3.876.0 + '@aws-sdk/credential-provider-env': 3.876.0 + '@aws-sdk/credential-provider-http': 3.876.0 + '@aws-sdk/credential-provider-process': 3.876.0 + '@aws-sdk/credential-provider-sso': 3.876.0 + '@aws-sdk/credential-provider-web-identity': 3.876.0 + '@aws-sdk/nested-clients': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/credential-provider-imds': 4.0.7 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-ini@3.879.0': + dependencies: + '@aws-sdk/core': 3.879.0 + '@aws-sdk/credential-provider-env': 3.879.0 + '@aws-sdk/credential-provider-http': 3.879.0 + '@aws-sdk/credential-provider-process': 3.879.0 + '@aws-sdk/credential-provider-sso': 3.879.0 + '@aws-sdk/credential-provider-web-identity': 3.879.0 + '@aws-sdk/nested-clients': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/credential-provider-imds': 4.0.7 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-node@3.876.0': + dependencies: + '@aws-sdk/credential-provider-env': 3.876.0 + '@aws-sdk/credential-provider-http': 3.876.0 + '@aws-sdk/credential-provider-ini': 3.876.0 + '@aws-sdk/credential-provider-process': 3.876.0 + '@aws-sdk/credential-provider-sso': 3.876.0 + '@aws-sdk/credential-provider-web-identity': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/credential-provider-imds': 4.0.7 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-node@3.879.0': + dependencies: + '@aws-sdk/credential-provider-env': 3.879.0 + '@aws-sdk/credential-provider-http': 3.879.0 + '@aws-sdk/credential-provider-ini': 3.879.0 + '@aws-sdk/credential-provider-process': 3.879.0 + '@aws-sdk/credential-provider-sso': 3.879.0 + '@aws-sdk/credential-provider-web-identity': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/credential-provider-imds': 4.0.7 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-process@3.876.0': + dependencies: + '@aws-sdk/core': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-process@3.879.0': + dependencies: + '@aws-sdk/core': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-sso@3.876.0': + dependencies: + '@aws-sdk/client-sso': 3.876.0 + '@aws-sdk/core': 3.876.0 + '@aws-sdk/token-providers': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-sso@3.879.0': + dependencies: + '@aws-sdk/client-sso': 3.879.0 + '@aws-sdk/core': 3.879.0 + '@aws-sdk/token-providers': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-web-identity@3.876.0': + dependencies: + '@aws-sdk/core': 3.876.0 + '@aws-sdk/nested-clients': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/credential-provider-web-identity@3.879.0': + dependencies: + '@aws-sdk/core': 3.879.0 + '@aws-sdk/nested-clients': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/middleware-bucket-endpoint@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-arn-parser': 3.873.0 + '@smithy/node-config-provider': 4.1.4 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + '@smithy/util-config-provider': 4.0.0 + tslib: 2.8.1 + + '@aws-sdk/middleware-expect-continue@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/middleware-flexible-checksums@3.878.0': + dependencies: + '@aws-crypto/crc32': 5.2.0 + '@aws-crypto/crc32c': 5.2.0 + '@aws-crypto/util': 5.2.0 + '@aws-sdk/core': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/is-array-buffer': 4.0.0 + '@smithy/node-config-provider': 4.1.4 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-stream': 4.2.4 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + + '@aws-sdk/middleware-host-header@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/middleware-location-constraint@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/middleware-logger@3.876.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/middleware-recursion-detection@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/middleware-sdk-s3@3.876.0': + dependencies: + '@aws-sdk/core': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-arn-parser': 3.873.0 + '@smithy/core': 3.9.0 + '@smithy/node-config-provider': 4.1.4 + '@smithy/protocol-http': 5.1.3 + '@smithy/signature-v4': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/util-config-provider': 4.0.0 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-stream': 4.2.4 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + + '@aws-sdk/middleware-ssec@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/middleware-user-agent@3.876.0': + dependencies: + '@aws-sdk/core': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-endpoints': 3.873.0 + '@smithy/core': 3.9.0 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/middleware-user-agent@3.879.0': + dependencies: + '@aws-sdk/core': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-endpoints': 3.879.0 + '@smithy/core': 3.9.0 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/nested-clients@3.876.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.876.0 + '@aws-sdk/middleware-host-header': 3.873.0 + '@aws-sdk/middleware-logger': 3.876.0 + '@aws-sdk/middleware-recursion-detection': 3.873.0 + '@aws-sdk/middleware-user-agent': 3.876.0 + '@aws-sdk/region-config-resolver': 3.873.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-endpoints': 3.873.0 + '@aws-sdk/util-user-agent-browser': 3.873.0 + '@aws-sdk/util-user-agent-node': 3.876.0 + '@smithy/config-resolver': 4.1.5 + '@smithy/core': 3.9.0 + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/hash-node': 4.0.5 + '@smithy/invalid-dependency': 4.0.5 + '@smithy/middleware-content-length': 4.0.5 + '@smithy/middleware-endpoint': 4.1.19 + '@smithy/middleware-retry': 4.1.20 + '@smithy/middleware-serde': 4.0.9 + '@smithy/middleware-stack': 4.0.5 + '@smithy/node-config-provider': 4.1.4 + '@smithy/node-http-handler': 4.1.1 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.27 + '@smithy/util-defaults-mode-node': 4.0.27 + '@smithy/util-endpoints': 3.0.7 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-retry': 4.0.7 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/nested-clients@3.879.0': + dependencies: + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.879.0 + '@aws-sdk/middleware-host-header': 3.873.0 + '@aws-sdk/middleware-logger': 3.876.0 + '@aws-sdk/middleware-recursion-detection': 3.873.0 + '@aws-sdk/middleware-user-agent': 3.879.0 + '@aws-sdk/region-config-resolver': 3.873.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-endpoints': 3.879.0 + '@aws-sdk/util-user-agent-browser': 3.873.0 + '@aws-sdk/util-user-agent-node': 3.879.0 + '@smithy/config-resolver': 4.1.5 + '@smithy/core': 3.9.0 + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/hash-node': 4.0.5 + '@smithy/invalid-dependency': 4.0.5 + '@smithy/middleware-content-length': 4.0.5 + '@smithy/middleware-endpoint': 4.1.19 + '@smithy/middleware-retry': 4.1.20 + '@smithy/middleware-serde': 4.0.9 + '@smithy/middleware-stack': 4.0.5 + '@smithy/node-config-provider': 4.1.4 + '@smithy/node-http-handler': 4.1.1 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.27 + '@smithy/util-defaults-mode-node': 4.0.27 + '@smithy/util-endpoints': 3.0.7 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-retry': 4.0.7 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/region-config-resolver@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/node-config-provider': 4.1.4 + '@smithy/types': 4.3.2 + '@smithy/util-config-provider': 4.0.0 + '@smithy/util-middleware': 4.0.5 + tslib: 2.8.1 + + '@aws-sdk/s3-request-presigner@3.878.0': + dependencies: + '@aws-sdk/signature-v4-multi-region': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@aws-sdk/util-format-url': 3.873.0 + '@smithy/middleware-endpoint': 4.1.19 + '@smithy/protocol-http': 5.1.3 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/signature-v4-multi-region@3.876.0': + dependencies: + '@aws-sdk/middleware-sdk-s3': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/protocol-http': 5.1.3 + '@smithy/signature-v4': 5.1.3 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/token-providers@3.876.0': + dependencies: + '@aws-sdk/core': 3.876.0 + '@aws-sdk/nested-clients': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/token-providers@3.879.0': + dependencies: + '@aws-sdk/core': 3.879.0 + '@aws-sdk/nested-clients': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt + + '@aws-sdk/types@3.862.0': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/util-arn-parser@3.873.0': + dependencies: + tslib: 2.8.1 + + '@aws-sdk/util-endpoints@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-endpoints': 3.0.7 + tslib: 2.8.1 + + '@aws-sdk/util-endpoints@3.879.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-endpoints': 3.0.7 + tslib: 2.8.1 + + '@aws-sdk/util-format-url@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/querystring-builder': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/util-locate-window@3.873.0': + dependencies: + tslib: 2.8.1 + + '@aws-sdk/util-user-agent-browser@3.873.0': + dependencies: + '@aws-sdk/types': 3.862.0 + '@smithy/types': 4.3.2 + bowser: 2.12.1 + tslib: 2.8.1 + + '@aws-sdk/util-user-agent-node@3.876.0': + dependencies: + '@aws-sdk/middleware-user-agent': 3.876.0 + '@aws-sdk/types': 3.862.0 + '@smithy/node-config-provider': 4.1.4 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/util-user-agent-node@3.879.0': + dependencies: + '@aws-sdk/middleware-user-agent': 3.879.0 + '@aws-sdk/types': 3.862.0 + '@smithy/node-config-provider': 4.1.4 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@aws-sdk/xml-builder@3.873.0': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + + '@hapi/hoek@9.3.0': {} + + '@hapi/topo@5.1.0': + dependencies: + '@hapi/hoek': 9.3.0 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2)': + optionalDependencies: + prisma: 6.15.0(typescript@5.9.2) + typescript: 5.9.2 + + '@prisma/config@6.15.0': + dependencies: + c12: 3.1.0 + deepmerge-ts: 7.1.5 + effect: 3.16.12 + empathic: 2.0.0 + transitivePeerDependencies: + - magicast + + '@prisma/debug@6.15.0': {} + + '@prisma/engines-version@6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb': {} + + '@prisma/engines@6.15.0': + dependencies: + '@prisma/debug': 6.15.0 + '@prisma/engines-version': 6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb + '@prisma/fetch-engine': 6.15.0 + '@prisma/get-platform': 6.15.0 + + '@prisma/fetch-engine@6.15.0': + dependencies: + '@prisma/debug': 6.15.0 + '@prisma/engines-version': 6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb + '@prisma/get-platform': 6.15.0 + + '@prisma/get-platform@6.15.0': + dependencies: + '@prisma/debug': 6.15.0 + + '@sideway/address@4.1.5': + dependencies: + '@hapi/hoek': 9.3.0 + + '@sideway/formula@3.0.1': {} + + '@sideway/pinpoint@2.0.0': {} + + '@smithy/abort-controller@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/chunked-blob-reader-native@4.0.0': + dependencies: + '@smithy/util-base64': 4.0.0 + tslib: 2.8.1 + + '@smithy/chunked-blob-reader@5.0.0': + dependencies: + tslib: 2.8.1 + + '@smithy/config-resolver@4.1.5': + dependencies: + '@smithy/node-config-provider': 4.1.4 + '@smithy/types': 4.3.2 + '@smithy/util-config-provider': 4.0.0 + '@smithy/util-middleware': 4.0.5 + tslib: 2.8.1 + + '@smithy/core@3.9.0': + dependencies: + '@smithy/middleware-serde': 4.0.9 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-stream': 4.2.4 + '@smithy/util-utf8': 4.0.0 + '@types/uuid': 9.0.8 + tslib: 2.8.1 + uuid: 9.0.1 + + '@smithy/credential-provider-imds@4.0.7': + dependencies: + '@smithy/node-config-provider': 4.1.4 + '@smithy/property-provider': 4.0.5 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + tslib: 2.8.1 + + '@smithy/eventstream-codec@4.0.5': + dependencies: + '@aws-crypto/crc32': 5.2.0 + '@smithy/types': 4.3.2 + '@smithy/util-hex-encoding': 4.0.0 + tslib: 2.8.1 + + '@smithy/eventstream-serde-browser@4.0.5': + dependencies: + '@smithy/eventstream-serde-universal': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/eventstream-serde-config-resolver@4.1.3': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/eventstream-serde-node@4.0.5': + dependencies: + '@smithy/eventstream-serde-universal': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/eventstream-serde-universal@4.0.5': + dependencies: + '@smithy/eventstream-codec': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/fetch-http-handler@5.1.1': + dependencies: + '@smithy/protocol-http': 5.1.3 + '@smithy/querystring-builder': 4.0.5 + '@smithy/types': 4.3.2 + '@smithy/util-base64': 4.0.0 + tslib: 2.8.1 + + '@smithy/hash-blob-browser@4.0.5': + dependencies: + '@smithy/chunked-blob-reader': 5.0.0 + '@smithy/chunked-blob-reader-native': 4.0.0 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/hash-node@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + '@smithy/util-buffer-from': 4.0.0 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + + '@smithy/hash-stream-node@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + + '@smithy/invalid-dependency@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/is-array-buffer@2.2.0': + dependencies: + tslib: 2.8.1 + + '@smithy/is-array-buffer@4.0.0': + dependencies: + tslib: 2.8.1 + + '@smithy/md5-js@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + + '@smithy/middleware-content-length@4.0.5': + dependencies: + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/middleware-endpoint@4.1.19': + dependencies: + '@smithy/core': 3.9.0 + '@smithy/middleware-serde': 4.0.9 + '@smithy/node-config-provider': 4.1.4 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + '@smithy/url-parser': 4.0.5 + '@smithy/util-middleware': 4.0.5 + tslib: 2.8.1 + + '@smithy/middleware-retry@4.1.20': + dependencies: + '@smithy/node-config-provider': 4.1.4 + '@smithy/protocol-http': 5.1.3 + '@smithy/service-error-classification': 4.0.7 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-retry': 4.0.7 + '@types/uuid': 9.0.8 + tslib: 2.8.1 + uuid: 9.0.1 + + '@smithy/middleware-serde@4.0.9': + dependencies: + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/middleware-stack@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/node-config-provider@4.1.4': + dependencies: + '@smithy/property-provider': 4.0.5 + '@smithy/shared-ini-file-loader': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/node-http-handler@4.1.1': + dependencies: + '@smithy/abort-controller': 4.0.5 + '@smithy/protocol-http': 5.1.3 + '@smithy/querystring-builder': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/property-provider@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/protocol-http@5.1.3': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/querystring-builder@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + '@smithy/util-uri-escape': 4.0.0 + tslib: 2.8.1 + + '@smithy/querystring-parser@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/service-error-classification@4.0.7': + dependencies: + '@smithy/types': 4.3.2 + + '@smithy/shared-ini-file-loader@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/signature-v4@5.1.3': + dependencies: + '@smithy/is-array-buffer': 4.0.0 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + '@smithy/util-hex-encoding': 4.0.0 + '@smithy/util-middleware': 4.0.5 + '@smithy/util-uri-escape': 4.0.0 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + + '@smithy/smithy-client@4.5.0': + dependencies: + '@smithy/core': 3.9.0 + '@smithy/middleware-endpoint': 4.1.19 + '@smithy/middleware-stack': 4.0.5 + '@smithy/protocol-http': 5.1.3 + '@smithy/types': 4.3.2 + '@smithy/util-stream': 4.2.4 + tslib: 2.8.1 + + '@smithy/types@4.3.2': + dependencies: + tslib: 2.8.1 + + '@smithy/url-parser@4.0.5': + dependencies: + '@smithy/querystring-parser': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/util-base64@4.0.0': + dependencies: + '@smithy/util-buffer-from': 4.0.0 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + + '@smithy/util-body-length-browser@4.0.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-body-length-node@4.0.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-buffer-from@2.2.0': + dependencies: + '@smithy/is-array-buffer': 2.2.0 + tslib: 2.8.1 + + '@smithy/util-buffer-from@4.0.0': + dependencies: + '@smithy/is-array-buffer': 4.0.0 + tslib: 2.8.1 + + '@smithy/util-config-provider@4.0.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-defaults-mode-browser@4.0.27': + dependencies: + '@smithy/property-provider': 4.0.5 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + bowser: 2.12.1 + tslib: 2.8.1 + + '@smithy/util-defaults-mode-node@4.0.27': + dependencies: + '@smithy/config-resolver': 4.1.5 + '@smithy/credential-provider-imds': 4.0.7 + '@smithy/node-config-provider': 4.1.4 + '@smithy/property-provider': 4.0.5 + '@smithy/smithy-client': 4.5.0 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/util-endpoints@3.0.7': + dependencies: + '@smithy/node-config-provider': 4.1.4 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/util-hex-encoding@4.0.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-middleware@4.0.5': + dependencies: + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/util-retry@4.0.7': + dependencies: + '@smithy/service-error-classification': 4.0.7 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@smithy/util-stream@4.2.4': + dependencies: + '@smithy/fetch-http-handler': 5.1.1 + '@smithy/node-http-handler': 4.1.1 + '@smithy/types': 4.3.2 + '@smithy/util-base64': 4.0.0 + '@smithy/util-buffer-from': 4.0.0 + '@smithy/util-hex-encoding': 4.0.0 + '@smithy/util-utf8': 4.0.0 + tslib: 2.8.1 + + '@smithy/util-uri-escape@4.0.0': + dependencies: + tslib: 2.8.1 + + '@smithy/util-utf8@2.3.0': + dependencies: + '@smithy/util-buffer-from': 2.2.0 + tslib: 2.8.1 + + '@smithy/util-utf8@4.0.0': + dependencies: + '@smithy/util-buffer-from': 4.0.0 + tslib: 2.8.1 + + '@smithy/util-waiter@4.0.7': + dependencies: + '@smithy/abort-controller': 4.0.5 + '@smithy/types': 4.3.2 + tslib: 2.8.1 + + '@socket.io/component-emitter@3.1.2': {} + + '@standard-schema/spec@1.0.0': {} + + '@tsconfig/node10@1.0.11': {} + + '@tsconfig/node12@1.0.11': {} + + '@tsconfig/node14@1.0.3': {} + + '@tsconfig/node16@1.0.4': {} + + '@types/amqplib@0.10.7': + dependencies: + '@types/node': 24.3.0 + + '@types/aws-sdk@2.7.4': + dependencies: + aws-sdk: 2.1692.0 + + '@types/bcrypt@6.0.0': + dependencies: + '@types/node': 24.3.0 + + '@types/body-parser@1.19.6': + dependencies: + '@types/connect': 3.4.38 + '@types/node': 24.3.0 + + '@types/connect@3.4.38': + dependencies: + '@types/node': 24.3.0 + + '@types/cors@2.8.19': + dependencies: + '@types/node': 24.3.0 + + '@types/express-serve-static-core@5.0.7': + dependencies: + '@types/node': 24.3.0 + '@types/qs': 6.14.0 + '@types/range-parser': 1.2.7 + '@types/send': 0.17.5 + + '@types/express@5.0.3': + dependencies: + '@types/body-parser': 1.19.6 + '@types/express-serve-static-core': 5.0.7 + '@types/serve-static': 1.15.8 + + '@types/http-errors@2.0.5': {} + + '@types/joi@17.2.3': + dependencies: + joi: 17.13.3 + + '@types/jsonwebtoken@9.0.10': + dependencies: + '@types/ms': 2.1.0 + '@types/node': 24.3.0 + + '@types/mime@1.3.5': {} + + '@types/ms@2.1.0': {} + + '@types/multer@2.0.0': + dependencies: + '@types/express': 5.0.3 + + '@types/node@24.3.0': + dependencies: + undici-types: 7.10.0 + + '@types/pg@8.15.5': + dependencies: + '@types/node': 24.3.0 + pg-protocol: 1.10.3 + pg-types: 2.2.0 + + '@types/qs@6.14.0': {} + + '@types/range-parser@1.2.7': {} + + '@types/send@0.17.5': + dependencies: + '@types/mime': 1.3.5 + '@types/node': 24.3.0 + + '@types/serve-static@1.15.8': + dependencies: + '@types/http-errors': 2.0.5 + '@types/node': 24.3.0 + '@types/send': 0.17.5 + + '@types/uuid@9.0.8': {} + + accepts@2.0.0: + dependencies: + mime-types: 3.0.1 + negotiator: 1.0.0 + + acorn-walk@8.3.4: + dependencies: + acorn: 8.15.0 + + acorn@8.15.0: {} + + amqplib@0.10.9: + dependencies: + buffer-more-ints: 1.0.0 + url-parse: 1.5.10 + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + + append-field@1.0.0: {} + + arg@4.1.3: {} + + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.1.0 + + aws-sdk@2.1692.0: + dependencies: + buffer: 4.9.2 + events: 1.1.1 + ieee754: 1.1.13 + jmespath: 0.16.0 + querystring: 0.2.0 + sax: 1.2.1 + url: 0.10.3 + util: 0.12.5 + uuid: 8.0.0 + xml2js: 0.6.2 + + balanced-match@1.0.2: {} + + base64-js@1.5.1: {} + + bcrypt@6.0.0: + dependencies: + node-addon-api: 8.5.0 + node-gyp-build: 4.8.4 + + binary-extensions@2.3.0: {} + + body-parser@2.2.0: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 4.4.1(supports-color@5.5.0) + http-errors: 2.0.0 + iconv-lite: 0.6.3 + on-finished: 2.4.1 + qs: 6.14.0 + raw-body: 3.0.0 + type-is: 2.0.1 + transitivePeerDependencies: + - supports-color + + bowser@2.12.1: {} + + brace-expansion@1.1.12: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + buffer-equal-constant-time@1.0.1: {} + + buffer-from@1.1.2: {} + + buffer-more-ints@1.0.0: {} + + buffer@4.9.2: + dependencies: + base64-js: 1.5.1 + ieee754: 1.1.13 + isarray: 1.0.0 + + busboy@1.6.0: + dependencies: + streamsearch: 1.1.0 + + bytes@3.1.2: {} + + c12@3.1.0: + dependencies: + chokidar: 4.0.3 + confbox: 0.2.2 + defu: 6.1.4 + dotenv: 16.6.1 + exsolve: 1.0.7 + giget: 2.0.0 + jiti: 2.5.1 + ohash: 2.0.11 + pathe: 2.0.3 + perfect-debounce: 1.0.0 + pkg-types: 2.3.0 + rc9: 2.1.2 + + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bind@1.0.8: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + get-intrinsic: 1.3.0 + set-function-length: 1.2.2 + + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + + chokidar@3.6.0: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + + chokidar@4.0.3: + dependencies: + readdirp: 4.1.2 + + citty@0.1.6: + dependencies: + consola: 3.4.2 + + concat-map@0.0.1: {} + + concat-stream@2.0.0: + dependencies: + buffer-from: 1.1.2 + inherits: 2.0.4 + readable-stream: 3.6.2 + typedarray: 0.0.6 + + confbox@0.2.2: {} + + consola@3.4.2: {} + + content-disposition@1.0.0: + dependencies: + safe-buffer: 5.2.1 + + content-type@1.0.5: {} + + cookie-signature@1.2.2: {} + + cookie@0.7.2: {} + + cors@2.8.5: + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + + create-require@1.1.1: {} + + debug@4.3.7: + dependencies: + ms: 2.1.3 + + debug@4.4.1(supports-color@5.5.0): + dependencies: + ms: 2.1.3 + optionalDependencies: + supports-color: 5.5.0 + + deepmerge-ts@7.1.5: {} + + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + + defu@6.1.4: {} + + depd@2.0.0: {} + + destr@2.0.5: {} + + diff@4.0.2: {} + + dotenv@16.6.1: {} + + dotenv@17.2.1: {} + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + + ecdsa-sig-formatter@1.0.11: + dependencies: + safe-buffer: 5.2.1 + + ee-first@1.1.1: {} + + effect@3.16.12: + dependencies: + '@standard-schema/spec': 1.0.0 + fast-check: 3.23.2 + + empathic@2.0.0: {} + + encodeurl@2.0.0: {} + + engine.io-client@6.6.3: + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.3.7 + engine.io-parser: 5.2.3 + ws: 8.17.1 + xmlhttprequest-ssl: 2.1.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + engine.io-parser@5.2.3: {} + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + + escape-html@1.0.3: {} + + etag@1.8.1: {} + + events@1.1.1: {} + + express-rate-limit@8.0.1(express@5.1.0): + dependencies: + express: 5.1.0 + ip-address: 10.0.1 + + express@5.1.0: + dependencies: + accepts: 2.0.0 + body-parser: 2.2.0 + content-disposition: 1.0.0 + content-type: 1.0.5 + cookie: 0.7.2 + cookie-signature: 1.2.2 + debug: 4.4.1(supports-color@5.5.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.1 + 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.2.0 + serve-static: 2.2.0 + statuses: 2.0.2 + type-is: 2.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + + exsolve@1.0.7: {} + + fast-check@3.23.2: + dependencies: + pure-rand: 6.1.0 + + fast-xml-parser@5.2.5: + dependencies: + strnum: 2.1.1 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + finalhandler@2.1.0: + dependencies: + debug: 4.4.1(supports-color@5.5.0) + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + for-each@0.3.5: + dependencies: + is-callable: 1.2.7 + + forwarded@0.2.0: {} + + fresh@2.0.0: {} + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + get-intrinsic@1.3.0: + 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 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + + giget@2.0.0: + dependencies: + citty: 0.1.6 + consola: 3.4.2 + defu: 6.1.4 + node-fetch-native: 1.6.7 + nypm: 0.6.1 + pathe: 2.0.3 + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + gopd@1.2.0: {} + + has-flag@3.0.0: {} + + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.1 + + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + http-errors@2.0.0: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + + iconv-lite@0.6.3: + dependencies: + safer-buffer: 2.1.2 + + ieee754@1.1.13: {} + + ignore-by-default@1.0.1: {} + + inherits@2.0.4: {} + + ip-address@10.0.1: {} + + ipaddr.js@1.9.1: {} + + is-arguments@1.2.0: + dependencies: + call-bound: 1.0.4 + has-tostringtag: 1.0.2 + + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.3.0 + + is-callable@1.2.7: {} + + is-extglob@2.1.1: {} + + is-generator-function@1.1.0: + dependencies: + call-bound: 1.0.4 + get-proto: 1.0.1 + has-tostringtag: 1.0.2 + safe-regex-test: 1.1.0 + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-number@7.0.0: {} + + is-promise@4.0.0: {} + + is-regex@1.2.1: + dependencies: + call-bound: 1.0.4 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + is-typed-array@1.1.15: + dependencies: + which-typed-array: 1.1.19 + + isarray@1.0.0: {} + + jiti@2.5.1: {} + + jmespath@0.16.0: {} + + joi@17.13.3: + dependencies: + '@hapi/hoek': 9.3.0 + '@hapi/topo': 5.1.0 + '@sideway/address': 4.1.5 + '@sideway/formula': 3.0.1 + '@sideway/pinpoint': 2.0.0 + + jsonwebtoken@9.0.2: + dependencies: + jws: 3.2.2 + lodash.includes: 4.3.0 + lodash.isboolean: 3.0.3 + lodash.isinteger: 4.0.4 + lodash.isnumber: 3.0.3 + lodash.isplainobject: 4.0.6 + lodash.isstring: 4.0.1 + lodash.once: 4.1.1 + ms: 2.1.3 + semver: 7.7.2 + + jwa@1.4.2: + dependencies: + buffer-equal-constant-time: 1.0.1 + ecdsa-sig-formatter: 1.0.11 + safe-buffer: 5.2.1 + + jws@3.2.2: + dependencies: + jwa: 1.4.2 + safe-buffer: 5.2.1 + + lodash.includes@4.3.0: {} + + lodash.isboolean@3.0.3: {} + + lodash.isinteger@4.0.4: {} + + lodash.isnumber@3.0.3: {} + + lodash.isplainobject@4.0.6: {} + + lodash.isstring@4.0.1: {} + + lodash.once@4.1.1: {} + + make-error@1.3.6: {} + + math-intrinsics@1.1.0: {} + + media-typer@0.3.0: {} + + media-typer@1.1.0: {} + + merge-descriptors@2.0.0: {} + + mime-db@1.52.0: {} + + mime-db@1.54.0: {} + + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + + mime-types@3.0.1: + dependencies: + mime-db: 1.54.0 + + minimatch@3.1.2: + dependencies: + brace-expansion: 1.1.12 + + minimist@1.2.8: {} + + mkdirp@0.5.6: + dependencies: + minimist: 1.2.8 + + ms@2.1.3: {} + + multer@2.0.2: + 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 + + negotiator@1.0.0: {} + + node-addon-api@8.5.0: {} + + node-fetch-native@1.6.7: {} + + node-gyp-build@4.8.4: {} + + nodemon@3.1.10: + dependencies: + chokidar: 3.6.0 + debug: 4.4.1(supports-color@5.5.0) + ignore-by-default: 1.0.1 + minimatch: 3.1.2 + pstree.remy: 1.1.8 + semver: 7.7.2 + simple-update-notifier: 2.0.0 + supports-color: 5.5.0 + touch: 3.1.1 + undefsafe: 2.0.5 + + normalize-path@3.0.0: {} + + nypm@0.6.1: + dependencies: + citty: 0.1.6 + consola: 3.4.2 + pathe: 2.0.3 + pkg-types: 2.3.0 + tinyexec: 1.0.1 + + object-assign@4.1.1: {} + + object-inspect@1.13.4: {} + + ohash@2.0.11: {} + + on-finished@2.4.1: + dependencies: + ee-first: 1.1.1 + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + parseurl@1.3.3: {} + + path-to-regexp@8.2.0: {} + + pathe@2.0.3: {} + + perfect-debounce@1.0.0: {} + + pg-cloudflare@1.2.7: + optional: true + + pg-connection-string@2.9.1: {} + + pg-int8@1.0.1: {} + + pg-pool@3.10.1(pg@8.16.3): + dependencies: + pg: 8.16.3 + + pg-protocol@1.10.3: {} + + pg-types@2.2.0: + dependencies: + pg-int8: 1.0.1 + postgres-array: 2.0.0 + postgres-bytea: 1.0.0 + postgres-date: 1.0.7 + postgres-interval: 1.2.0 + + pg@8.16.3: + dependencies: + pg-connection-string: 2.9.1 + pg-pool: 3.10.1(pg@8.16.3) + pg-protocol: 1.10.3 + pg-types: 2.2.0 + pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.2.7 + + pgpass@1.0.5: + dependencies: + split2: 4.2.0 + + picomatch@2.3.1: {} + + pkg-types@2.3.0: + dependencies: + confbox: 0.2.2 + exsolve: 1.0.7 + pathe: 2.0.3 + + possible-typed-array-names@1.1.0: {} + + postgres-array@2.0.0: {} + + postgres-bytea@1.0.0: {} + + postgres-date@1.0.7: {} + + postgres-interval@1.2.0: + dependencies: + xtend: 4.0.2 + + prisma@6.15.0(typescript@5.9.2): + dependencies: + '@prisma/config': 6.15.0 + '@prisma/engines': 6.15.0 + optionalDependencies: + typescript: 5.9.2 + transitivePeerDependencies: + - magicast + + proxy-addr@2.0.7: + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + + pstree.remy@1.1.8: {} + + punycode@1.3.2: {} + + pure-rand@6.1.0: {} + + qs@6.14.0: + dependencies: + side-channel: 1.1.0 + + querystring@0.2.0: {} + + querystringify@2.2.0: {} + + range-parser@1.2.1: {} + + raw-body@3.0.0: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.6.3 + unpipe: 1.0.0 + + rc9@2.1.2: + dependencies: + defu: 6.1.4 + destr: 2.0.5 + + readable-stream@3.6.2: + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + + readdirp@3.6.0: + dependencies: + picomatch: 2.3.1 + + readdirp@4.1.2: {} + + requires-port@1.0.0: {} + + router@2.2.0: + dependencies: + debug: 4.4.1(supports-color@5.5.0) + depd: 2.0.0 + is-promise: 4.0.0 + parseurl: 1.3.3 + path-to-regexp: 8.2.0 + transitivePeerDependencies: + - supports-color + + safe-buffer@5.2.1: {} + + safe-regex-test@1.1.0: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-regex: 1.2.1 + + safer-buffer@2.1.2: {} + + sax@1.2.1: {} + + semver@7.7.2: {} + + send@1.2.0: + dependencies: + debug: 4.4.1(supports-color@5.5.0) + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 2.0.0 + http-errors: 2.0.0 + mime-types: 3.0.1 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + serve-static@2.2.0: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 1.2.0 + transitivePeerDependencies: + - supports-color + + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.3.0 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + + setprototypeof@1.2.0: {} + + side-channel-list@1.0.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + simple-update-notifier@2.0.0: + dependencies: + semver: 7.7.2 + + socket.io-client@4.8.1: + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.3.7 + engine.io-client: 6.6.3 + socket.io-parser: 4.2.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + socket.io-parser@4.2.4: + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.3.7 + transitivePeerDependencies: + - supports-color + + split2@4.2.0: {} + + statuses@2.0.1: {} + + statuses@2.0.2: {} + + streamsearch@1.1.0: {} + + string_decoder@1.3.0: + dependencies: + safe-buffer: 5.2.1 + + strnum@2.1.1: {} + + supports-color@5.5.0: + dependencies: + has-flag: 3.0.0 + + tinyexec@1.0.1: {} + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + toidentifier@1.0.1: {} + + touch@3.1.1: {} + + ts-node@10.9.2(@types/node@24.3.0)(typescript@5.9.2): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 24.3.0 + acorn: 8.15.0 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.9.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + + tslib@2.8.1: {} + + type-is@1.6.18: + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + + type-is@2.0.1: + dependencies: + content-type: 1.0.5 + media-typer: 1.1.0 + mime-types: 3.0.1 + + typedarray@0.0.6: {} + + typescript@5.9.2: {} + + undefsafe@2.0.5: {} + + undici-types@7.10.0: {} + + unpipe@1.0.0: {} + + url-parse@1.5.10: + dependencies: + querystringify: 2.2.0 + requires-port: 1.0.0 + + url@0.10.3: + dependencies: + punycode: 1.3.2 + querystring: 0.2.0 + + util-deprecate@1.0.2: {} + + util@0.12.5: + dependencies: + inherits: 2.0.4 + is-arguments: 1.2.0 + is-generator-function: 1.1.0 + is-typed-array: 1.1.15 + which-typed-array: 1.1.19 + + uuid@8.0.0: {} + + uuid@9.0.1: {} + + v8-compile-cache-lib@3.0.1: {} + + vary@1.1.2: {} + + which-typed-array@1.1.19: + 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 + + wrappy@1.0.2: {} + + ws@8.17.1: {} + + xml2js@0.6.2: + dependencies: + sax: 1.2.1 + xmlbuilder: 11.0.1 + + xmlbuilder@11.0.1: {} + + xmlhttprequest-ssl@2.1.2: {} + + xtend@4.0.2: {} + + yn@3.1.1: {} diff --git a/prisma/dev.db b/prisma/dev.db new file mode 100755 index 0000000..e69de29 diff --git a/prisma/migrations/20250728103456_init/migration.sql b/prisma/migrations/20250728103456_init/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250728111351_add_address/migration.sql b/prisma/migrations/20250728111351_add_address/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250730071048_add_banner_url/migration.sql b/prisma/migrations/20250730071048_add_banner_url/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250730071403_add_gig_table/migration.sql b/prisma/migrations/20250730071403_add_gig_table/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250731084030_fix/migration.sql b/prisma/migrations/20250731084030_fix/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250731092201_init/migration.sql b/prisma/migrations/20250731092201_init/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250731092602_doi/migration.sql b/prisma/migrations/20250731092602_doi/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250731093947_ff/migration.sql b/prisma/migrations/20250731093947_ff/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250803042313_init/migration.sql b/prisma/migrations/20250803042313_init/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250803044427_make_idcard_required/migration.sql b/prisma/migrations/20250803044427_make_idcard_required/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250803044751_make_idcard_optional/migration.sql b/prisma/migrations/20250803044751_make_idcard_optional/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250803045109_make_idcard_required/migration.sql b/prisma/migrations/20250803045109_make_idcard_required/migration.sql old mode 100644 new mode 100755 diff --git a/prisma/migrations/20250817114502_chat_d_badded/migration.sql b/prisma/migrations/20250817114502_chat_d_badded/migration.sql new file mode 100755 index 0000000..0f75870 --- /dev/null +++ b/prisma/migrations/20250817114502_chat_d_badded/migration.sql @@ -0,0 +1,102 @@ +-- CreateTable +CREATE TABLE "ChatSettings" ( + "id" TEXT NOT NULL, + "notify" BOOLEAN NOT NULL DEFAULT true, + "userId" TEXT NOT NULL, + + CONSTRAINT "ChatSettings_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "BlockedConversation" ( + "id" TEXT NOT NULL, + "blocked" BOOLEAN NOT NULL DEFAULT false, + "userId" TEXT NOT NULL, + "conversationId" TEXT NOT NULL, + + CONSTRAINT "BlockedConversation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ConversationOnProfile" ( + "id" TEXT NOT NULL, + "deleted" BOOLEAN NOT NULL DEFAULT false, + "userId" TEXT NOT NULL, + "conversationId" TEXT NOT NULL, + "historyId" TEXT, + + CONSTRAINT "ConversationOnProfile_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Conversation" ( + "id" TEXT NOT NULL, + + CONSTRAINT "Conversation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "History" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "History_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "MessageHistory" ( + "id" TEXT NOT NULL, + "viewedAt" TIMESTAMP(3), + "receivedAt" TIMESTAMP(3), + "historyId" TEXT NOT NULL, + "messageId" TEXT NOT NULL, + + CONSTRAINT "MessageHistory_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Message" ( + "id" TEXT NOT NULL, + "content" TEXT NOT NULL, + "fromId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Message_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "ChatSettings_userId_key" ON "ChatSettings"("userId"); + +-- CreateIndex +CREATE INDEX "BlockedConversation_userId_conversationId_idx" ON "BlockedConversation"("userId", "conversationId"); + +-- CreateIndex +CREATE UNIQUE INDEX "ConversationOnProfile_historyId_key" ON "ConversationOnProfile"("historyId"); + +-- AddForeignKey +ALTER TABLE "ChatSettings" ADD CONSTRAINT "ChatSettings_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BlockedConversation" ADD CONSTRAINT "BlockedConversation_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BlockedConversation" ADD CONSTRAINT "BlockedConversation_conversationId_fkey" FOREIGN KEY ("conversationId") REFERENCES "Conversation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ConversationOnProfile" ADD CONSTRAINT "ConversationOnProfile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ConversationOnProfile" ADD CONSTRAINT "ConversationOnProfile_conversationId_fkey" FOREIGN KEY ("conversationId") REFERENCES "Conversation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ConversationOnProfile" ADD CONSTRAINT "ConversationOnProfile_historyId_fkey" FOREIGN KEY ("historyId") REFERENCES "History"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "MessageHistory" ADD CONSTRAINT "MessageHistory_historyId_fkey" FOREIGN KEY ("historyId") REFERENCES "History"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "MessageHistory" ADD CONSTRAINT "MessageHistory_messageId_fkey" FOREIGN KEY ("messageId") REFERENCES "Message"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Message" ADD CONSTRAINT "Message_fromId_fkey" FOREIGN KEY ("fromId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20250820103021_email_queue/migration.sql b/prisma/migrations/20250820103021_email_queue/migration.sql new file mode 100755 index 0000000..ea9c7e3 --- /dev/null +++ b/prisma/migrations/20250820103021_email_queue/migration.sql @@ -0,0 +1,88 @@ +/* + Warnings: + + - You are about to drop the `BlockedConversation` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `ChatSettings` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Conversation` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `ConversationOnProfile` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `History` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Message` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `MessageHistory` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- CreateEnum +CREATE TYPE "EmailType" AS ENUM ('BOOKING_CONFIRMATION', 'BOOKING_REMINDER', 'BOOKING_CANCELLATION_MODIFICATION', 'NEW_MESSAGE_OR_REVIEW', 'OTHER'); + +-- DropForeignKey +ALTER TABLE "BlockedConversation" DROP CONSTRAINT "BlockedConversation_conversationId_fkey"; + +-- DropForeignKey +ALTER TABLE "BlockedConversation" DROP CONSTRAINT "BlockedConversation_userId_fkey"; + +-- DropForeignKey +ALTER TABLE "ChatSettings" DROP CONSTRAINT "ChatSettings_userId_fkey"; + +-- DropForeignKey +ALTER TABLE "ConversationOnProfile" DROP CONSTRAINT "ConversationOnProfile_conversationId_fkey"; + +-- DropForeignKey +ALTER TABLE "ConversationOnProfile" DROP CONSTRAINT "ConversationOnProfile_historyId_fkey"; + +-- DropForeignKey +ALTER TABLE "ConversationOnProfile" DROP CONSTRAINT "ConversationOnProfile_userId_fkey"; + +-- DropForeignKey +ALTER TABLE "Message" DROP CONSTRAINT "Message_fromId_fkey"; + +-- DropForeignKey +ALTER TABLE "MessageHistory" DROP CONSTRAINT "MessageHistory_historyId_fkey"; + +-- DropForeignKey +ALTER TABLE "MessageHistory" DROP CONSTRAINT "MessageHistory_messageId_fkey"; + +-- DropTable +DROP TABLE "BlockedConversation"; + +-- DropTable +DROP TABLE "ChatSettings"; + +-- DropTable +DROP TABLE "Conversation"; + +-- DropTable +DROP TABLE "ConversationOnProfile"; + +-- DropTable +DROP TABLE "History"; + +-- DropTable +DROP TABLE "Message"; + +-- DropTable +DROP TABLE "MessageHistory"; + +-- CreateTable +CREATE TABLE "email_queue" ( + "id" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "to" TEXT NOT NULL, + "subject" TEXT NOT NULL, + "html" TEXT NOT NULL, + "emailType" "EmailType" NOT NULL, + "sentAt" TIMESTAMP(3), + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "email_queue_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "email_queue_userId_idx" ON "email_queue"("userId"); + +-- CreateIndex +CREATE INDEX "email_queue_emailType_idx" ON "email_queue"("emailType"); + +-- CreateIndex +CREATE INDEX "email_queue_sentAt_idx" ON "email_queue"("sentAt"); + +-- AddForeignKey +ALTER TABLE "email_queue" ADD CONSTRAINT "email_queue_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20250820122825_messaging_table_added/migration.sql b/prisma/migrations/20250820122825_messaging_table_added/migration.sql new file mode 100755 index 0000000..a7dc4ca --- /dev/null +++ b/prisma/migrations/20250820122825_messaging_table_added/migration.sql @@ -0,0 +1,30 @@ +-- CreateTable +CREATE TABLE "Conversation" ( + "id" TEXT NOT NULL, + "userIds" TEXT[], + "title" TEXT, + + CONSTRAINT "Conversation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Message" ( + "id" TEXT NOT NULL, + "content" TEXT NOT NULL, + "fromId" TEXT NOT NULL, + "toId" TEXT NOT NULL, + "conversationId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "receivedAt" TIMESTAMP(3), + + CONSTRAINT "Message_pkey" PRIMARY KEY ("id") +); + +-- AddForeignKey +ALTER TABLE "Message" ADD CONSTRAINT "Message_conversationId_fkey" FOREIGN KEY ("conversationId") REFERENCES "Conversation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Message" ADD CONSTRAINT "Message_fromId_fkey" FOREIGN KEY ("fromId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Message" ADD CONSTRAINT "Message_toId_fkey" FOREIGN KEY ("toId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20250821042048_add_vrify_for_easy/migration.sql b/prisma/migrations/20250821042048_add_vrify_for_easy/migration.sql new file mode 100755 index 0000000..5236df8 --- /dev/null +++ b/prisma/migrations/20250821042048_add_vrify_for_easy/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "ServiceProvider" ALTER COLUMN "isVerified" SET DEFAULT true; diff --git a/prisma/migrations/20250821103514_add_performance_indexes/migration.sql b/prisma/migrations/20250821103514_add_performance_indexes/migration.sql new file mode 100755 index 0000000..2bf5906 --- /dev/null +++ b/prisma/migrations/20250821103514_add_performance_indexes/migration.sql @@ -0,0 +1,38 @@ +-- CreateIndex +CREATE INDEX "Service_providerId_idx" ON "Service"("providerId"); + +-- CreateIndex +CREATE INDEX "Service_categoryId_idx" ON "Service"("categoryId"); + +-- CreateIndex +CREATE INDEX "Service_isActive_idx" ON "Service"("isActive"); + +-- CreateIndex +CREATE INDEX "Service_price_idx" ON "Service"("price"); + +-- CreateIndex +CREATE INDEX "Service_createdAt_idx" ON "Service"("createdAt"); + +-- CreateIndex +CREATE INDEX "ServiceProvider_userId_idx" ON "ServiceProvider"("userId"); + +-- CreateIndex +CREATE INDEX "ServiceProvider_isVerified_idx" ON "ServiceProvider"("isVerified"); + +-- CreateIndex +CREATE INDEX "ServiceProvider_averageRating_idx" ON "ServiceProvider"("averageRating"); + +-- CreateIndex +CREATE INDEX "ServiceProvider_createdAt_idx" ON "ServiceProvider"("createdAt"); + +-- CreateIndex +CREATE INDEX "User_email_idx" ON "User"("email"); + +-- CreateIndex +CREATE INDEX "User_role_idx" ON "User"("role"); + +-- CreateIndex +CREATE INDEX "User_isActive_idx" ON "User"("isActive"); + +-- CreateIndex +CREATE INDEX "User_createdAt_idx" ON "User"("createdAt"); diff --git a/prisma/migrations/20250904122624_replace_confirm_with_customer_provider_confirmation/migration.sql b/prisma/migrations/20250904122624_replace_confirm_with_customer_provider_confirmation/migration.sql new file mode 100755 index 0000000..fe55071 --- /dev/null +++ b/prisma/migrations/20250904122624_replace_confirm_with_customer_provider_confirmation/migration.sql @@ -0,0 +1,10 @@ +/* + Warnings: + + - You are about to drop the column `confirm` on the `Schedule` table. All the data in the column will be lost. + +*/ +-- AlterTable +ALTER TABLE "public"."Schedule" DROP COLUMN "confirm", +ADD COLUMN "customerConfirmation" BOOLEAN NOT NULL DEFAULT false, +ADD COLUMN "providerConfirmation" BOOLEAN NOT NULL DEFAULT false; diff --git a/prisma/migrations/20250904173228_add_service_fee_to_schedule/migration.sql b/prisma/migrations/20250904173228_add_service_fee_to_schedule/migration.sql new file mode 100755 index 0000000..ffc9973 --- /dev/null +++ b/prisma/migrations/20250904173228_add_service_fee_to_schedule/migration.sql @@ -0,0 +1,6 @@ +-- AlterTable +ALTER TABLE "public"."Schedule" ADD COLUMN "currency" TEXT NOT NULL DEFAULT 'RS', +ADD COLUMN "serviceFee" DECIMAL(10,2); + +-- AlterTable +ALTER TABLE "public"."Service" ALTER COLUMN "currency" SET DEFAULT 'RS'; diff --git a/prisma/migrations/20250905121501_add_customer_review/migration.sql b/prisma/migrations/20250905121501_add_customer_review/migration.sql new file mode 100755 index 0000000..2f4e4e3 --- /dev/null +++ b/prisma/migrations/20250905121501_add_customer_review/migration.sql @@ -0,0 +1,48 @@ +/* + Warnings: + + - You are about to drop the `Review` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE "public"."Review" DROP CONSTRAINT "Review_revieweeId_fkey"; + +-- DropForeignKey +ALTER TABLE "public"."Review" DROP CONSTRAINT "Review_reviewerId_fkey"; + +-- DropIndex +DROP INDEX "public"."Service_categoryId_idx"; + +-- DropIndex +DROP INDEX "public"."Service_createdAt_idx"; + +-- DropIndex +DROP INDEX "public"."Service_isActive_idx"; + +-- DropIndex +DROP INDEX "public"."Service_price_idx"; + +-- DropIndex +DROP INDEX "public"."Service_providerId_idx"; + +-- DropTable +DROP TABLE "public"."Review"; + +-- CreateTable +CREATE TABLE "public"."CustomerReview" ( + "id" TEXT NOT NULL, + "reviewerId" TEXT NOT NULL, + "revieweeId" TEXT NOT NULL, + "rating" INTEGER NOT NULL, + "comment" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "CustomerReview_pkey" PRIMARY KEY ("id") +); + +-- AddForeignKey +ALTER TABLE "public"."CustomerReview" ADD CONSTRAINT "CustomerReview_reviewerId_fkey" FOREIGN KEY ("reviewerId") REFERENCES "public"."User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "public"."CustomerReview" ADD CONSTRAINT "CustomerReview_revieweeId_fkey" FOREIGN KEY ("revieweeId") REFERENCES "public"."User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20250905171532_add_serviceid_to_conversation/migration.sql b/prisma/migrations/20250905171532_add_serviceid_to_conversation/migration.sql new file mode 100755 index 0000000..20a8833 --- /dev/null +++ b/prisma/migrations/20250905171532_add_serviceid_to_conversation/migration.sql @@ -0,0 +1,5 @@ +-- AlterTable +ALTER TABLE "public"."Conversation" ADD COLUMN "serviceId" TEXT; + +-- AddForeignKey +ALTER TABLE "public"."Conversation" ADD CONSTRAINT "Conversation_serviceId_fkey" FOREIGN KEY ("serviceId") REFERENCES "public"."Service"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20250907174417_add_video_url_to_service/migration.sql b/prisma/migrations/20250907174417_add_video_url_to_service/migration.sql new file mode 100755 index 0000000..9745f20 --- /dev/null +++ b/prisma/migrations/20250907174417_add_video_url_to_service/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "public"."Service" ADD COLUMN "videoUrl" TEXT; diff --git a/prisma/migrations/20250910091954_make_email_userid_optional/migration.sql b/prisma/migrations/20250910091954_make_email_userid_optional/migration.sql new file mode 100755 index 0000000..d54ea72 --- /dev/null +++ b/prisma/migrations/20250910091954_make_email_userid_optional/migration.sql @@ -0,0 +1,8 @@ +-- DropForeignKey +ALTER TABLE "public"."email_queue" DROP CONSTRAINT "email_queue_userId_fkey"; + +-- AlterTable +ALTER TABLE "public"."email_queue" ALTER COLUMN "userId" DROP NOT NULL; + +-- AddForeignKey +ALTER TABLE "public"."email_queue" ADD CONSTRAINT "email_queue_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."User"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20250911040624_add_admin_table/migration.sql b/prisma/migrations/20250911040624_add_admin_table/migration.sql new file mode 100755 index 0000000..cdafec2 --- /dev/null +++ b/prisma/migrations/20250911040624_add_admin_table/migration.sql @@ -0,0 +1,13 @@ +-- CreateTable +CREATE TABLE "Admin" ( + "id" SERIAL NOT NULL, + "username" TEXT NOT NULL, + "password" TEXT NOT NULL, + "firstName" TEXT NOT NULL, + "lastName" TEXT NOT NULL, + + CONSTRAINT "Admin_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Admin_username_key" ON "Admin"("username"); diff --git a/prisma/migrations/20250912035905_add_vector_embeddings/migration.sql b/prisma/migrations/20250912035905_add_vector_embeddings/migration.sql new file mode 100755 index 0000000..e321cb5 --- /dev/null +++ b/prisma/migrations/20250912035905_add_vector_embeddings/migration.sql @@ -0,0 +1,24 @@ +-- CreateExtension +CREATE EXTENSION IF NOT EXISTS "vector"; + +-- AlterTable +ALTER TABLE "public"."Service" ADD COLUMN "combinedEmbedding" vector(768), +ADD COLUMN "descriptionEmbedding" vector(768), +ADD COLUMN "embeddingUpdatedAt" TIMESTAMP(3), +ADD COLUMN "tagsEmbedding" vector(768), +ADD COLUMN "titleEmbedding" vector(768); + +-- CreateIndex +CREATE INDEX "Service_isActive_idx" ON "public"."Service"("isActive"); + +-- CreateIndex +CREATE INDEX "Service_categoryId_idx" ON "public"."Service"("categoryId"); + +-- CreateIndex +CREATE INDEX "Service_providerId_idx" ON "public"."Service"("providerId"); + +-- CreateIndex +CREATE INDEX "Service_createdAt_idx" ON "public"."Service"("createdAt"); + +-- CreateIndex +CREATE INDEX "Service_combinedEmbedding_idx" ON "public"."Service" USING GIN ("combinedEmbedding"); diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml old mode 100644 new mode 100755 diff --git a/prisma/schema.prisma b/prisma/schema.prisma old mode 100644 new mode 100755 index 988be33..34033eb --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,68 +1,74 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? -// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init - generator client { provider = "prisma-client-js" + previewFeatures = ["postgresqlExtensions"] } datasource db { provider = "postgresql" url = env("DATABASE_URL") + extensions = [pgvector(map: "vector"), postgis(map: "postgis")] } model User { - id String @id @default(cuid()) - email String @unique - password String - role String @default("USER") // USER, PROVIDER, ADMIN - isActive Boolean @default(true) - firstName String? - lastName String? - phone String? - imageUrl String? - location String? - address String? - isEmailVerified Boolean @default(false) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - lastLoginAt DateTime? - socialmedia String[] - - serviceProvider ServiceProvider? - schedules Schedule[] - payments Payment[] - reviewsWritten Review[] @relation("writtenReviews") - serviceReviewsWritten ServiceReview[] @relation("writtenServiceReviews") + id String @id @default(cuid()) + email String @unique + password String + role String @default("USER") + isActive Boolean @default(true) + firstName String? + lastName String? + phone String? + imageUrl String? + location String? + address String? + isEmailVerified Boolean @default(false) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + lastLoginAt DateTime? + socialmedia String[] + messagesSent Message[] @relation("MessagesSent") + messagesReceived Message[] @relation("MessagesReceived") + payments Payment[] + schedules Schedule[] + serviceProvider ServiceProvider? + notification Notification[] + customerReviewsWritten CustomerReview[] @relation("CustomerReviewReviewer") + customerReviewsReceived CustomerReview[] @relation("CustomerReviewReviewee") + writtenServiceReviews ServiceReview[] @relation("writtenServiceReviews") + + @@index([email]) + @@index([role]) + @@index([isActive]) + @@index([createdAt]) } model ServiceProvider { - id String @id @default(cuid()) - userId String @unique - user User @relation(fields: [userId], references: [id]) - + id String @id @default(cuid()) + userId String @unique bio String? skills String[] qualifications String[] logoUrl String? averageRating Float? totalReviews Int? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - isVerified Boolean @default(false) - IDCardUrl String // Required ID card image URL - + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + IDCardUrl String + isVerified Boolean @default(true) companies Company[] - services Service[] - schedules Schedule[] payments Payment[] - reviews Review[] @relation("receivedReviews") + schedules Schedule[] + services Service[] + user User @relation(fields: [userId], references: [id]) + + @@index([userId]) + @@index([isVerified]) + @@index([averageRating]) + @@index([createdAt]) } model Company { - id String @id @default(cuid()) + id String @id @default(cuid()) providerId String name String? description String? @@ -70,7 +76,6 @@ model Company { address String? contact String? socialmedia String[] - provider ServiceProvider @relation(fields: [providerId], references: [id]) } @@ -80,91 +85,175 @@ model Category { slug String @unique description String? parentId String? - parent Category? @relation("CategoryHierarchy", fields: [parentId], references: [id]) children Category[] @relation("CategoryHierarchy") services Service[] } model Service { - id String @id @default(cuid()) + id String @id @default(cuid()) providerId String categoryId String title String? description String? - price Decimal @db.Decimal(10, 2) - currency String @default("USD") + price Decimal @db.Decimal(10, 2) + currency String @default("RS") tags String[] images String[] - isActive Boolean @default(true) + videoUrl String? + isActive Boolean @default(true) workingTime String[] - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - provider ServiceProvider @relation(fields: [providerId], references: [id]) - category Category @relation(fields: [categoryId], references: [id]) - schedules Schedule[] + // Location fields + latitude Float? + longitude Float? + address String? + city String? + state String? + country String? + postalCode String? + serviceRadiusKm Float? @default(10) + locationLastUpdated DateTime? + + // Semantic search fields + titleEmbedding Unsupported("vector(768)")? + descriptionEmbedding Unsupported("vector(768)")? + tagsEmbedding Unsupported("vector(768)")? + combinedEmbedding Unsupported("vector(768)")? + embeddingUpdatedAt DateTime? + + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt payments Payment[] - reviews ServiceReview[] + schedules Schedule[] + conversations Conversation[] + category Category @relation(fields: [categoryId], references: [id]) + provider ServiceProvider @relation(fields: [providerId], references: [id]) + serviceReviews ServiceReview[] + + @@index([isActive]) + @@index([categoryId]) + @@index([providerId]) + @@index([createdAt]) + @@index([latitude, longitude]) + @@index([city]) + @@index([state]) } model Schedule { - id String @id @default(cuid()) - serviceId String - providerId String - userId String - startTime String - endTime String - confirm Boolean @default(false) - queueValue Int? - - service Service @relation(fields: [serviceId], references: [id]) - provider ServiceProvider @relation(fields: [providerId], references: [id]) - user User @relation(fields: [userId], references: [id]) + id String @id @default(cuid()) + serviceId String + providerId String + userId String + startTime String + endTime String + customerConfirmation Boolean @default(false) + providerConfirmation Boolean @default(false) + serviceFee Decimal? @db.Decimal(10, 2) + currency String @default("RS") + queueValue Int? + provider ServiceProvider @relation(fields: [providerId], references: [id]) + service Service @relation(fields: [serviceId], references: [id]) + user User @relation(fields: [userId], references: [id]) } model Payment { - id String @id @default(cuid()) + id String @id @default(cuid()) serviceId String providerId String userId String gateway String? - chargeId String @unique - amount Decimal @db.Decimal(10, 2) + chargeId String @unique + amount Decimal @db.Decimal(10, 2) currency String status String? paidAt DateTime? refundedAt DateTime? failureReason String? - createdAt DateTime @default(now()) + createdAt DateTime @default(now()) + provider ServiceProvider @relation(fields: [providerId], references: [id]) + service Service @relation(fields: [serviceId], references: [id]) + user User @relation(fields: [userId], references: [id]) +} + - service Service @relation(fields: [serviceId], references: [id]) - provider ServiceProvider @relation(fields: [providerId], references: [id]) - user User @relation(fields: [userId], references: [id]) +model ServiceReview { + id String @id @default(cuid()) + reviewerId String + serviceId String + rating Int + comment String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + reviewer User @relation("writtenServiceReviews", fields: [reviewerId], references: [id]) + service Service @relation(fields: [serviceId], references: [id]) } -model Review { - id String @id @default(cuid()) - reviewerId String - revieweeId String - rating Int - comment String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - reviewer User @relation("writtenReviews", fields: [reviewerId], references: [id]) - reviewee ServiceProvider @relation("receivedReviews", fields: [revieweeId], references: [id]) +model Notification { + id String @id @default(cuid()) + userId String? + to String + subject String + html String + emailType EmailType + sentAt DateTime? + createdAt DateTime @default(now()) + isRead Boolean @default(false) + user User? @relation(fields: [userId], references: [id]) + + @@index([userId]) + @@index([emailType]) + @@index([sentAt]) + @@map("notification") } + model Admin { + id Int @id @default(autoincrement()) + username String @unique + password String + firstName String + lastName String + } -model ServiceReview { - id String @id @default(cuid()) - reviewerId String - serviceId String - rating Int - comment String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - reviewer User @relation("writtenServiceReviews", fields: [reviewerId], references: [id]) - service Service @relation(fields: [serviceId], references: [id]) -} \ No newline at end of file +model Conversation { + id String @id @default(uuid()) + userIds String[] + title String? + serviceId String? + service Service? @relation(fields: [serviceId], references: [id]) + messages Message[] +} + +model Message { + id String @id @default(uuid()) + content String + fromId String + toId String + conversationId String + createdAt DateTime @default(now()) + receivedAt DateTime? + conversation Conversation @relation(fields: [conversationId], references: [id]) + from User @relation("MessagesSent", fields: [fromId], references: [id]) + to User @relation("MessagesReceived", fields: [toId], references: [id]) +} + +model CustomerReview { + id String @id @default(cuid()) + reviewerId String + revieweeId String + rating Int + comment String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + reviewer User @relation("CustomerReviewReviewer", fields: [reviewerId], references: [id]) + reviewee User @relation("CustomerReviewReviewee", fields: [revieweeId], references: [id]) +} + +enum EmailType { + BOOKING_CONFIRMATION @map("BOOKING_CONFIRMATION") + BOOKING_REMINDER @map("BOOKING_REMINDER") + BOOKING_CANCELLATION_MODIFICATION @map("BOOKING_CANCELLATION_MODIFICATION") + NEW_MESSAGE_OR_REVIEW @map("NEW_MESSAGE_OR_REVIEW") + OTHER @map("OTHER") + + @@map("EmailType") +} diff --git a/prisma/seed.js b/prisma/seed.js deleted file mode 100644 index 22946e7..0000000 --- a/prisma/seed.js +++ /dev/null @@ -1,24 +0,0 @@ - -import { PrismaClient } from "@prisma/client"; -import { hashPassword } from "../src/utils/hash.js"; - -const prisma = new PrismaClient(); - -async function seed() { - const adminPassword = await hashPassword("admin123"); - const userPassword = await hashPassword("user123"); - await prisma.user.createMany({ - data: [] - }); -} - -seed() - .then(() => { - console.log("Seeding completed successfully."); - }) - .catch((error) => { - console.error("Error during seeding:", error); - }) - .finally(async () => { - await prisma.$disconnect(); - }); \ No newline at end of file diff --git a/prisma/seed.ts b/prisma/seed.ts new file mode 100755 index 0000000..064344a --- /dev/null +++ b/prisma/seed.ts @@ -0,0 +1,76 @@ + +import { PrismaClient } from "@prisma/client"; +import { hashPassword } from "../src/utils/hash.js"; +import * as fs from "fs"; +import * as path from "path"; + +const prisma = new PrismaClient(); + +async function seed() { + console.log("Starting seed process..."); + + // Create default category first (needed for confirmation system) + const defaultCategory = await prisma.category.upsert({ + where: { slug: 'default' }, + update: {}, + create: { + id: 'default', + name: 'General Services', + slug: 'default', + description: 'General consultation and services', + parentId: null, + }, + }); + console.log(`Created default category: ${defaultCategory.name}`); + + // Read category data from JSON file + const categoryDataPath = path.join(process.cwd(), "category_dataset.json"); + const categoryData = JSON.parse(fs.readFileSync(categoryDataPath, "utf8")); + + console.log("Seeding categories..."); + + // Create main categories first + for (const category of categoryData.categories) { + const mainCategory = await prisma.category.upsert({ + where: { slug: category.slug }, + update: {}, + create: { + name: category.name, + slug: category.slug, + description: category.description, + parentId: null, + }, + }); + + console.log(`Created main category: ${mainCategory.name}`); + + // Create subcategories + if (category.subcategories) { + for (const subCategory of category.subcategories) { + const createdSubCategory = await prisma.category.upsert({ + where: { slug: subCategory.slug }, + update: {}, + create: { + name: subCategory.name, + slug: subCategory.slug, + description: subCategory.description, + parentId: mainCategory.id, + }, + }); + console.log(` Created subcategory: ${createdSubCategory.name}`); + } + } + } + console.log("Seed process completed successfully!"); +} + +seed() + .then(() => { + console.log("Seeding completed successfully."); + }) + .catch((error) => { + console.error("Error during seeding:", error); + }) + .finally(async () => { + await prisma.$disconnect(); + }); \ No newline at end of file diff --git a/rename_email_queue_to_notification_add_isread.sql b/rename_email_queue_to_notification_add_isread.sql new file mode 100755 index 0000000..71aed2e --- /dev/null +++ b/rename_email_queue_to_notification_add_isread.sql @@ -0,0 +1,28 @@ +-- Rename email_queue table to notification and add isRead column +-- Migration: Rename EmailQueue table and add read status tracking +-- Generated on: 2025-10-06 +-- Description: Database migration to rename email_queue to notification table and add isRead boolean field + +-- Step 1: Rename the table from email_queue to notification +ALTER TABLE "email_queue" RENAME TO "notification"; + +-- Step 2: Add the isRead column with a default value of false +-- This column tracks whether the notification has been read by the recipient +ALTER TABLE "notification" ADD COLUMN "isRead" BOOLEAN NOT NULL DEFAULT false; + +-- Step 3: Verify the migration (optional verification queries) +-- You can uncomment and run these queries to verify the migration: + +-- Check table structure: +-- SELECT column_name, data_type, is_nullable, column_default +-- FROM information_schema.columns +-- WHERE table_name = 'notification' +-- ORDER BY ordinal_position; + +-- Check if indexes were renamed properly (PostgreSQL should handle this automatically): +-- SELECT indexname, indexdef +-- FROM pg_indexes +-- WHERE tablename = 'notification'; + +-- Check existing data count to ensure no data loss: +-- SELECT COUNT(*) as notification_count FROM notification; diff --git a/scripts/generate-missing-embeddings.js b/scripts/generate-missing-embeddings.js new file mode 100755 index 0000000..6754d1a --- /dev/null +++ b/scripts/generate-missing-embeddings.js @@ -0,0 +1,228 @@ +/** + * Migration script to generate embeddings for existing services + * Run this script to populate embeddings for services that don't have them + */ + +import { PrismaClient } from '@prisma/client'; +import { embeddingService } from '../dist/src/services/embedding.service.js'; + +const prisma = new PrismaClient(); + +async function generateMissingEmbeddings() { + console.log('🚀 Starting migration: Generate missing embeddings for services'); + console.log('================================================'); + + try { + // Get count of services without embeddings + const totalServicesWithoutEmbeddings = await prisma.$queryRaw` + SELECT COUNT(*) as count + FROM "Service" + WHERE "combinedEmbedding" IS NULL + AND "isActive" = true + `; + + const totalCount = parseInt(totalServicesWithoutEmbeddings[0].count); + console.log(`📊 Found ${totalCount} services without embeddings`); + + if (totalCount === 0) { + console.log('✅ All active services already have embeddings!'); + return; + } + + console.log('⚠️ This process will take time due to API rate limits (15 requests/minute)'); + console.log(`⏱️ Estimated time: ${Math.ceil((totalCount * 5) / 60)} minutes\n`); + + const batchSize = 10; // Process in small batches + let processedCount = 0; + let successCount = 0; + let errorCount = 0; + + while (processedCount < totalCount) { + console.log(`\n📦 Processing batch ${Math.floor(processedCount / batchSize) + 1}...`); + + // Get next batch of services without embeddings + const services = await prisma.$queryRaw` + SELECT id, title, description, tags + FROM "Service" + WHERE "combinedEmbedding" IS NULL + AND "isActive" = true + ORDER BY "createdAt" DESC + LIMIT ${batchSize} + `; + + if (services.length === 0) { + console.log('🎉 No more services to process!'); + break; + } + + // Process each service in the batch + for (let i = 0; i < services.length; i++) { + const service = services[i]; + processedCount++; + + try { + console.log(`\n⏳ [${processedCount}/${totalCount}] Processing: "${service.title || 'Untitled Service'}"`); + console.log(` Service ID: ${service.id}`); + + // Generate embeddings + const embeddings = await embeddingService.generateServiceEmbeddings({ + title: service.title || '', + description: service.description || '', + tags: service.tags || [] + }); + + // Convert embeddings to vector format strings + const titleVector = `[${embeddings.titleEmbedding.join(',')}]`; + const descriptionVector = `[${embeddings.descriptionEmbedding.join(',')}]`; + const tagsVector = `[${embeddings.tagsEmbedding.join(',')}]`; + const combinedVector = `[${embeddings.combinedEmbedding.join(',')}]`; + + console.log(` 📐 Vector dimensions: ${embeddings.combinedEmbedding.length}`); + + // Update service with embeddings + await prisma.$executeRaw` + UPDATE "Service" + SET + "titleEmbedding" = ${titleVector}::vector, + "descriptionEmbedding" = ${descriptionVector}::vector, + "tagsEmbedding" = ${tagsVector}::vector, + "combinedEmbedding" = ${combinedVector}::vector, + "embeddingUpdatedAt" = NOW() + WHERE id = ${service.id} + `; + + successCount++; + console.log(` ✅ Success! Embeddings generated and saved.`); + + // Rate limiting: Wait 5 seconds between requests for free tier + if (processedCount < totalCount) { + console.log(` ⏱️ Waiting 5 seconds (rate limit)...`); + await new Promise(resolve => setTimeout(resolve, 5000)); + } + + } catch (error) { + errorCount++; + console.error(` ❌ Failed to process service ${service.id}:`); + console.error(` Error: ${error.message}`); + + // If it's a rate limit error, wait longer + if (error.message.includes('Daily API limit reached')) { + console.log('🚫 Daily API limit reached. Stopping migration.'); + console.log('💡 Please run this script again tomorrow to continue.'); + break; + } + + // Continue with next service for other errors + continue; + } + } + + // Progress update + const remainingCount = totalCount - processedCount; + const estimatedTimeRemaining = Math.ceil((remainingCount * 5) / 60); + + console.log(`\n📈 Progress: ${processedCount}/${totalCount} services processed`); + console.log(`✅ Successful: ${successCount} | ❌ Failed: ${errorCount}`); + + if (remainingCount > 0) { + console.log(`⏱️ Estimated time remaining: ${estimatedTimeRemaining} minutes`); + } + } + + console.log('\n================================================'); + console.log('🎉 Migration completed!'); + console.log(`📊 Total services processed: ${processedCount}`); + console.log(`✅ Successfully updated: ${successCount}`); + console.log(`❌ Failed: ${errorCount}`); + console.log(`📈 Success rate: ${((successCount / processedCount) * 100).toFixed(1)}%`); + + if (errorCount > 0) { + console.log('\n💡 Tip: You can run this script again to retry failed services.'); + } + + } catch (error) { + console.error('💥 Migration failed:', error); + console.error('Error details:', error.message); + process.exit(1); + } finally { + await prisma.$disconnect(); + } +} + +// Check if service is ready +async function checkPrerequisites() { + try { + // Test database connection + await prisma.$queryRaw`SELECT 1`; + console.log('✅ Database connection successful'); + + // Check if pgvector extension is available + const pgvectorCheck = await prisma.$queryRaw` + SELECT * FROM pg_extension WHERE extname = 'vector' + `; + + if (pgvectorCheck.length === 0) { + throw new Error('pgvector extension is not installed in the database'); + } + console.log('✅ pgvector extension is available'); + + // Test embedding service + const testEmbedding = await embeddingService.generateEmbedding('test'); + if (!testEmbedding || testEmbedding.length === 0) { + throw new Error('Embedding service is not working properly'); + } + console.log('✅ Embedding service is working'); + console.log(`📏 Embedding dimension: ${testEmbedding.length}`); + + return true; + } catch (error) { + console.error('❌ Prerequisites check failed:', error.message); + return false; + } +} + +// Main execution +async function main() { + console.log('🔍 Checking prerequisites...'); + + const prerequisitesOk = await checkPrerequisites(); + if (!prerequisitesOk) { + console.log('\n💡 Please fix the issues above before running the migration.'); + process.exit(1); + } + + console.log('\n✅ All prerequisites met. Starting migration...\n'); + + // Ask for confirmation in production + if (process.env.NODE_ENV === 'production') { + console.log('⚠️ You are running this in PRODUCTION mode.'); + console.log('🚨 This will modify the database and use API quota.'); + console.log('💰 Make sure you have sufficient API quota for the Gemini embedding service.'); + console.log('\nPress Ctrl+C to cancel, or wait 10 seconds to continue...'); + + await new Promise(resolve => setTimeout(resolve, 10000)); + } + + await generateMissingEmbeddings(); +} + +// Handle graceful shutdown +process.on('SIGINT', async () => { + console.log('\n\n🛑 Migration interrupted by user'); + console.log('💾 Any completed embeddings have been saved to the database'); + await prisma.$disconnect(); + process.exit(0); +}); + +process.on('SIGTERM', async () => { + console.log('\n\n🛑 Migration terminated'); + await prisma.$disconnect(); + process.exit(0); +}); + +// Run the migration +main().catch(async (error) => { + console.error('💥 Unexpected error:', error); + await prisma.$disconnect(); + process.exit(1); +}); \ No newline at end of file diff --git a/scripts/generate-missing-embeddings.ts b/scripts/generate-missing-embeddings.ts new file mode 100755 index 0000000..d1e5148 --- /dev/null +++ b/scripts/generate-missing-embeddings.ts @@ -0,0 +1,237 @@ +#!/usr/bin/env ts-node +/** + * TypeScript Migration script to generate embeddings for existing services + * Usage: npx ts-node scripts/generate-missing-embeddings.ts + */ + +import { PrismaClient } from '@prisma/client'; +import { embeddingService } from '../src/services/embedding.service.js'; + +const prisma = new PrismaClient(); + +async function generateMissingEmbeddings() { + console.log('🚀 Starting migration: Generate missing embeddings for services'); + console.log('================================================'); + + try { + // Get count of services without embeddings + const totalServicesWithoutEmbeddings = await prisma.$queryRaw<[{count: bigint}]>` + SELECT COUNT(*) as count + FROM "Service" + WHERE "combinedEmbedding" IS NULL + AND "isActive" = true + `; + + const totalCount = Number(totalServicesWithoutEmbeddings[0].count); + console.log(`📊 Found ${totalCount} services without embeddings`); + + if (totalCount === 0) { + console.log('✅ All active services already have embeddings!'); + return; + } + + console.log('⚠️ This process will take time due to API rate limits (15 requests/minute)'); + console.log(`⏱️ Estimated time: ${Math.ceil((totalCount * 5) / 60)} minutes\n`); + + const batchSize = 5; // Smaller batch for free tier + let processedCount = 0; + let successCount = 0; + let errorCount = 0; + + while (processedCount < totalCount) { + console.log(`\n📦 Processing batch ${Math.floor(processedCount / batchSize) + 1}...`); + + // Get next batch of services without embeddings + const services = await prisma.$queryRaw>` + SELECT id, title, description, tags + FROM "Service" + WHERE "combinedEmbedding" IS NULL + AND "isActive" = true + ORDER BY "createdAt" DESC + LIMIT ${batchSize} + `; + + if (services.length === 0) { + console.log('🎉 No more services to process!'); + break; + } + + // Process each service in the batch + for (let i = 0; i < services.length; i++) { + const service = services[i]; + processedCount++; + + try { + console.log(`\n⏳ [${processedCount}/${totalCount}] Processing: "${service.title || 'Untitled Service'}"`); + console.log(` Service ID: ${service.id}`); + + // Generate embeddings + const embeddings = await embeddingService.generateServiceEmbeddings({ + title: service.title || '', + description: service.description || '', + tags: service.tags || [] + }); + + // Update service with embeddings + await prisma.$executeRaw` + UPDATE "Service" + SET + "titleEmbedding" = ${embeddings.titleEmbedding}::vector, + "descriptionEmbedding" = ${embeddings.descriptionEmbedding}::vector, + "tagsEmbedding" = ${embeddings.tagsEmbedding}::vector, + "combinedEmbedding" = ${embeddings.combinedEmbedding}::vector, + "embeddingUpdatedAt" = NOW() + WHERE id = ${service.id} + `; + + successCount++; + console.log(` ✅ Success! Embeddings generated and saved.`); + + // Rate limiting: Wait 5 seconds between requests for free tier + if (processedCount < totalCount) { + console.log(` ⏱️ Waiting 5 seconds (rate limit)...`); + await new Promise(resolve => setTimeout(resolve, 5000)); + } + + } catch (error: any) { + errorCount++; + console.error(` ❌ Failed to process service ${service.id}:`); + console.error(` Error: ${error.message}`); + + // If it's a rate limit error, wait longer + if (error.message?.includes('Daily API limit reached')) { + console.log('🚫 Daily API limit reached. Stopping migration.'); + console.log('💡 Please run this script again tomorrow to continue.'); + break; + } + + // If it's a quota error, wait 1 minute and continue + if (error.message?.includes('quota') || error.message?.includes('rate limit')) { + console.log('⏸️ Rate limit hit. Waiting 60 seconds before continuing...'); + await new Promise(resolve => setTimeout(resolve, 60000)); + } + + // Continue with next service for other errors + continue; + } + } + + // Progress update + const remainingCount = totalCount - processedCount; + const estimatedTimeRemaining = Math.ceil((remainingCount * 5) / 60); + + console.log(`\n📈 Progress: ${processedCount}/${totalCount} services processed`); + console.log(`✅ Successful: ${successCount} | ❌ Failed: ${errorCount}`); + + if (remainingCount > 0) { + console.log(`⏱️ Estimated time remaining: ${estimatedTimeRemaining} minutes`); + } + } + + console.log('\n================================================'); + console.log('🎉 Migration completed!'); + console.log(`📊 Total services processed: ${processedCount}`); + console.log(`✅ Successfully updated: ${successCount}`); + console.log(`❌ Failed: ${errorCount}`); + + if (processedCount > 0) { + console.log(`📈 Success rate: ${((successCount / processedCount) * 100).toFixed(1)}%`); + } + + if (errorCount > 0) { + console.log('\n💡 Tip: You can run this script again to retry failed services.'); + } + + } catch (error: any) { + console.error('💥 Migration failed:', error); + console.error('Error details:', error.message); + process.exit(1); + } finally { + await prisma.$disconnect(); + } +} + +// Check if service is ready +async function checkPrerequisites() { + try { + // Test database connection + await prisma.$queryRaw`SELECT 1`; + console.log('✅ Database connection successful'); + + // Check if pgvector extension is available + const pgvectorCheck = await prisma.$queryRaw>` + SELECT * FROM pg_extension WHERE extname = 'vector' + `; + + if (pgvectorCheck.length === 0) { + throw new Error('pgvector extension is not installed in the database'); + } + console.log('✅ pgvector extension is available'); + + // Test embedding service + const testEmbedding = await embeddingService.generateEmbedding('test'); + if (!testEmbedding || testEmbedding.length === 0) { + throw new Error('Embedding service is not working properly'); + } + console.log('✅ Embedding service is working'); + console.log(`📏 Embedding dimension: ${testEmbedding.length}`); + + return true; + } catch (error: any) { + console.error('❌ Prerequisites check failed:', error.message); + return false; + } +} + +// Main execution +async function main() { + console.log('🔍 Checking prerequisites...'); + + const prerequisitesOk = await checkPrerequisites(); + if (!prerequisitesOk) { + console.log('\n💡 Please fix the issues above before running the migration.'); + process.exit(1); + } + + console.log('\n✅ All prerequisites met. Starting migration...\n'); + + // Ask for confirmation in production + if (process.env.NODE_ENV === 'production') { + console.log('⚠️ You are running this in PRODUCTION mode.'); + console.log('🚨 This will modify the database and use API quota.'); + console.log('💰 Make sure you have sufficient API quota for the Gemini embedding service.'); + console.log('\nPress Ctrl+C to cancel, or wait 10 seconds to continue...'); + + await new Promise(resolve => setTimeout(resolve, 10000)); + } + + await generateMissingEmbeddings(); +} + +// Handle graceful shutdown +process.on('SIGINT', async () => { + console.log('\n\n🛑 Migration interrupted by user'); + console.log('💾 Any completed embeddings have been saved to the database'); + await prisma.$disconnect(); + process.exit(0); +}); + +process.on('SIGTERM', async () => { + console.log('\n\n🛑 Migration terminated'); + await prisma.$disconnect(); + process.exit(0); +}); + +// Run the migration if this script is executed directly +if (import.meta.url === `file://${process.argv[1]}`) { + main().catch(async (error) => { + console.error('💥 Unexpected error:', error); + await prisma.$disconnect(); + process.exit(1); + }); +} \ No newline at end of file diff --git a/src/controllers/admin.controller.ts b/src/controllers/admin.controller.ts new file mode 100755 index 0000000..96ee8ad --- /dev/null +++ b/src/controllers/admin.controller.ts @@ -0,0 +1,187 @@ +import type { Request, Response } from 'express'; +import jwt from 'jsonwebtoken'; +import { adminService } from '../services/admin.service.js'; + +const JWT_SECRET = process.env.JWT_SECRET || 'fallback-secret-key'; +const JWT_EXPIRES_IN = process.env.JWT_EXPIRES_IN || '24h'; + +export class AdminController { + async register(req: Request, res: Response): Promise { + try { + const { username, password, firstName, lastName } = req.body; + + // Check if admin already exists + const existingAdmin = await adminService.getAdminByUsername(username); + if (existingAdmin) { + res.status(400).json({ + success: false, + message: 'Admin with this username already exists', + }); + return; + } + + const admin = await adminService.createAdmin({ + username, + password, + firstName, + lastName, + }); + + res.status(201).json({ + success: true, + message: 'Admin created successfully', + data: admin, + }); + } catch (error: any) { + console.error('Admin registration error:', error); + res.status(500).json({ + success: false, + message: 'Internal server error', + error: error.message, + }); + } + } + + async login(req: Request, res: Response): Promise { + try { + const { username, password } = req.body; + + const admin = await adminService.loginAdmin({ username, password }); + if (!admin) { + res.status(401).json({ + success: false, + message: 'Invalid username or password', + }); + return; + } + + // Generate JWT token + const token = jwt.sign( + { + adminId: admin.id, + username: admin.username, + role: 'ADMIN', + }, + JWT_SECRET, + { expiresIn: '24h' } + ); + + res.status(200).json({ + success: true, + message: 'Login successful', + data: { + admin, + token, + }, + }); + } catch (error: any) { + console.error('Admin login error:', error); + res.status(500).json({ + success: false, + message: 'Internal server error', + error: error.message, + }); + } + } + + async getProfile(req: Request, res: Response): Promise { + try { + const adminId = (req as any).admin?.id; + + const admin = await adminService.getAdminById(adminId); + if (!admin) { + res.status(404).json({ + success: false, + message: 'Admin not found', + }); + return; + } + + res.status(200).json({ + success: true, + data: admin, + }); + } catch (error: any) { + console.error('Get admin profile error:', error); + res.status(500).json({ + success: false, + message: 'Internal server error', + error: error.message, + }); + } + } + + async getAllAdmins(req: Request, res: Response): Promise { + try { + const admins = await adminService.getAllAdmins(); + + res.status(200).json({ + success: true, + data: admins, + }); + } catch (error: any) { + console.error('Get all admins error:', error); + res.status(500).json({ + success: false, + message: 'Internal server error', + error: error.message, + }); + } + } + + async updateProfile(req: Request, res: Response): Promise { + try { + const adminId = (req as any).admin?.id; + const { username, password, firstName, lastName } = req.body; + + // Check if at least one field is provided + if (!username && !password && !firstName && !lastName) { + res.status(400).json({ + success: false, + message: 'At least one field must be provided for update', + }); + return; + } + + const updateData: any = {}; + if (username) updateData.username = username; + if (password) updateData.password = password; + if (firstName) updateData.firstName = firstName; + if (lastName) updateData.lastName = lastName; + + const updatedAdmin = await adminService.updateAdmin(adminId, updateData); + + if (!updatedAdmin) { + res.status(404).json({ + success: false, + message: 'Admin not found', + }); + return; + } + + res.status(200).json({ + success: true, + message: 'Profile updated successfully', + data: updatedAdmin, + }); + } catch (error: any) { + console.error('Update admin profile error:', error); + + if (error.message === 'Username already exists') { + res.status(400).json({ + success: false, + message: 'Username already exists', + }); + return; + } + + res.status(500).json({ + success: false, + message: 'Internal server error', + error: error.message, + }); + } + } +} + +export const adminController = new AdminController(); diff --git a/src/controllers/catagory.controller.js b/src/controllers/catagory.controller.ts old mode 100644 new mode 100755 similarity index 78% rename from src/controllers/catagory.controller.js rename to src/controllers/catagory.controller.ts index ddbf870..d95f141 --- a/src/controllers/catagory.controller.js +++ b/src/controllers/catagory.controller.ts @@ -1,9 +1,10 @@ -import * as categoryService from '../services/catagory.service.js'; +import type { Request, Response, NextFunction } from 'express'; +import * as categoryService from '../services/category.service.js'; /** * Create a new category */ -export const createCategory = async (req, res, next) => { +export const createCategory = async (req: Request, res: Response, next: NextFunction) => { try { const categoryData = req.body; const newCategory = await categoryService.createCategory(categoryData); @@ -21,10 +22,10 @@ export const createCategory = async (req, res, next) => { /** * Get all categories with optional filtering */ -export const getCategories = async (req, res, next) => { +export const getCategories = async (req: Request, res: Response, next: NextFunction) => { try { const filters = { - parentId: req.query.parentId, + parentId: req.query.parentId as string | null, includeChildren: req.query.includeChildren !== 'false', includeParent: req.query.includeParent !== 'false', includeServices: req.query.includeServices === 'true' @@ -45,7 +46,7 @@ export const getCategories = async (req, res, next) => { /** * Get category by ID */ -export const getCategoryById = async (req, res, next) => { +export const getCategoryById = async (req: Request, res: Response, next: NextFunction) => { try { const { id } = req.params; const options = { @@ -54,7 +55,7 @@ export const getCategoryById = async (req, res, next) => { includeServices: req.query.includeServices === 'true' }; - const category = await categoryService.getCategoryById(id, options); + const category = await categoryService.getCategoryById(id!, options); if (!category) { return res.status(404).json({ @@ -76,7 +77,7 @@ export const getCategoryById = async (req, res, next) => { /** * Get category by slug */ -export const getCategoryBySlug = async (req, res, next) => { +export const getCategoryBySlug = async (req: Request, res: Response, next: NextFunction) => { try { const { slug } = req.params; const options = { @@ -85,7 +86,7 @@ export const getCategoryBySlug = async (req, res, next) => { includeServices: req.query.includeServices === 'true' }; - const category = await categoryService.getCategoryBySlug(slug, options); + const category = await categoryService.getCategoryBySlug(slug!, options); if (!category) { return res.status(404).json({ @@ -107,12 +108,12 @@ export const getCategoryBySlug = async (req, res, next) => { /** * Update category */ -export const updateCategory = async (req, res, next) => { +export const updateCategory = async (req: Request, res: Response, next: NextFunction) => { try { const { id } = req.params; const updateData = req.body; - const updatedCategory = await categoryService.updateCategory(id, updateData); + const updatedCategory = await categoryService.updateCategory(id!, updateData); res.status(200).json({ success: true, @@ -127,14 +128,14 @@ export const updateCategory = async (req, res, next) => { /** * Delete category */ -export const deleteCategory = async (req, res, next) => { +export const deleteCategory = async (req: Request, res: Response, next: NextFunction) => { try { const { id } = req.params; const options = { force: req.query.force === 'true' }; - const deletedCategory = await categoryService.deleteCategory(id, options); + const deletedCategory = await categoryService.deleteCategory(id!, options); res.status(200).json({ success: true, @@ -149,7 +150,7 @@ export const deleteCategory = async (req, res, next) => { /** * Get root categories (categories with no parent) */ -export const getRootCategories = async (req, res, next) => { +export const getRootCategories = async (req: Request, res: Response, next: NextFunction) => { try { const options = { includeChildren: req.query.includeChildren !== 'false' @@ -170,11 +171,11 @@ export const getRootCategories = async (req, res, next) => { /** * Get category hierarchy */ -export const getCategoryHierarchy = async (req, res, next) => { +export const getCategoryHierarchy = async (req: Request, res: Response, next: NextFunction) => { try { const { id } = req.params; - const hierarchy = await categoryService.getCategoryHierarchy(id); + const hierarchy = await categoryService.getCategoryHierarchy(id!); if (!hierarchy) { return res.status(404).json({ @@ -196,7 +197,7 @@ export const getCategoryHierarchy = async (req, res, next) => { /** * Search categories */ -export const searchCategories = async (req, res, next) => { +export const searchCategories = async (req: Request, res: Response, next: NextFunction) => { try { const { q: searchTerm } = req.query; @@ -212,7 +213,7 @@ export const searchCategories = async (req, res, next) => { includeParent: req.query.includeParent !== 'false' }; - const categories = await categoryService.searchCategories(searchTerm, options); + const categories = await categoryService.searchCategories(searchTerm as string, options); res.status(200).json({ success: true, diff --git a/src/controllers/category.controller.ts b/src/controllers/category.controller.ts new file mode 100755 index 0000000..e6ad390 --- /dev/null +++ b/src/controllers/category.controller.ts @@ -0,0 +1,273 @@ +import type { Request, Response, NextFunction } from 'express'; +import * as categoryService from '../services/category.service.js'; + +/** + * Create a new category + */ +export const createCategory = async (req: Request, res: Response, next: NextFunction) => { + try { + const categoryData = req.body; + const newCategory = await categoryService.createCategory(categoryData); + + res.status(201).json({ + success: true, + message: 'Category created successfully', + data: newCategory + }); + } catch (error) { + next(error); + } +}; + +/** + * Get categories with optional filtering + */ +export const getCategories = async (req: Request, res: Response, next: NextFunction) => { + try { + const { parentId, includeChildren, includeParent, includeServices } = req.query; + + const filters = { + ...(parentId && { parentId: parentId as string }), + ...(includeChildren !== undefined && { includeChildren: includeChildren === 'true' }), + ...(includeParent !== undefined && { includeParent: includeParent === 'true' }), + ...(includeServices !== undefined && { includeServices: includeServices === 'true' }) + }; + + const categories = await categoryService.getAllCategories(filters); + + res.status(200).json({ + success: true, + message: 'Categories fetched successfully', + data: categories + }); + } catch (error) { + next(error); + } +}; + +/** + * Get category by ID + */ +export const getCategoryById = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + const { includeChildren, includeParent, includeServices } = req.query; + + if (!id) { + return res.status(400).json({ + success: false, + message: 'Category ID is required' + }); + } + + const options = { + ...(includeChildren !== undefined && { includeChildren: includeChildren === 'true' }), + ...(includeParent !== undefined && { includeParent: includeParent === 'true' }), + ...(includeServices !== undefined && { includeServices: includeServices === 'true' }) + }; + + const category = await categoryService.getCategoryById(id, options); + + if (!category) { + return res.status(404).json({ + success: false, + message: 'Category not found' + }); + } + + res.status(200).json({ + success: true, + message: 'Category fetched successfully', + data: category + }); + } catch (error) { + next(error); + } +}; + +/** + * Get category by slug + */ +export const getCategoryBySlug = async (req: Request, res: Response, next: NextFunction) => { + try { + const { slug } = req.params; + const { includeChildren, includeParent, includeServices } = req.query; + + if (!slug) { + return res.status(400).json({ + success: false, + message: 'Category slug is required' + }); + } + + const options = { + ...(includeChildren !== undefined && { includeChildren: includeChildren === 'true' }), + ...(includeParent !== undefined && { includeParent: includeParent === 'true' }), + ...(includeServices !== undefined && { includeServices: includeServices === 'true' }) + }; + + const category = await categoryService.getCategoryBySlug(slug, options); + + if (!category) { + return res.status(404).json({ + success: false, + message: 'Category not found' + }); + } + + res.status(200).json({ + success: true, + message: 'Category fetched successfully', + data: category + }); + } catch (error) { + next(error); + } +}; + +/** + * Update category + */ +export const updateCategory = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + const updateData = req.body; + + if (!id) { + return res.status(400).json({ + success: false, + message: 'Category ID is required' + }); + } + + const updatedCategory = await categoryService.updateCategory(id, updateData); + + res.status(200).json({ + success: true, + message: 'Category updated successfully', + data: updatedCategory + }); + } catch (error) { + next(error); + } +}; + +/** + * Delete category + */ +export const deleteCategory = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + const { force } = req.query; + + if (!id) { + return res.status(400).json({ + success: false, + message: 'Category ID is required' + }); + } + + const options = { + ...(force !== undefined && { force: force === 'true' }) + }; + + const deletedCategory = await categoryService.deleteCategory(id, options); + + res.status(200).json({ + success: true, + message: 'Category deleted successfully', + data: deletedCategory + }); + } catch (error) { + next(error); + } +}; + +/** + * Get root categories + */ +export const getRootCategories = async (req: Request, res: Response, next: NextFunction) => { + try { + const { includeChildren, includeServices } = req.query; + + const options = { + ...(includeChildren !== undefined && { includeChildren: includeChildren === 'true' }), + ...(includeServices !== undefined && { includeServices: includeServices === 'true' }) + }; + + const categories = await categoryService.getRootCategories(options); + + res.status(200).json({ + success: true, + message: 'Root categories fetched successfully', + data: categories + }); + } catch (error) { + next(error); + } +}; + +/** + * Get category hierarchy + */ +export const getCategoryHierarchy = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + + if (!id) { + return res.status(400).json({ + success: false, + message: 'Category ID is required' + }); + } + + const hierarchy = await categoryService.getCategoryHierarchy(id); + + if (!hierarchy) { + return res.status(404).json({ + success: false, + message: 'Category not found' + }); + } + + res.status(200).json({ + success: true, + message: 'Category hierarchy fetched successfully', + data: hierarchy + }); + } catch (error) { + next(error); + } +}; + +/** + * Search categories + */ +export const searchCategories = async (req: Request, res: Response, next: NextFunction) => { + try { + const { q: searchTerm } = req.query; + const { includeChildren, includeParent } = req.query; + + if (!searchTerm || typeof searchTerm !== 'string') { + return res.status(400).json({ + success: false, + message: 'Search term is required' + }); + } + + const options = { + ...(includeChildren !== undefined && { includeChildren: includeChildren === 'true' }), + ...(includeParent !== undefined && { includeParent: includeParent === 'true' }) + }; + + const categories = await categoryService.searchCategories(searchTerm, options); + + res.status(200).json({ + success: true, + message: 'Categories search completed', + data: categories + }); + } catch (error) { + next(error); + } +}; diff --git a/src/controllers/chatbotController.ts b/src/controllers/chatbotController.ts new file mode 100755 index 0000000..ffaf1b7 --- /dev/null +++ b/src/controllers/chatbotController.ts @@ -0,0 +1,104 @@ +import { Request, Response } from 'express'; +import { chatbotService } from '../services/chatbotService.js'; + +export class ChatbotController { + + /** + * Process user question and return chatbot response + * POST /api/chatbot/ask + */ + async askQuestion(req: Request, res: Response) { + try { + const { message } = req.body; + + // Validate input + if (!message || typeof message !== 'string' || message.trim().length === 0) { + return res.status(400).json({ + success: false, + error: 'Message is required and must be a non-empty string', + data: { + question: message || '', + answer: "Please provide a valid question! I'm here to help you with the Zia platform.", + timestamp: new Date().toISOString() + } + }); + } + + // Process the question + const answer = await chatbotService.processQuestion(message.trim()); + + return res.status(200).json({ + success: true, + data: { + question: message.trim(), + answer: answer, + timestamp: new Date().toISOString() + } + }); + + } catch (error) { + console.error('❌ Chatbot error:', error); + + return res.status(500).json({ + success: false, + error: 'Sorry, I encountered an error processing your question. Please try again.', + data: { + question: req.body?.message || '', + answer: "I'm having trouble right now, but I'm here to help! Try asking about booking services, messaging, payments, or platform navigation.", + timestamp: new Date().toISOString() + } + }); + } + } + + /** + * Get quick question suggestions + * POST /api/chatbot/suggestions + */ + async getSuggestions(req: Request, res: Response) { + try { + const suggestions = chatbotService.getSuggestions(); + + return res.status(200).json({ + success: true, + data: { + suggestions, + timestamp: new Date().toISOString() + } + }); + + } catch (error) { + console.error('❌ Suggestions error:', error); + + // Fallback suggestions + return res.status(200).json({ + success: true, + data: { + suggestions: [ + "How do I book a service?", + "How do I use messaging?", + "How do payments work?", + "How do I become a provider?" + ], + timestamp: new Date().toISOString() + } + }); + } + } + + /** + * Health check for chatbot service + * GET /api/chatbot/health + */ + async healthCheck(req: Request, res: Response) { + return res.status(200).json({ + success: true, + service: 'Chatbot Service', + status: 'healthy', + timestamp: new Date().toISOString() + }); + } +} + +// Export singleton instance +export const chatbotController = new ChatbotController(); diff --git a/src/controllers/company.controller.js b/src/controllers/company.controller.js deleted file mode 100644 index ed59e28..0000000 --- a/src/controllers/company.controller.js +++ /dev/null @@ -1,45 +0,0 @@ -import * as companyService from '../services/company.service.js'; - -export const createCompany = async (req, res, next) => { - try { - const company = await companyService.createCompany(req.user.id, req.body); - res.status(201).json({ - message: 'Company created successfully', - company - }); - } catch (err) { - next(err); - } -}; - -export const updateCompany = async (req, res, next) => { - try { - const company = await companyService.updateCompany(req.user.id, req.params.companyId, req.body); - res.status(200).json({ - message: 'Company updated successfully', - company - }); - } catch (err) { - next(err); - } -}; - -export const deleteCompany = async (req, res, next) => { - try { - await companyService.deleteCompany(req.user.id, req.params.companyId); - res.status(200).json({ - message: 'Company deleted successfully' - }); - } catch (err) { - next(err); - } -}; - -export const getCompanies = async (req, res, next) => { - try { - const companies = await companyService.getCompanies(req.user.id); - res.status(200).json(companies); - } catch (err) { - next(err); - } -}; diff --git a/src/controllers/company.controller.ts b/src/controllers/company.controller.ts new file mode 100755 index 0000000..bc46088 --- /dev/null +++ b/src/controllers/company.controller.ts @@ -0,0 +1,46 @@ +import type { Request, Response, NextFunction } from 'express'; +import * as companyService from '../services/company.service.js'; + +export const createCompany = async (req: Request, res: Response, next: NextFunction) => { + try { + const company = await companyService.createCompany((req as any).user.id, req.body); + res.status(201).json({ + message: 'Company created successfully', + company + }); + } catch (err) { + next(err); + } +}; + +export const updateCompany = async (req: Request, res: Response, next: NextFunction) => { + try { + const company = await companyService.updateCompany((req as any).user.id, req.params.companyId!, req.body); + res.status(200).json({ + message: 'Company updated successfully', + company + }); + } catch (err) { + next(err); + } +}; + +export const deleteCompany = async (req: Request, res: Response, next: NextFunction) => { + try { + await companyService.deleteCompany((req as any).user.id, req.params.companyId!); + res.status(200).json({ + message: 'Company deleted successfully' + }); + } catch (err) { + next(err); + } +}; + +export const getCompanies = async (req: Request, res: Response, next: NextFunction) => { + try { + const companies = await companyService.getCompanies((req as any).user.id); + res.status(200).json(companies); + } catch (err) { + next(err); + } +}; diff --git a/src/controllers/confirmation.controller.ts b/src/controllers/confirmation.controller.ts new file mode 100755 index 0000000..6488de5 --- /dev/null +++ b/src/controllers/confirmation.controller.ts @@ -0,0 +1,372 @@ +import { Request, Response } from 'express'; +import { prisma } from '../utils/database.js'; +import { queueService } from '../services/queue.service.js'; + +// Confirmation data now maps to Schedule table fields +// conversationId will be used to find related schedules via conversation user IDs + +interface ConversationConfirmation { + id?: string; + conversationId: string; + customerConfirmation: boolean; + providerConfirmation: boolean; + startDate: string | null; + endDate: string | null; + serviceFee?: number | null; + currency?: string; + updatedAt?: string; +} + +// Helper function to find or create a schedule for a conversation +async function findOrCreateScheduleForConversation(conversationId: string): Promise { + // Get conversation with user IDs + const conversation = await prisma.conversation.findUnique({ + where: { id: conversationId }, + select: { userIds: true } + }); + + if (!conversation || conversation.userIds.length < 2) { + throw new Error('Invalid conversation or insufficient participants'); + } + + // First determine who is the provider and who is the customer + const users = await prisma.user.findMany({ + where: { id: { in: conversation.userIds } }, + include: { serviceProvider: true } + }); + + // Try to determine provider and customer based on service provider status + let providerUser = users.find(user => user.serviceProvider); + let customerUser = users.find(user => !user.serviceProvider); + + // Handle case where both users are service providers + if (!customerUser && users.length === 2 && users.every(user => user.serviceProvider)) { + // In provider-to-provider conversations, we'll treat the first user as the "service provider" + // and the second as the "customer" for the purpose of creating a schedule + // This allows for scenarios like: provider A hiring provider B, or collaboration + providerUser = users[0]; + customerUser = users[1]; + } + + // Handle case where both users are regular users (no service providers) + if (!providerUser && users.length === 2 && users.every(user => !user.serviceProvider)) { + throw new Error('Cannot create service confirmation between two regular users - at least one must be a service provider'); + } + + if (!providerUser || !customerUser) { + throw new Error('Unable to determine provider and customer in conversation'); + } + + // Try to find existing schedule for this conversation using proper IDs + // For provider-to-provider conversations, we need to be more flexible in finding existing schedules + // since either provider could be providing service to the other + let schedule = await prisma.schedule.findFirst({ + where: { + OR: [ + // Standard case: customerUser as customer, providerUser as provider + { + userId: customerUser.id, + providerId: providerUser.serviceProvider!.id + }, + // Reverse case: in case there's already a schedule with roles reversed + ...(customerUser.serviceProvider ? [{ + userId: providerUser.id, + providerId: customerUser.serviceProvider.id + }] : []) + ] + }, + include: { + user: true, + provider: { include: { user: true } }, + service: true + } + }); + + // If no schedule exists, create one + if (!schedule) { + // Get or create a default service for this provider + let service = await prisma.service.findFirst({ + where: { providerId: providerUser.serviceProvider!.id }, + orderBy: { createdAt: 'desc' } + }); + + if (!service) { + // Create a default category if it doesn't exist + let defaultCategory = await prisma.category.findUnique({ + where: { slug: 'default' } + }); + + if (!defaultCategory) { + defaultCategory = await prisma.category.create({ + data: { + id: 'default', + name: 'General Services', + slug: 'default', + description: 'General consultation and services' + } + }); + } + + // Create a default consultation service if none exists + service = await prisma.service.create({ + data: { + providerId: providerUser.serviceProvider!.id, + categoryId: defaultCategory.id, + title: 'General Consultation', + description: 'General consultation service', + price: 0, + currency: 'USD', + tags: ['consultation'], + images: [] + } + }); + } + + // Create new schedule + schedule = await prisma.schedule.create({ + data: { + serviceId: service.id, + providerId: providerUser.serviceProvider!.id, + userId: customerUser.id, + startTime: new Date().toISOString(), + endTime: new Date(Date.now() + 60 * 60 * 1000).toISOString(), // 1 hour default + customerConfirmation: false, + providerConfirmation: false + }, + include: { + user: true, + provider: { include: { user: true } }, + service: true + } + }); + } + + return schedule; +} + +// Helper function to convert schedule to confirmation format +function scheduleToConfirmation(schedule: any, conversationId: string): ConversationConfirmation { + return { + id: schedule.id, + conversationId, + customerConfirmation: schedule.customerConfirmation, + providerConfirmation: schedule.providerConfirmation, + startDate: schedule.startTime, + endDate: schedule.endTime, + serviceFee: schedule.serviceFee ? parseFloat(schedule.serviceFee.toString()) : null, + currency: schedule.currency, + updatedAt: schedule.updatedAt || new Date().toISOString() + }; +} + +// Remove the in-memory store as we're now using the database +// const confirmationStore = new Map(); + +// Helper function to send email notifications +async function sendConfirmationEmails(schedule: any, conversationId: string, eventType: 'BOOKING_CONFIRMATION' | 'BOOKING_CANCELLATION_MODIFICATION') { + try { + const emailData = { + conversationId, + scheduleId: schedule.id, + customerEmail: schedule.user.email, + providerEmail: schedule.provider.user.email, + customerName: schedule.user.fullName || schedule.user.email, + providerName: schedule.provider.user.fullName || schedule.provider.user.email, + serviceName: schedule.service.title, + startDate: schedule.startTime, + endDate: schedule.endTime, + serviceFee: schedule.serviceFee ? parseFloat(schedule.serviceFee.toString()) : undefined, + currency: schedule.currency || 'USD' + }; + + if (eventType === 'BOOKING_CONFIRMATION') { + await queueService.sendBookingConfirmation(emailData); + console.log('📧 Booking confirmation emails queued successfully'); + } else { + await queueService.sendBookingModification({ + ...emailData, + message: 'Booking details have been updated' + }); + console.log('📧 Booking modification emails queued successfully'); + } + } catch (emailError) { + console.error(`❌ Failed to queue ${eventType} emails:`, emailError); + + // Enhanced error logging for better debugging + if (emailError.message?.includes('daily limit') || emailError.message?.includes('sending limit')) { + console.error('🚫 Email service has hit daily sending limits'); + console.error('💡 Recommendation: Upgrade to a professional email service (SendGrid, AWS SES, Mailgun)'); + console.error('📝 Booking was still processed successfully - only email notifications failed'); + } else if (emailError.message?.includes('authentication')) { + console.error('🔐 Email service authentication failed'); + console.error('💡 Check email credentials and app password configuration'); + } else { + console.error('❓ Unknown email service error - please check email service health'); + } + + // Don't fail the main operation - booking confirmations should work even if emails fail + console.log('✅ Booking operation completed successfully despite email notification failure'); + } +} + +export const getConfirmationController = async (req: Request, res: Response) => { + try { + const { conversationId } = req.params; + + // Check if conversation exists + const conversation = await prisma.conversation.findUnique({ + where: { id: conversationId } + }); + + if (!conversation) { + return res.status(404).json({ error: 'Conversation not found' }); + } + + // Find or create schedule for this conversation + const schedule = await findOrCreateScheduleForConversation(conversationId); + + // Convert schedule to confirmation format + const confirmation = scheduleToConfirmation(schedule, conversationId); + + res.json(confirmation); + } catch (error) { + console.error('Error getting confirmation:', error); + res.status(500).json({ error: 'Internal server error' }); + } +}; + +export const createConfirmationController = async (req: Request, res: Response) => { + try { + const { conversationId, customerConfirmation = false, providerConfirmation = false, startDate = null, endDate = null, serviceFee = null, currency = 'USD' } = req.body; + + if (!conversationId) { + return res.status(400).json({ error: 'conversationId is required' }); + } + + // Check if conversation exists + const conversation = await prisma.conversation.findUnique({ + where: { id: conversationId } + }); + + if (!conversation) { + return res.status(404).json({ error: 'Conversation not found' }); + } + + // Find or create schedule for this conversation + let schedule = await findOrCreateScheduleForConversation(conversationId); + + // Update the schedule with provided values + schedule = await prisma.schedule.update({ + where: { id: schedule.id }, + data: { + customerConfirmation, + providerConfirmation, + startTime: startDate || schedule.startTime, + endTime: endDate || schedule.endTime, + ...(serviceFee !== null && { serviceFee: serviceFee }), + ...(currency && { currency }) + }, + include: { + user: true, + provider: { include: { user: true } }, + service: true + } + }); + + // Convert to confirmation format + const confirmation = scheduleToConfirmation(schedule, conversationId); + + // Notify communication service for real-time update + try { + await fetch('http://localhost:3001/api/confirmation/broadcast', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ conversationId, confirmation }) + }); + } catch (notifyErr) { + console.error('Failed to notify communication service:', notifyErr); + } + + // Send email notification + await sendConfirmationEmails(schedule, conversationId, 'BOOKING_CONFIRMATION'); + + res.status(201).json(confirmation); + } catch (error) { + console.error('Error creating confirmation:', error); + res.status(500).json({ error: 'Internal server error' }); + } +}; + +export const upsertConfirmationController = async (req: Request, res: Response) => { + try { + const { conversationId } = req.params; + const updates = req.body; + + // Check if conversation exists + const conversation = await prisma.conversation.findUnique({ + where: { id: conversationId } + }); + + if (!conversation) { + return res.status(404).json({ error: 'Conversation not found' }); + } + + // Find or create schedule for this conversation + let schedule = await findOrCreateScheduleForConversation(conversationId); + + // Prepare update data, only including defined values + const updateData: any = {}; + + if (updates.customerConfirmation !== undefined) { + updateData.customerConfirmation = updates.customerConfirmation; + } + if (updates.providerConfirmation !== undefined) { + updateData.providerConfirmation = updates.providerConfirmation; + } + if (updates.startDate !== undefined) { + updateData.startTime = updates.startDate; + } + if (updates.endDate !== undefined) { + updateData.endTime = updates.endDate; + } + if (updates.serviceFee !== undefined) { + updateData.serviceFee = updates.serviceFee; + } + if (updates.currency !== undefined) { + updateData.currency = updates.currency; + } + + // Update the schedule + schedule = await prisma.schedule.update({ + where: { id: schedule.id }, + data: updateData, + include: { + user: true, + provider: { include: { user: true } }, + service: true + } + }); + + // Convert to confirmation format + const confirmation = scheduleToConfirmation(schedule, conversationId); + + // Notify communication service for real-time update + try { + await fetch('http://localhost:3001/api/confirmation/broadcast', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ conversationId, confirmation }) + }); + } catch (notifyErr) { + console.error('Failed to notify communication service:', notifyErr); + } + + // Send email notification + await sendConfirmationEmails(schedule, conversationId, 'BOOKING_CANCELLATION_MODIFICATION'); + + res.json(confirmation); + } catch (error) { + console.error('Error updating confirmation:', error); + res.status(500).json({ error: 'Internal server error' }); + } +}; diff --git a/src/controllers/provider.controller.js b/src/controllers/provider.controller.js deleted file mode 100644 index 2760dd2..0000000 --- a/src/controllers/provider.controller.js +++ /dev/null @@ -1,43 +0,0 @@ -import * as providerService from '../services/provider.service.js'; - -export const createProvider = async (req, res, next) => { - try { - const provider = await providerService.createProvider(req.user.id, req.body); - res.status(201).json({ - message: 'Service provider profile created successfully', - provider - }); - } catch (err) { - next(err); - } -}; - -export const updateProvider = async (req, res, next) => { - try { - const provider = await providerService.updateProvider(req.user.id, req.body); - res.status(200).json({ - message: 'Service provider profile updated successfully', - provider - }); - } catch (err) { - next(err); - } -}; - -export const deleteProvider = async (req, res, next) => { - try { - const result = await providerService.deleteProvider(req.user.id); - res.status(200).json(result); - } catch (err) { - next(err); - } -}; - -export const getProviderProfile = async (req, res, next) => { - try { - const provider = await providerService.getProviderProfile(req.user.id); - res.status(200).json(provider); - } catch (err) { - next(err); - } -}; diff --git a/src/controllers/provider.controller.ts b/src/controllers/provider.controller.ts new file mode 100755 index 0000000..d78dea7 --- /dev/null +++ b/src/controllers/provider.controller.ts @@ -0,0 +1,77 @@ +import type { Request, Response, NextFunction } from 'express'; +import * as providerService from '../services/provider.service.js'; + +export const createProvider = async (req: Request, res: Response, next: NextFunction) => { + try { + const provider = await providerService.createProvider((req as any).user.id, req.body); + res.status(201).json({ + message: 'Service provider profile created successfully', + provider + }); + } catch (err) { + next(err); + } +}; + +export const updateProvider = async (req: Request, res: Response, next: NextFunction) => { + try { + const provider = await providerService.updateProvider((req as any).user.id, req.body); + res.status(200).json({ + message: 'Service provider profile updated successfully', + provider + }); + } catch (err) { + next(err); + } +}; + +export const deleteProvider = async (req: Request, res: Response, next: NextFunction) => { + try { + const result = await providerService.deleteProvider((req as any).user.id); + res.status(200).json(result); + } catch (err) { + next(err); + } +}; + +export const getProviderProfile = async (req: Request, res: Response, next: NextFunction) => { + try { + const provider = await providerService.getProviderProfile((req as any).user.id); + res.status(200).json(provider); + } catch (err) { + next(err); + } +}; + +export const getProviderById = async (req: Request, res: Response, next: NextFunction) => { + try { + const provider = await providerService.getProviderById(req.params.id); + res.status(200).json(provider); + } catch (err) { + next(err); + } +}; + +export const verifyProvider = async (req: Request, res: Response, next: NextFunction) => { + try { + const provider = await providerService.verifyProvider(req.params.id); + res.status(200).json({ + message: 'Service provider verified successfully', + provider + }); + } catch (err) { + next(err); + } +}; + +export const unverifyProvider = async (req: Request, res: Response, next: NextFunction) => { + try { + const provider = await providerService.unverifyProvider(req.params.id); + res.status(200).json({ + message: 'Service provider unverified successfully', + provider + }); + } catch (err) { + next(err); + } +}; diff --git a/src/controllers/review.controller.ts b/src/controllers/review.controller.ts new file mode 100755 index 0000000..5fdc520 --- /dev/null +++ b/src/controllers/review.controller.ts @@ -0,0 +1,126 @@ +import type { Request, Response, NextFunction } from 'express'; +import { + createReview, + getCustomerReviews, + getReviewsByProvider, + getReviewById, + updateReview, + deleteReview, + getCustomerStats +} from '../services/review.service.js'; +import { queueService } from '../services/queue.service.js'; +import { prisma } from '../utils/database.js'; + +export const createReviewController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { reviewerId, revieweeId, rating, comment } = req.body; + const review = await createReview({ reviewerId, revieweeId, rating, comment }); + + // Send email notification for new review + try { + // Get full user data for email notifications + const [reviewer, reviewee] = await Promise.all([ + prisma.user.findUnique({ + where: { id: reviewerId }, + select: { email: true, firstName: true, lastName: true } + }), + prisma.user.findUnique({ + where: { id: revieweeId }, + select: { email: true, firstName: true, lastName: true } + }) + ]); + + if (reviewer && reviewee) { + await queueService.sendMessageOrReviewNotification({ + customerEmail: reviewer.email, + providerEmail: reviewee.email, + customerName: `${reviewer.firstName} ${reviewer.lastName}`.trim() || reviewer.email, + providerName: `${reviewee.firstName} ${reviewee.lastName}`.trim() || reviewee.email, + reviewData: { + rating, + comment, + reviewerName: `${reviewer.firstName} ${reviewer.lastName}`.trim() || reviewer.email + }, + notificationType: 'REVIEW', + metadata: { + reviewId: review.id, + rating: rating + } + }); + console.log('📧 Review notification email queued successfully'); + } + } catch (emailError) { + console.error('❌ Failed to queue review notification email:', emailError); + // Don't fail the review creation if email fails + } + + res.status(201).json({ message: 'Review created', review }); + } catch (err) { + next(err); + } +}; + +export const getCustomerReviewsController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { customerId } = req.params; + const { page = 1, limit = 10 } = req.query; + const reviews = await getCustomerReviews(customerId, Number(page), Number(limit)); + res.status(200).json(reviews); + } catch (err) { + next(err); + } +}; + +export const getReviewsByProviderController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { providerId } = req.params; + const { page = 1, limit = 10 } = req.query; + const reviews = await getReviewsByProvider(providerId, Number(page), Number(limit)); + res.status(200).json(reviews); + } catch (err) { + next(err); + } +}; + +export const getReviewByIdController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { reviewId } = req.params; + const review = await getReviewById(reviewId); + res.status(200).json(review); + } catch (err) { + next(err); + } +}; + +export const updateReviewController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { reviewId } = req.params; + const reviewerId = req.body.reviewerId; + const updateData = req.body; + const review = await updateReview(reviewId, updateData, reviewerId); + res.status(200).json({ message: 'Review updated', review }); + } catch (err) { + next(err); + } +}; + +export const deleteReviewController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { reviewId } = req.params; + const reviewerId = req.body.reviewerId; + const result = await deleteReview(reviewId, reviewerId); + res.status(200).json(result); + } catch (err) { + next(err); + } +}; + +export const getCustomerStatsController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { customerId } = req.params; + const stats = await getCustomerStats(customerId); + res.status(200).json(stats); + } catch (err) { + next(err); + } +}; diff --git a/src/controllers/serviceReview.controller.ts b/src/controllers/serviceReview.controller.ts new file mode 100755 index 0000000..359d173 --- /dev/null +++ b/src/controllers/serviceReview.controller.ts @@ -0,0 +1,156 @@ +import { + createServiceReview, + getServiceReviews, + getServiceReviewById, + updateServiceReview, + deleteServiceReview, + getServiceReviewStats, + getServiceReviewsDetailed, + getProviderServiceReviews, + getProviderReviewStats, + CreateServiceReviewData, + UpdateServiceReviewData +} from '../services/serviceReview.service.js'; +import { Request, Response } from 'express'; + +export const createServiceReviewController = async (req: Request, res: Response) => { + try { + const data: CreateServiceReviewData = req.body; + // reviewerId should come from auth middleware (req.user.id) + data.reviewerId = req.user.id; + const review = await createServiceReview(data); + res.status(201).json(review); + } catch (err: any) { + res.status(400).json({ error: err.message }); + } +}; + +export const getServiceReviewsController = async (req: Request, res: Response) => { + try { + const { serviceId } = req.params; + const { page = 1, limit = 10 } = req.query; + const result = await getServiceReviews(serviceId, Number(page), Number(limit)); + res.json(result); + } catch (err: any) { + res.status(400).json({ error: err.message }); + } +}; + +export const getServiceReviewByIdController = async (req: Request, res: Response) => { + try { + const { reviewId } = req.params; + const review = await getServiceReviewById(reviewId); + res.json(review); + } catch (err: any) { + res.status(404).json({ error: err.message }); + } +}; + +export const updateServiceReviewController = async (req: Request, res: Response) => { + try { + const { reviewId } = req.params; + const data: UpdateServiceReviewData = req.body; + const userId = req.user.id; + const review = await updateServiceReview(reviewId, data, userId); + res.json(review); + } catch (err: any) { + res.status(400).json({ error: err.message }); + } +}; + +export const deleteServiceReviewController = async (req: Request, res: Response) => { + try { + const { reviewId } = req.params; + const userId = req.user.id; + const result = await deleteServiceReview(reviewId, userId); + res.json(result); + } catch (err: any) { + res.status(400).json({ error: err.message }); + } +}; + +export const getServiceReviewStatsController = async (req: Request, res: Response) => { + try { + const { serviceId } = req.params; + const stats = await getServiceReviewStats(serviceId); + res.json({ + success: true, + message: 'Service review statistics retrieved successfully', + data: stats + }); + } catch (err: any) { + res.status(400).json({ + success: false, + error: err.message + }); + } +}; + +export const getServiceReviewsDetailedController = async (req: Request, res: Response) => { + try { + const { serviceId } = req.params; + const { page = 1, limit = 10, rating } = req.query; + + const ratingFilter = rating ? Number(rating) : undefined; + const result = await getServiceReviewsDetailed( + serviceId, + Number(page), + Number(limit), + ratingFilter + ); + + res.json({ + success: true, + message: 'Service reviews retrieved successfully', + data: result + }); + } catch (err: any) { + res.status(400).json({ + success: false, + error: err.message + }); + } +}; + +export const getProviderServiceReviewsController = async (req: Request, res: Response) => { + try { + const { providerId } = req.params; + const { page = 1, limit = 10, rating } = req.query; + + const ratingFilter = rating ? Number(rating) : undefined; + const result = await getProviderServiceReviews( + providerId, + Number(page), + Number(limit), + ratingFilter + ); + + res.json({ + success: true, + message: 'Provider service reviews retrieved successfully', + data: result + }); + } catch (err: any) { + res.status(400).json({ + success: false, + error: err.message + }); + } +}; + +export const getProviderReviewStatsController = async (req: Request, res: Response) => { + try { + const { providerId } = req.params; + const stats = await getProviderReviewStats(providerId); + res.json({ + success: true, + message: 'Provider review statistics retrieved successfully', + data: stats + }); + } catch (err: any) { + res.status(400).json({ + success: false, + error: err.message + }); + } +}; diff --git a/src/controllers/services.controller.js b/src/controllers/services.controller.js deleted file mode 100644 index 88884a2..0000000 --- a/src/controllers/services.controller.js +++ /dev/null @@ -1,111 +0,0 @@ -import * as serviceService from '../services/services.service.js'; - -/** - * Create a new service - */ -export const createService = async (req, res, next) => { - try { - const serviceData = req.body; - const newService = await serviceService.createService(serviceData); - - res.status(201).json({ - success: true, - message: 'Service created successfully', - data: newService - }); - } catch (error) { - next(error); - } -}; - -/** - * Get all services with optional filtering - */ -export const getServices = async (req, res, next) => { - try { - const filters = { - providerId: req.query.providerId, - categoryId: req.query.categoryId, - isActive: req.query.isActive ? req.query.isActive === 'true' : undefined, - skip: req.query.skip ? parseInt(req.query.skip) : 0, - take: req.query.take ? parseInt(req.query.take) : 10 - }; - - const services = await serviceService.getServices(filters); - - res.status(200).json({ - success: true, - message: 'Services retrieved successfully', - data: services, - pagination: { - skip: filters.skip, - take: filters.take - } - }); - } catch (error) { - next(error); - } -}; - -/** - * Get a single service by ID - */ -export const getServiceById = async (req, res, next) => { - try { - const { id } = req.params; - const service = await serviceService.getServiceById(id); - - if (!service) { - return res.status(404).json({ - success: false, - message: 'Service not found' - }); - } - - res.status(200).json({ - success: true, - message: 'Service retrieved successfully', - data: service - }); - } catch (error) { - next(error); - } -}; - -/** - * Update a service - */ -export const updateService = async (req, res, next) => { - try { - const { id } = req.params; - const updateData = req.body; - - const updatedService = await serviceService.updateService(id, updateData); - - res.status(200).json({ - success: true, - message: 'Service updated successfully', - data: updatedService - }); - } catch (error) { - next(error); - } -}; - -/** - * Delete a service - */ -export const deleteService = async (req, res, next) => { - try { - const { id } = req.params; - - await serviceService.deleteService(id); - - res.status(200).json({ - success: true, - message: 'Service deleted successfully' - }); - } catch (error) { - next(error); - } -}; diff --git a/src/controllers/services.controller.ts b/src/controllers/services.controller.ts new file mode 100755 index 0000000..24137e2 --- /dev/null +++ b/src/controllers/services.controller.ts @@ -0,0 +1,684 @@ +import type { Request, Response, NextFunction } from 'express'; +import * as serviceService from '../services/services.service.js'; +import { semanticSearchService } from '../services/semantic-search.service.js'; +import googleMapsService from '../services/googleMaps.service.js'; + +/** + * Create a new service + */ +export const createService = async (req: Request, res: Response, next: NextFunction) => { + try { + console.log('=== SERVICE CREATION DEBUG ==='); + console.log('Request body received:', JSON.stringify(req.body, null, 2)); + + const serviceData = req.body; + + // Handle location data if provided + if (serviceData.address || (serviceData.latitude && serviceData.longitude)) { + try { + let locationData; + + if (serviceData.latitude && serviceData.longitude) { + // Manual coordinates provided - validate and reverse geocode + if (!googleMapsService.validateCoordinates(serviceData.latitude, serviceData.longitude)) { + return res.status(400).json({ + success: false, + message: 'Invalid coordinates provided' + }); + } + + locationData = await googleMapsService.reverseGeocode( + serviceData.latitude, + serviceData.longitude + ); + } else if (serviceData.address) { + // Address provided - geocode to get coordinates + locationData = await googleMapsService.geocodeAddress(serviceData.address); + } + + if (locationData) { + // Merge location data into service data + serviceData.latitude = locationData.lat; + serviceData.longitude = locationData.lng; + serviceData.address = locationData.formatted_address; + serviceData.city = locationData.city; + serviceData.state = locationData.state; + serviceData.country = locationData.country; + serviceData.postalCode = locationData.postal_code; + serviceData.locationLastUpdated = new Date(); + } + } catch (locationError) { + console.warn('Location processing failed:', locationError); + // Continue without location data rather than failing the entire request + } + } + + // Debug: Check if videoUrl is present + console.log('Video URL in service data:', serviceData.videoUrl); + console.log('Video URL type:', typeof serviceData.videoUrl); + console.log('Video URL length:', serviceData.videoUrl ? serviceData.videoUrl.length : 'N/A'); + + console.log('Calling service creation...'); + const newService = await serviceService.createService(serviceData); + + console.log('Service created successfully. Result:', JSON.stringify(newService, null, 2)); + console.log('Video URL in created service:', (newService as any).videoUrl); + + res.status(201).json({ + success: true, + message: 'Service created successfully', + data: newService + }); + } catch (error) { + console.error('=== SERVICE CREATION ERROR ==='); + console.error('Error details:', error); + console.error('Error message:', error instanceof Error ? error.message : 'Unknown error'); + console.error('Error stack:', error instanceof Error ? error.stack : 'No stack trace'); + next(error); + } +}; + +/** + * Get all services with optional filtering + */ +export const getServices = async (req: Request, res: Response, next: NextFunction) => { + try { + const filters: any = { + providerId: req.query.providerId as string, + categoryId: req.query.categoryId as string, + skip: req.query.skip ? parseInt(req.query.skip as string) : 0, + take: req.query.take ? parseInt(req.query.take as string) : 10 + }; + if (typeof req.query.isActive !== 'undefined') { + filters.isActive = req.query.isActive === 'true'; + } + + const services = await serviceService.getServices(filters); + + res.status(200).json({ + success: true, + message: 'Services retrieved successfully', + data: services, + pagination: { + skip: filters.skip, + take: filters.take + } + }); + } catch (error) { + next(error); + } +}; + +/** + * Get a single service by ID + */ +export const getServiceById = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + const service = await serviceService.getServiceById(id!); + + if (!service) { + return res.status(404).json({ + success: false, + message: 'Service not found' + }); + } + + res.status(200).json({ + success: true, + message: 'Service retrieved successfully', + data: service + }); + } catch (error) { + next(error); + } +}; + +/** + * Update a service + */ +export const updateService = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + const updateData = req.body; + + const updatedService = await serviceService.updateService(id!, updateData); + + res.status(200).json({ + success: true, + message: 'Service updated successfully', + data: updatedService + }); + } catch (error) { + next(error); + } +}; + +/** + * Delete a service + */ +export const deleteService = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + + await serviceService.deleteService(id!); + + res.status(200).json({ + success: true, + message: 'Service deleted successfully' + }); + } catch (error) { + next(error); + } +}; + +/** + * Get a service by conversation ID + */ +export const getServiceByConversationId = async (req: Request, res: Response, next: NextFunction) => { + try { + const { conversationId } = req.params; + const service = await serviceService.getServiceByConversationId(conversationId!); + + if (!service) { + return res.status(404).json({ + success: false, + message: 'Service not found for this conversation' + }); + } + + res.status(200).json({ + success: true, + message: 'Service retrieved successfully', + data: service + }); + } catch (error) { + next(error); + } +}; + +/** + * Hybrid search for services (combines semantic search with geolocation) + */ +export const hybridSearchServices = async (req: Request, res: Response, next: NextFunction) => { + try { + const { + query, + limit = 20, + threshold = 0.3, + categoryId, + providerId, + minPrice, + maxPrice, + // Location parameters + lat, + lng, + latitude, + longitude, + address, + radius = 50, // Default 50km radius + includeWithoutLocation = true + } = req.query; + + // Determine user coordinates + let userLat: number | undefined, userLng: number | undefined; + let locationProvided = false; + + if (lat && lng) { + userLat = parseFloat(lat as string); + userLng = parseFloat(lng as string); + locationProvided = true; + } else if (latitude && longitude) { + userLat = parseFloat(latitude as string); + userLng = parseFloat(longitude as string); + locationProvided = true; + } else if (address) { + try { + const locationData = await googleMapsService.geocodeAddress(address as string); + userLat = locationData.lat; + userLng = locationData.lng; + locationProvided = true; + } catch (error) { + console.warn('Geocoding failed for address:', address, error); + // Continue without location filtering + } + } + + let results: any[] = []; + let searchType = ''; + + // Case 1: Both query and location provided - Semantic search with location filtering + if (query && typeof query === 'string' && query.trim() && locationProvided && userLat && userLng) { + console.log('Hybrid search: semantic + location'); + searchType = 'hybrid'; + + // First get semantic search results + const semanticResults = await semanticSearchService.searchServices({ + query: query as string, + limit: parseInt(limit as string) * 2, // Get more results to filter by location + threshold: parseFloat(threshold as string), + categoryId: categoryId as string, + providerId: providerId as string, + minPrice: minPrice ? parseFloat(minPrice as string) : undefined, + maxPrice: maxPrice ? parseFloat(maxPrice as string) : undefined, + }); + + // Then filter by location and add distance + const locationFilteredResults = []; + + for (const service of semanticResults) { + // Get full service data with location + const fullService = await serviceService.getServiceById(service.id); + + if (fullService && fullService.latitude && fullService.longitude) { + // Calculate distance + const distance = googleMapsService.calculateDistance( + userLat!, + userLng!, + fullService.latitude, + fullService.longitude + ); + + // Check if within radius + if (distance <= parseFloat(radius as string)) { + locationFilteredResults.push({ + ...service, + latitude: fullService.latitude, + longitude: fullService.longitude, + address: fullService.address, + city: fullService.city, + state: fullService.state, + country: fullService.country, + postalCode: fullService.postalCode, + serviceRadiusKm: fullService.serviceRadiusKm, + distance_km: distance + }); + } + } else if (includeWithoutLocation === 'true' || includeWithoutLocation === true) { + // Include services without location (available everywhere) + locationFilteredResults.push({ + ...service, + distance_km: null // No distance for services without location + }); + } + } + + // Sort by similarity first, then by distance + results = locationFilteredResults + .sort((a, b) => { + if (a.similarity !== b.similarity) { + return b.similarity - a.similarity; // Higher similarity first + } + if (a.distance_km !== null && b.distance_km !== null) { + return a.distance_km - b.distance_km; // Closer distance first + } + if (a.distance_km === null) return 1; // Services without location go last + if (b.distance_km === null) return -1; + return 0; + }) + .slice(0, parseInt(limit as string)); + } + + // Case 2: Only query provided - Pure semantic search + else if (query && typeof query === 'string' && query.trim()) { + console.log('Semantic search only'); + searchType = 'semantic'; + + results = await semanticSearchService.searchServices({ + query: query as string, + limit: parseInt(limit as string), + threshold: parseFloat(threshold as string), + categoryId: categoryId as string, + providerId: providerId as string, + minPrice: minPrice ? parseFloat(minPrice as string) : undefined, + maxPrice: maxPrice ? parseFloat(maxPrice as string) : undefined, + }); + } + + // Case 3: Only location provided - Location-based search + else if (locationProvided && userLat && userLng) { + console.log('Location search only'); + searchType = 'location'; + + const locationSearchOptions = { + latitude: userLat, + longitude: userLng, + radius: parseFloat(radius as string), + page: 1, + limit: parseInt(limit as string), + categoryId: categoryId as string, + minPrice: minPrice ? parseFloat(minPrice as string) : undefined, + maxPrice: maxPrice ? parseFloat(maxPrice as string) : undefined + }; + + const locationResults = await serviceService.searchServicesByLocation(locationSearchOptions); + results = locationResults.services; + } + + // Case 4: No query and no location - Return general service list + else { + console.log('General service listing'); + searchType = 'general'; + + const generalResults = await serviceService.getServices({ + categoryId: categoryId as string, + providerId: providerId as string, + isActive: true, + skip: 0, + take: parseInt(limit as string) + }); + + results = generalResults; + } + + res.status(200).json({ + success: true, + message: 'Search completed successfully', + data: { + query: query || null, + location: locationProvided ? { latitude: userLat, longitude: userLng, radius } : null, + searchType, + results: results, + count: results.length + } + }); + } catch (error) { + console.error('Hybrid search error:', error); + next(error); + } +}; + +/** + * Semantic search for services + */ +export const searchServices = async (req: Request, res: Response, next: NextFunction) => { + try { + const { query, limit, threshold, categoryId, providerId, minPrice, maxPrice } = req.query; + + if (!query || typeof query !== 'string') { + return res.status(400).json({ + success: false, + message: 'Search query is required' + }); + } + + const searchOptions = { + query: query as string, + limit: limit ? parseInt(limit as string) : 20, + threshold: threshold ? parseFloat(threshold as string) : 0.7, + categoryId: categoryId as string, + providerId: providerId as string, + minPrice: minPrice ? parseFloat(minPrice as string) : undefined, + maxPrice: maxPrice ? parseFloat(maxPrice as string) : undefined, + }; + + const results = await semanticSearchService.searchServices(searchOptions); + + res.status(200).json({ + success: true, + message: 'Semantic search completed successfully', + data: { + query: query, + results: results, + count: results.length + } + }); + } catch (error) { + next(error); + } +}; + +/** + * Find similar services to a given service + */ +export const getSimilarServices = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + const { limit } = req.query; + + const similarServices = await semanticSearchService.findSimilarServices( + id!, + limit ? parseInt(limit as string) : 5 + ); + + res.status(200).json({ + success: true, + message: 'Similar services retrieved successfully', + data: similarServices + }); + } catch (error) { + next(error); + } +}; + +/** + * Update embeddings for a specific service + */ +export const updateServiceEmbeddings = async (req: Request, res: Response, next: NextFunction) => { + try { + const { id } = req.params; + + await semanticSearchService.updateServiceEmbeddings(id!); + + res.status(200).json({ + success: true, + message: 'Service embeddings updated successfully' + }); + } catch (error) { + next(error); + } +}; + +/** + * Batch update embeddings for all services + */ +export const updateAllServiceEmbeddings = async (req: Request, res: Response, next: NextFunction) => { + try { + const { batchSize } = req.query; + + const updatedCount = await semanticSearchService.updateAllServiceEmbeddings( + batchSize ? parseInt(batchSize as string) : 10 + ); + + res.status(200).json({ + success: true, + message: `Batch embedding update completed. Updated ${updatedCount} services.`, + data: { + updatedCount + } + }); + } catch (error) { + next(error); + } +}; + +/** + * Search services by location + */ +export const searchServicesByLocation = async (req: Request, res: Response, next: NextFunction) => { + try { + const { + lat, + lng, + address, + radius = 10, // Default 10km radius + page = 1, + limit = 20, + categoryId, + minPrice, + maxPrice + } = req.query; + + let userLat: number, userLng: number; + + // Determine user coordinates + if (lat && lng) { + userLat = parseFloat(lat as string); + userLng = parseFloat(lng as string); + + if (!googleMapsService.validateCoordinates(userLat, userLng)) { + return res.status(400).json({ + success: false, + message: 'Invalid coordinates provided' + }); + } + } else if (address) { + try { + const locationData = await googleMapsService.geocodeAddress(address as string); + userLat = locationData.lat; + userLng = locationData.lng; + } catch (error) { + return res.status(400).json({ + success: false, + message: 'Could not geocode the provided address' + }); + } + } else { + return res.status(400).json({ + success: false, + message: 'Location required for search (provide lat/lng or address)' + }); + } + + const searchOptions = { + latitude: userLat, + longitude: userLng, + radius: parseFloat(radius as string), + page: parseInt(page as string), + limit: parseInt(limit as string), + categoryId: categoryId as string, + minPrice: minPrice ? parseFloat(minPrice as string) : undefined, + maxPrice: maxPrice ? parseFloat(maxPrice as string) : undefined + }; + + const results = await serviceService.searchServicesByLocation(searchOptions); + + res.status(200).json({ + success: true, + message: 'Location-based search completed successfully', + data: { + services: results.services, + pagination: { + total: results.total, + page: searchOptions.page, + limit: searchOptions.limit, + totalPages: Math.ceil(results.total / searchOptions.limit) + }, + search_location: { + lat: userLat, + lng: userLng, + radius: searchOptions.radius + } + } + }); + } catch (error) { + next(error); + } +}; + +/** + * Get user location from IP address + */ +export const getLocationFromIP = async (req: Request, res: Response, next: NextFunction) => { + try { + const clientIP = req.ip || req.connection.remoteAddress || req.headers['x-forwarded-for'] as string; + + try { + const locationData = await googleMapsService.getLocationFromIP(clientIP); + + res.status(200).json({ + success: true, + message: 'Location detected from IP address', + data: locationData + }); + } catch (error) { + res.status(200).json({ + success: false, + message: 'Could not determine location from IP address', + data: null + }); + } + } catch (error) { + next(error); + } +}; + +/** + * Geocode an address + */ +export const geocodeAddress = async (req: Request, res: Response, next: NextFunction) => { + try { + const { address } = req.body; + + if (!address) { + return res.status(400).json({ + success: false, + message: 'Address is required' + }); + } + + try { + const locationData = await googleMapsService.geocodeAddress(address); + + res.status(200).json({ + success: true, + message: 'Address geocoded successfully', + data: locationData + }); + } catch (error) { + res.status(400).json({ + success: false, + message: 'Could not geocode the provided address' + }); + } + } catch (error) { + next(error); + } +}; + +/** + * Reverse geocode coordinates + */ +export const reverseGeocode = async (req: Request, res: Response, next: NextFunction) => { + try { + const { lat, lng, latitude, longitude } = req.body; + + // Support both lat/lng and latitude/longitude formats + const latValue = lat || latitude; + const lngValue = lng || longitude; + + if (!latValue || !lngValue) { + return res.status(400).json({ + success: false, + message: 'Latitude and longitude are required' + }); + } + + const latParsed = parseFloat(latValue); + const lngParsed = parseFloat(lngValue); + + if (!googleMapsService.validateCoordinates(latParsed, lngParsed)) { + return res.status(400).json({ + success: false, + message: 'Invalid coordinates provided' + }); + } + + try { + const locationData = await googleMapsService.reverseGeocode(latParsed, lngParsed); + + res.status(200).json({ + success: true, + message: 'Coordinates reverse geocoded successfully', + data: locationData + }); + } catch (error) { + res.status(400).json({ + success: false, + message: 'Could not reverse geocode the provided coordinates' + }); + } + } catch (error) { + next(error); + } +}; diff --git a/src/controllers/user.controller.js b/src/controllers/user.controller.js deleted file mode 100644 index 21d3ca8..0000000 --- a/src/controllers/user.controller.js +++ /dev/null @@ -1,60 +0,0 @@ -import * as userService from '../services/user.service.js'; - -export const createUser = async (req, res, next) => { - try { - const { email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia } = req.body; - const user = await userService.register({ email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia }); - res.status(201).json({ message: 'User registered', user }); - } catch (err) { - next(err); - } -}; - -export const checkEmailExists = async (req, res, next) => { - try { - const { email } = req.query; - if (!email) { - return res.status(400).json({ message: 'Email is required' }); - } - const exists = await userService.checkEmailExists(email); - res.status(200).json({ exists }); - } catch (err) { - next(err); - } -}; - -export const loginUser = async (req, res) => { - try { - const result = await userService.login(req.body); - res.status(200).json({ message: 'Login successful', ...result }); - } catch (err) { - res.status(401).json({ message: err.message }); - } -}; - -export const getUserProfile = async (req, res, next) => { - try { - const user = await userService.getProfile(req.user.id); - res.status(200).json(user); - } catch (err) { - next(err); - } -}; - -export const updateUserProfile = async (req, res, next) => { - try { - const updatedUser = await userService.updateProfile(req.user.id, req.body); - res.status(200).json({ message: 'Profile updated', user: updatedUser }); - } catch (err) { - next(err); - } -}; - -export const deleteUserProfile = async (req, res, next) => { - try { - await userService.deleteProfile(req.user.id); - res.status(200).json({ message: 'Profile deleted' }); - } catch (err) { - next(err); - } -}; \ No newline at end of file diff --git a/src/controllers/user.controller.ts b/src/controllers/user.controller.ts new file mode 100755 index 0000000..a8a69ac --- /dev/null +++ b/src/controllers/user.controller.ts @@ -0,0 +1,168 @@ +import type { Request, Response, NextFunction } from 'express'; +import { register, login, getProfile, updateProfile, deleteProfile, checkEmailExists, searchUsers, getUserById, createAdmin } from '../services/user.service.js'; +import { uploadToS3, deleteFromS3, uploadVideoToS3 } from '../utils/s3.js'; + +export const createUser = async (req: Request, res: Response, next: NextFunction) => { + try { + const { email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia } = req.body; + const user = await register({ email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia }); + res.status(201).json({ message: 'User registered', user }); + } catch (err) { + next(err); + } +}; + +export const createAdminUser = async (req: Request, res: Response, next: NextFunction) => { + try { + const { email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia } = req.body; + const admin = await createAdmin({ email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia }); + res.status(201).json({ + message: 'Admin user created successfully', + admin + }); + } catch (err) { + next(err); + } +}; + +export const checkEmailExistsController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { email } = req.query; + if (!email) { + return res.status(400).json({ message: 'Email is required' }); + } + const exists = await checkEmailExists(email as string); + res.status(200).json({ exists }); + } catch (err) { + next(err); + } +}; + +export const loginUser = async (req: Request, res: Response) => { + try { + const result = await login(req.body); + res.status(200).json({ message: 'Login successful', ...result }); + } catch (err: any) { + res.status(401).json({ message: err.message }); + } +}; + +export const getUserProfile = async (req: Request, res: Response, next: NextFunction) => { + try { + const user = await getProfile((req as any).user.id); + res.status(200).json(user); + } catch (err) { + next(err); + } +}; + +export const updateUserProfile = async (req: Request, res: Response, next: NextFunction) => { + try { + let imageUrl = req.body.imageUrl; + + // If a new image file is uploaded, upload it to S3 + if ((req as any).file) { + // Get current user to check if they have an existing image + const currentUser = await getProfile((req as any).user.id); + + // Upload new image to S3 + imageUrl = await uploadToS3((req as any).file, 'profile-images'); + + // Delete old image if it exists and is from S3 + if (currentUser.imageUrl && currentUser.imageUrl.includes('amazonaws.com')) { + await deleteFromS3(currentUser.imageUrl); + } + } + + const updateData = { ...req.body }; + if (imageUrl) { + updateData.imageUrl = imageUrl; + } + + // Parse socialmedia if it's a JSON string + if (updateData.socialmedia && typeof updateData.socialmedia === 'string') { + try { + updateData.socialmedia = JSON.parse(updateData.socialmedia); + } catch (e) { + // If parsing fails, treat it as an array with single item + updateData.socialmedia = [updateData.socialmedia]; + } + } + + const updatedUser = await updateProfile((req as any).user.id, updateData); + res.status(200).json({ message: 'Profile updated', user: updatedUser }); + } catch (err) { + next(err); + } +}; + +export const deleteUserProfile = async (req: Request, res: Response, next: NextFunction) => { + try { + await deleteProfile((req as any).user.id); + res.status(200).json({ message: 'Profile deleted' }); + } catch (err) { + next(err); + } +}; + +export const searchUsersController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { q } = req.query; + if (!q) { + return res.status(400).json({ message: 'Search query is required' }); + } + const users = await searchUsers(q as string); + res.status(200).json(users); + } catch (err) { + next(err); + } +}; + +export const uploadImageController = async (req: Request, res: Response, next: NextFunction) => { + try { + if (!(req as any).file) { + return res.status(400).json({ message: 'No image file provided' }); + } + + // Upload image to S3 + const imageUrl = await uploadToS3((req as any).file, 'uploads'); + + res.status(200).json({ + message: 'Image uploaded successfully', + imageUrl + }); + } catch (err) { + next(err); + } +}; + +export const getUserByIdController = async (req: Request, res: Response, next: NextFunction) => { + try { + const { userId } = req.params; + if (!userId) { + return res.status(400).json({ message: 'User ID is required' }); + } + const user = await getUserById(userId); + res.status(200).json(user); + } catch (err) { + next(err); + } +}; + +export const uploadVideoController = async (req: Request, res: Response, next: NextFunction) => { + try { + if (!(req as any).file) { + return res.status(400).json({ message: 'No video file provided' }); + } + + // Upload video to S3 + const videoUrl = await uploadVideoToS3((req as any).file, 'service-videos'); + + res.status(200).json({ + message: 'Video uploaded successfully', + videoUrl + }); + } catch (err) { + next(err); + } +}; \ No newline at end of file diff --git a/src/data/knowledge-base.json b/src/data/knowledge-base.json new file mode 100755 index 0000000..57c5d13 --- /dev/null +++ b/src/data/knowledge-base.json @@ -0,0 +1,110 @@ +{ + "platform_guide": { + "getting_started": { + "title": "Getting Started with Zia Platform", + "content": [ + "Welcome to Zia! This is your service marketplace platform.", + "To get started: 1) Create your account, 2) Complete your profile, 3) Browse or offer services", + "You can be both a service provider and a customer on our platform" + ] + }, + "account_setup": { + "title": "Account Setup", + "content": [ + "Complete your profile with accurate information", + "Upload a professional profile picture", + "Verify your email address and phone number", + "Add your location and preferred service categories" + ] + }, + "finding_services": { + "title": "How to Find Services", + "content": [ + "Use the search bar to find specific services", + "Browse by categories in the main navigation", + "Filter results by location, price, and ratings", + "Read provider profiles and reviews before booking" + ] + }, + "booking_process": { + "title": "Booking Services", + "content": [ + "Click 'Book Now' on any service you want", + "Fill in your requirements and preferred time", + "Wait for provider confirmation", + "Communicate through our messaging system", + "Both parties must confirm before service delivery" + ] + }, + "offering_services": { + "title": "Offering Services", + "content": [ + "Switch to Provider mode in your profile", + "Create detailed service listings with clear descriptions", + "Set competitive pricing and availability", + "Upload relevant photos and certifications", + "Respond promptly to customer inquiries" + ] + }, + "messaging_system": { + "title": "Communication & Messaging", + "content": [ + "All communication happens through our secure messaging system", + "Access conversations from the Conversation Hub", + "Use the confirmation panel to track booking status", + "Both customer and provider must confirm completion", + "Chat history is preserved for your records" + ] + }, + "payments_ratings": { + "title": "Payments & Ratings", + "content": [ + "Payments are processed securely through our platform", + "Rate your experience after service completion", + "Both customers and providers can leave reviews", + "Ratings help build trust in our community", + "Contact support for any payment issues" + ] + }, + "safety_guidelines": { + "title": "Safety Guidelines", + "content": [ + "Always communicate through our platform messaging", + "Meet in public places for in-person services", + "Verify provider credentials and reviews", + "Report any suspicious behavior to our support team", + "Never share personal payment information outside the platform" + ] + }, + "troubleshooting": { + "title": "Common Issues & Solutions", + "content": [ + "Can't find a conversation? Check the Conversation Hub or refresh the page", + "Booking not confirmed? Contact the provider through messaging", + "Payment issues? Contact our support team immediately", + "Profile not saving? Check your internet connection and try again", + "Service not appearing? Ensure all required fields are completed" + ] + }, + "support": { + "title": "Getting Help", + "content": [ + "Use this chatbot for quick platform guidance", + "Check our FAQ section for common questions", + "Contact support through the help center", + "Join our community forums for tips and discussions", + "Follow our social media for updates and announcements" + ] + } + }, + "quick_answers": { + "how_to_book": "To book a service: 1) Find the service you want, 2) Click 'Book Now', 3) Fill in your requirements, 4) Wait for provider confirmation, 5) Communicate through our messaging system.", + "how_to_message": "Access all your conversations through the Conversation Hub. Click on any conversation to view messages and use the confirmation panel to track booking status.", + "how_to_rate": "After both parties confirm service completion, you can rate your experience. Customers rate services, providers rate customers.", + "payment_process": "Payments are handled securely through our platform. You'll be charged after service confirmation and can rate your experience.", + "safety_first": "Always use our messaging system, meet in public for in-person services, verify provider credentials, and report any issues to support.", + "profile_setup": "Complete your profile with accurate info, upload a professional photo, verify your contact details, and add your location and service preferences.", + "become_provider": "To become a service provider: 1) Switch to Provider mode in your profile settings, 2) Create detailed service listings with clear descriptions, 3) Set competitive pricing and availability, 4) Upload relevant photos and certifications, 5) Respond promptly to customer inquiries.", + "find_conversations": "Go to the Conversation Hub to see all your messages. If you can't find a specific conversation, try refreshing the page or check if the URL is correct." + } +} diff --git a/src/middlewares/admin.middleware.ts b/src/middlewares/admin.middleware.ts new file mode 100755 index 0000000..f3b7afd --- /dev/null +++ b/src/middlewares/admin.middleware.ts @@ -0,0 +1,120 @@ +import type { Request, Response, NextFunction } from 'express'; +import jwt from 'jsonwebtoken'; +import { adminService } from '../services/admin.service.js'; + +const JWT_SECRET = process.env.JWT_SECRET || 'fallback-secret-key'; + +interface AdminTokenPayload { + adminId: number; + username: string; + role: string; +} + +// Extend Request interface to include admin property +declare global { + namespace Express { + interface Request { + admin?: { + id: number; + username: string; + firstName: string; + lastName: string; + }; + } + } +} + +export const adminAuthMiddleware = async ( + req: Request, + res: Response, + next: NextFunction +): Promise => { + try { + const authHeader = req.headers.authorization; + + if (!authHeader || !authHeader.startsWith('Bearer ')) { + res.status(401).json({ + success: false, + message: 'Access token is required', + }); + return; + } + + const token = authHeader.substring(7); // Remove 'Bearer ' prefix + + try { + const decoded = jwt.verify(token, JWT_SECRET) as AdminTokenPayload; + + // Verify the admin still exists + const admin = await adminService.getAdminById(decoded.adminId); + if (!admin) { + res.status(401).json({ + success: false, + message: 'Admin not found', + }); + return; + } + + // Verify role is admin + if (decoded.role !== 'ADMIN') { + res.status(403).json({ + success: false, + message: 'Admin access required', + }); + return; + } + + // Add admin to request object + req.admin = admin; + next(); + } catch (jwtError) { + res.status(401).json({ + success: false, + message: 'Invalid or expired token', + }); + return; + } + } catch (error: any) { + console.error('Admin auth middleware error:', error); + res.status(500).json({ + success: false, + message: 'Internal server error', + error: error.message, + }); + } +}; + +export const adminOptionalMiddleware = async ( + req: Request, + res: Response, + next: NextFunction +): Promise => { + try { + const authHeader = req.headers.authorization; + + if (!authHeader || !authHeader.startsWith('Bearer ')) { + next(); + return; + } + + const token = authHeader.substring(7); + + try { + const decoded = jwt.verify(token, JWT_SECRET) as AdminTokenPayload; + + if (decoded.role === 'ADMIN') { + const admin = await adminService.getAdminById(decoded.adminId); + if (admin) { + req.admin = admin; + } + } + } catch (jwtError) { + // Token is invalid, but we continue without authentication + } + + next(); + } catch (error: any) { + console.error('Admin optional middleware error:', error); + next(); + } +}; diff --git a/src/middlewares/auth.middleware.js b/src/middlewares/auth.middleware.ts old mode 100644 new mode 100755 similarity index 61% rename from src/middlewares/auth.middleware.js rename to src/middlewares/auth.middleware.ts index b2e7d66..d49958b --- a/src/middlewares/auth.middleware.js +++ b/src/middlewares/auth.middleware.ts @@ -1,7 +1,8 @@ +import type { Request, Response, NextFunction } from 'express'; import jwt from 'jsonwebtoken'; const { verify } = jwt; -export default (req, res, next) => { +export default (req: Request, res: Response, next: NextFunction) => { const authHeader = req.headers['authorization']; if (!authHeader || !authHeader.startsWith('Bearer ')) { @@ -11,8 +12,8 @@ export default (req, res, next) => { const token = authHeader.split(' ')[1]; try { - const decoded = verify(token, process.env.JWT_SECRET); - req.user = decoded; // Add user info to request + const decoded = verify(token, process.env.JWT_SECRET!); + (req as any).user = decoded; // Add user info to request next(); } catch (err) { return res.status(401).json({ message: 'Unauthorized: Token invalid' }); diff --git a/src/middlewares/database.middleware.ts b/src/middlewares/database.middleware.ts new file mode 100755 index 0000000..97a588d --- /dev/null +++ b/src/middlewares/database.middleware.ts @@ -0,0 +1,52 @@ +import { Request, Response, NextFunction } from 'express'; +import { PrismaClientKnownRequestError, PrismaClientUnknownRequestError } from '@prisma/client/runtime/library'; + +export const databaseErrorHandler = (error: any, req: Request, res: Response, next: NextFunction) => { + console.error('Database Error:', error); + + // Handle Prisma connection errors + if (error.code === 'P1001') { + return res.status(503).json({ + error: 'Database connection failed', + message: 'Unable to connect to the database. Please try again later.', + code: 'DATABASE_CONNECTION_ERROR' + }); + } + + // Handle other Prisma errors + if (error instanceof PrismaClientKnownRequestError) { + switch (error.code) { + case 'P2002': + return res.status(409).json({ + error: 'Unique constraint violation', + message: 'A record with this data already exists.', + code: 'DUPLICATE_RECORD' + }); + + case 'P2025': + return res.status(404).json({ + error: 'Record not found', + message: 'The requested record does not exist.', + code: 'RECORD_NOT_FOUND' + }); + + default: + return res.status(500).json({ + error: 'Database operation failed', + message: 'An error occurred while processing your request.', + code: 'DATABASE_ERROR' + }); + } + } + + if (error instanceof PrismaClientUnknownRequestError) { + return res.status(500).json({ + error: 'Unknown database error', + message: 'An unexpected database error occurred.', + code: 'UNKNOWN_DATABASE_ERROR' + }); + } + + // Pass other errors to the next error handler + next(error); +}; diff --git a/src/middlewares/validation.middleware.js b/src/middlewares/validation.middleware.ts old mode 100644 new mode 100755 similarity index 88% rename from src/middlewares/validation.middleware.js rename to src/middlewares/validation.middleware.ts index 7929a94..855164e --- a/src/middlewares/validation.middleware.js +++ b/src/middlewares/validation.middleware.ts @@ -1,9 +1,11 @@ +import type { Request, Response, NextFunction } from 'express'; + /** * Validation middleware that can validate different parts of the request * @param {Object} schema - Joi validation schema * @param {string} source - Source to validate: 'body', 'query', 'params' (default: 'body') */ -export default (schema, source = 'body') => (req, res, next) => { +export default (schema: any, source = 'body') => (req: Request, res: Response, next: NextFunction) => { console.log(`=== Validation Middleware (${source}) ===`); let dataToValidate; @@ -35,7 +37,7 @@ export default (schema, source = 'body') => (req, res, next) => { return res.status(400).json({ success: false, message: 'Validation failed', - errors: error.details.map(detail => ({ + errors: error.details.map((detail: any) => ({ field: detail.path.join('.'), message: detail.message })) diff --git a/src/modules/chatbot/README.md b/src/modules/chatbot/README.md new file mode 100755 index 0000000..60bbc38 --- /dev/null +++ b/src/modules/chatbot/README.md @@ -0,0 +1,110 @@ +# Chatbot Module + +A self-contained chatbot module for the Zia platform that provides AI-powered platform guidance to users. + +## Structure + +``` +src/modules/chatbot/ +├── README.md # This file +├── index.ts # Module exports +├── config.ts # Module configuration +├── types.ts # TypeScript definitions +├── chatbotService.ts # Core logic +├── chatbotController.ts # Express controllers +├── chatbotRoutes.ts # API routes +└── data/ + └── knowledge-base.json # Platform guidance content +``` + +## Features + +- ✅ **Static Knowledge Base**: Reliable, predictable responses +- ✅ **Keyword Matching**: Intelligent question understanding +- ✅ **Express Integration**: Clean REST API endpoints +- ✅ **Modular Design**: Self-contained and reusable +- ✅ **TypeScript Support**: Full type safety +- ✅ **Fallback Responses**: Graceful error handling + +## API Endpoints + +### POST `/api/chatbot/ask` +Process user questions and return chatbot responses. + +**Request:** +```json +{ + "message": "How do I book a service?" +} +``` + +**Response:** +```json +{ + "success": true, + "data": { + "question": "How do I book a service?", + "answer": "**Booking Services**\n\nTo book a service...", + "timestamp": "2025-09-11T12:00:00.000Z" + } +} +``` + +### POST `/api/chatbot/suggestions` +Get quick question suggestions for users. + +**Response:** +```json +{ + "success": true, + "data": { + "suggestions": [ + "How do I book a service?", + "How do I become a provider?", + "How do payments work?" + ], + "timestamp": "2025-09-11T12:00:00.000Z" + } +} +``` + +### GET `/api/chatbot/health` +Health check endpoint for monitoring. + +## Knowledge Base Topics + +The chatbot can help with: +- Account setup and profile management +- Finding and booking services +- Becoming a service provider +- Using the messaging system +- Payments and ratings +- Safety guidelines +- Troubleshooting common issues + +## Usage in Frontend + +```typescript +import { chatbotApi } from '../api/chatbotApi'; + +// Ask a question +const response = await chatbotApi.askQuestion("How do I book a service?"); + +// Get suggestions +const suggestions = await chatbotApi.getSuggestions(); +``` + +## Customization + +To add new knowledge or modify responses: +1. Update `data/knowledge-base.json` +2. Modify keyword matching in `chatbotService.ts` +3. Add new response patterns as needed + +## Future Enhancements + +- [ ] LLM integration (OpenAI, etc.) +- [ ] Dynamic knowledge base updates +- [ ] Analytics and usage tracking +- [ ] Multi-language support +- [ ] Context-aware conversations diff --git a/src/modules/chatbot/chatbotController.ts b/src/modules/chatbot/chatbotController.ts new file mode 100755 index 0000000..9356f43 --- /dev/null +++ b/src/modules/chatbot/chatbotController.ts @@ -0,0 +1,104 @@ +import { Request, Response } from 'express'; +import { chatbotService } from './chatbotService.js'; + +export class ChatbotController { + + /** + * Process user question and return chatbot response + * POST /api/chatbot/ask + */ + async askQuestion(req: Request, res: Response) { + try { + const { message } = req.body; + + // Validate input + if (!message || typeof message !== 'string' || message.trim().length === 0) { + return res.status(400).json({ + success: false, + error: 'Message is required and must be a non-empty string', + data: { + question: message || '', + answer: "Please provide a valid question! I'm here to help you with the Zia platform.", + timestamp: new Date().toISOString() + } + }); + } + + // Process the question + const answer = await chatbotService.processQuestion(message.trim()); + + return res.status(200).json({ + success: true, + data: { + question: message.trim(), + answer: answer, + timestamp: new Date().toISOString() + } + }); + + } catch (error) { + console.error('❌ Chatbot error:', error); + + return res.status(500).json({ + success: false, + error: 'Sorry, I encountered an error processing your question. Please try again.', + data: { + question: req.body?.message || '', + answer: "I'm having trouble right now, but I'm here to help! Try asking about booking services, messaging, payments, or platform navigation.", + timestamp: new Date().toISOString() + } + }); + } + } + + /** + * Get quick question suggestions + * POST /api/chatbot/suggestions + */ + async getSuggestions(req: Request, res: Response) { + try { + const suggestions = chatbotService.getSuggestions(); + + return res.status(200).json({ + success: true, + data: { + suggestions, + timestamp: new Date().toISOString() + } + }); + + } catch (error) { + console.error('❌ Suggestions error:', error); + + // Fallback suggestions + return res.status(200).json({ + success: true, + data: { + suggestions: [ + "How do I book a service?", + "How do I use messaging?", + "How do payments work?", + "How do I become a provider?" + ], + timestamp: new Date().toISOString() + } + }); + } + } + + /** + * Health check for chatbot service + * GET /api/chatbot/health + */ + async healthCheck(req: Request, res: Response) { + return res.status(200).json({ + success: true, + service: 'Chatbot Service', + status: 'healthy', + timestamp: new Date().toISOString() + }); + } +} + +// Export singleton instance +export const chatbotController = new ChatbotController(); diff --git a/src/modules/chatbot/chatbotRoutes.ts b/src/modules/chatbot/chatbotRoutes.ts new file mode 100755 index 0000000..32ee9a5 --- /dev/null +++ b/src/modules/chatbot/chatbotRoutes.ts @@ -0,0 +1,27 @@ +import { Router, type Express } from 'express'; +import { chatbotController } from './chatbotController.js'; + +const router: ReturnType = Router(); + +/** + * @route POST /api/chatbot/ask + * @desc Process user question and get chatbot response + * @access Public + */ +router.post('/ask', chatbotController.askQuestion.bind(chatbotController)); + +/** + * @route POST /api/chatbot/suggestions + * @desc Get quick question suggestions + * @access Public + */ +router.post('/suggestions', chatbotController.getSuggestions.bind(chatbotController)); + +/** + * @route GET /api/chatbot/health + * @desc Health check for chatbot service + * @access Public + */ +router.get('/health', chatbotController.healthCheck.bind(chatbotController)); + +export default router; diff --git a/src/modules/chatbot/chatbotService.ts b/src/modules/chatbot/chatbotService.ts new file mode 100755 index 0000000..2491b60 --- /dev/null +++ b/src/modules/chatbot/chatbotService.ts @@ -0,0 +1,185 @@ +import { KNOWLEDGE_BASE } from './knowledgeBase.js'; + +interface KnowledgeBase { + platform_guide: Record; + quick_answers: Record; +} + +class ChatbotService { + private knowledgeBase: KnowledgeBase; + + constructor() { + this.loadKnowledgeBase(); + } + + private loadKnowledgeBase() { + try { + // Use embedded knowledge base instead of file system + this.knowledgeBase = KNOWLEDGE_BASE; + console.log('✅ Chatbot knowledge base loaded successfully (embedded)'); + } catch (error) { + console.error('❌ Failed to load knowledge base:', error); + // Fallback knowledge base + this.knowledgeBase = { + platform_guide: {}, + quick_answers: { + default: "I'm here to help you navigate the Zia platform! You can ask me about booking services, messaging, payments, safety guidelines, and more." + } + }; + } + } + + async processQuestion(question: string): Promise { + const lowerQuestion = question.toLowerCase(); + console.log('🤖 Processing question:', lowerQuestion); + + // First check quick answers for exact matches + for (const [key, answer] of Object.entries(this.knowledgeBase.quick_answers)) { + if (this.isQuestionMatch(lowerQuestion, key)) { + return answer; + } + } + + // Specific keyword matching with priority order (most specific first) + if (this.containsKeywords(lowerQuestion, ['book', 'booking', 'reserve']) && + !this.containsKeywords(lowerQuestion, ['become', 'provider', 'offer', 'sell'])) { + const bookingData = this.knowledgeBase.platform_guide.booking_process; + if (bookingData) { + return `**${bookingData.title}**\n\n${bookingData.content.join('\n\n')}`; + } + } + + if ((this.containsKeywords(lowerQuestion, ['become', 'provider']) || + this.containsKeywords(lowerQuestion, ['offer', 'sell']) || + (this.containsKeywords(lowerQuestion, ['provide', 'service']) && !this.containsKeywords(lowerQuestion, ['book', 'find'])))) { + const providerData = this.knowledgeBase.platform_guide.offering_services; + if (providerData) { + return `**${providerData.title}**\n\n${providerData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['message', 'chat', 'conversation', 'talk'])) { + const messagingData = this.knowledgeBase.platform_guide.messaging_system; + if (messagingData) { + return `**${messagingData.title}**\n\n${messagingData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['pay', 'payment', 'money', 'rate', 'rating'])) { + const paymentData = this.knowledgeBase.platform_guide.payments_ratings; + if (paymentData) { + return `**${paymentData.title}**\n\n${paymentData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['safe', 'safety', 'secure', 'security'])) { + const safetyData = this.knowledgeBase.platform_guide.safety_guidelines; + if (safetyData) { + return `**${safetyData.title}**\n\n${safetyData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['profile', 'account', 'setup', 'sign up'])) { + const setupData = this.knowledgeBase.platform_guide.account_setup; + if (setupData) { + return `**${setupData.title}**\n\n${setupData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['find', 'search', 'look', 'browse'])) { + const findData = this.knowledgeBase.platform_guide.finding_services; + if (findData) { + return `**${findData.title}**\n\n${findData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['problem', 'issue', 'error', 'trouble', 'help'])) { + const troubleData = this.knowledgeBase.platform_guide.troubleshooting; + if (troubleData) { + return `**${troubleData.title}**\n\n${troubleData.content.join('\n\n')}`; + } + } + + // Check platform guide sections with original matching + for (const [section, data] of Object.entries(this.knowledgeBase.platform_guide)) { + if (this.isQuestionMatch(lowerQuestion, section) || + this.isQuestionMatch(lowerQuestion, data.title.toLowerCase())) { + return `**${data.title}**\n\n${data.content.join('\n\n')}`; + } + } + + console.log('🔄 No specific match found, using default response'); + return this.getDefaultResponse(lowerQuestion); + } + + private isQuestionMatch(question: string, keyword: string): boolean { + const questionWords = question.split(/\s+/); + const keywordWords = keyword.replace(/_/g, ' ').split(/\s+/); + + return keywordWords.some(word => + questionWords.some(qWord => + qWord.includes(word) || word.includes(qWord) + ) + ); + } + + private containsKeywords(question: string, keywords: string[]): boolean { + return keywords.some(keyword => + question.includes(keyword.toLowerCase()) + ); + } + + getSuggestions(): string[] { + return [ + "How do I book a service?", + "How do I use the messaging system?", + "How do I become a service provider?", + "What are the safety guidelines?", + "How do payments work?", + "How do I rate my experience?", + "Where can I find my conversations?", + "How do I set up my profile?" + ]; + } + + private getDefaultResponse(question: string): string { + // Provide helpful suggestions based on common question patterns + if (question.includes('book') || question.includes('booking')) { + return this.knowledgeBase.quick_answers.how_to_book || + "To book a service, find what you need and click 'Book Now'. I can help you with the booking process!"; + } + + if (question.includes('message') || question.includes('chat') || question.includes('conversation')) { + return this.knowledgeBase.quick_answers.how_to_message || + "You can access all your conversations through the Conversation Hub. Need help with messaging?"; + } + + if (question.includes('pay') || question.includes('payment')) { + return this.knowledgeBase.quick_answers.payment_process || + "Payments are handled securely through our platform. What specific payment question do you have?"; + } + + if (question.includes('safe') || question.includes('security')) { + return this.knowledgeBase.quick_answers.safety_first || + "Safety is important! Always use our messaging system and verify provider credentials."; + } + + // General helpful response + return `I'm here to help you with the Zia platform! I can assist with: + +• **Booking services** - How to find and book what you need +• **Messaging** - Using our conversation system +• **Payments & ratings** - Understanding our payment process +• **Safety guidelines** - Staying safe on the platform +• **Account setup** - Getting your profile ready +• **Becoming a provider** - Offering your own services + +What would you like to know more about?`; + } +} + +// Export singleton instance +export const chatbotService = new ChatbotService(); diff --git a/src/modules/chatbot/config.ts b/src/modules/chatbot/config.ts new file mode 100755 index 0000000..6ee5c29 --- /dev/null +++ b/src/modules/chatbot/config.ts @@ -0,0 +1,41 @@ +/** + * Chatbot Module Configuration + * + * This module provides AI-powered platform guidance for users. + * It uses a static knowledge base approach with keyword matching + * for reliable and predictable responses. + */ + +export const CHATBOT_CONFIG = { + // Module settings + module: { + name: 'Zia Chatbot', + enabled: true, + version: '1.0.0' + }, + + // API settings + api: { + basePath: '/api/chatbot', + rateLimit: { + windowMs: 15 * 60 * 1000, // 15 minutes + max: 100 // requests per window + } + }, + + // Response settings + responses: { + maxLength: 1000, + includeTimestamp: true, + includeSource: false + }, + + // Knowledge base settings + knowledgeBase: { + autoReload: false, // Set to true in development + fallbackEnabled: true, + debugLogging: process.env.NODE_ENV === 'development' + } +} as const; + +export type ChatbotConfig = typeof CHATBOT_CONFIG; diff --git a/src/modules/chatbot/data/knowledge-base.json b/src/modules/chatbot/data/knowledge-base.json new file mode 100755 index 0000000..57c5d13 --- /dev/null +++ b/src/modules/chatbot/data/knowledge-base.json @@ -0,0 +1,110 @@ +{ + "platform_guide": { + "getting_started": { + "title": "Getting Started with Zia Platform", + "content": [ + "Welcome to Zia! This is your service marketplace platform.", + "To get started: 1) Create your account, 2) Complete your profile, 3) Browse or offer services", + "You can be both a service provider and a customer on our platform" + ] + }, + "account_setup": { + "title": "Account Setup", + "content": [ + "Complete your profile with accurate information", + "Upload a professional profile picture", + "Verify your email address and phone number", + "Add your location and preferred service categories" + ] + }, + "finding_services": { + "title": "How to Find Services", + "content": [ + "Use the search bar to find specific services", + "Browse by categories in the main navigation", + "Filter results by location, price, and ratings", + "Read provider profiles and reviews before booking" + ] + }, + "booking_process": { + "title": "Booking Services", + "content": [ + "Click 'Book Now' on any service you want", + "Fill in your requirements and preferred time", + "Wait for provider confirmation", + "Communicate through our messaging system", + "Both parties must confirm before service delivery" + ] + }, + "offering_services": { + "title": "Offering Services", + "content": [ + "Switch to Provider mode in your profile", + "Create detailed service listings with clear descriptions", + "Set competitive pricing and availability", + "Upload relevant photos and certifications", + "Respond promptly to customer inquiries" + ] + }, + "messaging_system": { + "title": "Communication & Messaging", + "content": [ + "All communication happens through our secure messaging system", + "Access conversations from the Conversation Hub", + "Use the confirmation panel to track booking status", + "Both customer and provider must confirm completion", + "Chat history is preserved for your records" + ] + }, + "payments_ratings": { + "title": "Payments & Ratings", + "content": [ + "Payments are processed securely through our platform", + "Rate your experience after service completion", + "Both customers and providers can leave reviews", + "Ratings help build trust in our community", + "Contact support for any payment issues" + ] + }, + "safety_guidelines": { + "title": "Safety Guidelines", + "content": [ + "Always communicate through our platform messaging", + "Meet in public places for in-person services", + "Verify provider credentials and reviews", + "Report any suspicious behavior to our support team", + "Never share personal payment information outside the platform" + ] + }, + "troubleshooting": { + "title": "Common Issues & Solutions", + "content": [ + "Can't find a conversation? Check the Conversation Hub or refresh the page", + "Booking not confirmed? Contact the provider through messaging", + "Payment issues? Contact our support team immediately", + "Profile not saving? Check your internet connection and try again", + "Service not appearing? Ensure all required fields are completed" + ] + }, + "support": { + "title": "Getting Help", + "content": [ + "Use this chatbot for quick platform guidance", + "Check our FAQ section for common questions", + "Contact support through the help center", + "Join our community forums for tips and discussions", + "Follow our social media for updates and announcements" + ] + } + }, + "quick_answers": { + "how_to_book": "To book a service: 1) Find the service you want, 2) Click 'Book Now', 3) Fill in your requirements, 4) Wait for provider confirmation, 5) Communicate through our messaging system.", + "how_to_message": "Access all your conversations through the Conversation Hub. Click on any conversation to view messages and use the confirmation panel to track booking status.", + "how_to_rate": "After both parties confirm service completion, you can rate your experience. Customers rate services, providers rate customers.", + "payment_process": "Payments are handled securely through our platform. You'll be charged after service confirmation and can rate your experience.", + "safety_first": "Always use our messaging system, meet in public for in-person services, verify provider credentials, and report any issues to support.", + "profile_setup": "Complete your profile with accurate info, upload a professional photo, verify your contact details, and add your location and service preferences.", + "become_provider": "To become a service provider: 1) Switch to Provider mode in your profile settings, 2) Create detailed service listings with clear descriptions, 3) Set competitive pricing and availability, 4) Upload relevant photos and certifications, 5) Respond promptly to customer inquiries.", + "find_conversations": "Go to the Conversation Hub to see all your messages. If you can't find a specific conversation, try refreshing the page or check if the URL is correct." + } +} diff --git a/src/modules/chatbot/index.ts b/src/modules/chatbot/index.ts new file mode 100755 index 0000000..b077865 --- /dev/null +++ b/src/modules/chatbot/index.ts @@ -0,0 +1,16 @@ +// Chatbot Module - Clean exports for external use +export { chatbotService } from './chatbotService.js'; +export { chatbotController } from './chatbotController.js'; +export { default as chatbotRoutes } from './chatbotRoutes.js'; + +// Module information +export const CHATBOT_MODULE_INFO = { + name: 'Chatbot Module', + version: '1.0.0', + description: 'AI-powered platform guidance chatbot', + endpoints: [ + 'POST /api/chatbot/ask - Process user questions', + 'POST /api/chatbot/suggestions - Get quick suggestions', + 'GET /api/chatbot/health - Health check' + ] +} as const; diff --git a/src/modules/chatbot/knowledgeBase.ts b/src/modules/chatbot/knowledgeBase.ts new file mode 100755 index 0000000..bc49eef --- /dev/null +++ b/src/modules/chatbot/knowledgeBase.ts @@ -0,0 +1,117 @@ +/** + * Embedded Knowledge Base for Chatbot + * This ensures the knowledge base is always available after compilation + */ + +export const KNOWLEDGE_BASE = { + platform_guide: { + getting_started: { + title: "Getting Started with Zia Platform", + content: [ + "Welcome to Zia! This is your service marketplace platform.", + "To get started: 1) Create your account, 2) Complete your profile, 3) Browse or offer services", + "You can be both a service provider and a customer on our platform" + ] + }, + account_setup: { + title: "Account Setup", + content: [ + "Complete your profile with accurate information", + "Upload a professional profile picture", + "Verify your email address and phone number", + "Add your location and preferred service categories" + ] + }, + finding_services: { + title: "How to Find Services", + content: [ + "Use the search bar to find specific services", + "Browse by categories in the main navigation", + "Filter results by location, price, and ratings", + "Read provider profiles and reviews before booking" + ] + }, + booking_process: { + title: "Booking Services", + content: [ + "Click 'Book Now' on any service you want", + "Fill in your requirements and preferred time", + "Wait for provider confirmation", + "Communicate through our messaging system", + "Both parties must confirm before service delivery" + ] + }, + offering_services: { + title: "Offering Services", + content: [ + "Switch to Provider mode in your profile", + "Create detailed service listings with clear descriptions", + "Set competitive pricing and availability", + "Upload relevant photos and certifications", + "Respond promptly to customer inquiries" + ] + }, + messaging_system: { + title: "Communication & Messaging", + content: [ + "All communication happens through our secure messaging system", + "Access conversations from the Conversation Hub", + "Use the confirmation panel to track booking status", + "Both customer and provider must confirm completion", + "Chat history is preserved for your records" + ] + }, + payments_ratings: { + title: "Payments & Ratings", + content: [ + "Payments are processed securely through our platform", + "Rate your experience after service completion", + "Both customers and providers can leave reviews", + "Ratings help build trust in our community", + "Contact support for any payment issues" + ] + }, + safety_guidelines: { + title: "Safety Guidelines", + content: [ + "Always communicate through our platform messaging", + "Meet in public places for in-person services", + "Verify provider credentials and reviews", + "Report any suspicious behavior to our support team", + "Never share personal payment information outside the platform" + ] + }, + troubleshooting: { + title: "Common Issues & Solutions", + content: [ + "Can't find a conversation? Check the Conversation Hub or refresh the page", + "Booking not confirmed? Contact the provider through messaging", + "Payment issues? Contact our support team immediately", + "Profile not saving? Check your internet connection and try again", + "Service not appearing? Ensure all required fields are completed" + ] + }, + support: { + title: "Getting Help", + content: [ + "Use this chatbot for quick platform guidance", + "Check our FAQ section for common questions", + "Contact support through the help center", + "Join our community forums for tips and discussions", + "Follow our social media for updates and announcements" + ] + } + }, + quick_answers: { + how_to_book: "To book a service: 1) Find the service you want, 2) Click 'Book Now', 3) Fill in your requirements, 4) Wait for provider confirmation, 5) Communicate through our messaging system.", + how_to_message: "Access all your conversations through the Conversation Hub. Click on any conversation to view messages and use the confirmation panel to track booking status.", + how_to_rate: "After both parties confirm service completion, you can rate your experience. Customers rate services, providers rate customers.", + payment_process: "Payments are handled securely through our platform. You'll be charged after service confirmation and can rate your experience.", + safety_first: "Always use our messaging system, meet in public for in-person services, verify provider credentials, and report any issues to support.", + profile_setup: "Complete your profile with accurate info, upload a professional photo, verify your contact details, and add your location and service preferences.", + become_provider: "To become a service provider: 1) Switch to Provider mode in your profile settings, 2) Create detailed service listings with clear descriptions, 3) Set competitive pricing and availability, 4) Upload relevant photos and certifications, 5) Respond promptly to customer inquiries.", + find_conversations: "Go to the Conversation Hub to see all your messages. If you can't find a specific conversation, try refreshing the page or check if the URL is correct." + } +} as const; + +export type KnowledgeBaseType = typeof KNOWLEDGE_BASE; diff --git a/src/modules/chatbot/types.ts b/src/modules/chatbot/types.ts new file mode 100755 index 0000000..1bfae69 --- /dev/null +++ b/src/modules/chatbot/types.ts @@ -0,0 +1,50 @@ +/** + * Chatbot Module Type Definitions + */ + +export interface ChatMessage { + question: string; + answer: string; + timestamp: string; +} + +export interface ChatbotResponse { + success: boolean; + data: ChatMessage; + error?: string; +} + +export interface SuggestionsResponse { + success: boolean; + data: { + suggestions: string[]; + timestamp: string; + }; +} + +export interface KnowledgeBase { + platform_guide: Record; + quick_answers: Record; +} + +export interface HealthCheckResponse { + success: boolean; + service: string; + status: 'healthy' | 'unhealthy'; + timestamp: string; +} + +// Request types +export interface AskQuestionRequest { + message: string; +} + +// Internal types +export interface ProcessedQuestion { + original: string; + normalized: string; + keywords: string[]; +} diff --git a/src/routes/admin.route.ts b/src/routes/admin.route.ts new file mode 100755 index 0000000..2d79461 --- /dev/null +++ b/src/routes/admin.route.ts @@ -0,0 +1,17 @@ +import { Router, type Router as RouterType } from 'express'; +import { adminController } from '../controllers/admin.controller.js'; +import { adminAuthMiddleware } from '../middlewares/admin.middleware.js'; +import { validateAdminLogin, validateAdminRegistration, validateAdminUpdate } from '../validators/admin.validator.js'; + +const router: RouterType = Router(); + +// Public routes +router.post('/register', validateAdminRegistration, adminController.register); +router.post('/login', validateAdminLogin, adminController.login); + +// Protected routes (require admin authentication) +router.get('/profile', adminAuthMiddleware, adminController.getProfile); +router.put('/profile', adminAuthMiddleware, validateAdminUpdate, adminController.updateProfile); +router.get('/all', adminAuthMiddleware, adminController.getAllAdmins); + +export default router; diff --git a/src/routes/catagory.route.js b/src/routes/catagory.route.ts old mode 100644 new mode 100755 similarity index 96% rename from src/routes/catagory.route.js rename to src/routes/catagory.route.ts index e9c554e..26da6b5 --- a/src/routes/catagory.route.js +++ b/src/routes/catagory.route.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -const router = Router(); +const router: import('express').Router = Router(); import { createCategory, @@ -11,7 +11,7 @@ import { getRootCategories, getCategoryHierarchy, searchCategories -} from '../controllers/catagory.controller.js'; +} from '../controllers/category.controller.js'; import validate from '../middlewares/validation.middleware.js'; import { @@ -21,7 +21,7 @@ import { categorySlugSchema, searchCategoriesSchema, categoryQuerySchema -} from '../validators/catagory.validator.js'; +} from '../validators/category.validator.js'; import authMiddleware from '../middlewares/auth.middleware.js'; diff --git a/src/routes/category.route.ts b/src/routes/category.route.ts new file mode 100755 index 0000000..26da6b5 --- /dev/null +++ b/src/routes/category.route.ts @@ -0,0 +1,121 @@ +import { Router } from 'express'; +const router: import('express').Router = Router(); + +import { + createCategory, + getCategories, + getCategoryById, + getCategoryBySlug, + updateCategory, + deleteCategory, + getRootCategories, + getCategoryHierarchy, + searchCategories +} from '../controllers/category.controller.js'; + +import validate from '../middlewares/validation.middleware.js'; +import { + createCategorySchema, + updateCategorySchema, + categoryIdSchema, + categorySlugSchema, + searchCategoriesSchema, + categoryQuerySchema +} from '../validators/category.validator.js'; + +import authMiddleware from '../middlewares/auth.middleware.js'; + +// Public routes (no authentication required) +/** + * @route GET /api/categories + * @desc Get all categories with optional filtering + * @access Public + * @query parentId - Filter by parent category ID + * @query includeChildren - Include children categories (default: true) + * @query includeParent - Include parent category info (default: true) + * @query includeServices - Include services count (default: false) + */ +router.get('/', validate(categoryQuerySchema, 'query'), getCategories); + +/** + * @route GET /api/categories/roots + * @desc Get all root categories (categories with no parent) + * @access Public + * @query includeChildren - Include children categories (default: true) + */ +router.get('/roots', validate(categoryQuerySchema, 'query'), getRootCategories); + +/** + * @route GET /api/categories/search + * @desc Search categories by name or description + * @access Public + * @query q - Search term (required) + * @query includeChildren - Include children categories (default: true) + * @query includeParent - Include parent category info (default: true) + */ +router.get('/search', validate(searchCategoriesSchema, 'query'), searchCategories); + +/** + * @route GET /api/categories/id/:id + * @desc Get category by ID + * @access Public + * @param id - Category ID + * @query includeChildren - Include children categories (default: true) + * @query includeParent - Include parent category info (default: true) + * @query includeServices - Include services (default: false) + */ +router.get('/id/:id', validate(categoryIdSchema, 'params'), getCategoryById); + +/** + * @route GET /api/categories/slug/:slug + * @desc Get category by slug + * @access Public + * @param slug - Category slug + * @query includeChildren - Include children categories (default: true) + * @query includeParent - Include parent category info (default: true) + * @query includeServices - Include services (default: false) + */ +router.get('/slug/:slug', validate(categorySlugSchema, 'params'), getCategoryBySlug); + +/** + * @route GET /api/categories/:id/hierarchy + * @desc Get category hierarchy (full tree starting from category) + * @access Public + * @param id - Category ID + */ +router.get('/:id/hierarchy', validate(categoryIdSchema, 'params'), getCategoryHierarchy); + +// Protected routes (authentication required) +/** + * @route POST /api/categories + * @desc Create a new category + * @access Public (For Testing) + * @body name - Category name (optional) + * @body slug - Category slug (required, unique) + * @body description - Category description (optional) + * @body parentId - Parent category ID (optional) + */ +router.post('/', validate(createCategorySchema), createCategory); + +/** + * @route PUT /api/categories/:id + * @desc Update a category + * @access Private (Admin/Provider) + * @param id - Category ID + * @body name - Category name (optional) + * @body slug - Category slug (optional) + * @body description - Category description (optional) + * @body parentId - Parent category ID (optional) + */ +router.put('/:id', authMiddleware, validate(categoryIdSchema, 'params'), validate(updateCategorySchema), updateCategory); + +/** + * @route DELETE /api/categories/:id + * @desc Delete a category + * @access Private (Admin only) + * @param id - Category ID + * @query force - Force delete even if category has children or services (default: false) + */ +router.delete('/:id', authMiddleware, validate(categoryIdSchema, 'params'), deleteCategory); + +export default router; diff --git a/src/routes/chatbotRoutes.ts b/src/routes/chatbotRoutes.ts new file mode 100755 index 0000000..3a311a9 --- /dev/null +++ b/src/routes/chatbotRoutes.ts @@ -0,0 +1,27 @@ +import { Router, type Express } from 'express'; +import { chatbotController } from '../controllers/chatbotController.js'; + +const router: ReturnType = Router(); + +/** + * @route POST /api/chatbot/ask + * @desc Process user question and get chatbot response + * @access Public + */ +router.post('/ask', chatbotController.askQuestion.bind(chatbotController)); + +/** + * @route POST /api/chatbot/suggestions + * @desc Get quick question suggestions + * @access Public + */ +router.post('/suggestions', chatbotController.getSuggestions.bind(chatbotController)); + +/** + * @route GET /api/chatbot/health + * @desc Health check for chatbot service + * @access Public + */ +router.get('/health', chatbotController.healthCheck.bind(chatbotController)); + +export default router; diff --git a/src/routes/company.route.js b/src/routes/company.route.ts old mode 100644 new mode 100755 similarity index 93% rename from src/routes/company.route.js rename to src/routes/company.route.ts index d25d86a..fa7311f --- a/src/routes/company.route.js +++ b/src/routes/company.route.ts @@ -4,7 +4,7 @@ import authMiddleware from '../middlewares/auth.middleware.js'; import validationMiddleware from '../middlewares/validation.middleware.js'; import { createCompanySchema, updateCompanySchema } from '../validators/company.validator.js'; -const router = express.Router(); +const router: import('express').Router = express.Router(); // All routes require authentication router.use(authMiddleware); diff --git a/src/routes/confirmation.route.ts b/src/routes/confirmation.route.ts new file mode 100755 index 0000000..7cf9ea2 --- /dev/null +++ b/src/routes/confirmation.route.ts @@ -0,0 +1,19 @@ +import { Router } from 'express'; +import { getConfirmationController, upsertConfirmationController, createConfirmationController } from '../controllers/confirmation.controller.js'; +import authMiddleware from '../middlewares/auth.middleware.js'; + +const router: Router = Router(); + +// All confirmation routes require authentication +router.use(authMiddleware); + +// Get confirmation by conversation ID +router.get('/:conversationId', getConfirmationController); + +// Create confirmation for conversation +router.post('/', createConfirmationController); + +// Update confirmation (patch) +router.patch('/:conversationId', upsertConfirmationController); + +export default router; diff --git a/src/routes/health.route.ts b/src/routes/health.route.ts new file mode 100755 index 0000000..09c8b69 --- /dev/null +++ b/src/routes/health.route.ts @@ -0,0 +1,57 @@ +import { Router, Request, Response } from 'express'; +import { prisma } from '../utils/database.js'; + +const router: import('express').Router = Router(); + +router.get('/health', async (req: Request, res: Response) => { + try { + // Test database connection + await prisma.$queryRaw`SELECT 1`; + + res.json({ + status: 'healthy', + database: { + connected: true + }, + timestamp: new Date().toISOString() + }); + + } catch (error: any) { + console.error('Health check failed:', error); + + res.status(503).json({ + status: 'unhealthy', + database: { + connected: false, + error: error.message + }, + timestamp: new Date().toISOString() + }); + } +}); + +router.get('/health/database', async (req: Request, res: Response) => { + try { + // Basic database connection test + await prisma.$queryRaw`SELECT 1`; + + res.json({ + status: 'healthy', + database: { + connected: true + }, + timestamp: new Date().toISOString() + }); + + } catch (error: any) { + res.status(503).json({ + status: 'unhealthy', + error: { + message: error.message + }, + timestamp: new Date().toISOString() + }); + } +}); + +export default router; diff --git a/src/routes/provider.route.js b/src/routes/provider.route.js deleted file mode 100644 index c27f414..0000000 --- a/src/routes/provider.route.js +++ /dev/null @@ -1,18 +0,0 @@ -import { Router } from 'express'; -const router = Router(); -import { - createProvider, - updateProvider, - deleteProvider, - getProviderProfile -} from '../controllers/provider.controller.js'; -import validate from '../middlewares/validation.middleware.js'; -import { createProviderSchema, updateProviderSchema } from '../validators/provider.validator.js'; -import authMiddleware from '../middlewares/auth.middleware.js'; - -router.post('/', authMiddleware, validate(createProviderSchema), createProvider); -router.get('/profile', authMiddleware, getProviderProfile); -router.put('/profile', authMiddleware, validate(updateProviderSchema), updateProvider); -router.delete('/profile', authMiddleware, deleteProvider); - -export default router; diff --git a/src/routes/provider.route.ts b/src/routes/provider.route.ts new file mode 100755 index 0000000..274736c --- /dev/null +++ b/src/routes/provider.route.ts @@ -0,0 +1,27 @@ +import { Router } from 'express'; +const router: import('express').Router = Router(); +import { + createProvider, + updateProvider, + deleteProvider, + getProviderProfile, + getProviderById, + verifyProvider, + unverifyProvider +} from '../controllers/provider.controller.js'; +import validate from '../middlewares/validation.middleware.js'; +import { createProviderSchema, updateProviderSchema, providerParamsSchema } from '../validators/provider.validator.js'; +import authMiddleware from '../middlewares/auth.middleware.js'; +import { adminAuthMiddleware } from '../middlewares/admin.middleware.js'; + +router.post('/', authMiddleware, validate(createProviderSchema), createProvider); +router.get('/profile', authMiddleware, getProviderProfile); +router.put('/profile', authMiddleware, validate(updateProviderSchema), updateProvider); +router.delete('/profile', authMiddleware, deleteProvider); +router.get('/:id', validate(providerParamsSchema, 'params'), getProviderById); + +// Verification routes (admin only) +router.put('/:id/verify', authMiddleware, adminAuthMiddleware, validate(providerParamsSchema, 'params'), verifyProvider); +router.put('/:id/unverify', authMiddleware, adminAuthMiddleware, validate(providerParamsSchema, 'params'), unverifyProvider); + +export default router; diff --git a/src/routes/review.route.ts b/src/routes/review.route.ts new file mode 100755 index 0000000..fbca8d8 --- /dev/null +++ b/src/routes/review.route.ts @@ -0,0 +1,35 @@ +import { Router } from 'express'; +import { + createReviewController, + getCustomerReviewsController, + getReviewsByProviderController, + getReviewByIdController, + updateReviewController, + deleteReviewController, + getCustomerStatsController +} from '../controllers/review.controller.js'; + +const router: import('express').Router = Router(); + +// Create a review +router.post('/', createReviewController); + +// Get all reviews for a specific customer +router.get('/customer/:customerId', getCustomerReviewsController); + +// Get all reviews written by a service provider +router.get('/provider/:providerId', getReviewsByProviderController); + +// Get a specific review by ID +router.get('/:reviewId', getReviewByIdController); + +// Update a review +router.put('/:reviewId', updateReviewController); + +// Delete a review +router.delete('/:reviewId', deleteReviewController); + +// Get customer statistics (average rating, total reviews, rating distribution) +router.get('/customer/:customerId/stats', getCustomerStatsController); + +export default router; diff --git a/src/routes/serviceReview.route.ts b/src/routes/serviceReview.route.ts new file mode 100755 index 0000000..8fc2adf --- /dev/null +++ b/src/routes/serviceReview.route.ts @@ -0,0 +1,57 @@ +import { Router } from 'express'; +import { + createServiceReviewController, + getServiceReviewsController, + getServiceReviewByIdController, + updateServiceReviewController, + deleteServiceReviewController, + getServiceReviewStatsController, + getServiceReviewsDetailedController, + getProviderServiceReviewsController, + getProviderReviewStatsController +} from '../controllers/serviceReview.controller.js'; +import authMiddleware from '../middlewares/auth.middleware.js'; + +const router: import('express').Router = Router(); + +// Public routes (no authentication required) +// Get review statistics for a service +router.get('/service/:serviceId/stats', getServiceReviewStatsController); + +// Get detailed reviews for a service with stats and filtering +router.get('/service/:serviceId/detailed', getServiceReviewsDetailedController); + +// Get all reviews for a service (basic) +router.get('/service/:serviceId', getServiceReviewsController); + +// Get all reviews for all services of a provider +router.get('/provider/:providerId', getProviderServiceReviewsController); + +// Get review statistics for all services of a provider +router.get('/provider/:providerId/stats', getProviderReviewStatsController); + +// Protected routes (authentication required) +router.use(authMiddleware); + +// Create a service review +router.post('/', createServiceReviewController); + +// Get a single review by id +router.get('/:reviewId', getServiceReviewByIdController); + +// Update a review +router.patch('/:reviewId', updateServiceReviewController); + +// Delete a review +router.delete('/:reviewId', deleteServiceReviewController); + +// Get a single review by id +router.get('/:reviewId', getServiceReviewByIdController); + +// Update a review +router.patch('/:reviewId', updateServiceReviewController); + +// Delete a review +router.delete('/:reviewId', deleteServiceReviewController); + +export default router; diff --git a/src/routes/services.route.js b/src/routes/services.route.js deleted file mode 100644 index 2fddd54..0000000 --- a/src/routes/services.route.js +++ /dev/null @@ -1,62 +0,0 @@ -import { Router } from 'express'; -import { - createService, - getServices, - getServiceById, - updateService, - deleteService -} from '../controllers/services.controller.js'; -import validate from '../middlewares/validation.middleware.js'; -import { - createServiceSchema, - updateServiceSchema, - getServicesQuerySchema, - serviceIdSchema -} from '../validators/services.validator.js'; -import authMiddleware from '../middlewares/auth.middleware.js'; - -const router = Router(); - -// Apply authentication middleware to all routes -// router.use(authMiddleware); - -/** - * @route POST /api/services - * @desc Create a new service - * @access Private (Service Provider only) - */ -router.post('/', validate(createServiceSchema), createService); - -/** - * @route GET /api/services - * @desc Get all services with optional filtering - * @access Public - */ -router.get('/', validate(getServicesQuerySchema, 'query'), getServices); - -/** - * @route GET /api/services/:id - * @desc Get a single service by ID - * @access Public - */ -router.get('/:id', validate(serviceIdSchema, 'params'), getServiceById); - -/** - * @route PUT /api/services/:id - * @desc Update a service - * @access Private (Service Provider - own services only) - */ -router.put('/:id', - validate(serviceIdSchema, 'params'), - validate(updateServiceSchema), - updateService -); - -/** - * @route DELETE /api/services/:id - * @desc Delete a service - * @access Private (Service Provider - own services only) - */ -router.delete('/:id', validate(serviceIdSchema, 'params'), deleteService); - -export default router; diff --git a/src/routes/services.route.ts b/src/routes/services.route.ts new file mode 100755 index 0000000..a797afc --- /dev/null +++ b/src/routes/services.route.ts @@ -0,0 +1,146 @@ +import { Router } from 'express'; +import { + createService, + getServices, + getServiceById, + updateService, + deleteService, + getServiceByConversationId, + searchServices, + hybridSearchServices, + getSimilarServices, + updateServiceEmbeddings, + updateAllServiceEmbeddings, + searchServicesByLocation, + getLocationFromIP, + geocodeAddress, + reverseGeocode +} from '../controllers/services.controller.js'; +import validate from '../middlewares/validation.middleware.js'; +import { + createServiceSchema, + updateServiceSchema, + getServicesQuerySchema, + serviceIdSchema, + conversationIdSchema, + searchServicesByLocationSchema, + geocodeAddressSchema, + reverseGeocodeSchema +} from '../validators/services.validator.js'; +import authMiddleware from '../middlewares/auth.middleware.js'; + +const router: import('express').Router = Router(); + +// Apply authentication middleware to all routes +// router.use(authMiddleware); + +/** + * @route POST /api/services + * @desc Create a new service + * @access Private (Service Provider only) + */ +router.post('/', validate(createServiceSchema), createService); + +/** + * @route GET /api/services/search/hybrid + * @desc Hybrid search for services (semantic + location) + * @access Public + */ +router.get('/search/hybrid', hybridSearchServices); + +/** + * @route GET /api/services/search + * @desc Semantic search for services + * @access Public + */ +router.get('/search', searchServices); + +/** + * @route GET /api/services/search/location + * @desc Search services by location with radius filtering + * @access Public + */ +router.get('/search/location', validate(searchServicesByLocationSchema, 'query'), searchServicesByLocation); + +/** + * @route GET /api/services/location/ip + * @desc Get location information from IP address + * @access Public + */ +router.get('/location/ip', getLocationFromIP); + +/** + * @route POST /api/services/location/geocode + * @desc Convert address to coordinates + * @access Public + */ +router.post('/location/geocode', validate(geocodeAddressSchema), geocodeAddress); + +/** + * @route POST /api/services/location/reverse-geocode + * @desc Convert coordinates to address + * @access Public + */ +router.post('/location/reverse-geocode', validate(reverseGeocodeSchema), reverseGeocode); + +/** + * @route POST /api/services/embeddings/batch + * @desc Batch update embeddings for all services + * @access Private (Admin) + */ +router.post('/embeddings/batch', updateAllServiceEmbeddings); + +/** + * @route GET /api/services + * @desc Get all services with optional filtering + * @access Public + */ +router.get('/', validate(getServicesQuerySchema, 'query'), getServices); + +/** + * @route GET /api/services/:id + * @desc Get a single service by ID + * @access Public + */ +router.get('/:id', validate(serviceIdSchema, 'params'), getServiceById); + +/** + * @route GET /api/services/conversation/:conversationId + * @desc Get a service by conversation ID + * @access Public + */ +router.get('/conversation/:conversationId', validate(conversationIdSchema, 'params'), getServiceByConversationId); + +/** + * @route GET /api/services/:id/similar + * @desc Get similar services to a given service + * @access Public + */ +router.get('/:id/similar', validate(serviceIdSchema, 'params'), getSimilarServices); + +/** + * @route POST /api/services/:id/embeddings + * @desc Update embeddings for a specific service + * @access Private (Admin) + */ +router.post('/:id/embeddings', validate(serviceIdSchema, 'params'), updateServiceEmbeddings); + +/** + * @route PUT /api/services/:id + * @desc Update a service + * @access Private (Service Provider - own services only) + */ +router.put('/:id', + validate(serviceIdSchema, 'params'), + validate(updateServiceSchema), + updateService +); + +/** + * @route DELETE /api/services/:id + * @desc Delete a service + * @access Private (Service Provider - own services only) + */ +router.delete('/:id', validate(serviceIdSchema, 'params'), deleteService); + +export default router; diff --git a/src/routes/user.route.js b/src/routes/user.route.js deleted file mode 100644 index d1ad645..0000000 --- a/src/routes/user.route.js +++ /dev/null @@ -1,15 +0,0 @@ -import { Router } from 'express'; -const router = Router(); -import { createUser,loginUser,getUserProfile,updateUserProfile,deleteUserProfile,checkEmailExists} from '../controllers/user.controller.js'; -import validate from '../middlewares/validation.middleware.js'; -import { registerSchema,loginSchema,updateProfileSchema } from '../validators/user.validator.js'; -import authMiddleware from '../middlewares/auth.middleware.js'; - -router.get('/check-email', checkEmailExists); -router.post('/register', validate(registerSchema), createUser); -router.post('/login', validate(loginSchema), loginUser); -router.get('/profile', authMiddleware, getUserProfile); -router.put('/profile', authMiddleware, validate(updateProfileSchema), updateUserProfile); -router.delete('/profile', authMiddleware, deleteUserProfile); - -export default router; diff --git a/src/routes/user.route.ts b/src/routes/user.route.ts new file mode 100755 index 0000000..02ef3cf --- /dev/null +++ b/src/routes/user.route.ts @@ -0,0 +1,24 @@ +import { Router } from 'express'; +const router: import('express').Router = Router(); +import { createUser,loginUser,getUserProfile,updateUserProfile,deleteUserProfile,checkEmailExistsController,searchUsersController,uploadImageController,createAdminUser,getUserByIdController,uploadVideoController } from '../controllers/user.controller.js'; +import validate from '../middlewares/validation.middleware.js'; +import { registerSchema,loginSchema,updateProfileSchema } from '../validators/user.validator.js'; +import authMiddleware from '../middlewares/auth.middleware.js'; +import { adminAuthMiddleware } from '../middlewares/admin.middleware.js'; +import { upload, uploadVideo } from '../utils/s3.js'; + +router.get('/check-email', checkEmailExistsController); +router.get('/search', authMiddleware, searchUsersController); +router.get('/profile', authMiddleware, getUserProfile); +router.get('/:userId', getUserByIdController); +router.post('/register', validate(registerSchema), createUser); +router.post('/login', validate(loginSchema), loginUser); +router.put('/profile', authMiddleware, upload.single('profileImage'), updateUserProfile); +router.delete('/profile', authMiddleware, deleteUserProfile); +router.post('/upload-image', authMiddleware, upload.single('image'), uploadImageController); +router.post('/upload-video', authMiddleware, uploadVideo.single('video'), uploadVideoController); + +// Admin creation route (admin only) +router.post('/admin', authMiddleware, adminAuthMiddleware, validate(registerSchema), createAdminUser); + +export default router; diff --git a/src/services/admin.service.ts b/src/services/admin.service.ts new file mode 100755 index 0000000..349550a --- /dev/null +++ b/src/services/admin.service.ts @@ -0,0 +1,145 @@ +import { prisma } from '../utils/database.js'; +import { hashPassword, comparePassword } from '../utils/hash.js'; +import type { Admin } from '@prisma/client'; + +export interface CreateAdminData { + username: string; + password: string; + firstName: string; + lastName: string; +} + +export interface LoginAdminData { + username: string; + password: string; +} + +export interface UpdateAdminData { + username?: string; + password?: string; + firstName?: string; + lastName?: string; +} + +export class AdminService { + async createAdmin(data: CreateAdminData): Promise> { + const hashedPassword = await hashPassword(data.password); + + const admin = await prisma.admin.create({ + data: { + username: data.username, + password: hashedPassword, + firstName: data.firstName, + lastName: data.lastName, + }, + select: { + id: true, + username: true, + firstName: true, + lastName: true, + }, + }); + + return admin; + } + + async loginAdmin(data: LoginAdminData): Promise | null> { + const admin = await prisma.admin.findUnique({ + where: { username: data.username }, + }); + + if (!admin) { + return null; + } + + const isPasswordValid = await comparePassword(data.password, admin.password); + if (!isPasswordValid) { + return null; + } + + return { + id: admin.id, + username: admin.username, + firstName: admin.firstName, + lastName: admin.lastName, + }; + } + + async getAdminById(id: number): Promise | null> { + const admin = await prisma.admin.findUnique({ + where: { id }, + select: { + id: true, + username: true, + firstName: true, + lastName: true, + }, + }); + + return admin; + } + + async getAdminByUsername(username: string): Promise | null> { + const admin = await prisma.admin.findUnique({ + where: { username }, + select: { + id: true, + username: true, + firstName: true, + lastName: true, + }, + }); + + return admin; + } + + async getAllAdmins(): Promise[]> { + const admins = await prisma.admin.findMany({ + select: { + id: true, + username: true, + firstName: true, + lastName: true, + }, + }); + + return admins; + } + + async updateAdmin(id: number, data: UpdateAdminData): Promise | null> { + // Check if username is being updated and if it already exists + if (data.username) { + const existingAdmin = await prisma.admin.findUnique({ + where: { username: data.username }, + }); + + if (existingAdmin && existingAdmin.id !== id) { + throw new Error('Username already exists'); + } + } + + const updateData: any = {}; + + if (data.username) updateData.username = data.username; + if (data.firstName) updateData.firstName = data.firstName; + if (data.lastName) updateData.lastName = data.lastName; + if (data.password) { + updateData.password = await hashPassword(data.password); + } + + const admin = await prisma.admin.update({ + where: { id }, + data: updateData, + select: { + id: true, + username: true, + firstName: true, + lastName: true, + }, + }); + + return admin; + } +} + +export const adminService = new AdminService(); diff --git a/src/services/catagory.service.js b/src/services/catagory.service.ts old mode 100644 new mode 100755 similarity index 85% rename from src/services/catagory.service.js rename to src/services/catagory.service.ts index 6fe1535..cef64f7 --- a/src/services/catagory.service.js +++ b/src/services/catagory.service.ts @@ -1,17 +1,68 @@ -import { PrismaClient } from '@prisma/client'; +import { prisma } from '../utils/database.js'; + +// Type definitions +interface CategoryCreateData { + name?: string; + slug: string; + description?: string; + parentId?: string; +} + +interface CategoryUpdateData { + name?: string; + slug?: string; + description?: string; + parentId?: string; +} + +interface CategoryFilters { + parentId?: string | null; + includeChildren?: boolean; + includeParent?: boolean; + includeServices?: boolean; +} + +interface CategoryOptions { + includeChildren?: boolean; + includeParent?: boolean; + includeServices?: boolean; +} + +interface DeleteOptions { + force?: boolean; +} + +interface SearchOptions { + includeChildren?: boolean; + includeParent?: boolean; +} + +interface RootCategoryOptions { + includeChildren?: boolean; +} + +// Custom error class for better error handling +class CustomError extends Error { + status?: number; + + constructor(message: string, status?: number, name = 'Error') { + super(message); + this.status = status; + this.name = name; + } +} -const prisma = new PrismaClient(); +// Extend Error interface to include status property +interface ErrorWithStatus extends Error { + status?: number; +} /** * Create a new category - * @param {Object} categoryData - The category data - * @param {string} [categoryData.name] - Category name - * @param {string} categoryData.slug - Unique slug for the category - * @param {string} [categoryData.description] - Category description - * @param {string} [categoryData.parentId] - Parent category ID for hierarchical structure + * @param {CategoryCreateData} categoryData - The category data * @returns {Promise} Created category object */ -export const createCategory = async (categoryData) => { +export const createCategory = async (categoryData: CategoryCreateData) => { try { const { name, slug, description, parentId } = categoryData; @@ -25,7 +76,7 @@ export const createCategory = async (categoryData) => { where: { slug } }); if (existingCategory) { - const err = new Error('Category with this slug already exists'); + const err = new Error('Category with this slug already exists') as ErrorWithStatus; err.name = 'BadRequestError'; err.status = 400; throw err; @@ -74,7 +125,7 @@ export const createCategory = async (categoryData) => { return newCategory; } catch (error) { - throw new Error(`Failed to create category: ${error.message}`); + throw new Error(`Failed to create category: ${error instanceof Error ? error.message : 'Unknown error'}`); } }; @@ -87,7 +138,14 @@ export const createCategory = async (categoryData) => { * @param {boolean} [filters.includeServices=false] - Include services count * @returns {Promise} Array of category objects */ -export const getAllCategories = async (filters = {}) => { +interface CategoryFilters { + parentId?: string | null; + includeChildren?: boolean; + includeParent?: boolean; + includeServices?: boolean; +} + +export const getAllCategories = async (filters: CategoryFilters = {}) => { try { const { parentId, @@ -96,7 +154,7 @@ export const getAllCategories = async (filters = {}) => { includeServices = false } = filters; - const whereClause = {}; + const whereClause: any = {}; if (parentId !== undefined) { whereClause.parentId = parentId; } @@ -145,7 +203,7 @@ export const getAllCategories = async (filters = {}) => { * @param {boolean} [options.includeServices=false] - Include services * @returns {Promise} Category object or null if not found */ -export const getCategoryById = async (id, options = {}) => { +export const getCategoryById = async (id: string, options: CategoryOptions = {}) => { try { const { includeChildren = true, @@ -205,7 +263,7 @@ export const getCategoryById = async (id, options = {}) => { * @param {boolean} [options.includeServices=false] - Include services * @returns {Promise} Category object or null if not found */ -export const getCategoryBySlug = async (slug, options = {}) => { +export const getCategoryBySlug = async (slug: string, options: CategoryOptions = {}) => { try { const { includeChildren = true, @@ -266,7 +324,7 @@ export const getCategoryBySlug = async (slug, options = {}) => { * @param {string} [updateData.parentId] - Parent category ID * @returns {Promise} Updated category object */ -export const updateCategory = async (id, updateData) => { +export const updateCategory = async (id: string, updateData: CategoryUpdateData) => { try { const { name, slug, description, parentId } = updateData; @@ -284,7 +342,7 @@ export const updateCategory = async (id, updateData) => { where: { slug } }); if (slugExists) { - const err = new Error('Category with this slug already exists'); + const err = new Error('Category with this slug already exists') as ErrorWithStatus; err.name = 'BadRequestError'; err.status = 400; throw err; @@ -356,7 +414,7 @@ export const updateCategory = async (id, updateData) => { * @param {boolean} [options.force=false] - Force delete even if category has children or services * @returns {Promise} Deleted category object */ -export const deleteCategory = async (id, options = {}) => { +export const deleteCategory = async (id: string, options: DeleteOptions = {}) => { try { const { force = false } = options; @@ -416,7 +474,7 @@ export const deleteCategory = async (id, options = {}) => { * @param {boolean} [options.includeChildren=true] - Include children categories * @returns {Promise} Array of root category objects */ -export const getRootCategories = async (options = {}) => { +export const getRootCategories = async (options: RootCategoryOptions = {}) => { try { const { includeChildren = true } = options; @@ -436,7 +494,7 @@ export const getRootCategories = async (options = {}) => { * @param {string} categoryId - Starting category ID * @returns {Promise} Category with full hierarchy */ -export const getCategoryHierarchy = async (categoryId) => { +export const getCategoryHierarchy = async (categoryId: string) => { try { const category = await prisma.category.findUnique({ where: { id: categoryId }, @@ -474,7 +532,7 @@ export const getCategoryHierarchy = async (categoryId) => { * @param {string} newParentId - New parent category ID * @returns {Promise} True if circular reference would be created */ -const checkCircularReference = async (categoryId, newParentId) => { +const checkCircularReference = async (categoryId: string, newParentId: string): Promise => { let currentParentId = newParentId; while (currentParentId) { @@ -502,7 +560,7 @@ const checkCircularReference = async (categoryId, newParentId) => { * @param {boolean} [options.includeParent=true] - Include parent category info * @returns {Promise} Array of matching categories */ -export const searchCategories = async (searchTerm, options = {}) => { +export const searchCategories = async (searchTerm: string, options: SearchOptions = {}) => { try { const { includeChildren = true, includeParent = true } = options; diff --git a/src/services/category.service.ts b/src/services/category.service.ts new file mode 100755 index 0000000..b860310 --- /dev/null +++ b/src/services/category.service.ts @@ -0,0 +1,601 @@ +import { prisma } from '../utils/database.js'; + +// Type definitions +interface CategoryCreateData { + name?: string; + slug: string; + description?: string; + parentId?: string; +} + +interface CategoryUpdateData { + name?: string; + slug?: string; + description?: string; + parentId?: string; +} + +interface CategoryFilters { + parentId?: string | null; + includeChildren?: boolean; + includeParent?: boolean; + includeServices?: boolean; +} + +interface CategoryOptions { + includeChildren?: boolean; + includeParent?: boolean; + includeServices?: boolean; +} + +interface DeleteOptions { + force?: boolean; +} + +interface SearchOptions { + includeChildren?: boolean; + includeParent?: boolean; +} + +interface RootCategoryOptions { + includeChildren?: boolean; + includeServices?: boolean; +} + +// Custom error class for better error handling +class CategoryError extends Error { + status: number | undefined; + + constructor(message: string, status?: number, name = 'CategoryError') { + super(message); + if (status !== undefined) { + this.status = status; + } + this.name = name; + } +} + +/** + * Create a new category + * @param categoryData - The category data + * @returns Created category object + */ +export const createCategory = async (categoryData: CategoryCreateData) => { + try { + const { name, slug, description, parentId } = categoryData; + + // Validate required fields + if (!slug) { + throw new CategoryError('Slug is required', 400); + } + + // Check if slug already exists + const existingCategory = await prisma.category.findUnique({ + where: { slug } + }); + if (existingCategory) { + throw new CategoryError('Category with this slug already exists', 400); + } + + // If parentId is provided, validate that parent exists + if (parentId) { + const parentCategory = await prisma.category.findUnique({ + where: { id: parentId } + }); + if (!parentCategory) { + throw new CategoryError('Parent category not found', 404); + } + } + + // Create data object with only defined properties + const createData: any = { slug }; + if (name !== undefined) createData.name = name; + if (description !== undefined) createData.description = description; + if (parentId !== undefined) createData.parentId = parentId; + + // Create the category + const newCategory = await prisma.category.create({ + data: createData, + include: { + parent: { + select: { + id: true, + name: true, + slug: true + } + }, + children: { + select: { + id: true, + name: true, + slug: true + } + }, + _count: { + select: { + services: true + } + } + } + }); + + return newCategory; + } catch (error) { + if (error instanceof CategoryError) { + throw error; + } + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to create category: ${errorMessage}`); + } +}; + +/** + * Get all categories with optional filtering + * @param filters - Optional filters + * @returns Array of category objects + */ +export const getAllCategories = async (filters: CategoryFilters = {}) => { + try { + const { + parentId, + includeChildren = true, + includeParent = true, + includeServices = false + } = filters; + + const whereClause: any = {}; + if (parentId !== undefined) { + whereClause.parentId = parentId; + } + + const categories = await prisma.category.findMany({ + where: whereClause, + include: { + parent: includeParent ? { + select: { + id: true, + name: true, + slug: true + } + } : false, + children: includeChildren ? { + select: { + id: true, + name: true, + slug: true, + description: true, + _count: { + select: { + services: true + } + } + } + } : false, + _count: includeServices ? { + select: { + services: true + } + } : false + }, + orderBy: { + name: 'asc' + } + }); + + return categories; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to fetch categories: ${errorMessage}`); + } +}; + +/** + * Get category by ID + * @param id - Category ID + * @param options - Additional options + * @returns Category object or null if not found + */ +export const getCategoryById = async (id: string, options: CategoryOptions = {}) => { + try { + const { + includeChildren = true, + includeParent = true, + includeServices = false + } = options; + + const category = await prisma.category.findUnique({ + where: { id }, + include: { + parent: includeParent ? { + select: { + id: true, + name: true, + slug: true, + description: true + } + } : false, + children: includeChildren ? { + include: { + _count: { + select: { + services: true + } + } + } + } : false, + services: includeServices ? { + select: { + id: true, + title: true, + description: true, + price: true, + currency: true, + isActive: true + } + } : false, + _count: { + select: { + services: true + } + } + } + }); + + return category; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to fetch category: ${errorMessage}`); + } +}; + +/** + * Get category by slug + * @param slug - Category slug + * @param options - Additional options + * @returns Category object or null if not found + */ +export const getCategoryBySlug = async (slug: string, options: CategoryOptions = {}) => { + try { + const { + includeChildren = true, + includeParent = true, + includeServices = false + } = options; + + const category = await prisma.category.findUnique({ + where: { slug }, + include: { + parent: includeParent ? { + select: { + id: true, + name: true, + slug: true, + description: true + } + } : false, + children: includeChildren ? { + include: { + _count: { + select: { + services: true + } + } + } + } : false, + services: includeServices ? { + select: { + id: true, + title: true, + description: true, + price: true, + currency: true, + isActive: true + } + } : false, + _count: { + select: { + services: true + } + } + } + }); + + return category; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to fetch category: ${errorMessage}`); + } +}; + +/** + * Update a category + * @param id - Category ID + * @param updateData - Data to update + * @returns Updated category object + */ +export const updateCategory = async (id: string, updateData: CategoryUpdateData) => { + try { + const { name, slug, description, parentId } = updateData; + + // Check if category exists + const existingCategory = await prisma.category.findUnique({ + where: { id } + }); + if (!existingCategory) { + throw new CategoryError('Category not found', 404); + } + + // If slug is being updated, check if new slug already exists + if (slug && slug !== existingCategory.slug) { + const slugExists = await prisma.category.findUnique({ + where: { slug } + }); + if (slugExists) { + throw new CategoryError('Category with this slug already exists', 400); + } + } + + // If parentId is being updated, validate that parent exists and prevent circular references + if (parentId && parentId !== existingCategory.parentId) { + if (parentId === id) { + throw new CategoryError('Category cannot be its own parent', 400); + } + + const parentCategory = await prisma.category.findUnique({ + where: { id: parentId } + }); + if (!parentCategory) { + throw new CategoryError('Parent category not found', 404); + } + + // Check for circular reference by checking if the current category is an ancestor of the new parent + const isCircularReference = await checkCircularReference(id, parentId); + if (isCircularReference) { + throw new CategoryError('Cannot create circular reference in category hierarchy', 400); + } + } + + // Create update data object with only defined properties + const updateDataObj: any = {}; + if (name !== undefined) updateDataObj.name = name; + if (slug !== undefined) updateDataObj.slug = slug; + if (description !== undefined) updateDataObj.description = description; + if (parentId !== undefined) updateDataObj.parentId = parentId; + + // Update the category + const updatedCategory = await prisma.category.update({ + where: { id }, + data: updateDataObj, + include: { + parent: { + select: { + id: true, + name: true, + slug: true + } + }, + children: { + select: { + id: true, + name: true, + slug: true + } + }, + _count: { + select: { + services: true + } + } + } + }); + + return updatedCategory; + } catch (error) { + if (error instanceof CategoryError) { + throw error; + } + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to update category: ${errorMessage}`); + } +}; + +/** + * Delete a category + * @param id - Category ID + * @param options - Delete options + * @returns Deleted category object + */ +export const deleteCategory = async (id: string, options: DeleteOptions = {}) => { + try { + const { force = false } = options; + + // Check if category exists + const existingCategory = await prisma.category.findUnique({ + where: { id }, + include: { + children: true, + _count: { + select: { + services: true + } + } + } + }); + + if (!existingCategory) { + throw new CategoryError('Category not found', 404); + } + + // Check if category has children or services and force is not enabled + if (!force) { + if (existingCategory.children.length > 0) { + throw new CategoryError('Cannot delete category with child categories. Use force option or delete children first.', 400); + } + if (existingCategory._count.services > 0) { + throw new CategoryError('Cannot delete category with associated services. Use force option or remove services first.', 400); + } + } + + // If force delete, handle children and services + if (force) { + // Set children's parentId to null (make them root categories) + await prisma.category.updateMany({ + where: { parentId: id }, + data: { parentId: null } + }); + + // Note: Services will be orphaned but not deleted + // You might want to handle this differently based on business requirements + } + + // Delete the category + const deletedCategory = await prisma.category.delete({ + where: { id } + }); + + return deletedCategory; + } catch (error) { + if (error instanceof CategoryError) { + throw error; + } + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to delete category: ${errorMessage}`); + } +}; + +/** + * Get root categories (categories with no parent) + * @param options - Additional options + * @returns Array of root category objects + */ +export const getRootCategories = async (options: RootCategoryOptions = {}) => { + try { + const { includeChildren = true, includeServices = true } = options; + + return await getAllCategories({ + parentId: null, + includeChildren, + includeParent: false, + includeServices + }); + } catch (error) { + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to fetch root categories: ${errorMessage}`); + } +}; + +/** + * Get category hierarchy starting from a specific category + * @param categoryId - Starting category ID + * @returns Category with full hierarchy + */ +export const getCategoryHierarchy = async (categoryId: string) => { + try { + const category = await prisma.category.findUnique({ + where: { id: categoryId }, + include: { + parent: { + include: { + parent: { + include: { + parent: true // Up to 3 levels up + } + } + } + }, + children: { + include: { + children: { + include: { + children: true // Up to 3 levels down + } + } + } + } + } + }); + + return category; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to fetch category hierarchy: ${errorMessage}`); + } +}; + +/** + * Helper function to check for circular references in category hierarchy + * @param categoryId - Current category ID + * @param newParentId - New parent category ID + * @returns True if circular reference would be created + */ +const checkCircularReference = async (categoryId: string, newParentId: string): Promise => { + let currentParentId: string | null = newParentId; + + while (currentParentId) { + if (currentParentId === categoryId) { + return true; // Circular reference found + } + + const parent: { parentId: string | null } | null = await prisma.category.findUnique({ + where: { id: currentParentId }, + select: { parentId: true } + }); + + if (!parent) break; + currentParentId = parent.parentId; + } + + return false; +}; + +/** + * Search categories by name or description + * @param searchTerm - Search term + * @param options - Search options + * @returns Array of matching categories + */ +export const searchCategories = async (searchTerm: string, options: SearchOptions = {}) => { + try { + const { includeChildren = true, includeParent = true } = options; + + const categories = await prisma.category.findMany({ + where: { + OR: [ + { name: { contains: searchTerm, mode: 'insensitive' } }, + { description: { contains: searchTerm, mode: 'insensitive' } } + ] + }, + include: { + parent: includeParent ? { + select: { + id: true, + name: true, + slug: true + } + } : false, + children: includeChildren ? { + include: { + _count: { + select: { + services: true + } + } + } + } : false, + _count: { + select: { + services: true + } + } + }, + orderBy: { + name: 'asc' + } + }); + + return categories; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : 'Unknown error'; + throw new CategoryError(`Failed to search categories: ${errorMessage}`); + } +}; diff --git a/src/services/chatbotService.ts b/src/services/chatbotService.ts new file mode 100755 index 0000000..7f42762 --- /dev/null +++ b/src/services/chatbotService.ts @@ -0,0 +1,184 @@ +import * as fs from 'fs'; +import * as path from 'path'; + +interface KnowledgeBase { + platform_guide: Record; + quick_answers: Record; +} + +class ChatbotService { + private knowledgeBase: KnowledgeBase; + + constructor() { + this.loadKnowledgeBase(); + } + + private loadKnowledgeBase() { + try { + const filePath = path.join(__dirname, '../data/knowledge-base.json'); + const data = fs.readFileSync(filePath, 'utf8'); + this.knowledgeBase = JSON.parse(data); + console.log('✅ Chatbot knowledge base loaded successfully'); + } catch (error) { + console.error('❌ Failed to load knowledge base:', error); + // Fallback knowledge base + this.knowledgeBase = { + platform_guide: {}, + quick_answers: { + default: "I'm here to help you navigate the Zia platform! You can ask me about booking services, messaging, payments, safety guidelines, and more." + } + }; + } + } + + async processQuestion(question: string): Promise { + const lowerQuestion = question.toLowerCase(); + console.log('🤖 Processing question:', lowerQuestion); + + // Enhanced keyword matching for common questions + if (this.containsKeywords(lowerQuestion, ['become', 'provider', 'offer', 'service', 'sell'])) { + const providerData = this.knowledgeBase.platform_guide.offering_services; + if (providerData) { + return `**${providerData.title}**\n\n${providerData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['book', 'booking', 'reserve'])) { + const bookingData = this.knowledgeBase.platform_guide.booking_process; + if (bookingData) { + return `**${bookingData.title}**\n\n${bookingData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['message', 'chat', 'conversation', 'talk'])) { + const messagingData = this.knowledgeBase.platform_guide.messaging_system; + if (messagingData) { + return `**${messagingData.title}**\n\n${messagingData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['pay', 'payment', 'money', 'rate', 'rating'])) { + const paymentData = this.knowledgeBase.platform_guide.payments_ratings; + if (paymentData) { + return `**${paymentData.title}**\n\n${paymentData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['safe', 'safety', 'secure', 'security'])) { + const safetyData = this.knowledgeBase.platform_guide.safety_guidelines; + if (safetyData) { + return `**${safetyData.title}**\n\n${safetyData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['profile', 'account', 'setup', 'sign up'])) { + const setupData = this.knowledgeBase.platform_guide.account_setup; + if (setupData) { + return `**${setupData.title}**\n\n${setupData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['find', 'search', 'look', 'browse'])) { + const findData = this.knowledgeBase.platform_guide.finding_services; + if (findData) { + return `**${findData.title}**\n\n${findData.content.join('\n\n')}`; + } + } + + if (this.containsKeywords(lowerQuestion, ['problem', 'issue', 'error', 'trouble', 'help'])) { + const troubleData = this.knowledgeBase.platform_guide.troubleshooting; + if (troubleData) { + return `**${troubleData.title}**\n\n${troubleData.content.join('\n\n')}`; + } + } + + // Check for quick answers with flexible matching + for (const [key, answer] of Object.entries(this.knowledgeBase.quick_answers)) { + if (this.isQuestionMatch(lowerQuestion, key)) { + return answer; + } + } + + // Check platform guide sections with original matching + for (const [section, data] of Object.entries(this.knowledgeBase.platform_guide)) { + if (this.isQuestionMatch(lowerQuestion, section) || + this.isQuestionMatch(lowerQuestion, data.title.toLowerCase())) { + return `**${data.title}**\n\n${data.content.join('\n\n')}`; + } + } + + console.log('🔄 No specific match found, using default response'); + return this.getDefaultResponse(lowerQuestion); + } + + private isQuestionMatch(question: string, keyword: string): boolean { + const questionWords = question.split(/\s+/); + const keywordWords = keyword.replace(/_/g, ' ').split(/\s+/); + + return keywordWords.some(word => + questionWords.some(qWord => + qWord.includes(word) || word.includes(qWord) + ) + ); + } + + private containsKeywords(question: string, keywords: string[]): boolean { + return keywords.some(keyword => + question.includes(keyword.toLowerCase()) + ); + } + + getSuggestions(): string[] { + return [ + "How do I book a service?", + "How do I use the messaging system?", + "How do I become a service provider?", + "What are the safety guidelines?", + "How do payments work?", + "How do I rate my experience?", + "Where can I find my conversations?", + "How do I set up my profile?" + ]; + } + + private getDefaultResponse(question: string): string { + // Provide helpful suggestions based on common question patterns + if (question.includes('book') || question.includes('booking')) { + return this.knowledgeBase.quick_answers.how_to_book || + "To book a service, find what you need and click 'Book Now'. I can help you with the booking process!"; + } + + if (question.includes('message') || question.includes('chat') || question.includes('conversation')) { + return this.knowledgeBase.quick_answers.how_to_message || + "You can access all your conversations through the Conversation Hub. Need help with messaging?"; + } + + if (question.includes('pay') || question.includes('payment')) { + return this.knowledgeBase.quick_answers.payment_process || + "Payments are handled securely through our platform. What specific payment question do you have?"; + } + + if (question.includes('safe') || question.includes('security')) { + return this.knowledgeBase.quick_answers.safety_first || + "Safety is important! Always use our messaging system and verify provider credentials."; + } + + // General helpful response + return `I'm here to help you with the Zia platform! I can assist with: + +• **Booking services** - How to find and book what you need +• **Messaging** - Using our conversation system +• **Payments & ratings** - Understanding our payment process +• **Safety guidelines** - Staying safe on the platform +• **Account setup** - Getting your profile ready +• **Becoming a provider** - Offering your own services + +What would you like to know more about?`; + } +} + +// Export singleton instance +export const chatbotService = new ChatbotService(); diff --git a/src/services/company.service.js b/src/services/company.service.ts old mode 100644 new mode 100755 similarity index 77% rename from src/services/company.service.js rename to src/services/company.service.ts index d44648b..38c99ca --- a/src/services/company.service.js +++ b/src/services/company.service.ts @@ -1,8 +1,25 @@ -import { PrismaClient } from '@prisma/client'; - -const prisma = new PrismaClient(); - -export const createCompany = async (userId, companyData) => { +import { prisma } from '../utils/database.js'; + +// Types +interface CompanyCreateData { + name: string; + description?: string; + logo?: string; + address?: string; + contact?: string; + socialmedia?: any; +} + +interface CompanyUpdateData { + name?: string; + description?: string; + logo?: string; + address?: string; + contact?: string; + socialmedia?: any; +} + +export const createCompany = async (userId: string, companyData: CompanyCreateData) => { // Check if user is a verified provider const provider = await prisma.serviceProvider.findUnique({ where: { userId }, @@ -32,7 +49,7 @@ export const createCompany = async (userId, companyData) => { return company; }; -export const updateCompany = async (userId, companyId, companyData) => { +export const updateCompany = async (userId: string, companyId: string, companyData: CompanyUpdateData) => { // Check if user owns this company const provider = await prisma.serviceProvider.findUnique({ where: { userId }, @@ -51,7 +68,7 @@ export const updateCompany = async (userId, companyId, companyData) => { throw new Error('Company not found or you do not have permission to update it'); } - const updatedData = {}; + const updatedData: any = {}; if (companyData.name !== undefined) updatedData.name = companyData.name; if (companyData.description !== undefined) updatedData.description = companyData.description; if (companyData.logo !== undefined) updatedData.logo = companyData.logo; @@ -67,7 +84,7 @@ export const updateCompany = async (userId, companyId, companyData) => { return company; }; -export const deleteCompany = async (userId, companyId) => { +export const deleteCompany = async (userId: string, companyId: string) => { // Check if user owns this company const provider = await prisma.serviceProvider.findUnique({ where: { userId }, @@ -91,7 +108,7 @@ export const deleteCompany = async (userId, companyId) => { }); }; -export const getCompanies = async (userId) => { +export const getCompanies = async (userId: string) => { const provider = await prisma.serviceProvider.findUnique({ where: { userId }, include: { diff --git a/src/services/embedding.service.ts b/src/services/embedding.service.ts new file mode 100755 index 0000000..427b09d --- /dev/null +++ b/src/services/embedding.service.ts @@ -0,0 +1,231 @@ +export interface GeminiEmbeddingResponse { + embedding: { + values: number[]; + }; +} + +export class EmbeddingService { + private apiKey: string; + private apiUrl: string; + private model: string; + private lastRequestTime: number = 0; + private requestCount: number = 0; + private dailyRequestCount: number = 0; + private lastResetTime: number = Date.now(); + + constructor() { + // Use Gemini API for embeddings + this.apiKey = process.env.GEMINI_API_KEY || ''; + this.apiUrl = process.env.EMBEDDING_API_URL || 'https://generativelanguage.googleapis.com/v1beta/models'; + this.model = process.env.EMBEDDING_MODEL || 'text-embedding-004'; // Gemini text embedding model + } + + /** + * Rate limiting for free tier: 15 RPM, 1500/day + */ + private async rateLimitCheck(): Promise { + const now = Date.now(); + + // Reset daily counter if it's a new day + if (now - this.lastResetTime > 24 * 60 * 60 * 1000) { + this.dailyRequestCount = 0; + this.lastResetTime = now; + } + + // Check daily limit (free tier: 1500/day) + if (this.dailyRequestCount >= 1500) { + throw new Error('Daily API limit reached (1500 requests). Try again tomorrow.'); + } + + // Check rate limit (free tier: 15 RPM) + const timeSinceLastRequest = now - this.lastRequestTime; + const minTimeBetweenRequests = 60 * 1000 / 15; // 4 seconds between requests + + if (timeSinceLastRequest < minTimeBetweenRequests) { + const waitTime = minTimeBetweenRequests - timeSinceLastRequest; + console.log(`⏳ Rate limiting: waiting ${Math.ceil(waitTime/1000)}s before next request`); + await new Promise(resolve => setTimeout(resolve, waitTime)); + } + + this.lastRequestTime = Date.now(); + this.requestCount++; + this.dailyRequestCount++; + } + + /** + * Generate embeddings for text input + */ + async generateEmbedding(text: string): Promise { + try { + // Clean and prepare text + const cleanText = this.cleanText(text); + + if (!cleanText) { + console.warn('Empty text provided for embedding generation'); + return new Array(768).fill(0); // Return zero vector for empty text (Gemini uses 768 dimensions) + } + + if (this.apiKey) { + await this.rateLimitCheck(); // Add rate limiting + return await this.generateGeminiEmbedding(cleanText); + } else { + console.warn('No embedding API configured, using fallback'); + return await this.generateFallbackEmbedding(cleanText); + } + } catch (error) { + console.error('Error generating embedding:', error); + + // If rate limit hit, use fallback + if (error instanceof Error && error.message.includes('Daily API limit reached')) { + console.warn('🚫 API limit reached, using fallback embedding'); + return await this.generateFallbackEmbedding(this.cleanText(text)); + } + + return new Array(768).fill(0); // Return zero vector on error + } + } + + /** + * Generate embeddings for service data (title + description + tags) + */ + async generateServiceEmbeddings(service: { + title?: string; + description?: string; + tags?: string[]; + }) { + const title = service.title || ''; + const description = service.description || ''; + const tags = service.tags?.join(', ') || ''; + + // Combine all text for comprehensive embedding + const combinedText = [title, description, tags] + .filter(Boolean) + .join('. '); + + const [titleEmbedding, descriptionEmbedding, tagsEmbedding, combinedEmbedding] = await Promise.all([ + this.generateEmbedding(title), + this.generateEmbedding(description), + this.generateEmbedding(tags), + this.generateEmbedding(combinedText) + ]); + + return { + titleEmbedding, + descriptionEmbedding, + tagsEmbedding, + combinedEmbedding + }; + } + + /** + * Generate embedding using Gemini API + */ + private async generateGeminiEmbedding(text: string): Promise { + const url = `${this.apiUrl}/${this.model}:embedContent?key=${this.apiKey}`; + + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + model: `models/${this.model}`, + content: { + parts: [{ + text: text + }] + } + }) + }); + + if (!response.ok) { + throw new Error(`Gemini API error: ${response.status} ${response.statusText}`); + } + + const data = await response.json() as GeminiEmbeddingResponse; + + if (data.embedding && data.embedding.values) { + return data.embedding.values; + } + + throw new Error('Invalid embedding response from Gemini'); + } + + /** + * Simple fallback embedding for development/testing + * Uses basic text hashing - not suitable for production + */ + private async generateFallbackEmbedding(text: string): Promise { + console.warn('Using fallback embedding generation - not suitable for production'); + + // Simple hash-based embedding (for development only) + const embedding = new Array(768).fill(0); + const words = text.toLowerCase().split(/\s+/); + + words.forEach((word, index) => { + const hash = this.simpleHash(word); + const position = hash % 768; + embedding[position] += 1; + }); + + // Normalize the vector + const magnitude = Math.sqrt(embedding.reduce((sum, val) => sum + val * val, 0)); + return embedding.map(val => magnitude > 0 ? val / magnitude : 0); + } + + /** + * Clean text for embedding generation + */ + private cleanText(text: string): string { + if (!text) return ''; + + return text + .trim() + .replace(/\s+/g, ' ') // Normalize whitespace + .replace(/[^\w\s.-]/g, '') // Remove special characters except periods and hyphens + .substring(0, 8000); // Limit text length + } + + /** + * Simple hash function for fallback embedding + */ + private simpleHash(str: string): number { + let hash = 0; + for (let i = 0; i < str.length; i++) { + const char = str.charCodeAt(i); + hash = ((hash << 5) - hash) + char; + hash = hash & hash; // Convert to 32-bit integer + } + return Math.abs(hash); + } + + /** + * Calculate cosine similarity between two vectors + */ + static cosineSimilarity(vecA: number[], vecB: number[]): number { + if (vecA.length !== vecB.length) { + throw new Error('Vectors must have the same length'); + } + + let dotProduct = 0; + let normA = 0; + let normB = 0; + + for (let i = 0; i < vecA.length; i++) { + dotProduct += vecA[i] * vecB[i]; + normA += vecA[i] * vecA[i]; + normB += vecB[i] * vecB[i]; + } + + normA = Math.sqrt(normA); + normB = Math.sqrt(normB); + + if (normA === 0 || normB === 0) { + return 0; + } + + return dotProduct / (normA * normB); + } +} + +export const embeddingService = new EmbeddingService(); diff --git a/src/services/googleMaps.service.ts b/src/services/googleMaps.service.ts new file mode 100755 index 0000000..5015ff7 --- /dev/null +++ b/src/services/googleMaps.service.ts @@ -0,0 +1,218 @@ +import { Client } from '@googlemaps/google-maps-services-js'; +import { config } from 'dotenv'; + +config(); + +interface LocationData { + lat: number; + lng: number; + formatted_address: string; + city: string; + state: string; + country: string; + postal_code: string; +} + +interface AddressComponent { + long_name: string; + short_name: string; + types: string[]; +} + +class GoogleMapsService { + private client: Client; + private apiKey: string; + private geocodeCache: Map; + + constructor() { + this.client = new Client({}); + this.apiKey = process.env.GOOGLE_MAPS_API_KEY || ''; + this.geocodeCache = new Map(); + + if (!this.apiKey) { + console.warn('Google Maps API key not found. Location services will be disabled.'); + } + } + + /** + * Convert address to coordinates using Google Geocoding API + */ + async geocodeAddress(address: string): Promise { + if (!this.apiKey) { + throw new Error('Google Maps API key not configured'); + } + + // Check cache first + if (this.geocodeCache.has(address)) { + return this.geocodeCache.get(address)!; + } + + try { + const response = await this.client.geocode({ + params: { + address: address, + key: this.apiKey, + }, + }); + + if (response.data.results.length === 0) { + throw new Error('Address not found'); + } + + const result = response.data.results[0]; + const location = result.geometry.location; + const components = result.address_components; + + const locationData: LocationData = { + lat: location.lat, + lng: location.lng, + formatted_address: result.formatted_address, + city: this.extractComponent(components, 'locality') || + this.extractComponent(components, 'administrative_area_level_2') || '', + state: this.extractComponent(components, 'administrative_area_level_1') || '', + country: this.extractComponent(components, 'country') || '', + postal_code: this.extractComponent(components, 'postal_code') || '', + }; + + // Cache the result + this.geocodeCache.set(address, locationData); + + return locationData; + } catch (error) { + console.error('Geocoding error:', error); + throw new Error(`Failed to geocode address: ${address}`); + } + } + + /** + * Convert coordinates to address using Google Reverse Geocoding API + */ + async reverseGeocode(lat: number, lng: number): Promise { + if (!this.apiKey) { + throw new Error('Google Maps API key not configured'); + } + + const cacheKey = `${lat},${lng}`; + if (this.geocodeCache.has(cacheKey)) { + return this.geocodeCache.get(cacheKey)!; + } + + try { + const response = await this.client.reverseGeocode({ + params: { + latlng: { lat, lng }, + key: this.apiKey, + }, + }); + + if (response.data.results.length === 0) { + throw new Error('Location not found'); + } + + const result = response.data.results[0]; + const components = result.address_components; + + const locationData: LocationData = { + lat, + lng, + formatted_address: result.formatted_address, + city: this.extractComponent(components, 'locality') || + this.extractComponent(components, 'administrative_area_level_2') || '', + state: this.extractComponent(components, 'administrative_area_level_1') || '', + country: this.extractComponent(components, 'country') || '', + postal_code: this.extractComponent(components, 'postal_code') || '', + }; + + // Cache the result + this.geocodeCache.set(cacheKey, locationData); + + return locationData; + } catch (error) { + console.error('Reverse geocoding error:', error); + throw new Error(`Failed to reverse geocode coordinates: ${lat}, ${lng}`); + } + } + + /** + * Validate coordinates + */ + validateCoordinates(lat: number, lng: number): boolean { + return lat >= -90 && lat <= 90 && lng >= -180 && lng <= 180; + } + + /** + * Calculate distance between two points in kilometers + */ + calculateDistance(lat1: number, lng1: number, lat2: number, lng2: number): number { + const R = 6371; // Earth's radius in kilometers + const dLat = this.toRadians(lat2 - lat1); + const dLng = this.toRadians(lng2 - lng1); + + const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + + Math.cos(this.toRadians(lat1)) * Math.cos(this.toRadians(lat2)) * + Math.sin(dLng / 2) * Math.sin(dLng / 2); + + const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); + return R * c; + } + + /** + * Get location from IP address as fallback + */ + async getLocationFromIP(ip?: string): Promise> { + try { + // Using a free IP geolocation service + const url = ip ? `https://ipapi.co/${ip}/json/` : 'https://ipapi.co/json/'; + const response = await fetch(url); + const data = await response.json() as any; + + if (data.error) { + throw new Error(data.reason || 'IP geolocation failed'); + } + + return { + lat: data.latitude, + lng: data.longitude, + city: data.city || '', + state: data.region || '', + country: data.country_name || '', + postal_code: data.postal || '', + formatted_address: `${data.city}, ${data.region}, ${data.country_name}` + }; + } catch (error) { + console.error('IP geolocation error:', error); + throw new Error('Could not determine location from IP'); + } + } + + /** + * Extract address component by type + */ + private extractComponent(components: AddressComponent[], type: string): string { + const component = components.find(c => c.types.includes(type)); + return component ? component.long_name : ''; + } + + /** + * Convert degrees to radians + */ + private toRadians(degrees: number): number { + return degrees * (Math.PI / 180); + } + + /** + * Clear geocoding cache + */ + clearCache(): void { + this.geocodeCache.clear(); + } + + /** + * Get cache size + */ + getCacheSize(): number { + return this.geocodeCache.size; + } +} + +export default new GoogleMapsService(); \ No newline at end of file diff --git a/src/services/provider.service.js b/src/services/provider.service.ts old mode 100644 new mode 100755 similarity index 58% rename from src/services/provider.service.js rename to src/services/provider.service.ts index f2f3b5f..01efd50 --- a/src/services/provider.service.js +++ b/src/services/provider.service.ts @@ -1,8 +1,23 @@ -import { PrismaClient } from '@prisma/client'; +import { prisma } from '../utils/database.js'; -const prisma = new PrismaClient(); +// Type definitions +interface ProviderCreateData { + bio?: string; + skills?: string[]; + qualifications?: string[]; + logoUrl?: string; + IDCardUrl?: string; +} -export const createProvider = async (userId, providerData) => { +interface ProviderUpdateData { + bio?: string; + skills?: string[]; + qualifications?: string[]; + logoUrl?: string; + IDCardUrl?: string; +} + +export const createProvider = async (userId: string, providerData: ProviderCreateData) => { // Check if user exists and doesn't already have a provider profile const user = await prisma.user.findUnique({ where: { id: userId }, @@ -50,7 +65,7 @@ export const createProvider = async (userId, providerData) => { return newProvider; }; -export const updateProvider = async (userId, providerData) => { +export const updateProvider = async (userId: string, providerData: ProviderUpdateData) => { // Check if user has a provider profile const existingProvider = await prisma.serviceProvider.findUnique({ where: { userId } @@ -60,7 +75,7 @@ export const updateProvider = async (userId, providerData) => { throw new Error('Service provider profile not found'); } - const updatedData = {}; + const updatedData: any = {}; if (providerData.bio !== undefined) updatedData.bio = providerData.bio; if (providerData.skills !== undefined) updatedData.skills = providerData.skills; if (providerData.qualifications !== undefined) updatedData.qualifications = providerData.qualifications; @@ -91,25 +106,6 @@ export const updateProvider = async (userId, providerData) => { images: true, isActive: true } - }, - reviews: { - select: { - id: true, - rating: true, - comment: true, - createdAt: true, - reviewer: { - select: { - firstName: true, - lastName: true, - imageUrl: true - } - } - }, - orderBy: { - createdAt: 'desc' - }, - take: 10 } } }); @@ -117,15 +113,14 @@ export const updateProvider = async (userId, providerData) => { return updatedProvider; }; -export const deleteProvider = async (userId) => { +export const deleteProvider = async (userId: string) => { // Check if user has a provider profile const existingProvider = await prisma.serviceProvider.findUnique({ where: { userId }, include: { services: true, - schedules: true, - payments: true, - reviews: true + schedules: { select: { customerConfirmation: true, providerConfirmation: true } }, + payments: true } }); @@ -139,7 +134,9 @@ export const deleteProvider = async (userId) => { throw new Error('Cannot delete provider with active services. Please deactivate all services first.'); } - const pendingSchedules = existingProvider.schedules.filter(schedule => !schedule.confirm); + const pendingSchedules = existingProvider.schedules.filter(schedule => + !schedule.customerConfirmation || !schedule.providerConfirmation + ); if (pendingSchedules.length > 0) { throw new Error('Cannot delete provider with pending schedules.'); } @@ -158,7 +155,7 @@ export const deleteProvider = async (userId) => { return { message: 'Service provider profile deleted successfully' }; }; -export const getProviderProfile = async (userId) => { +export const getProviderProfile = async (userId: string) => { const provider = await prisma.serviceProvider.findUnique({ where: { userId }, include: { @@ -198,31 +195,127 @@ export const getProviderProfile = async (userId) => { orderBy: { createdAt: 'desc' } + } + } + }); + + if (!provider) { + throw new Error('Service provider profile not found'); + } + + return provider; +}; + +export const getProviderById = async (id: string) => { + const provider = await prisma.serviceProvider.findUnique({ + where: { id }, + include: { + user: { + select: { + id: true, + email: true, + firstName: true, + lastName: true, + imageUrl: true, + role: true + } }, - reviews: { + services: { select: { id: true, - rating: true, - comment: true, - createdAt: true, - reviewer: { - select: { - firstName: true, - lastName: true, - imageUrl: true - } - } - }, - orderBy: { - createdAt: 'desc' + title: true, + description: true, + price: true, + currency: true, + images: true, + isActive: true } } } }); if (!provider) { - throw new Error('Service provider profile not found'); + throw new Error('Service provider not found'); } return provider; }; + +export const verifyProvider = async (providerId: string) => { + // Check if provider exists + const existingProvider = await prisma.serviceProvider.findUnique({ + where: { id: providerId }, + include: { + user: { + select: { + id: true, + email: true, + firstName: true, + lastName: true, + role: true + } + } + } + }); + + if (!existingProvider) { + throw new Error('Service provider not found'); + } + + if (existingProvider.isVerified) { + throw new Error('Service provider is already verified'); + } + + // Update verification status + const verifiedProvider = await prisma.serviceProvider.update({ + where: { id: providerId }, + data: { isVerified: true }, + include: { + user: { + select: { + id: true, + email: true, + firstName: true, + lastName: true, + role: true + } + } + } + }); + + return verifiedProvider; +}; + +export const unverifyProvider = async (providerId: string) => { + // Check if provider exists + const existingProvider = await prisma.serviceProvider.findUnique({ + where: { id: providerId } + }); + + if (!existingProvider) { + throw new Error('Service provider not found'); + } + + if (!existingProvider.isVerified) { + throw new Error('Service provider is already unverified'); + } + + // Update verification status + const unverifiedProvider = await prisma.serviceProvider.update({ + where: { id: providerId }, + data: { isVerified: false }, + include: { + user: { + select: { + id: true, + email: true, + firstName: true, + lastName: true, + role: true + } + } + } + }); + + return unverifiedProvider; +}; diff --git a/src/services/queue.service.ts b/src/services/queue.service.ts new file mode 100755 index 0000000..92f26ee --- /dev/null +++ b/src/services/queue.service.ts @@ -0,0 +1,238 @@ +import * as amqp from 'amqplib'; + +export interface EmailEvent { + type: 'BOOKING_CONFIRMATION' | 'BOOKING_REMINDER' | 'BOOKING_CANCELLATION_MODIFICATION' | 'NEW_MESSAGE_OR_REVIEW' | 'OTHER'; + data: { + conversationId?: string; + scheduleId?: string; + customerEmail: string; + providerEmail: string; + customerName: string; + providerName: string; + serviceName?: string; + startDate?: string; + endDate?: string; + serviceFee?: number; + currency?: string; + message?: string; + reviewData?: any; + metadata?: Record; + }; + timestamp: string; +} + +class QueueService { + private connection: any = null; + private channel: any = null; + private readonly exchangeName = 'email_notifications'; + private isConnecting = false; + private readonly routingKeys = { + BOOKING_CONFIRMATION: 'email.booking.confirmation', + BOOKING_REMINDER: 'email.booking.reminder', + BOOKING_CANCELLATION_MODIFICATION: 'email.booking.modification', + NEW_MESSAGE_OR_REVIEW: 'email.message.review', + OTHER: 'email.other' + }; + + async connect(): Promise { + if (this.isConnecting) { + console.log('🔄 Connection already in progress, waiting...'); + return; + } + + try { + this.isConnecting = true; + const rabbitmqUrl = process.env.RABBITMQ_URL || 'amqp://localhost:5672'; + + // Add connection options for better stability + this.connection = await amqp.connect(rabbitmqUrl, { + heartbeat: 60, // 60 seconds heartbeat + connection_timeout: 30000, // 30 seconds connection timeout + }); + + this.channel = await this.connection.createChannel(); + + // Handle connection errors + this.connection.on('error', (err: any) => { + console.error('❌ RabbitMQ connection error:', err); + this.connection = null; + this.channel = null; + }); + + this.connection.on('close', () => { + console.log('📤 RabbitMQ connection closed'); + this.connection = null; + this.channel = null; + }); + + // Handle channel errors + this.channel.on('error', (err: any) => { + console.error('❌ RabbitMQ channel error:', err); + this.channel = null; + }); + + this.channel.on('close', () => { + console.log('📤 RabbitMQ channel closed'); + this.channel = null; + }); + + // Declare exchange + await this.channel.assertExchange(this.exchangeName, 'topic', { + durable: true + }); + + console.log('✅ Connected to RabbitMQ and exchange created'); + } catch (error) { + console.error('❌ Failed to connect to RabbitMQ:', error); + this.connection = null; + this.channel = null; + // Don't throw error to prevent server crash + console.error('📧 Email notifications will be disabled until connection is restored'); + } finally { + this.isConnecting = false; + } + } + + async publishEmailEvent(event: EmailEvent): Promise { + // Check if connection is available, if not, try to reconnect + if (!this.channel || !this.connection) { + console.log('🔄 RabbitMQ connection not available, attempting to reconnect...'); + await this.connect(); + } + + // If still no connection after reconnect attempt, skip email + if (!this.channel) { + console.error('📧 Email notification skipped - RabbitMQ connection unavailable'); + return; + } + + try { + const routingKey = this.routingKeys[event.type]; + const message = Buffer.from(JSON.stringify(event)); + + const published = this.channel!.publish( + this.exchangeName, + routingKey, + message, + { + persistent: true, + timestamp: Date.now(), + messageId: `${event.type}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}` + } + ); + + if (published) { + console.log(`📧 Email event published: ${event.type} for conversation ${event.data.conversationId}`); + } else { + throw new Error('Failed to publish message to queue'); + } + } catch (error) { + console.error('❌ Error publishing email event:', error); + + // Reset connection on error + this.connection = null; + this.channel = null; + + // Don't throw error to prevent breaking the main confirmation flow + console.error('📧 Email notification failed but continuing with main operation'); + } + } + + async sendBookingConfirmation(data: { + conversationId: string; + scheduleId: string; + customerEmail: string; + providerEmail: string; + customerName: string; + providerName: string; + serviceName: string; + startDate: string; + endDate: string; + serviceFee?: number; + currency?: string; + }): Promise { + const event: EmailEvent = { + type: 'BOOKING_CONFIRMATION', + data, + timestamp: new Date().toISOString() + }; + + await this.publishEmailEvent(event); + } + + async sendBookingModification(data: { + conversationId: string; + scheduleId: string; + customerEmail: string; + providerEmail: string; + customerName: string; + providerName: string; + serviceName: string; + startDate?: string; + endDate?: string; + serviceFee?: number; + currency?: string; + message?: string; + }): Promise { + const event: EmailEvent = { + type: 'BOOKING_CANCELLATION_MODIFICATION', + data, + timestamp: new Date().toISOString() + }; + + await this.publishEmailEvent(event); + } + + async sendMessageOrReviewNotification(data: { + conversationId?: string; + customerEmail: string; + providerEmail: string; + customerName: string; + providerName: string; + message?: string; + reviewData?: any; + notificationType: 'MESSAGE' | 'REVIEW'; + metadata?: Record; + }): Promise { + const event: EmailEvent = { + type: 'NEW_MESSAGE_OR_REVIEW', + data: { + ...data, + serviceName: data.notificationType === 'REVIEW' ? 'Service Review' : 'New Message' + }, + timestamp: new Date().toISOString() + }; + + await this.publishEmailEvent(event); + } + + async close(): Promise { + try { + if (this.channel) { + await this.channel.close(); + } + if (this.connection) { + await this.connection.close(); + } + } catch (error) { + console.error('Error closing RabbitMQ connection:', error); + } + } + + // Graceful shutdown + setupGracefulShutdown(): void { + process.on('SIGINT', async () => { + console.log('🔄 Gracefully shutting down RabbitMQ connection...'); + await this.close(); + process.exit(0); + }); + + process.on('SIGTERM', async () => { + console.log('🔄 Gracefully shutting down RabbitMQ connection...'); + await this.close(); + process.exit(0); + }); + } +} + +export const queueService = new QueueService(); diff --git a/src/services/review.service.ts b/src/services/review.service.ts new file mode 100755 index 0000000..ccbea79 --- /dev/null +++ b/src/services/review.service.ts @@ -0,0 +1,394 @@ +import { prisma } from '../utils/database.js'; + +export interface CreateReviewData { + reviewerId: string; + revieweeId: string; + rating: number; + comment?: string; +} + +export interface UpdateReviewData { + rating?: number; + comment?: string; +} + +export interface CustomerStats { + totalReviews: number; + averageRating: number; + ratingDistribution: { + 5: number; + 4: number; + 3: number; + 2: number; + 1: number; + }; +} + +export const createReview = async (data: CreateReviewData) => { + try { + // Check if review already exists + const existingReview = await prisma.customerReview.findFirst({ + where: { + reviewerId: data.reviewerId, + revieweeId: data.revieweeId, + }, + }); + + if (existingReview) { + throw new Error('Review already exists for this provider'); + } + + // Create the review + const review = await prisma.customerReview.create({ + data: { + reviewerId: data.reviewerId, + revieweeId: data.revieweeId, + rating: data.rating, + comment: data.comment, + }, + include: { + reviewer: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + reviewee: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + }, + }); + + // Update provider's average rating (using revieweeId which is the user ID) + await updateProviderRating(data.revieweeId); + + return review; + } catch (error) { + console.error('Error creating review:', error); + throw error; + } +}; + +export const getCustomerReviews = async (customerId: string, page: number = 1, limit: number = 10) => { + try { + const skip = (page - 1) * limit; + + const [reviews, total] = await Promise.all([ + prisma.customerReview.findMany({ + where: { + reviewerId: customerId, + }, + include: { + reviewer: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + reviewee: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + }, + orderBy: { + createdAt: 'desc', + }, + skip, + take: limit, + }), + prisma.customerReview.count({ + where: { + reviewerId: customerId, + }, + }), + ]); + + return { + reviews, + pagination: { + page, + limit, + total, + totalPages: Math.ceil(total / limit), + }, + }; + } catch (error) { + console.error('Error getting customer reviews:', error); + throw error; + } +}; + +export const getReviewsByProvider = async (providerId: string, page: number = 1, limit: number = 10) => { + try { + const skip = (page - 1) * limit; + + const [reviews, total] = await Promise.all([ + prisma.customerReview.findMany({ + where: { + revieweeId: providerId, + }, + include: { + reviewer: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + reviewee: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + }, + orderBy: { + createdAt: 'desc', + }, + skip, + take: limit, + }), + prisma.customerReview.count({ + where: { + revieweeId: providerId, + }, + }), + ]); + + return { + reviews, + pagination: { + page, + limit, + total, + totalPages: Math.ceil(total / limit), + }, + }; + } catch (error) { + console.error('Error getting provider reviews:', error); + throw error; + } +}; + +export const getReviewById = async (reviewId: string) => { + try { + const review = await prisma.customerReview.findUnique({ + where: { + id: reviewId, + }, + include: { + reviewer: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + reviewee: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + }, + }); + + if (!review) { + throw new Error('Review not found'); + } + + return review; + } catch (error) { + console.error('Error getting review:', error); + throw error; + } +}; + +export const updateReview = async (reviewId: string, data: UpdateReviewData, userId: string) => { + try { + // Check if review exists and belongs to the user + const existingReview = await prisma.customerReview.findUnique({ + where: { + id: reviewId, + }, + }); + + if (!existingReview) { + throw new Error('Review not found'); + } + + if (existingReview.reviewerId !== userId) { + throw new Error('Unauthorized to update this review'); + } + + const review = await prisma.customerReview.update({ + where: { + id: reviewId, + }, + data: { + rating: data.rating, + comment: data.comment, + updatedAt: new Date(), + }, + include: { + reviewer: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + reviewee: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + }, + }, + }); + + // Update provider's average rating (using revieweeId which is the user ID) + await updateProviderRating(existingReview.revieweeId); + + return review; + } catch (error) { + console.error('Error updating review:', error); + throw error; + } +}; + +export const deleteReview = async (reviewId: string, userId: string) => { + try { + // Check if review exists and belongs to the user + const existingReview = await prisma.customerReview.findUnique({ + where: { + id: reviewId, + }, + }); + + if (!existingReview) { + throw new Error('Review not found'); + } + + if (existingReview.reviewerId !== userId) { + throw new Error('Unauthorized to delete this review'); + } + + const revieweeUserId = existingReview.revieweeId; + + await prisma.customerReview.delete({ + where: { + id: reviewId, + }, + }); + + // Update provider's average rating (using userId which is the user ID) + await updateProviderRating(revieweeUserId); + + return { message: 'Review deleted successfully' }; + } catch (error) { + console.error('Error deleting review:', error); + throw error; + } +}; + +export const getCustomerStats = async (customerId: string): Promise => { + try { + const reviews = await prisma.customerReview.findMany({ + where: { + reviewerId: customerId, + }, + select: { + rating: true, + }, + }); + + const totalReviews = reviews.length; + const averageRating = totalReviews > 0 + ? reviews.reduce((sum, review) => sum + review.rating, 0) / totalReviews + : 0; + + const ratingDistribution = { + 5: reviews.filter(r => r.rating === 5).length, + 4: reviews.filter(r => r.rating === 4).length, + 3: reviews.filter(r => r.rating === 3).length, + 2: reviews.filter(r => r.rating === 2).length, + 1: reviews.filter(r => r.rating === 1).length, + }; + + return { + totalReviews, + averageRating: Math.round(averageRating * 100) / 100, // Round to 2 decimal places + ratingDistribution, + }; + } catch (error) { + console.error('Error getting customer stats:', error); + throw error; + } +}; + +// Helper function to update provider's average rating +const updateProviderRating = async (userId: string) => { + try { + // First check if the user is a service provider + const serviceProvider = await prisma.serviceProvider.findUnique({ + where: { + userId: userId, + }, + }); + + if (!serviceProvider) { + console.log(`User ${userId} is not a service provider, skipping rating update`); + return; + } + + const reviews = await prisma.customerReview.findMany({ + where: { + revieweeId: userId, + }, + select: { + rating: true, + }, + }); + + const totalReviews = reviews.length; + const averageRating = totalReviews > 0 + ? reviews.reduce((sum, review) => sum + review.rating, 0) / totalReviews + : null; + + await prisma.serviceProvider.update({ + where: { + userId: userId, + }, + data: { + averageRating: averageRating, + totalReviews: totalReviews, + }, + }); + } catch (error) { + console.error('Error updating provider rating:', error); + // Don't throw error here as this is a background update + } +}; \ No newline at end of file diff --git a/src/services/semantic-search.service.ts b/src/services/semantic-search.service.ts new file mode 100755 index 0000000..0a5fee2 --- /dev/null +++ b/src/services/semantic-search.service.ts @@ -0,0 +1,329 @@ +import { prisma } from '../utils/database.js'; +import { embeddingService } from './embedding.service.js'; + +export interface SemanticSearchOptions { + query: string; + limit?: number; + threshold?: number; + categoryId?: string; + providerId?: string; + isActive?: boolean; + minPrice?: number; + maxPrice?: number; +} + +export interface SemanticSearchResult { + id: string; + title: string; + description: string; + price: number; + currency: string; + tags: string[]; + images: string[]; + similarity: number; + provider: { + id: string; + user: { + firstName: string; + lastName: string; + }; + }; + category: { + id: string; + name: string; + }; +} + +export class SemanticSearchService { + /** + * Perform semantic search for services + */ + async searchServices(options: SemanticSearchOptions): Promise { + const { + query, + limit = 20, + threshold = 0.3, + categoryId, + providerId, + isActive = true, + minPrice, + maxPrice + } = options; + + try { + // Generate embedding for search query + const queryEmbedding = await embeddingService.generateEmbedding(query); + + // Convert embedding to PostgreSQL array format + const embeddingVector = `[${queryEmbedding.join(',')}]`; + + // Build WHERE conditions + const whereConditions = ['s."isActive" = $1']; + const params: any[] = [isActive]; + let paramIndex = 2; + + if (categoryId) { + whereConditions.push(`s."categoryId" = $${paramIndex}`); + params.push(categoryId); + paramIndex++; + } + + if (providerId) { + whereConditions.push(`s."providerId" = $${paramIndex}`); + params.push(providerId); + paramIndex++; + } + + if (minPrice !== undefined) { + whereConditions.push(`s.price >= $${paramIndex}`); + params.push(minPrice); + paramIndex++; + } + + if (maxPrice !== undefined) { + whereConditions.push(`s.price <= $${paramIndex}`); + params.push(maxPrice); + paramIndex++; + } + + // Add similarity threshold + whereConditions.push(`(1 - (s."combinedEmbedding" <=> $${paramIndex}::vector)) >= $${paramIndex + 1}`); + params.push(embeddingVector, threshold); + paramIndex += 2; + + const whereClause = whereConditions.join(' AND '); + + // Raw SQL query for vector similarity search + const query_sql = ` + SELECT + s.id, + s.title, + s.description, + s.price, + s.currency, + s.tags, + s.images, + s."createdAt", + (1 - (s."combinedEmbedding" <=> $${paramIndex}::vector)) as similarity, + p.id as provider_id, + u."firstName" as provider_first_name, + u."lastName" as provider_last_name, + c.id as category_id, + c.name as category_name + FROM "Service" s + INNER JOIN "ServiceProvider" p ON s."providerId" = p.id + INNER JOIN "User" u ON p."userId" = u.id + INNER JOIN "Category" c ON s."categoryId" = c.id + WHERE ${whereClause} + AND s."combinedEmbedding" IS NOT NULL + ORDER BY similarity DESC + LIMIT $${paramIndex + 1} + `; + + params.push(embeddingVector, limit); + + const results = await prisma.$queryRawUnsafe(query_sql, ...params) as any[]; + + return results.map(row => ({ + id: row.id, + title: row.title || '', + description: row.description || '', + price: parseFloat(row.price), + currency: row.currency, + tags: row.tags || [], + images: row.images || [], + similarity: parseFloat(row.similarity), + provider: { + id: row.provider_id, + user: { + firstName: row.provider_first_name || '', + lastName: row.provider_last_name || '' + } + }, + category: { + id: row.category_id, + name: row.category_name || '' + } + })); + + } catch (error) { + console.error('Semantic search error:', error); + throw new Error('Failed to perform semantic search'); + } + } + + /** + * Update embeddings for a service + */ + async updateServiceEmbeddings(serviceId: string) { + try { + // Get service data + const service = await prisma.service.findUnique({ + where: { id: serviceId }, + select: { + id: true, + title: true, + description: true, + tags: true + } + }); + + if (!service) { + throw new Error(`Service with ID ${serviceId} not found`); + } + + // Generate embeddings + const embeddings = await embeddingService.generateServiceEmbeddings({ + title: service.title, + description: service.description, + tags: service.tags + }); + + // Update service with embeddings using raw query + await prisma.$executeRaw` + UPDATE "Service" + SET + "titleEmbedding" = ${`[${embeddings.titleEmbedding.join(',')}]`}::vector, + "descriptionEmbedding" = ${`[${embeddings.descriptionEmbedding.join(',')}]`}::vector, + "tagsEmbedding" = ${`[${embeddings.tagsEmbedding.join(',')}]`}::vector, + "combinedEmbedding" = ${`[${embeddings.combinedEmbedding.join(',')}]`}::vector, + "embeddingUpdatedAt" = NOW() + WHERE id = ${serviceId} + `; + + console.log(`✅ Updated embeddings for service ${serviceId}`); + + } catch (error) { + console.error(`❌ Failed to update embeddings for service ${serviceId}:`, error); + throw error; + } + } + + /** + * Batch update embeddings for all services that don't have them + */ + async updateAllServiceEmbeddings(batchSize: number = 5) { // Reduced batch size for free tier + try { + console.log('🚀 Starting batch embedding update...'); + + // Get services without embeddings (smaller batches for free tier) + const services = await prisma.$queryRawUnsafe(` + SELECT id, title, description, tags + FROM "Service" + WHERE "combinedEmbedding" IS NULL + AND "isActive" = true + LIMIT $1 + `, batchSize) as any[]; + + console.log(`📝 Found ${services.length} services to update`); + + for (let i = 0; i < services.length; i++) { + const service = services[i]; + try { + console.log(`⏳ Processing service ${i + 1}/${services.length}: ${service.title}`); + await this.updateServiceEmbeddings(service.id); + + // Add delay between requests for free tier (4+ seconds) + if (i < services.length - 1) { + console.log('⏱️ Waiting 5s before next request (rate limit)...'); + await new Promise(resolve => setTimeout(resolve, 5000)); + } + } catch (error) { + console.error(`Failed to update embeddings for service ${service.id}:`, error); + // Continue with next service + } + } + + console.log('✅ Batch embedding update completed'); + return services.length; + + } catch (error) { + console.error('❌ Batch embedding update failed:', error); + throw error; + } + } + + /** + * Find similar services to a given service + */ + async findSimilarServices(serviceId: string, limit: number = 5): Promise { + try { + console.log('🔍 Finding similar services for:', serviceId); + + // Use raw query to get embedding (cast to text to avoid deserialization issues) + const serviceResult = await prisma.$queryRawUnsafe(` + SELECT "combinedEmbedding"::text as embedding_text + FROM "Service" + WHERE id = $1 AND "combinedEmbedding" IS NOT NULL + `, serviceId) as any[]; + + console.log('📊 Service query result:', serviceResult?.length ? 'Found embedding' : 'No embedding found'); + + if (!serviceResult || serviceResult.length === 0) { + throw new Error('Service embedding not found'); + } + + const serviceEmbedding = serviceResult[0].embedding_text; + console.log('✅ Got service embedding as text, length:', serviceEmbedding?.length || 0); + + const query_sql = ` + SELECT + s.id, + s.title, + s.description, + s.price, + s.currency, + s.tags, + s.images, + (1 - (s."combinedEmbedding" <=> ($1::text)::vector)) as similarity, + p.id as provider_id, + u."firstName" as provider_first_name, + u."lastName" as provider_last_name, + c.id as category_id, + c.name as category_name + FROM "Service" s + INNER JOIN "ServiceProvider" p ON s."providerId" = p.id + INNER JOIN "User" u ON p."userId" = u.id + INNER JOIN "Category" c ON s."categoryId" = c.id + WHERE s.id != $2 + AND s."isActive" = true + AND s."combinedEmbedding" IS NOT NULL + ORDER BY similarity DESC + LIMIT $3 + `; + + console.log('🔍 Executing similarity query with params:', { serviceId, limit }); + const results = await prisma.$queryRawUnsafe(query_sql, serviceEmbedding, serviceId, limit) as any[]; + console.log('📊 Query results count:', results?.length || 0); + + return results.map(row => ({ + id: row.id, + title: row.title || '', + description: row.description || '', + price: parseFloat(row.price), + currency: row.currency, + tags: row.tags || [], + images: row.images || [], + similarity: parseFloat(row.similarity), + provider: { + id: row.provider_id, + user: { + firstName: row.provider_first_name || '', + lastName: row.provider_last_name || '' + } + }, + category: { + id: row.category_id, + name: row.category_name || '' + } + })); + + } catch (error) { + console.error('❌ Error finding similar services:', error); + console.error('Error details:', error.message, error.stack); + throw new Error('Failed to find similar services'); + } + } +} + +export const semanticSearchService = new SemanticSearchService(); diff --git a/src/services/serviceReview.service.ts b/src/services/serviceReview.service.ts new file mode 100755 index 0000000..e63b321 --- /dev/null +++ b/src/services/serviceReview.service.ts @@ -0,0 +1,282 @@ +// ServiceReview Service - mirrors customerReview.service.ts but for ServiceReview +import { prisma } from '../utils/database.js'; + +export interface CreateServiceReviewData { + reviewerId: string; // customer id + serviceId: string; + rating: number; + comment?: string; +} + +export interface UpdateServiceReviewData { + rating?: number; + comment?: string; +} + +export const createServiceReview = async (data: CreateServiceReviewData) => { + // Prevent duplicate reviews by same user for same service + const existing = await prisma.serviceReview.findFirst({ + where: { reviewerId: data.reviewerId, serviceId: data.serviceId } + }); + if (existing) throw new Error('You have already reviewed this service.'); + return prisma.serviceReview.create({ + data, + include: { + reviewer: { select: { id: true, firstName: true, lastName: true, imageUrl: true } }, + service: { select: { id: true, title: true } } + } + }); +}; + +export const getServiceReviews = async (serviceId: string, page = 1, limit = 10) => { + const skip = (page - 1) * limit; + const [reviews, total] = await Promise.all([ + prisma.serviceReview.findMany({ + where: { serviceId }, + include: { + reviewer: { select: { id: true, firstName: true, lastName: true, imageUrl: true } }, + service: { select: { id: true, title: true } } + }, + orderBy: { createdAt: 'desc' }, + skip, take: limit + }), + prisma.serviceReview.count({ where: { serviceId } }) + ]); + return { reviews, pagination: { page, limit, total, totalPages: Math.ceil(total / limit) } }; +}; + +export const getServiceReviewById = async (reviewId: string) => { + const review = await prisma.serviceReview.findUnique({ + where: { id: reviewId }, + include: { + reviewer: { select: { id: true, firstName: true, lastName: true, imageUrl: true } }, + service: { select: { id: true, title: true } } + } + }); + if (!review) throw new Error('Service review not found'); + return review; +}; + +export const updateServiceReview = async (reviewId: string, data: UpdateServiceReviewData, userId: string) => { + const existing = await prisma.serviceReview.findUnique({ where: { id: reviewId } }); + if (!existing) throw new Error('Review not found'); + if (existing.reviewerId !== userId) throw new Error('Unauthorized'); + return prisma.serviceReview.update({ + where: { id: reviewId }, + data: { ...data, updatedAt: new Date() }, + include: { + reviewer: { select: { id: true, firstName: true, lastName: true, imageUrl: true } }, + service: { select: { id: true, title: true } } + } + }); +}; + +export const deleteServiceReview = async (reviewId: string, userId: string) => { + const existing = await prisma.serviceReview.findUnique({ where: { id: reviewId } }); + if (!existing) throw new Error('Review not found'); + if (existing.reviewerId !== userId) throw new Error('Unauthorized'); + await prisma.serviceReview.delete({ where: { id: reviewId } }); + return { message: 'Service review deleted successfully' }; +}; + +export const getServiceReviewStats = async (serviceId: string) => { + const reviews = await prisma.serviceReview.findMany({ + where: { serviceId }, + select: { rating: true } + }); + + if (reviews.length === 0) { + return { + averageRating: 0, + totalReviews: 0, + ratingDistribution: { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0 } + }; + } + + const totalReviews = reviews.length; + const averageRating = reviews.reduce((sum, review) => sum + review.rating, 0) / totalReviews; + + const ratingDistribution = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0 }; + reviews.forEach(review => { + ratingDistribution[review.rating as keyof typeof ratingDistribution]++; + }); + + return { + averageRating: Number(averageRating.toFixed(1)), + totalReviews, + ratingDistribution + }; +}; + +export const getServiceReviewsDetailed = async (serviceId: string, page = 1, limit = 10, ratingFilter?: number) => { + const skip = (page - 1) * limit; + + const whereClause: any = { serviceId }; + if (ratingFilter && ratingFilter >= 1 && ratingFilter <= 5) { + whereClause.rating = ratingFilter; + } + + const [reviews, total, stats] = await Promise.all([ + prisma.serviceReview.findMany({ + where: whereClause, + include: { + reviewer: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true + } + }, + service: { + select: { + id: true, + title: true + } + } + }, + orderBy: { createdAt: 'desc' }, + skip, + take: limit + }), + prisma.serviceReview.count({ where: whereClause }), + getServiceReviewStats(serviceId) + ]); + + // Transform reviews to match frontend format + const transformedReviews = reviews.map(review => ({ + id: review.id, + rating: review.rating, + comment: review.comment || '', + clientName: `${review.reviewer.firstName || ''} ${review.reviewer.lastName || ''}`.trim() || 'Anonymous', + clientAvatar: review.reviewer.imageUrl || `https://picsum.photos/seed/${review.reviewer.id}/60/60`, + date: review.createdAt.toISOString().split('T')[0], // Format: YYYY-MM-DD + helpful: 0, // We don't have helpful votes yet, default to 0 + service: review.service.title, + reviewerId: review.reviewer.id, + createdAt: review.createdAt.toISOString(), + updatedAt: review.updatedAt.toISOString() + })); + + return { + reviews: transformedReviews, + pagination: { + page, + limit, + total, + totalPages: Math.ceil(total / limit) + }, + stats + }; +}; + +// Get all reviews for all services of a specific provider +export const getProviderServiceReviews = async (providerId: string, page = 1, limit = 10, ratingFilter?: number) => { + const skip = (page - 1) * limit; + + const whereClause: any = { + service: { + providerId: providerId + } + }; + + if (ratingFilter && ratingFilter >= 1 && ratingFilter <= 5) { + whereClause.rating = ratingFilter; + } + + const [reviews, total] = await Promise.all([ + prisma.serviceReview.findMany({ + where: whereClause, + include: { + reviewer: { + select: { + id: true, + firstName: true, + lastName: true, + imageUrl: true + } + }, + service: { + select: { + id: true, + title: true, + images: true, + category: { + select: { + name: true + } + } + } + } + }, + orderBy: { createdAt: 'desc' }, + skip, + take: limit + }), + prisma.serviceReview.count({ where: whereClause }) + ]); + + // Transform reviews to match frontend format + const transformedReviews = reviews.map(review => ({ + id: review.id, + rating: review.rating, + comment: review.comment || '', + clientName: `${review.reviewer.firstName || ''} ${review.reviewer.lastName || ''}`.trim() || 'Anonymous', + clientAvatar: review.reviewer.imageUrl || `https://picsum.photos/seed/${review.reviewer.id}/60/60`, + date: review.createdAt.toISOString().split('T')[0], // Format: YYYY-MM-DD + helpful: 0, // We don't have helpful votes yet, default to 0 + service: { + id: review.service.id, + title: review.service.title, + image: review.service.images && review.service.images.length > 0 ? review.service.images[0] : null, + category: review.service.category?.name || 'Uncategorized' + }, + reviewerId: review.reviewer.id, + createdAt: review.createdAt.toISOString(), + updatedAt: review.updatedAt.toISOString() + })); + + return { + reviews: transformedReviews, + pagination: { + page, + limit, + total, + totalPages: Math.ceil(total / limit) + } + }; +}; + +// Get review statistics for all services of a provider +export const getProviderReviewStats = async (providerId: string) => { + const reviews = await prisma.serviceReview.findMany({ + where: { + service: { + providerId: providerId + } + }, + select: { rating: true } + }); + + if (reviews.length === 0) { + return { + averageRating: 0, + totalReviews: 0, + ratingDistribution: { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0 } + }; + } + + const totalReviews = reviews.length; + const averageRating = reviews.reduce((sum, review) => sum + review.rating, 0) / totalReviews; + + const ratingDistribution = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0 }; + reviews.forEach(review => { + ratingDistribution[review.rating as keyof typeof ratingDistribution]++; + }); + + return { + averageRating: Number(averageRating.toFixed(1)), + totalReviews, + ratingDistribution + }; +}; diff --git a/src/services/services.service.js b/src/services/services.service.js deleted file mode 100644 index 244f42e..0000000 --- a/src/services/services.service.js +++ /dev/null @@ -1,271 +0,0 @@ -import { PrismaClient } from '@prisma/client'; - -const prisma = new PrismaClient(); - -/** - * Create a new service - * @param {Object} serviceData - The service data - * @param {string} serviceData.providerId - ID of the service provider - * @param {string} serviceData.categoryId - ID of the service category - * @param {string} [serviceData.title] - Service title - * @param {string} [serviceData.description] - Service description - * @param {number} serviceData.price - Service price - * @param {string} [serviceData.currency="USD"] - Currency (defaults to USD) - * @param {string[]} [serviceData.tags=[]] - Array of tags - * @param {string[]} [serviceData.images=[]] - Array of image URLs - * @param {boolean} [serviceData.isActive=true] - Service active status - * @param {string[]} [serviceData.workingTime=[]] - Array of working time slots - * @returns {Promise} Created service object - */ -export const createService = async (serviceData) => { - try { - const { - providerId, - categoryId, - title, - description, - price, - currency = "USD", - tags = [], - images = [], - isActive = true, - workingTime = [] - } = serviceData; - - // Validate required fields - if (!providerId) { - throw new Error('Provider ID is required'); - } - if (!categoryId) { - throw new Error('Category ID is required'); - } - if (price === undefined || price === null) { - throw new Error('Price is required'); - } - - // Validate that provider exists - const provider = await prisma.serviceProvider.findUnique({ - where: { id: providerId } - }); - if (!provider) { - throw new Error('Service provider not found'); - } - - // Validate that category exists - const category = await prisma.category.findUnique({ - where: { id: categoryId } - }); - if (!category) { - throw new Error('Category not found'); - } - - // Create the service - const newService = await prisma.service.create({ - data: { - providerId, - categoryId, - title, - description, - price, - currency, - tags, - images, - isActive, - workingTime - }, - include: { - provider: { - include: { - user: { - select: { - firstName: true, - lastName: true, - email: true - } - } - } - }, - category: true - } - }); - - return newService; - } catch (error) { - throw new Error(`Failed to create service: ${error.message}`); - } -}; - -/** - * Get all services with optional filtering - * @param {Object} filters - Optional filters - * @param {string} [filters.providerId] - Filter by provider ID - * @param {string} [filters.categoryId] - Filter by category ID - * @param {boolean} [filters.isActive] - Filter by active status - * @param {number} [filters.skip=0] - Number of records to skip for pagination - * @param {number} [filters.take=10] - Number of records to take for pagination - * @returns {Promise} Array of service objects - */ -export const getServices = async (filters = {}) => { - try { - const { - providerId, - categoryId, - isActive, - skip = 0, - take = 10 - } = filters; - - const whereClause = {}; - - if (providerId) whereClause.providerId = providerId; - if (categoryId) whereClause.categoryId = categoryId; - if (isActive !== undefined) whereClause.isActive = isActive; - - const services = await prisma.service.findMany({ - where: whereClause, - skip, - take, - include: { - provider: { - include: { - user: { - select: { - firstName: true, - lastName: true, - email: true - } - } - } - }, - category: true, - reviews: { - include: { - reviewer: { - select: { - firstName: true, - lastName: true - } - } - } - } - }, - orderBy: { - createdAt: 'desc' - } - }); - - return services; - } catch (error) { - throw new Error(`Failed to fetch services: ${error.message}`); - } -}; - -/** - * Get a single service by ID - * @param {string} serviceId - The service ID - * @returns {Promise} Service object or null if not found - */ -export const getServiceById = async (serviceId) => { - try { - const service = await prisma.service.findUnique({ - where: { id: serviceId }, - include: { - provider: { - include: { - user: { - select: { - firstName: true, - lastName: true, - email: true, - phone: true - } - } - } - }, - category: true, - reviews: { - include: { - reviewer: { - select: { - firstName: true, - lastName: true - } - } - } - }, - schedules: true - } - }); - - return service; - } catch (error) { - throw new Error(`Failed to fetch service: ${error.message}`); - } -}; - -/** - * Update a service - * @param {string} serviceId - The service ID - * @param {Object} updateData - Data to update - * @returns {Promise} Updated service object - */ -export const updateService = async (serviceId, updateData) => { - try { - const service = await prisma.service.findUnique({ - where: { id: serviceId } - }); - - if (!service) { - throw new Error('Service not found'); - } - - const updatedService = await prisma.service.update({ - where: { id: serviceId }, - data: updateData, - include: { - provider: { - include: { - user: { - select: { - firstName: true, - lastName: true, - email: true - } - } - } - }, - category: true - } - }); - - return updatedService; - } catch (error) { - throw new Error(`Failed to update service: ${error.message}`); - } -}; - -/** - * Delete a service - * @param {string} serviceId - The service ID - * @returns {Promise} Deleted service object - */ -export const deleteService = async (serviceId) => { - try { - const service = await prisma.service.findUnique({ - where: { id: serviceId } - }); - - if (!service) { - throw new Error('Service not found'); - } - - const deletedService = await prisma.service.delete({ - where: { id: serviceId } - }); - - return deletedService; - } catch (error) { - throw new Error(`Failed to delete service: ${error.message}`); - } -}; - diff --git a/src/services/services.service.ts b/src/services/services.service.ts new file mode 100755 index 0000000..5558227 --- /dev/null +++ b/src/services/services.service.ts @@ -0,0 +1,609 @@ +import { prisma } from '../utils/database.js'; +import { embeddingService } from './embedding.service.js'; + +// Type definitions +interface ServiceCreateData { + providerId: string; + categoryId: string; + title?: string; + description?: string; + price: number; + currency?: string; + tags?: string[]; + images?: string[]; + videoUrl?: string; // Add videoUrl to interface + isActive?: boolean; + workingTime?: string[]; + // Location fields + latitude?: number; + longitude?: number; + address?: string; + city?: string; + state?: string; + country?: string; + postalCode?: string; + serviceRadiusKm?: number; + locationLastUpdated?: Date; +} + +interface ServiceFilters { + providerId?: string; + categoryId?: string; + isActive?: boolean; + skip?: number; + take?: number; +} + +interface LocationSearchOptions { + latitude: number; + longitude: number; + radius: number; + page: number; + limit: number; + categoryId?: string; + minPrice?: number; + maxPrice?: number; +} + +/** + * Create a new service + * @param {ServiceCreateData} serviceData - The service data + * @returns {Promise} Created service object + */ +export const createService = async (serviceData: ServiceCreateData) => { + try { + console.log('=== SERVICE SERVICE DEBUG ==='); + console.log('Service data received in service layer:', JSON.stringify(serviceData, null, 2)); + + const { + providerId, + categoryId, + title, + description, + price, + currency = "USD", + tags = [], + images = [], + isActive = true, + workingTime = [] + } = serviceData; + + // Debug: Extract videoUrl specifically + const videoUrl = serviceData.videoUrl; + console.log('Extracted videoUrl:', videoUrl); + console.log('VideoUrl type:', typeof videoUrl); + + // Validate required fields + if (!providerId) { + throw new Error('Provider ID is required'); + } + if (!categoryId) { + throw new Error('Category ID is required'); + } + if (price === undefined || price === null) { + throw new Error('Price is required'); + } + + // Validate that provider exists + const provider = await prisma.serviceProvider.findUnique({ + where: { id: providerId } + }); + if (!provider) { + throw new Error('Service provider not found'); + } + + // Validate that category exists + const category = await prisma.category.findUnique({ + where: { id: categoryId } + }); + if (!category) { + throw new Error('Category not found'); + } + + // Prepare data for Prisma create + const createData = { + providerId, + categoryId, + title, + description, + price, + currency, + tags, + images, + isActive, + workingTime, + videoUrl, // Make sure videoUrl is included + // Location fields + latitude: serviceData.latitude, + longitude: serviceData.longitude, + address: serviceData.address, + city: serviceData.city, + state: serviceData.state, + country: serviceData.country, + postalCode: serviceData.postalCode, + serviceRadiusKm: serviceData.serviceRadiusKm, + locationLastUpdated: serviceData.locationLastUpdated + }; + + console.log('Data being sent to Prisma create:', JSON.stringify(createData, null, 2)); + console.log('VideoUrl in create data:', createData.videoUrl); + + // Create the service first + const newService = await prisma.service.create({ + data: createData, + include: { + provider: { + include: { + user: { + select: { + firstName: true, + lastName: true, + email: true + } + } + } + }, + category: true + } + }); + + console.log('Service created by Prisma. Checking result...'); + console.log('Service ID:', newService.id); + console.log('Service videoUrl field:', (newService as any).videoUrl); + + // Generate and update embeddings for the newly created service + try { + console.log('Generating embeddings for service:', newService.id); + const embeddings = await embeddingService.generateServiceEmbeddings({ + title: newService.title, + description: newService.description, + tags: newService.tags + }); + + // Update service with embeddings using raw query + await prisma.$executeRaw` + UPDATE "Service" + SET + "titleEmbedding" = ${`[${embeddings.titleEmbedding.join(',')}]`}::vector, + "descriptionEmbedding" = ${`[${embeddings.descriptionEmbedding.join(',')}]`}::vector, + "tagsEmbedding" = ${`[${embeddings.tagsEmbedding.join(',')}]`}::vector, + "combinedEmbedding" = ${`[${embeddings.combinedEmbedding.join(',')}]`}::vector, + "embeddingUpdatedAt" = NOW() + WHERE id = ${newService.id} + `; + + console.log('✅ Embeddings generated and stored for service:', newService.id); + } catch (embeddingError) { + console.warn('⚠️ Failed to generate embeddings for service:', newService.id, embeddingError); + // Don't fail the service creation if embedding generation fails + } + + return newService; + } catch (error) { + console.error('=== SERVICE SERVICE ERROR ==='); + console.error('Error in createService:', error); + throw new Error(`Failed to create service: ${error.message}`); + } +}; + +/** + * Get all services with optional filtering + * @param {Object} filters - Optional filters + * @param {string} [filters.providerId] - Filter by provider ID + * @param {string} [filters.categoryId] - Filter by category ID + * @param {boolean} [filters.isActive] - Filter by active status + * @param {number} [filters.skip=0] - Number of records to skip for pagination + * @param {number} [filters.take=10] - Number of records to take for pagination + * @returns {Promise} Array of service objects + */ +export const getServices = async (filters: ServiceFilters = {}) => { + try { + const { + providerId, + categoryId, + isActive = true, // Default to active services only + skip = 0, + take = 20 // Increased default for better UX + } = filters; + + const whereClause: any = {}; + + if (providerId) whereClause.providerId = providerId; + if (categoryId) whereClause.categoryId = categoryId; + if (isActive !== undefined) whereClause.isActive = isActive; + + const services = await prisma.service.findMany({ + where: whereClause, + skip, + take, + include: { + provider: { + include: { + user: { + select: { + firstName: true, + lastName: true, + imageUrl: true + } + } + } + }, + category: { + select: { + id: true, + name: true, + slug: true + } + }, + _count: { + select: { + serviceReviews: true + } + } + }, + orderBy: { + createdAt: 'desc' + } + }); + + return services; + } catch (error) { + throw new Error(`Failed to fetch services: ${error.message}`); + } +}; + +/** + * Get a single service by ID + * @param {string} serviceId - The service ID + * @returns {Promise} Service object or null if not found + */ +export const getServiceById = async (serviceId: string) => { + try { + const service = await prisma.service.findUnique({ + where: { id: serviceId }, + include: { + provider: { + include: { + user: { + select: { + firstName: true, + lastName: true, + email: true, + phone: true, + imageUrl: true + } + } + } + }, + category: { + select: { + id: true, + name: true, + slug: true, + description: true + } + }, + _count: { + select: { + serviceReviews: true, + schedules: true + } + } + } + }); + + console.log('=== GET SERVICE BY ID DEBUG ==='); + console.log('Service found:', service?.id); + console.log('Service videoUrl:', (service as any)?.videoUrl); + + return service; + } catch (error) { + throw new Error(`Failed to fetch service: ${error.message}`); + } +}; + +/** + * Update a service + * @param {string} serviceId - The service ID + * @param {Object} updateData - Data to update + * @returns {Promise} Updated service object + */ +export const updateService = async (serviceId: string, updateData: Partial) => { + try { + const service = await prisma.service.findUnique({ + where: { id: serviceId } + }); + + if (!service) { + throw new Error('Service not found'); + } + + // Check if content that affects embeddings has changed + const contentChanged = ( + (updateData.title !== undefined && updateData.title !== service.title) || + (updateData.description !== undefined && updateData.description !== service.description) || + (updateData.tags !== undefined && JSON.stringify(updateData.tags) !== JSON.stringify(service.tags)) + ); + + const updatedService = await prisma.service.update({ + where: { id: serviceId }, + data: updateData, + include: { + provider: { + include: { + user: { + select: { + firstName: true, + lastName: true, + email: true + } + } + } + }, + category: true + } + }); + + // Regenerate embeddings if content changed + if (contentChanged) { + try { + console.log('Content changed, regenerating embeddings for service:', serviceId); + const embeddings = await embeddingService.generateServiceEmbeddings({ + title: updatedService.title, + description: updatedService.description, + tags: updatedService.tags + }); + + // Update service with new embeddings using raw query + await prisma.$executeRaw` + UPDATE "Service" + SET + "titleEmbedding" = ${`[${embeddings.titleEmbedding.join(',')}]`}::vector, + "descriptionEmbedding" = ${`[${embeddings.descriptionEmbedding.join(',')}]`}::vector, + "tagsEmbedding" = ${`[${embeddings.tagsEmbedding.join(',')}]`}::vector, + "combinedEmbedding" = ${`[${embeddings.combinedEmbedding.join(',')}]`}::vector, + "embeddingUpdatedAt" = NOW() + WHERE id = ${serviceId} + `; + + console.log('✅ Embeddings regenerated for updated service:', serviceId); + } catch (embeddingError) { + console.warn('⚠️ Failed to regenerate embeddings for service:', serviceId, embeddingError); + // Don't fail the service update if embedding generation fails + } + } + + return updatedService; + } catch (error) { + throw new Error(`Failed to update service: ${error.message}`); + } +}; + +/** + * Delete a service + * @param {string} serviceId - The service ID + * @returns {Promise} Deleted service object + */ +export const deleteService = async (serviceId: string) => { + try { + const service = await prisma.service.findUnique({ + where: { id: serviceId } + }); + + if (!service) { + throw new Error('Service not found'); + } + + const deletedService = await prisma.service.delete({ + where: { id: serviceId } + }); + + return deletedService; + } catch (error) { + throw new Error(`Failed to delete service: ${error.message}`); + } +}; + +/** + * Get a service by conversation ID + * @param {string} conversationId - The conversation ID + * @returns {Promise} Service object or null if not found + */ +export const getServiceByConversationId = async (conversationId: string) => { + try { + const conversation = await prisma.conversation.findUnique({ + where: { id: conversationId }, + include: { + service: { + include: { + provider: { + include: { + user: { + select: { + firstName: true, + lastName: true, + email: true, + phone: true, + imageUrl: true + } + } + } + }, + category: { + select: { + id: true, + name: true, + slug: true, + description: true + } + }, + _count: { + select: { + serviceReviews: true, + schedules: true + } + } + } + } + } + }); + + if (!conversation || !conversation.service) { + return null; + } + + return conversation.service; + } catch (error) { + throw new Error(`Failed to fetch service by conversation ID: ${error.message}`); + } +}; + +/** + * Search services by location using PostGIS spatial queries + * @param {LocationSearchOptions} options - Search options + * @returns {Promise} Services and pagination info + */ +export const searchServicesByLocation = async (options: LocationSearchOptions) => { + try { + const { + latitude, + longitude, + radius, + page, + limit, + categoryId, + minPrice, + maxPrice + } = options; + + const offset = (page - 1) * limit; + + // Build WHERE clause for additional filters + let whereConditions = ['s."isActive" = true']; + const queryParams: any[] = [longitude, latitude, radius * 1000, limit, offset]; // radius in meters + let paramIndex = 6; + + if (categoryId) { + whereConditions.push(`s."categoryId" = $${paramIndex}`); + queryParams.push(categoryId); + paramIndex++; + } + + if (minPrice !== undefined) { + whereConditions.push(`s.price >= $${paramIndex}`); + queryParams.push(minPrice); + paramIndex++; + } + + if (maxPrice !== undefined) { + whereConditions.push(`s.price <= $${paramIndex}`); + queryParams.push(maxPrice); + paramIndex++; + } + + const whereClause = whereConditions.length > 0 ? `WHERE ${whereConditions.join(' AND ')}` : ''; + + // Main query to get services within radius + const servicesQuery = ` + SELECT + s.*, + ST_Distance( + ST_SetSRID(ST_MakePoint(s.longitude, s.latitude), 4326)::geography, + ST_SetSRID(ST_MakePoint($1, $2), 4326)::geography + ) / 1000 as distance_km, + sp.id as provider_id, + sp."averageRating" as provider_average_rating, + sp."totalReviews" as provider_total_reviews, + u."firstName" as provider_first_name, + u."lastName" as provider_last_name, + u."imageUrl" as provider_image_url, + c.name as category_name, + c.slug as category_slug + FROM "Service" s + INNER JOIN "ServiceProvider" sp ON s."providerId" = sp.id + INNER JOIN "User" u ON sp."userId" = u.id + INNER JOIN "Category" c ON s."categoryId" = c.id + ${whereClause} + AND s.latitude IS NOT NULL + AND s.longitude IS NOT NULL + AND ST_DWithin( + ST_SetSRID(ST_MakePoint(s.longitude, s.latitude), 4326)::geography, + ST_SetSRID(ST_MakePoint($1, $2), 4326)::geography, + $3 + ) + ORDER BY distance_km ASC + LIMIT $4 OFFSET $5 + `; + + // Count query for pagination + const countQuery = ` + SELECT COUNT(*) + FROM "Service" s + ${whereClause} + AND s.latitude IS NOT NULL + AND s.longitude IS NOT NULL + AND ST_DWithin( + ST_SetSRID(ST_MakePoint(s.longitude, s.latitude), 4326)::geography, + ST_SetSRID(ST_MakePoint($1, $2), 4326)::geography, + $3 + ) + `; + + // Execute queries + const [servicesResult, countResult] = await Promise.all([ + prisma.$queryRawUnsafe(servicesQuery, ...queryParams), + prisma.$queryRawUnsafe(countQuery, longitude, latitude, radius * 1000, ...queryParams.slice(5, paramIndex - 1)) + ]); + + const services = servicesResult as any[]; + const total = parseInt((countResult as any[])[0].count); + + // Format the results + const formattedServices = services.map(service => ({ + id: service.id, + title: service.title, + description: service.description, + price: parseFloat(service.price), + currency: service.currency, + tags: service.tags, + images: service.images, + videoUrl: service.videoUrl, + isActive: service.isActive, + workingTime: service.workingTime, + latitude: parseFloat(service.latitude), + longitude: parseFloat(service.longitude), + address: service.address, + city: service.city, + state: service.state, + country: service.country, + postalCode: service.postalCode, + serviceRadiusKm: service.serviceRadiusKm ? parseFloat(service.serviceRadiusKm) : null, + distance_km: parseFloat(service.distance_km), + createdAt: service.createdAt, + updatedAt: service.updatedAt, + provider: { + id: service.provider_id, + averageRating: service.provider_average_rating ? parseFloat(service.provider_average_rating) : null, + totalReviews: service.provider_total_reviews, + user: { + firstName: service.provider_first_name, + lastName: service.provider_last_name, + imageUrl: service.provider_image_url + } + }, + category: { + name: service.category_name, + slug: service.category_slug + } + })); + + return { + services: formattedServices, + total + }; + } catch (error) { + console.error('Location search error:', error); + throw new Error(`Failed to search services by location: ${error.message}`); + } +}; + diff --git a/src/services/user.service.js b/src/services/user.service.js deleted file mode 100644 index 38e47cd..0000000 --- a/src/services/user.service.js +++ /dev/null @@ -1,131 +0,0 @@ - -import { PrismaClient } from '@prisma/client'; -import jwt from 'jsonwebtoken'; -import { comparePassword, hashPassword } from '../utils/hash.js'; - -const prisma = new PrismaClient(); - -export const register = async ({ email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia }) => { - const existingUser = await prisma.user.findUnique({ where: { email } }); - if (existingUser) { - const err = new Error('Email already exists. Please use a different email address.'); - err.name = 'BadRequestError'; - err.status = 400; - throw err; - } - const hashedPassword = await hashPassword(password); - return await prisma.user.create({ - data: { - email, - firstName, - lastName, - password: hashedPassword, - imageUrl, - location, - address, - phone, - socialmedia, - }, - }); -}; - -export const login = async ({ email, password }) => { - const user = await prisma.user.findUnique({ where: { email } }); - if (!user) throw new Error('User not found'); - - const isMatch = await comparePassword(password, user.password); - if (!isMatch) throw new Error('Invalid credentials'); - - const token = jwt.sign({ id: user.id, email: user.email }, process.env.JWT_SECRET, { expiresIn: '1h' }); - return { token, user }; -}; - -export const getProfile = async (userId) => { - const user = await prisma.user.findUnique({ - where: { id: userId }, - select: { - id: true, - email: true, - role: true, - firstName: true, - lastName: true, - imageUrl: true, - location: true, - address: true, - phone: true, - socialmedia: true, - createdAt: true, - isEmailVerified: true, - serviceProvider: { - select: { - id: true, - bio: true, - skills: true, - qualifications: true, - logoUrl: true, - averageRating: true, - totalReviews: true, - services: { - select: { - id: true, - title: true, - description: true, - price: true, - currency: true, - images: true, - isActive: true - } - }, - reviews: { - select: { - id: true, - rating: true, - comment: true, - createdAt: true, - reviewer: { - select: { - firstName: true, - lastName: true, - imageUrl: true - } - } - }, - orderBy: { - createdAt: 'desc' - }, - take: 10 - } - } - } - }, - }); - if (!user) throw new Error('User not found'); - return user; -} - -export const updateProfile = async (userId, data) => { - const updatedData = {}; - if (data.firstName) updatedData.firstName = data.firstName; - if (data.lastName) updatedData.lastName = data.lastName; - if (data.imageUrl) updatedData.imageUrl = data.imageUrl; - if (data.location) updatedData.location = data.location; - if (data.address) updatedData.address = data.address; - if (data.phone) updatedData.phone = data.phone; - if (data.socialmedia) updatedData.socialmedia = data.socialmedia; - - return await prisma.user.update({ - where: { id: userId }, - data: updatedData, - }); -} - -export const deleteProfile = async (userId) => { - await prisma.user.delete({ - where: { id: userId }, - }); -} - -export const checkEmailExists = async (email) => { - const user = await prisma.user.findUnique({ where: { email } }); - return !!user; -} \ No newline at end of file diff --git a/src/services/user.service.ts b/src/services/user.service.ts new file mode 100755 index 0000000..47f53ac --- /dev/null +++ b/src/services/user.service.ts @@ -0,0 +1,253 @@ +import { prisma } from '../utils/database.js'; +import jwt from 'jsonwebtoken'; +import { comparePassword, hashPassword } from '../utils/hash.js'; + +// Type definitions +interface UserRegistrationData { + email: string; + firstName: string; + lastName: string; + password: string; + imageUrl?: string; + location?: string; + address?: string; + phone?: string; + socialmedia?: any; +} + +interface UserUpdateData { + firstName?: string; + lastName?: string; + imageUrl?: string; + location?: string; + address?: string; + phone?: string; + socialmedia?: any; +} + +// Extend Error interface to include status property +interface ErrorWithStatus extends Error { + status?: number; +} + +export const register = async ({ email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia }: UserRegistrationData) => { + const existingUser = await prisma.user.findUnique({ where: { email } }); + if (existingUser) { + const err = new Error('Email already exists. Please use a different email address.') as ErrorWithStatus; + err.name = 'BadRequestError'; + err.status = 400; + throw err; + } + const hashedPassword = await hashPassword(password); + return await prisma.user.create({ + data: { + email, + firstName, + lastName, + password: hashedPassword, + imageUrl, + location, + address, + phone, + socialmedia, + }, + }); +}; + +export const createAdmin = async ({ email, firstName, lastName, password, imageUrl, location, address, phone, socialmedia }: UserRegistrationData) => { + const existingUser = await prisma.user.findUnique({ where: { email } }); + if (existingUser) { + const err = new Error('Email already exists. Please use a different email address.') as ErrorWithStatus; + err.name = 'BadRequestError'; + err.status = 400; + throw err; + } + + const hashedPassword = await hashPassword(password); + const adminUser = await prisma.user.create({ + data: { + email, + firstName, + lastName, + password: hashedPassword, + role: 'ADMIN', // Set role to ADMIN + imageUrl, + location, + address, + phone, + socialmedia, + isEmailVerified: true, // Admins are auto-verified + }, + }); + + // Return user data without password + const { password: _, ...adminUserWithoutPassword } = adminUser; + return adminUserWithoutPassword; +}; + +export const login = async ({ email, password }: { email: string; password: string }) => { + const user = await prisma.user.findUnique({ where: { email } }); + if (!user) throw new Error('User not found'); + + const isMatch = await comparePassword(password, user.password); + if (!isMatch) throw new Error('Invalid credentials'); + + const token = jwt.sign({ id: user.id, email: user.email }, process.env.JWT_SECRET, { expiresIn: '1h' }); + return { token, user }; +}; + +export const getProfile = async (userId: string) => { + const user = await prisma.user.findUnique({ + where: { id: userId }, + select: { + id: true, + email: true, + role: true, + firstName: true, + lastName: true, + imageUrl: true, + location: true, + address: true, + phone: true, + socialmedia: true, + createdAt: true, + isEmailVerified: true, + }, + }); + + if (!user) throw new Error('User not found'); + + // Fetch service provider data separately to avoid heavy joins + let serviceProvider = null; + if (user.role === 'PROVIDER' || user.role === 'ADMIN') { + serviceProvider = await prisma.serviceProvider.findUnique({ + where: { userId }, + select: { + id: true, + bio: true, + skills: true, + qualifications: true, + logoUrl: true, + averageRating: true, + totalReviews: true, + }, + }); + + // Get services count + if (serviceProvider) { + const servicesCount = await prisma.service.count({ + where: { providerId: serviceProvider.id, isActive: true } + }); + + // Get latest 5 reviews + const recentReviews = await prisma.customerReview.findMany({ + where: { revieweeId: serviceProvider.id }, + select: { + id: true, + rating: true, + comment: true, + createdAt: true, + reviewer: { + select: { + firstName: true, + lastName: true, + imageUrl: true + } + } + }, + orderBy: { createdAt: 'desc' }, + take: 5 + }); + + serviceProvider = { + ...serviceProvider, + servicesCount, + recentReviews + }; + } + } + + return { ...user, serviceProvider }; +} + +export const updateProfile = async (userId: string, data: UserUpdateData) => { + const updatedData: any = {}; + if (data.firstName) updatedData.firstName = data.firstName; + if (data.lastName) updatedData.lastName = data.lastName; + if (data.imageUrl) updatedData.imageUrl = data.imageUrl; + if (data.location) updatedData.location = data.location; + if (data.address) updatedData.address = data.address; + if (data.phone) updatedData.phone = data.phone; + if (data.socialmedia) updatedData.socialmedia = data.socialmedia; + + return await prisma.user.update({ + where: { id: userId }, + data: updatedData, + }); +} + +export const deleteProfile = async (userId: string) => { + await prisma.user.delete({ + where: { id: userId }, + }); +} + +export const checkEmailExists = async (email: string) => { + const user = await prisma.user.findUnique({ + where: { email }, + select: { id: true } // Only select id for minimal data transfer + }); + return !!user; +} + +export const searchUsers = async (query: string) => { + const users = await prisma.user.findMany({ + where: { + OR: [ + { firstName: { contains: query, mode: 'insensitive' } }, + { lastName: { contains: query, mode: 'insensitive' } }, + { email: { contains: query, mode: 'insensitive' } }, + ], + }, + select: { + id: true, + email: true, + firstName: true, + lastName: true, + imageUrl: true, + }, + take: 20, + }); + return users; +} + +export const getUserById = async (userId: string) => { + const user = await prisma.user.findUnique({ + where: { id: userId }, + select: { + id: true, + email: true, + role: true, + isActive: true, + firstName: true, + lastName: true, + phone: true, + imageUrl: true, + location: true, + address: true, + isEmailVerified: true, + createdAt: true, + updatedAt: true, + lastLoginAt: true, + socialmedia: true, + }, + }); + + if (!user) { + const err = new Error('User not found') as ErrorWithStatus; + err.status = 404; + throw err; + } + + return user; +} \ No newline at end of file diff --git a/src/types/express/index.d.ts b/src/types/express/index.d.ts new file mode 100755 index 0000000..c670c78 --- /dev/null +++ b/src/types/express/index.d.ts @@ -0,0 +1,9 @@ +import { User } from '@prisma/client'; + +declare global { + namespace Express { + interface Request { + user: { id: string } & Partial; + } + } +} diff --git a/src/utils/database.ts b/src/utils/database.ts new file mode 100755 index 0000000..ed59293 --- /dev/null +++ b/src/utils/database.ts @@ -0,0 +1,45 @@ +import { PrismaClient } from '@prisma/client'; + +// Singleton Prisma client to prevent multiple instances +class DatabaseManager { + private static instance: PrismaClient; + + public static getInstance(): PrismaClient { + if (!DatabaseManager.instance) { + DatabaseManager.instance = new PrismaClient({ + log: ['warn', 'error'], + datasources: { + db: { + url: process.env.DATABASE_URL, + }, + }, + }); + + // Handle graceful shutdown + process.on('beforeExit', async () => { + await DatabaseManager.instance.$disconnect(); + }); + + process.on('SIGINT', async () => { + await DatabaseManager.instance.$disconnect(); + process.exit(0); + }); + + process.on('SIGTERM', async () => { + await DatabaseManager.instance.$disconnect(); + process.exit(0); + }); + } + + return DatabaseManager.instance; + } + + public static async disconnect(): Promise { + if (DatabaseManager.instance) { + await DatabaseManager.instance.$disconnect(); + } + } +} + +// Export the singleton instance +export const prisma = DatabaseManager.getInstance(); diff --git a/src/utils/hash.js b/src/utils/hash.js deleted file mode 100644 index 96d80b5..0000000 --- a/src/utils/hash.js +++ /dev/null @@ -1,9 +0,0 @@ -import { hash as _hash, compare } from 'bcrypt'; - -export async function hashPassword(plainText) { - return await _hash(plainText, 10); -} - -export async function comparePassword(plainText, hash) { - return await compare(plainText, hash); -} diff --git a/src/utils/hash.ts b/src/utils/hash.ts new file mode 100755 index 0000000..8232d9f --- /dev/null +++ b/src/utils/hash.ts @@ -0,0 +1,9 @@ +import { hash as _hash, compare } from 'bcrypt'; + +export async function hashPassword(plainText: string): Promise { + return await _hash(plainText, 10); +} + +export async function comparePassword(plainText: string, hash: string): Promise { + return await compare(plainText, hash); +} diff --git a/src/utils/s3.ts b/src/utils/s3.ts new file mode 100755 index 0000000..6a6e3dc --- /dev/null +++ b/src/utils/s3.ts @@ -0,0 +1,126 @@ +import { S3Client, PutObjectCommand, DeleteObjectCommand } from '@aws-sdk/client-s3'; +import multer from 'multer'; +import { Request } from 'express'; + +// Configure AWS S3 Client +const s3Client = new S3Client({ + region: process.env.AWS_REGION || 'us-east-1', + credentials: { + accessKeyId: process.env.AWS_ACCESS_KEY_ID!, + secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!, + }, +}); + +// Configure multer for memory storage +const storage = multer.memoryStorage(); + +export const upload = multer({ + storage, + limits: { + fileSize: 50 * 1024 * 1024, // 50MB limit for images + }, + fileFilter: (req: Request, file: Express.Multer.File, cb: multer.FileFilterCallback) => { + // Check if file is an image + if (file.mimetype.startsWith('image/')) { + cb(null, true); + } else { + cb(new Error('Only image files are allowed')); + } + }, +}); + +// Upload file to S3 +export const uploadToS3 = async ( + file: Express.Multer.File, + folder: string = 'profile-images' +): Promise => { + // Sanitize filename by removing spaces and special characters + const sanitizedFilename = file.originalname + .replace(/\s+/g, '_') // Replace spaces with underscores + .replace(/[^a-zA-Z0-9._-]/g, '') // Remove special characters except dots, underscores, and hyphens + .replace(/_+/g, '_'); // Replace multiple underscores with single underscore + + const key = `${folder}/${Date.now()}-${Math.random().toString(36).substring(2)}-${sanitizedFilename}`; + + const params = { + Bucket: process.env.AWS_S3_BUCKET_NAME!, + Key: key, + Body: file.buffer, + ContentType: file.mimetype, + }; + + try { + const command = new PutObjectCommand(params); + await s3Client.send(command); + return `https://${process.env.AWS_S3_BUCKET_NAME}.s3.${process.env.AWS_REGION}.amazonaws.com/${key}`; + } catch (error) { + console.error('Error uploading to S3:', error); + throw new Error('Failed to upload image'); + } +}; + +// Configure multer for video uploads with higher limits +export const uploadVideo = multer({ + storage, + limits: { + fileSize: 100 * 1024 * 1024, // 100MB limit for videos + }, + fileFilter: (req: Request, file: Express.Multer.File, cb: multer.FileFilterCallback) => { + // Check if file is a video + if (file.mimetype.startsWith('video/')) { + cb(null, true); + } else { + cb(new Error('Only video files are allowed')); + } + }, +}); + +// Upload video to S3 +export const uploadVideoToS3 = async ( + file: Express.Multer.File, + folder: string = 'service-videos' +): Promise => { + // Sanitize filename by removing spaces and special characters + const sanitizedFilename = file.originalname + .replace(/\s+/g, '_') // Replace spaces with underscores + .replace(/[^a-zA-Z0-9._-]/g, '') // Remove special characters except dots, underscores, and hyphens + .replace(/_+/g, '_'); // Replace multiple underscores with single underscore + + const key = `${folder}/${Date.now()}-${Math.random().toString(36).substring(2)}-${sanitizedFilename}`; + + const params = { + Bucket: process.env.AWS_S3_BUCKET_NAME!, + Key: key, + Body: file.buffer, + ContentType: file.mimetype, + }; + + try { + const command = new PutObjectCommand(params); + await s3Client.send(command); + return `https://${process.env.AWS_S3_BUCKET_NAME}.s3.${process.env.AWS_REGION}.amazonaws.com/${key}`; + } catch (error) { + console.error('Error uploading video to S3:', error); + throw new Error('Failed to upload video'); + } +}; + +// Delete file from S3 +export const deleteFromS3 = async (imageUrl: string): Promise => { + try { + // Extract key from URL + const url = new URL(imageUrl); + const key = url.pathname.substring(1); // Remove leading slash + + const params = { + Bucket: process.env.AWS_S3_BUCKET_NAME!, + Key: key, + }; + + const command = new DeleteObjectCommand(params); + await s3Client.send(command); + } catch (error) { + console.error('Error deleting from S3:', error); + // Don't throw error for delete failures to avoid breaking the update operation + } +}; diff --git a/src/validators/admin.validator.ts b/src/validators/admin.validator.ts new file mode 100755 index 0000000..28ab7dd --- /dev/null +++ b/src/validators/admin.validator.ts @@ -0,0 +1,185 @@ +import Joi from 'joi'; +import type { Request, Response, NextFunction } from 'express'; + +const adminRegistrationSchema = Joi.object({ + username: Joi.string() + .alphanum() + .min(3) + .max(30) + .required() + .messages({ + 'string.alphanum': 'Username must only contain alphanumeric characters', + 'string.min': 'Username must be at least 3 characters long', + 'string.max': 'Username must not exceed 30 characters', + 'any.required': 'Username is required', + }), + password: Joi.string() + .min(8) + .max(128) + .pattern(new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]')) + .required() + .messages({ + 'string.min': 'Password must be at least 8 characters long', + 'string.max': 'Password must not exceed 128 characters', + 'string.pattern.base': 'Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character', + 'any.required': 'Password is required', + }), + firstName: Joi.string() + .min(1) + .max(50) + .pattern(new RegExp('^[a-zA-Z\\s]+$')) + .required() + .messages({ + 'string.min': 'First name must be at least 1 character long', + 'string.max': 'First name must not exceed 50 characters', + 'string.pattern.base': 'First name must only contain letters and spaces', + 'any.required': 'First name is required', + }), + lastName: Joi.string() + .min(1) + .max(50) + .pattern(new RegExp('^[a-zA-Z\\s]+$')) + .required() + .messages({ + 'string.min': 'Last name must be at least 1 character long', + 'string.max': 'Last name must not exceed 50 characters', + 'string.pattern.base': 'Last name must only contain letters and spaces', + 'any.required': 'Last name is required', + }), +}); + +const adminLoginSchema = Joi.object({ + username: Joi.string() + .required() + .messages({ + 'any.required': 'Username is required', + }), + password: Joi.string() + .required() + .messages({ + 'any.required': 'Password is required', + }), +}); + +const adminUpdateSchema = Joi.object({ + username: Joi.string() + .alphanum() + .min(3) + .max(30) + .optional() + .messages({ + 'string.alphanum': 'Username must only contain alphanumeric characters', + 'string.min': 'Username must be at least 3 characters long', + 'string.max': 'Username must not exceed 30 characters', + }), + password: Joi.string() + .min(8) + .max(128) + .pattern(new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]')) + .optional() + .messages({ + 'string.min': 'Password must be at least 8 characters long', + 'string.max': 'Password must not exceed 128 characters', + 'string.pattern.base': 'Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character', + }), + firstName: Joi.string() + .min(1) + .max(50) + .pattern(new RegExp('^[a-zA-Z\\s]+$')) + .optional() + .messages({ + 'string.min': 'First name must be at least 1 character long', + 'string.max': 'First name must not exceed 50 characters', + 'string.pattern.base': 'First name must only contain letters and spaces', + }), + lastName: Joi.string() + .min(1) + .max(50) + .pattern(new RegExp('^[a-zA-Z\\s]+$')) + .optional() + .messages({ + 'string.min': 'Last name must be at least 1 character long', + 'string.max': 'Last name must not exceed 50 characters', + 'string.pattern.base': 'Last name must only contain letters and spaces', + }), +}).min(1).messages({ + 'object.min': 'At least one field must be provided for update', +}); + +export const validateAdminRegistration = ( + req: Request, + res: Response, + next: NextFunction +): void => { + const { error } = adminRegistrationSchema.validate(req.body, { + abortEarly: false, + }); + + if (error) { + const errors = error.details.map((detail) => ({ + field: detail.path.join('.'), + message: detail.message, + })); + + res.status(400).json({ + success: false, + message: 'Validation failed', + errors, + }); + return; + } + + next(); +}; + +export const validateAdminLogin = ( + req: Request, + res: Response, + next: NextFunction +): void => { + const { error } = adminLoginSchema.validate(req.body, { + abortEarly: false, + }); + + if (error) { + const errors = error.details.map((detail) => ({ + field: detail.path.join('.'), + message: detail.message, + })); + + res.status(400).json({ + success: false, + message: 'Validation failed', + errors, + }); + return; + } + + next(); +}; + +export const validateAdminUpdate = ( + req: Request, + res: Response, + next: NextFunction +): void => { + const { error } = adminUpdateSchema.validate(req.body, { + abortEarly: false, + }); + + if (error) { + const errors = error.details.map((detail) => ({ + field: detail.path.join('.'), + message: detail.message, + })); + + res.status(400).json({ + success: false, + message: 'Validation failed', + errors, + }); + return; + } + + next(); +}; diff --git a/src/validators/catagory.validator.js b/src/validators/category.validator.ts old mode 100644 new mode 100755 similarity index 100% rename from src/validators/catagory.validator.js rename to src/validators/category.validator.ts diff --git a/src/validators/company.validator.js b/src/validators/company.validator.ts old mode 100644 new mode 100755 similarity index 100% rename from src/validators/company.validator.js rename to src/validators/company.validator.ts diff --git a/src/validators/provider.validator.js b/src/validators/provider.validator.ts old mode 100644 new mode 100755 similarity index 56% rename from src/validators/provider.validator.js rename to src/validators/provider.validator.ts index 8ba21b6..baa1206 --- a/src/validators/provider.validator.js +++ b/src/validators/provider.validator.ts @@ -4,14 +4,18 @@ export const createProviderSchema = Joi.object({ bio: Joi.string().max(1000).optional(), skills: Joi.array().items(Joi.string()).optional(), qualifications: Joi.array().items(Joi.string()).optional(), - logoUrl: Joi.string().uri().optional(), - IDCardUrl: Joi.string().uri().required() // Required ID card image URL + logoUrl: Joi.string().uri().allow('').optional(), + IDCardUrl: Joi.string().uri().allow('').optional() // Optional ID card image URL }); export const updateProviderSchema = Joi.object({ bio: Joi.string().max(1000).optional(), skills: Joi.array().items(Joi.string()).optional(), qualifications: Joi.array().items(Joi.string()).optional(), - logoUrl: Joi.string().uri().optional(), - IDCardUrl: Joi.string().uri().optional() // Optional for updates + logoUrl: Joi.string().uri().allow('').optional(), + IDCardUrl: Joi.string().uri().allow('').optional() // Optional for updates +}); + +export const providerParamsSchema = Joi.object({ + id: Joi.string().required() }); diff --git a/src/validators/services.validator.js b/src/validators/services.validator.js deleted file mode 100644 index b391fe7..0000000 --- a/src/validators/services.validator.js +++ /dev/null @@ -1,121 +0,0 @@ -import Joi from 'joi'; - -/** - * Validation schema for creating a service - */ -export const createServiceSchema = Joi.object({ - providerId: Joi.string().required().messages({ - 'string.empty': 'Provider ID is required', - 'any.required': 'Provider ID is required' - }), - - categoryId: Joi.string().required().messages({ - 'string.empty': 'Category ID is required', - 'any.required': 'Category ID is required' - }), - - title: Joi.string().min(3).max(100).optional().messages({ - 'string.min': 'Title must be at least 3 characters long', - 'string.max': 'Title must not exceed 100 characters' - }), - - description: Joi.string().min(10).max(1000).optional().messages({ - 'string.min': 'Description must be at least 10 characters long', - 'string.max': 'Description must not exceed 1000 characters' - }), - - price: Joi.number().positive().precision(2).required().messages({ - 'number.positive': 'Price must be a positive number', - 'any.required': 'Price is required' - }), - - currency: Joi.string().length(3).uppercase().optional().default('USD').messages({ - 'string.length': 'Currency must be a 3-character code (e.g., USD, EUR)', - 'string.uppercase': 'Currency must be uppercase' - }), - - tags: Joi.array().items(Joi.string().min(2).max(30)).max(10).optional().default([]).messages({ - 'array.max': 'Maximum 10 tags allowed', - 'string.min': 'Each tag must be at least 2 characters long', - 'string.max': 'Each tag must not exceed 30 characters' - }), - - images: Joi.array().items(Joi.string().uri()).max(5).optional().default([]).messages({ - 'array.max': 'Maximum 5 images allowed', - 'string.uri': 'Each image must be a valid URL' - }), - - isActive: Joi.boolean().optional().default(true), - - workingTime: Joi.array().items( - Joi.string().pattern(/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday):\s*\d{1,2}:\d{2}\s*(AM|PM)\s*-\s*\d{1,2}:\d{2}\s*(AM|PM)$/i) - ).max(7).optional().default([]).messages({ - 'array.max': 'Maximum 7 working time slots allowed (one per day)', - 'string.pattern.base': 'Working time must be in format "Day: HH:MM AM/PM - HH:MM AM/PM" (e.g., "Monday: 9:00 AM - 5:00 PM")' - }) -}); - -/** - * Validation schema for updating a service - */ -export const updateServiceSchema = Joi.object({ - title: Joi.string().min(3).max(100).optional().messages({ - 'string.min': 'Title must be at least 3 characters long', - 'string.max': 'Title must not exceed 100 characters' - }), - - description: Joi.string().min(10).max(1000).optional().messages({ - 'string.min': 'Description must be at least 10 characters long', - 'string.max': 'Description must not exceed 1000 characters' - }), - - price: Joi.number().positive().precision(2).optional().messages({ - 'number.positive': 'Price must be a positive number' - }), - - currency: Joi.string().length(3).uppercase().optional().messages({ - 'string.length': 'Currency must be a 3-character code (e.g., USD, EUR)', - 'string.uppercase': 'Currency must be uppercase' - }), - - tags: Joi.array().items(Joi.string().min(2).max(30)).max(10).optional().messages({ - 'array.max': 'Maximum 10 tags allowed', - 'string.min': 'Each tag must be at least 2 characters long', - 'string.max': 'Each tag must not exceed 30 characters' - }), - - images: Joi.array().items(Joi.string().uri()).max(5).optional().messages({ - 'array.max': 'Maximum 5 images allowed', - 'string.uri': 'Each image must be a valid URL' - }), - - isActive: Joi.boolean().optional(), - - workingTime: Joi.array().items( - Joi.string().pattern(/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday):\s*\d{1,2}:\d{2}\s*(AM|PM)\s*-\s*\d{1,2}:\d{2}\s*(AM|PM)$/i) - ).max(7).optional().messages({ - 'array.max': 'Maximum 7 working time slots allowed (one per day)', - 'string.pattern.base': 'Working time must be in format "Day: HH:MM AM/PM - HH:MM AM/PM" (e.g., "Monday: 9:00 AM - 5:00 PM")' - }) -}); - -/** - * Validation schema for service query parameters - */ -export const getServicesQuerySchema = Joi.object({ - providerId: Joi.string().optional(), - categoryId: Joi.string().optional(), - isActive: Joi.string().valid('true', 'false').optional(), - skip: Joi.number().integer().min(0).optional().default(0), - take: Joi.number().integer().min(1).max(100).optional().default(10) -}); - -/** - * Validation schema for service ID parameter - */ -export const serviceIdSchema = Joi.object({ - id: Joi.string().required().messages({ - 'string.empty': 'Service ID is required', - 'any.required': 'Service ID is required' - }) -}); diff --git a/src/validators/services.validator.ts b/src/validators/services.validator.ts new file mode 100755 index 0000000..afa04b5 --- /dev/null +++ b/src/validators/services.validator.ts @@ -0,0 +1,303 @@ +import Joi from 'joi'; + +/** + * Validation schema for creating a service + */ +export const createServiceSchema = Joi.object({ + providerId: Joi.string().required().messages({ + 'string.empty': 'Provider ID is required', + 'any.required': 'Provider ID is required' + }), + + categoryId: Joi.string().required().messages({ + 'string.empty': 'Category ID is required', + 'any.required': 'Category ID is required' + }), + + title: Joi.string().min(3).max(100).optional().messages({ + 'string.min': 'Title must be at least 3 characters long', + 'string.max': 'Title must not exceed 100 characters' + }), + + description: Joi.string().min(10).max(1000).optional().messages({ + 'string.min': 'Description must be at least 10 characters long', + 'string.max': 'Description must not exceed 1000 characters' + }), + + price: Joi.number().positive().precision(2).required().messages({ + 'number.positive': 'Price must be a positive number', + 'any.required': 'Price is required' + }), + + currency: Joi.string().length(3).uppercase().optional().default('USD').messages({ + 'string.length': 'Currency must be a 3-character code (e.g., USD, EUR)', + 'string.uppercase': 'Currency must be uppercase' + }), + + tags: Joi.array().items(Joi.string().min(2).max(30)).max(10).optional().default([]).messages({ + 'array.max': 'Maximum 10 tags allowed', + 'string.min': 'Each tag must be at least 2 characters long', + 'string.max': 'Each tag must not exceed 30 characters' + }), + + images: Joi.array().items(Joi.string().uri()).max(5).optional().default([]).messages({ + 'array.max': 'Maximum 5 images allowed', + 'string.uri': 'Each image must be a valid URL' + }), + + videoUrl: Joi.string().optional().custom((value, helpers) => { + // Allow empty/null values + if (!value) return value; + + try { + // Try to create a URL object - this will handle most valid URLs including S3 URLs with encoded characters + new URL(value); + return value; + } catch (error) { + // If URL constructor fails, try to URL encode any spaces and special characters + try { + const encodedUrl = value.replace(/\s/g, '%20'); + new URL(encodedUrl); + return value; // Return original value, not encoded + } catch (encodedError) { + return helpers.error('string.uri'); + } + } + }).messages({ + 'string.uri': 'Video URL must be a valid URL' + }), + + isActive: Joi.boolean().optional().default(true), + + workingTime: Joi.array().items( + Joi.string().pattern(/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday):\s*\d{1,2}:\d{2}\s*(AM|PM)\s*-\s*\d{1,2}:\d{2}\s*(AM|PM)$/i) + ).max(7).optional().default([]).messages({ + 'array.max': 'Maximum 7 working time slots allowed (one per day)', + 'string.pattern.base': 'Working time must be in format "Day: HH:MM AM/PM - HH:MM AM/PM" (e.g., "Monday: 9:00 AM - 5:00 PM")' + }), + + // Location fields + latitude: Joi.number().min(-90).max(90).optional().messages({ + 'number.min': 'Latitude must be between -90 and 90', + 'number.max': 'Latitude must be between -90 and 90' + }), + + longitude: Joi.number().min(-180).max(180).optional().messages({ + 'number.min': 'Longitude must be between -180 and 180', + 'number.max': 'Longitude must be between -180 and 180' + }), + + address: Joi.string().max(500).allow('').optional().messages({ + 'string.max': 'Address must not exceed 500 characters' + }), + + city: Joi.string().max(100).allow('').optional().messages({ + 'string.max': 'City must not exceed 100 characters' + }), + + state: Joi.string().max(100).allow('').optional().messages({ + 'string.max': 'State must not exceed 100 characters' + }), + + country: Joi.string().max(100).allow('').optional().messages({ + 'string.max': 'Country must not exceed 100 characters' + }), + + postalCode: Joi.string().max(20).allow('').optional().messages({ + 'string.max': 'Postal code must not exceed 20 characters' + }), + + serviceRadiusKm: Joi.number().positive().max(100).optional().default(10).messages({ + 'number.positive': 'Service radius must be a positive number', + 'number.max': 'Service radius cannot exceed 100 km' + }) +}); + +/** + * Validation schema for updating a service + */ +export const updateServiceSchema = Joi.object({ + title: Joi.string().min(3).max(100).optional().messages({ + 'string.min': 'Title must be at least 3 characters long', + 'string.max': 'Title must not exceed 100 characters' + }), + + description: Joi.string().min(10).max(1000).optional().messages({ + 'string.min': 'Description must be at least 10 characters long', + 'string.max': 'Description must not exceed 1000 characters' + }), + + price: Joi.number().positive().precision(2).optional().messages({ + 'number.positive': 'Price must be a positive number' + }), + + currency: Joi.string().length(3).uppercase().optional().messages({ + 'string.length': 'Currency must be a 3-character code (e.g., USD, EUR)', + 'string.uppercase': 'Currency must be uppercase' + }), + + tags: Joi.array().items(Joi.string().min(2).max(30)).max(10).optional().messages({ + 'array.max': 'Maximum 10 tags allowed', + 'string.min': 'Each tag must be at least 2 characters long', + 'string.max': 'Each tag must not exceed 30 characters' + }), + + images: Joi.array().items(Joi.string().uri()).max(5).optional().messages({ + 'array.max': 'Maximum 5 images allowed', + 'string.uri': 'Each image must be a valid URL' + }), + + videoUrl: Joi.string().optional().custom((value, helpers) => { + // Allow empty/null values + if (!value) return value; + + try { + // Try to create a URL object - this will handle most valid URLs including S3 URLs with encoded characters + new URL(value); + return value; + } catch (error) { + // If URL constructor fails, try to URL encode any spaces and special characters + try { + const encodedUrl = value.replace(/\s/g, '%20'); + new URL(encodedUrl); + return value; // Return original value, not encoded + } catch (encodedError) { + return helpers.error('string.uri'); + } + } + }).messages({ + 'string.uri': 'Video URL must be a valid URL' + }), + + isActive: Joi.boolean().optional(), + + workingTime: Joi.array().items( + Joi.string().pattern(/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday):\s*\d{1,2}:\d{2}\s*(AM|PM)\s*-\s*\d{1,2}:\d{2}\s*(AM|PM)$/i) + ).max(7).optional().messages({ + 'array.max': 'Maximum 7 working time slots allowed (one per day)', + 'string.pattern.base': 'Working time must be in format "Day: HH:MM AM/PM - HH:MM AM/PM" (e.g., "Monday: 9:00 AM - 5:00 PM")' + }), + + // Location fields (same as create schema) + latitude: Joi.number().min(-90).max(90).optional().messages({ + 'number.min': 'Latitude must be between -90 and 90', + 'number.max': 'Latitude must be between -90 and 90' + }), + + longitude: Joi.number().min(-180).max(180).optional().messages({ + 'number.min': 'Longitude must be between -180 and 180', + 'number.max': 'Longitude must be between -180 and 180' + }), + + address: Joi.string().max(500).allow('').optional().messages({ + 'string.max': 'Address must not exceed 500 characters' + }), + + city: Joi.string().max(100).allow('').optional().messages({ + 'string.max': 'City must not exceed 100 characters' + }), + + state: Joi.string().max(100).allow('').optional().messages({ + 'string.max': 'State must not exceed 100 characters' + }), + + country: Joi.string().max(100).allow('').optional().messages({ + 'string.max': 'Country must not exceed 100 characters' + }), + + postalCode: Joi.string().max(20).allow('').optional().messages({ + 'string.max': 'Postal code must not exceed 20 characters' + }), + + serviceRadiusKm: Joi.number().positive().max(100).optional().messages({ + 'number.positive': 'Service radius must be a positive number', + 'number.max': 'Service radius cannot exceed 100 km' + }) +}); + +/** + * Validation schema for service query parameters + */ +export const getServicesQuerySchema = Joi.object({ + providerId: Joi.string().optional(), + categoryId: Joi.string().optional(), + isActive: Joi.string().valid('true', 'false').optional(), + skip: Joi.number().integer().min(0).optional().default(0), + take: Joi.number().integer().min(1).max(100).optional().default(10) +}); + +/** + * Validation schema for service ID parameter + */ +export const serviceIdSchema = Joi.object({ + id: Joi.string().required().messages({ + 'string.empty': 'Service ID is required', + 'any.required': 'Service ID is required' + }) +}); + +/** + * Validation schema for conversation ID parameter + */ +export const conversationIdSchema = Joi.object({ + conversationId: Joi.string().required().messages({ + 'string.empty': 'Conversation ID is required', + 'any.required': 'Conversation ID is required' + }) +}); + +/** + * Validation schema for location-based service search + */ +export const searchServicesByLocationSchema = Joi.object({ + lat: Joi.number().min(-90).max(90).required().messages({ + 'number.min': 'Latitude must be between -90 and 90', + 'number.max': 'Latitude must be between -90 and 90', + 'any.required': 'Latitude is required' + }), + lng: Joi.number().min(-180).max(180).required().messages({ + 'number.min': 'Longitude must be between -180 and 180', + 'number.max': 'Longitude must be between -180 and 180', + 'any.required': 'Longitude is required' + }), + radius: Joi.number().positive().max(100).optional().default(10).messages({ + 'number.positive': 'Radius must be a positive number', + 'number.max': 'Radius cannot exceed 100 km' + }), + categoryId: Joi.string().optional(), + skip: Joi.number().integer().min(0).optional().default(0), + take: Joi.number().integer().min(1).max(100).optional().default(10) +}); + +/** + * Validation schema for geocoding address + */ +export const geocodeAddressSchema = Joi.object({ + address: Joi.string().min(5).max(500).required().messages({ + 'string.min': 'Address must be at least 5 characters long', + 'string.max': 'Address must not exceed 500 characters', + 'any.required': 'Address is required' + }) +}); + +/** + * Validation schema for reverse geocoding coordinates + */ +export const reverseGeocodeSchema = Joi.object({ + lat: Joi.number().min(-90).max(90).optional().messages({ + 'number.min': 'Latitude must be between -90 and 90', + 'number.max': 'Latitude must be between -90 and 90' + }), + lng: Joi.number().min(-180).max(180).optional().messages({ + 'number.min': 'Longitude must be between -180 and 180', + 'number.max': 'Longitude must be between -180 and 180' + }), + latitude: Joi.number().min(-90).max(90).optional().messages({ + 'number.min': 'Latitude must be between -90 and 90', + 'number.max': 'Latitude must be between -90 and 90' + }), + longitude: Joi.number().min(-180).max(180).optional().messages({ + 'number.min': 'Longitude must be between -180 and 180', + 'number.max': 'Longitude must be between -180 and 180' + }) +}).or('lat', 'latitude').or('lng', 'longitude'); diff --git a/src/validators/user.validator.js b/src/validators/user.validator.ts old mode 100644 new mode 100755 similarity index 100% rename from src/validators/user.validator.js rename to src/validators/user.validator.ts diff --git a/tsconfig.json b/tsconfig.json new file mode 100755 index 0000000..2f74320 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,47 @@ +{ + // Visit https://aka.ms/tsconfig to read more about this file + "compilerOptions": { + // File Layout + // "rootDir": "./src", + "outDir": "./dist", + + // Environment Settings + // See also https://aka.ms/tsconfig/module + "module": "ESNext", + "target": "ESNext", + "moduleResolution": "node", + "types": ["node"], + "lib": ["esnext"], + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + + // Other Outputs + "sourceMap": true, + "declaration": true, + "declarationMap": true, + + // Stricter Typechecking Options + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": false, + + // Style Options + // "noImplicitReturns": true, + // "noImplicitOverride": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + // "noFallthroughCasesInSwitch": true, + // "noPropertyAccessFromIndexSignature": true, + + // Recommended Options + "strict": false, + "jsx": "react-jsx", + "verbatimModuleSyntax": false, + "isolatedModules": true, + "noUncheckedSideEffectImports": false, + "moduleDetection": "force", + "skipLibCheck": true, + }, + "ts-node": { + "esm": true + } +} \ No newline at end of file