diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..adb56be --- /dev/null +++ b/.dockerignore @@ -0,0 +1,41 @@ +# Dependencies +node_modules +npm-debug.log +yarn-error.log + +# Build output +dist + +# IDE +.idea +.vscode +*.swp +*.swo + +# Testing +coverage +.nyc_output + +# Environment +.env +.env.* +!.env.example + +# Git +.git +.gitignore + +# Docker +Dockerfile +docker-compose*.yml +.dockerignore + +# Documentation +README.md +docs + +# Tests +test +*.spec.ts +*.test.ts +jest.config.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1900a45 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +coverage/ +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5d6b7e6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,89 @@ +# ============================================================================= +# MiChangarrito - Backend Dockerfile +# ============================================================================= +# Multi-stage build for NestJS application +# Puerto: 3141 +# ============================================================================= + +# Build stage +FROM node:20-alpine AS builder + +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install dependencies +RUN npm ci + +# Copy source code +COPY . . + +# Build application +RUN npm run build + +# Production stage +FROM node:20-alpine AS production + +# Labels +LABEL maintainer="ISEM" +LABEL description="MiChangarrito Backend API" +LABEL version="1.0.0" + +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install only production dependencies +RUN npm ci --only=production && npm cache clean --force + +# Copy built application +COPY --from=builder /app/dist ./dist + +# Create non-root user +RUN addgroup -g 1001 -S nodejs && \ + adduser -S nestjs -u 1001 -G nodejs + +# Set ownership +RUN chown -R nestjs:nodejs /app + +USER nestjs + +# Environment +ENV NODE_ENV=production +ENV PORT=3141 + +# Expose port +EXPOSE 3141 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:3141/api/v1/health || exit 1 + +# Start application +CMD ["node", "dist/main"] + +# Development stage +FROM node:20-alpine AS development + +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install all dependencies +RUN npm ci + +# Copy source code +COPY . . + +# Environment +ENV NODE_ENV=development +ENV PORT=3141 + +# Expose port +EXPOSE 3141 + +# Start in development mode +CMD ["npm", "run", "start:dev"] diff --git a/nest-cli.json b/nest-cli.json new file mode 100644 index 0000000..f9aa683 --- /dev/null +++ b/nest-cli.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli", + "collection": "@nestjs/schematics", + "sourceRoot": "src", + "compilerOptions": { + "deleteOutDir": true + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..098527d --- /dev/null +++ b/package-lock.json @@ -0,0 +1,11845 @@ +{ + "name": "michangarrito-backend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "michangarrito-backend", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@nestjs/common": "^10.3.0", + "@nestjs/config": "^3.1.1", + "@nestjs/core": "^10.3.0", + "@nestjs/jwt": "^10.2.0", + "@nestjs/passport": "^10.0.3", + "@nestjs/platform-express": "^10.3.0", + "@nestjs/swagger": "^7.2.0", + "@nestjs/typeorm": "^10.0.1", + "@react-native-community/netinfo": "^11.4.1", + "bcrypt": "^5.1.1", + "class-transformer": "^0.5.1", + "class-validator": "^0.14.1", + "helmet": "^7.1.0", + "passport": "^0.7.0", + "passport-jwt": "^4.0.1", + "pg": "^8.11.3", + "reflect-metadata": "^0.2.1", + "rxjs": "^7.8.1", + "stripe": "^20.1.1", + "typeorm": "^0.3.19", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@nestjs/cli": "^10.3.0", + "@nestjs/schematics": "^10.1.0", + "@nestjs/testing": "^10.3.0", + "@types/bcrypt": "^5.0.2", + "@types/express": "^4.17.21", + "@types/jest": "^29.5.11", + "@types/node": "^20.10.8", + "@types/passport-jwt": "^4.0.0", + "@types/uuid": "^9.0.7", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.19.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", + "jest": "^29.7.0", + "prettier": "^3.2.4", + "source-map-support": "^0.5.21", + "supertest": "^6.3.4", + "ts-jest": "^29.1.1", + "ts-loader": "^9.5.1", + "ts-node": "^10.9.2", + "tsconfig-paths": "^4.2.0", + "typescript": "^5.3.3" + } + }, + "node_modules/@angular-devkit/core": { + "version": "17.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-17.3.11.tgz", + "integrity": "sha512-vTNDYNsLIWpYk2I969LMQFH29GTsLzxNk/0cLw5q56ARF0v5sIWfHYwGTS88jdDqIpuuettcSczbxeA7EuAmqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "8.12.0", + "ajv-formats": "2.1.1", + "jsonc-parser": "3.2.1", + "picomatch": "4.0.1", + "rxjs": "7.8.1", + "source-map": "0.7.4" + }, + "engines": { + "node": "^18.13.0 || >=20.9.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "chokidar": "^3.5.2" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } + } + }, + "node_modules/@angular-devkit/core/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@angular-devkit/schematics": { + "version": "17.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-17.3.11.tgz", + "integrity": "sha512-I5wviiIqiFwar9Pdk30Lujk8FczEEc18i22A5c6Z9lbmhPQdTroDnEQdsfXjy404wPe8H62s0I15o4pmMGfTYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.11", + "jsonc-parser": "3.2.1", + "magic-string": "0.30.8", + "ora": "5.4.1", + "rxjs": "7.8.1" + }, + "engines": { + "node": "^18.13.0 || >=20.9.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@angular-devkit/schematics-cli": { + "version": "17.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics-cli/-/schematics-cli-17.3.11.tgz", + "integrity": "sha512-kcOMqp+PHAKkqRad7Zd7PbpqJ0LqLaNZdY1+k66lLWmkEBozgq8v4ASn/puPWf9Bo0HpCiK+EzLf0VHE8Z/y6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.11", + "@angular-devkit/schematics": "17.3.11", + "ansi-colors": "4.1.3", + "inquirer": "9.2.15", + "symbol-observable": "4.0.0", + "yargs-parser": "21.1.1" + }, + "bin": { + "schematics": "bin/schematics.js" + }, + "engines": { + "node": "^18.13.0 || >=20.9.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 12" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/inquirer": { + "version": "9.2.15", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.15.tgz", + "integrity": "sha512-vI2w4zl/mDluHt9YEQ/543VTCwPKWiHzKtm9dM2V0NdFcqEexDAjUHzO1oA60HRNaVifGXXM1tRRNluLVHa0Kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ljharb/through": "^2.3.12", + "ansi-escapes": "^4.3.2", + "chalk": "^5.3.0", + "cli-cursor": "^3.1.0", + "cli-width": "^4.1.0", + "external-editor": "^3.1.0", + "figures": "^3.2.0", + "lodash": "^4.17.21", + "mute-stream": "1.0.0", + "ora": "^5.4.1", + "run-async": "^3.0.0", + "rxjs": "^7.8.1", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/run-async": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", + "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/@angular-devkit/schematics/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", + "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", + "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", + "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse--for-generate-function-map": { + "name": "@babel/traverse", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/ttlcache": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz", + "integrity": "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/create-cache-key-function": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/create-cache-key-function/-/create-cache-key-function-29.7.0.tgz", + "integrity": "sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@jest/reporters/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@jest/reporters/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@ljharb/through": { + "version": "2.3.14", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.14.tgz", + "integrity": "sha512-ajBvlKpWucBB17FuQYUShqpqy8GRgYEpJW0vWJbUu1CV9lWyrDCapy0lScU8T8Z6qn49sSwJB3+M+evYIdGg+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/@lukeed/csprng": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", + "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "license": "BSD-3-Clause", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@microsoft/tsdoc": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.1.tgz", + "integrity": "sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==", + "license": "MIT" + }, + "node_modules/@nestjs/cli": { + "version": "10.4.9", + "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-10.4.9.tgz", + "integrity": "sha512-s8qYd97bggqeK7Op3iD49X2MpFtW4LVNLAwXFkfbRxKME6IYT7X0muNTJ2+QfI8hpbNx9isWkrLWIp+g5FOhiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.11", + "@angular-devkit/schematics": "17.3.11", + "@angular-devkit/schematics-cli": "17.3.11", + "@nestjs/schematics": "^10.0.1", + "chalk": "4.1.2", + "chokidar": "3.6.0", + "cli-table3": "0.6.5", + "commander": "4.1.1", + "fork-ts-checker-webpack-plugin": "9.0.2", + "glob": "10.4.5", + "inquirer": "8.2.6", + "node-emoji": "1.11.0", + "ora": "5.4.1", + "tree-kill": "1.2.2", + "tsconfig-paths": "4.2.0", + "tsconfig-paths-webpack-plugin": "4.2.0", + "typescript": "5.7.2", + "webpack": "5.97.1", + "webpack-node-externals": "3.0.0" + }, + "bin": { + "nest": "bin/nest.js" + }, + "engines": { + "node": ">= 16.14" + }, + "peerDependencies": { + "@swc/cli": "^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0", + "@swc/core": "^1.3.62" + }, + "peerDependenciesMeta": { + "@swc/cli": { + "optional": true + }, + "@swc/core": { + "optional": true + } + } + }, + "node_modules/@nestjs/cli/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@nestjs/cli/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@nestjs/cli/node_modules/typescript": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@nestjs/cli/node_modules/webpack": { + "version": "5.97.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", + "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/@nestjs/common": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.20.tgz", + "integrity": "sha512-hxJxZF7jcKGuUzM9EYbuES80Z/36piJbiqmPy86mk8qOn5gglFebBTvcx7PWVbRNSb4gngASYnefBj/Y2HAzpQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "file-type": "20.4.1", + "iterare": "1.2.1", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "class-transformer": "*", + "class-validator": "*", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/config": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@nestjs/config/-/config-3.3.0.tgz", + "integrity": "sha512-pdGTp8m9d0ZCrjTpjkUbZx6gyf2IKf+7zlkrPNMsJzYZ4bFRRTpXrnj+556/5uiI6AfL5mMrJc2u7dB6bvM+VA==", + "license": "MIT", + "dependencies": { + "dotenv": "16.4.5", + "dotenv-expand": "10.0.0", + "lodash": "4.17.21" + }, + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "rxjs": "^7.1.0" + } + }, + "node_modules/@nestjs/core": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.20.tgz", + "integrity": "sha512-kRdtyKA3+Tu70N3RQ4JgmO1E3LzAMs/eppj7SfjabC7TgqNWoS4RLhWl4BqmsNVmjj6D5jgfPVtHtgYkU3AfpQ==", + "hasInstallScript": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nuxtjs/opencollective": "0.3.2", + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "3.3.0", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/microservices": "^10.0.0", + "@nestjs/platform-express": "^10.0.0", + "@nestjs/websockets": "^10.0.0", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + }, + "@nestjs/websockets": { + "optional": true + } + } + }, + "node_modules/@nestjs/jwt": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/@nestjs/jwt/-/jwt-10.2.0.tgz", + "integrity": "sha512-x8cG90SURkEiLOehNaN2aRlotxT0KZESUliOPKKnjWiyJOcWurkF3w345WOX0P4MgFzUjGoZ1Sy0aZnxeihT0g==", + "license": "MIT", + "dependencies": { + "@types/jsonwebtoken": "9.0.5", + "jsonwebtoken": "9.0.2" + }, + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0" + } + }, + "node_modules/@nestjs/mapped-types": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.5.tgz", + "integrity": "sha512-bSJv4pd6EY99NX9CjBIyn4TVDoSit82DUZlL4I3bqNfy5Gt+gXTa86i3I/i0iIV9P4hntcGM5GyO+FhZAhxtyg==", + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "class-transformer": "^0.4.0 || ^0.5.0", + "class-validator": "^0.13.0 || ^0.14.0", + "reflect-metadata": "^0.1.12 || ^0.2.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/passport": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/passport/-/passport-10.0.3.tgz", + "integrity": "sha512-znJ9Y4S8ZDVY+j4doWAJ8EuuVO7SkQN3yOBmzxbGaXbvcSwFDAdGJ+OMCg52NdzIO4tQoN4pYKx8W6M0ArfFRQ==", + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "passport": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0" + } + }, + "node_modules/@nestjs/platform-express": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.4.20.tgz", + "integrity": "sha512-rh97mX3rimyf4xLMLHuTOBKe6UD8LOJ14VlJ1F/PTd6C6ZK9Ak6EHuJvdaGcSFQhd3ZMBh3I6CuujKGW9pNdIg==", + "license": "MIT", + "peer": true, + "dependencies": { + "body-parser": "1.20.3", + "cors": "2.8.5", + "express": "4.21.2", + "multer": "2.0.2", + "tslib": "2.8.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0" + } + }, + "node_modules/@nestjs/schematics": { + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-10.2.3.tgz", + "integrity": "sha512-4e8gxaCk7DhBxVUly2PjYL4xC2ifDFexCqq1/u4TtivLGXotVk0wHdYuPYe1tHTHuR1lsOkRbfOCpkdTnigLVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.11", + "@angular-devkit/schematics": "17.3.11", + "comment-json": "4.2.5", + "jsonc-parser": "3.3.1", + "pluralize": "8.0.0" + }, + "peerDependencies": { + "typescript": ">=4.8.2" + } + }, + "node_modules/@nestjs/schematics/node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@nestjs/swagger": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.4.2.tgz", + "integrity": "sha512-Mu6TEn1M/owIvAx2B4DUQObQXqo2028R2s9rSZ/hJEgBK95+doTwS0DjmVA2wTeZTyVtXOoN7CsoM5pONBzvKQ==", + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "^0.15.0", + "@nestjs/mapped-types": "2.0.5", + "js-yaml": "4.1.0", + "lodash": "4.17.21", + "path-to-regexp": "3.3.0", + "swagger-ui-dist": "5.17.14" + }, + "peerDependencies": { + "@fastify/static": "^6.0.0 || ^7.0.0", + "@nestjs/common": "^9.0.0 || ^10.0.0", + "@nestjs/core": "^9.0.0 || ^10.0.0", + "class-transformer": "*", + "class-validator": "*", + "reflect-metadata": "^0.1.12 || ^0.2.0" + }, + "peerDependenciesMeta": { + "@fastify/static": { + "optional": true + }, + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/testing": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-10.4.20.tgz", + "integrity": "sha512-nMkRDukDKskdPruM6EsgMq7yJua+CPZM6I6FrLP8yXw8BiVSPv9Nm0CtcGGwt3kgZF9hfxKjGqLjsvVBsv6Vfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "2.8.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0", + "@nestjs/microservices": "^10.0.0", + "@nestjs/platform-express": "^10.0.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + } + } + }, + "node_modules/@nestjs/typeorm": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-10.0.2.tgz", + "integrity": "sha512-H738bJyydK4SQkRCTeh1aFBxoO1E9xdL/HaLGThwrqN95os5mEyAtK7BLADOS+vldP4jDZ2VQPLj4epWwRqCeQ==", + "license": "MIT", + "dependencies": { + "uuid": "9.0.1" + }, + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "@nestjs/core": "^8.0.0 || ^9.0.0 || ^10.0.0", + "reflect-metadata": "^0.1.13 || ^0.2.0", + "rxjs": "^7.2.0", + "typeorm": "^0.3.0" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nuxtjs/opencollective": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", + "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "consola": "^2.15.0", + "node-fetch": "^2.6.1" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, + "node_modules/@react-native-community/netinfo": { + "version": "11.4.1", + "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-11.4.1.tgz", + "integrity": "sha512-B0BYAkghz3Q2V09BF88RA601XursIEA111tnc2JOaN7axJWmNefmfjZqw/KdSxKZp7CZUuPpjBmz/WCR9uaHYg==", + "license": "MIT", + "peerDependencies": { + "react-native": ">=0.59" + } + }, + "node_modules/@react-native/assets-registry": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.83.1.tgz", + "integrity": "sha512-AT7/T6UwQqO39bt/4UL5EXvidmrddXrt0yJa7ENXndAv+8yBzMsZn6fyiax6+ERMt9GLzAECikv3lj22cn2wJA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/codegen": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.83.1.tgz", + "integrity": "sha512-FpRxenonwH+c2a5X5DZMKUD7sCudHxB3eSQPgV9R+uxd28QWslyAWrpnJM/Az96AEksHnymDzEmzq2HLX5nb+g==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/parser": "^7.25.3", + "glob": "^7.1.1", + "hermes-parser": "0.32.0", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "yargs": "^17.6.2" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/codegen/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@react-native/codegen/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@react-native/codegen/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@react-native/community-cli-plugin": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.83.1.tgz", + "integrity": "sha512-FqR1ftydr08PYlRbrDF06eRiiiGOK/hNmz5husv19sK6iN5nHj1SMaCIVjkH/a5vryxEddyFhU6PzO/uf4kOHg==", + "license": "MIT", + "dependencies": { + "@react-native/dev-middleware": "0.83.1", + "debug": "^4.4.0", + "invariant": "^2.2.4", + "metro": "^0.83.3", + "metro-config": "^0.83.3", + "metro-core": "^0.83.3", + "semver": "^7.1.3" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@react-native-community/cli": "*", + "@react-native/metro-config": "*" + }, + "peerDependenciesMeta": { + "@react-native-community/cli": { + "optional": true + }, + "@react-native/metro-config": { + "optional": true + } + } + }, + "node_modules/@react-native/debugger-frontend": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.83.1.tgz", + "integrity": "sha512-01Rn3goubFvPjHXONooLmsW0FLxJDKIUJNOlOS0cPtmmTIx9YIjxhe/DxwHXGk7OnULd7yl3aYy7WlBsEd5Xmg==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/debugger-shell": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.83.1.tgz", + "integrity": "sha512-d+0w446Hxth5OP/cBHSSxOEpbj13p2zToUy6e5e3tTERNJ8ueGlW7iGwGTrSymNDgXXFjErX+dY4P4/3WokPIQ==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.6", + "fb-dotslash": "0.5.8" + }, + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/dev-middleware": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.83.1.tgz", + "integrity": "sha512-QJaSfNRzj3Lp7MmlCRgSBlt1XZ38xaBNXypXAp/3H3OdFifnTZOeYOpFmcpjcXYnDqkxetuwZg8VL65SQhB8dg==", + "license": "MIT", + "dependencies": { + "@isaacs/ttlcache": "^1.4.1", + "@react-native/debugger-frontend": "0.83.1", + "@react-native/debugger-shell": "0.83.1", + "chrome-launcher": "^0.15.2", + "chromium-edge-launcher": "^0.2.0", + "connect": "^3.6.5", + "debug": "^4.4.0", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "open": "^7.0.3", + "serve-static": "^1.16.2", + "ws": "^7.5.10" + }, + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/gradle-plugin": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.83.1.tgz", + "integrity": "sha512-6ESDnwevp1CdvvxHNgXluil5OkqbjkJAkVy7SlpFsMGmVhrSxNAgD09SSRxMNdKsnLtzIvMsFCzyHLsU/S4PtQ==", + "license": "MIT", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/js-polyfills": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.83.1.tgz", + "integrity": "sha512-qgPpdWn/c5laA+3WoJ6Fak8uOm7CG50nBsLlPsF8kbT7rUHIVB9WaP6+GPsoKV/H15koW7jKuLRoNVT7c3Ht3w==", + "license": "MIT", + "engines": { + "node": ">= 20.19.4" + } + }, + "node_modules/@react-native/normalize-colors": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.83.1.tgz", + "integrity": "sha512-84feABbmeWo1kg81726UOlMKAhcQyFXYz2SjRKYkS78QmfhVDhJ2o/ps1VjhFfBz0i/scDwT1XNv9GwmRIghkg==", + "license": "MIT" + }, + "node_modules/@react-native/virtualized-lists": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.83.1.tgz", + "integrity": "sha512-MdmoAbQUTOdicCocm5XAFDJWsswxk7hxa6ALnm6Y88p01HFML0W593hAn6qOt9q6IM1KbAcebtH6oOd4gcQy8w==", + "license": "MIT", + "dependencies": { + "invariant": "^2.2.4", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@types/react": "^19.2.0", + "react": "*", + "react-native": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@sqltools/formatter": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", + "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==", + "license": "MIT" + }, + "node_modules/@tokenizer/inflate": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz", + "integrity": "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "fflate": "^0.8.2", + "token-types": "^6.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "license": "MIT" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/bcrypt": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@types/bcrypt/-/bcrypt-5.0.2.tgz", + "integrity": "sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==", + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/express": { + "version": "4.17.25", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.25.tgz", + "integrity": "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "^1" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.7.tgz", + "integrity": "sha512-FvPtiIf1LfhzsaIXhv/PHan/2FeQBbtBDtfX2QfvPxdUelMDEckK08SM6nqo1MIZY3RUlfA+HV8+hFUSio78qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", + "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.5.tgz", + "integrity": "sha512-VRLSGzik+Unrup6BsouBeHsf4d1hOEgYWTm/7Nmw1sXoN1+tRly/Gy/po3yeahnP4jfnQWWAhQAqcNfH7ngOkA==", + "license": "MIT", + "dependencies": { + "@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==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.19.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.26.tgz", + "integrity": "sha512-0l6cjgF0XnihUpndDhk+nyD3exio3iKaYROSgvh/qSevPXax3L8p5DBRFjbvalnwatGgHEQn2R88y2fA3g4irg==", + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/passport": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.17.tgz", + "integrity": "sha512-aciLyx+wDwT2t2/kJGJR2AEeBz0nJU4WuRX04Wu9Dqc5lSUtwu0WERPHYsLhF9PtseiAMPBGNUOtFjxZ56prsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/passport-jwt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/passport-jwt/-/passport-jwt-4.0.1.tgz", + "integrity": "sha512-Y0Ykz6nWP4jpxgEUYq8NoVZeCQPo1ZndJLfapI249g1jHChvRfZRO/LS3tqu26YgAS/laI1qx98sYGz0IalRXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/jsonwebtoken": "*", + "@types/passport-strategy": "*" + } + }, + "node_modules/@types/passport-strategy": { + "version": "0.2.38", + "resolved": "https://registry.npmjs.org/@types/passport-strategy/-/passport-strategy-0.2.38.tgz", + "integrity": "sha512-GC6eMqqojOooq993Tmnmp7AUTbbQSgilyvpCYQjT+H6JfG/g6RGc7nXEniZlp0zyKJ0WUdOiZWLBZft9Yug1uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/express": "*", + "@types/passport": "*" + } + }, + "node_modules/@types/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.1.tgz", + "integrity": "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.10.tgz", + "integrity": "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "<1" + } + }, + "node_modules/@types/serve-static/node_modules/@types/send": { + "version": "0.17.6", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.6.tgz", + "integrity": "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "license": "MIT" + }, + "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==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/validator": { + "version": "13.15.10", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.10.tgz", + "integrity": "sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==", + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC" + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-phases": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", + "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + }, + "peerDependencies": { + "acorn": "^8.14.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/anser": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz", + "integrity": "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==", + "license": "MIT" + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ansis": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ansis/-/ansis-4.2.0.tgz", + "integrity": "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==", + "license": "ISC", + "engines": { + "node": ">=14" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/app-root-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", + "license": "MIT" + }, + "node_modules/aproba": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", + "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==", + "license": "ISC" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-plugin-syntax-hermes-parser": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.32.0.tgz", + "integrity": "sha512-m5HthL++AbyeEA2FcdwOLfVFvWYECOBObLHNqdR8ceY4TsEdn4LdX2oTvbB2QJSSElE2AWA/b2MXZ/PF/CqLZg==", + "license": "MIT", + "dependencies": { + "hermes-parser": "0.32.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.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/baseline-browser-mapping": { + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.5.tgz", + "integrity": "sha512-D5vIoztZOq1XM54LUdttJVc96ggEsIfju2JBvht06pSzpckp3C7HReun67Bghzrtdsq9XdMGbSSB3v3GhMNmAA==", + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/bcrypt": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.1.tgz", + "integrity": "sha512-AGBHOG5hPYZ5Xl9KXzU5iKq9516yEmvCKDg3ecP5kX2aB6UqTeXZxk2ELnDgDm6BQSMlLt9rDB4LoSMx0rYwww==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.11", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "license": "Apache-2.0", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-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/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001759", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001759.tgz", + "integrity": "sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/chrome-launcher": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.15.2.tgz", + "integrity": "sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==", + "license": "Apache-2.0", + "dependencies": { + "@types/node": "*", + "escape-string-regexp": "^4.0.0", + "is-wsl": "^2.2.0", + "lighthouse-logger": "^1.0.0" + }, + "bin": { + "print-chrome-path": "bin/print-chrome-path.js" + }, + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0" + } + }, + "node_modules/chromium-edge-launcher": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/chromium-edge-launcher/-/chromium-edge-launcher-0.2.0.tgz", + "integrity": "sha512-JfJjUnq25y9yg4FABRRVPmBGWPZZi+AQXT4mxupb67766/0UlhG8PAZCz6xzEMXTbW3CsSoE8PcCWA49n35mKg==", + "license": "Apache-2.0", + "dependencies": { + "@types/node": "*", + "escape-string-regexp": "^4.0.0", + "is-wsl": "^2.2.0", + "lighthouse-logger": "^1.0.0", + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + } + }, + "node_modules/chromium-edge-launcher/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/class-transformer": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", + "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==", + "license": "MIT", + "peer": true + }, + "node_modules/class-validator": { + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.3.tgz", + "integrity": "sha512-rXXekcjofVN1LTOSw+u4u9WXVEUvNBVjORW154q/IdmYWy1nMbOU9aNtZB0t8m+FJQ9q91jlr2f9CwwUFdFMRA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/validator": "^13.15.3", + "libphonenumber-js": "^1.11.1", + "validator": "^13.15.20" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", + "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", + "dev": true, + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/comment-json": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", + "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.3", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/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/connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/connect/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/connect/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/connect/node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/connect/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/connect/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/connect/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/consola": { + "version": "2.15.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "license": "MIT" + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cosmiconfig": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/dayjs": { + "version": "1.11.19", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/dedent": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz", + "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==", + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT" + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "dev": true, + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "devOptional": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-expand": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz", + "integrity": "sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.267", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz", + "integrity": "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==", + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", + "integrity": "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.2.tgz", + "integrity": "sha512-iI1f+D2ViGn+uvv5HuHVUamg8ll4tN+JRHGc6IJi4TP9Kl976C57fzPXgseXNs8v0iA8aSJpHsTWjDb9QJamGQ==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", + "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.11.7" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/exponential-backoff": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", + "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", + "license": "Apache-2.0" + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/express/node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-dotslash": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/fb-dotslash/-/fb-dotslash-0.5.8.tgz", + "integrity": "sha512-XHYLKk9J4BupDxi9bSEhkfss0m+Vr9ChTrjhf9l2iw3jB5C7BnY4GVPoMcqbrTutsKJso6yj2nAB6BI/F2oZaA==", + "license": "(MIT OR Apache-2.0)", + "bin": { + "dotslash": "bin/dotslash" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "license": "Apache-2.0", + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/file-type": { + "version": "20.4.1", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.4.1.tgz", + "integrity": "sha512-hw9gNZXUfZ02Jo0uafWLaFVPter5/k2rfcrjFJJHX/77xtSDOfJuEFb6oKlFV86FLP1SuyHMW1PSk0U9M5tKkQ==", + "license": "MIT", + "dependencies": { + "@tokenizer/inflate": "^0.2.6", + "strtok3": "^10.2.0", + "token-types": "^6.0.0", + "uint8array-extras": "^1.4.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, + "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/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/flow-enums-runtime": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz", + "integrity": "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==", + "license": "MIT" + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fork-ts-checker-webpack-plugin": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-9.0.2.tgz", + "integrity": "sha512-Uochze2R8peoN1XqlSi/rGUkDQpRogtLFocP9+PGu68zk1BDAKXfdeCdyVZpgTk8V8WFVQXdEz426VKjXLO1Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "chalk": "^4.1.2", + "chokidar": "^3.5.3", + "cosmiconfig": "^8.2.0", + "deepmerge": "^4.2.2", + "fs-extra": "^10.0.0", + "memfs": "^3.4.1", + "minimatch": "^3.0.4", + "node-abort-controller": "^3.0.1", + "schema-utils": "^3.1.1", + "semver": "^7.3.5", + "tapable": "^2.2.1" + }, + "engines": { + "node": ">=12.13.0", + "yarn": ">=1.0.0" + }, + "peerDependencies": { + "typescript": ">3.6.0", + "webpack": "^5.11.0" + } + }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/formidable": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.5.tgz", + "integrity": "sha512-Oz5Hwvwak/DCaXVVUtPn4oLMLLy1CdclLKO1LFgU7XzDpVMUU5UjlSLpGMocyQNNk8F6IJW9M/YdooSn2MRI+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", + "dezalgo": "^1.0.4", + "once": "^1.4.0", + "qs": "^6.11.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/fs-monkey": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.1.0.tgz", + "integrity": "sha512-QMUezzXWII9EV5aTFXW1UBVUO77wYPpjqIF8/AviUCThNeSYZykpoTixUeaNNBwmCev0AMDWMAni+f8Hxb1IFw==", + "dev": true, + "license": "Unlicense" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/gauge/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/handlebars/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC" + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/helmet": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.2.0.tgz", + "integrity": "sha512-ZRiwvN089JfMXokizgqEPXsl2Guk094yExfoDXR0cBYWxtBbaSww/w+vT4WEJsBW2iTUi1GgZ6swmoug3Oy4Xw==", + "license": "MIT", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/hermes-compiler": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-0.14.0.tgz", + "integrity": "sha512-clxa193o+GYYwykWVFfpHduCATz8fR5jvU7ngXpfKHj+E9hr9vjLNtdLSEe8MUbObvVexV3wcyxQ00xTPIrB1Q==", + "license": "MIT" + }, + "node_modules/hermes-estree": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.32.0.tgz", + "integrity": "sha512-KWn3BqnlDOl97Xe1Yviur6NbgIZ+IP+UVSpshlZWkq+EtoHg6/cwiDj/osP9PCEgFE15KBm1O55JRwbMEm5ejQ==", + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.32.0.tgz", + "integrity": "sha512-g4nBOWFpuiTqjR3LZdRxKUkij9iyveWeuks7INEsMX741f3r9xxrOe8TeQfUxtda0eXmiIFiMQzoeSQEno33Hw==", + "license": "MIT", + "dependencies": { + "hermes-estree": "0.32.0" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/image-size": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz", + "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==", + "license": "MIT", + "dependencies": { + "queue": "6.0.2" + }, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=16.x" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "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-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/iterare": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", + "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==", + "license": "ISC", + "engines": { + "node": ">=6" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/jest-config/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-config/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/jest-runtime/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-runtime/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/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/jonschlinkert" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsc-safe-url": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", + "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", + "license": "0BSD" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", + "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.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jwa": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", + "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz", + "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==", + "license": "MIT", + "dependencies": { + "jwa": "^1.4.2", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/libphonenumber-js": { + "version": "1.12.31", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.31.tgz", + "integrity": "sha512-Z3IhgVgrqO1S5xPYM3K5XwbkDasU67/Vys4heW+lfSBALcUZjeIIzI8zCLifY+OCzSq+fpDdywMDa7z+4srJPQ==", + "license": "MIT" + }, + "node_modules/lighthouse-logger": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz", + "integrity": "sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==", + "license": "Apache-2.0", + "dependencies": { + "debug": "^2.6.9", + "marky": "^1.2.2" + } + }, + "node_modules/lighthouse-logger/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/lighthouse-logger/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/loader-runner": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz", + "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "devOptional": true, + "license": "ISC" + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/marky": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/marky/-/marky-1.3.0.tgz", + "integrity": "sha512-ocnPZQLNpvbedwTy9kNrQEsknEfgvcLMvOtz3sFeWApDq1MXH1TqkCIx58xlpESsfwQOnuBO9beyQuNGzVvuhQ==", + "license": "Apache-2.0" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "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/memfs": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", + "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==", + "dev": true, + "license": "Unlicense", + "dependencies": { + "fs-monkey": "^1.0.4" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/memoize-one": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", + "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", + "license": "MIT" + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/metro": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.83.3.tgz", + "integrity": "sha512-+rP+/GieOzkt97hSJ0MrPOuAH/jpaS21ZDvL9DJ35QYRDlQcwzcvUlGUf79AnQxq/2NPiS/AULhhM4TKutIt8Q==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/core": "^7.25.2", + "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.3", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.3", + "@babel/types": "^7.25.2", + "accepts": "^1.3.7", + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "connect": "^3.6.5", + "debug": "^4.4.0", + "error-stack-parser": "^2.0.6", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "hermes-parser": "0.32.0", + "image-size": "^1.0.2", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "jsc-safe-url": "^0.2.2", + "lodash.throttle": "^4.1.1", + "metro-babel-transformer": "0.83.3", + "metro-cache": "0.83.3", + "metro-cache-key": "0.83.3", + "metro-config": "0.83.3", + "metro-core": "0.83.3", + "metro-file-map": "0.83.3", + "metro-resolver": "0.83.3", + "metro-runtime": "0.83.3", + "metro-source-map": "0.83.3", + "metro-symbolicate": "0.83.3", + "metro-transform-plugins": "0.83.3", + "metro-transform-worker": "0.83.3", + "mime-types": "^2.1.27", + "nullthrows": "^1.1.1", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", + "throat": "^5.0.0", + "ws": "^7.5.10", + "yargs": "^17.6.2" + }, + "bin": { + "metro": "src/cli.js" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-babel-transformer": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.83.3.tgz", + "integrity": "sha512-1vxlvj2yY24ES1O5RsSIvg4a4WeL7PFXgKOHvXTXiW0deLvQr28ExXj6LjwCCDZ4YZLhq6HddLpZnX4dEdSq5g==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "hermes-parser": "0.32.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-cache": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.83.3.tgz", + "integrity": "sha512-3jo65X515mQJvKqK3vWRblxDEcgY55Sk3w4xa6LlfEXgQ9g1WgMh9m4qVZVwgcHoLy0a2HENTPCCX4Pk6s8c8Q==", + "license": "MIT", + "dependencies": { + "exponential-backoff": "^3.1.1", + "flow-enums-runtime": "^0.0.6", + "https-proxy-agent": "^7.0.5", + "metro-core": "0.83.3" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-cache-key": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.83.3.tgz", + "integrity": "sha512-59ZO049jKzSmvBmG/B5bZ6/dztP0ilp0o988nc6dpaDsU05Cl1c/lRf+yx8m9WW/JVgbmfO5MziBU559XjI5Zw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-cache/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/metro-cache/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/metro-config": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.83.3.tgz", + "integrity": "sha512-mTel7ipT0yNjKILIan04bkJkuCzUUkm2SeEaTads8VfEecCh+ltXchdq6DovXJqzQAXuR2P9cxZB47Lg4klriA==", + "license": "MIT", + "dependencies": { + "connect": "^3.6.5", + "flow-enums-runtime": "^0.0.6", + "jest-validate": "^29.7.0", + "metro": "0.83.3", + "metro-cache": "0.83.3", + "metro-core": "0.83.3", + "metro-runtime": "0.83.3", + "yaml": "^2.6.1" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-core": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.83.3.tgz", + "integrity": "sha512-M+X59lm7oBmJZamc96usuF1kusd5YimqG/q97g4Ac7slnJ3YiGglW5CsOlicTR5EWf8MQFxxjDoB6ytTqRe8Hw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "lodash.throttle": "^4.1.1", + "metro-resolver": "0.83.3" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-file-map": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.83.3.tgz", + "integrity": "sha512-jg5AcyE0Q9Xbbu/4NAwwZkmQn7doJCKGW0SLeSJmzNB9Z24jBe0AL2PHNMy4eu0JiKtNWHz9IiONGZWq7hjVTA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "fb-watchman": "^2.0.0", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "nullthrows": "^1.1.1", + "walker": "^1.0.7" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-minify-terser": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.83.3.tgz", + "integrity": "sha512-O2BmfWj6FSfzBLrNCXt/rr2VYZdX5i6444QJU0fFoc7Ljg+Q+iqebwE3K0eTvkI6TRjELsXk1cjU+fXwAR4OjQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "terser": "^5.15.0" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-resolver": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.83.3.tgz", + "integrity": "sha512-0js+zwI5flFxb1ktmR///bxHYg7OLpRpWZlBBruYG8OKYxeMP7SV0xQ/o/hUelrEMdK4LJzqVtHAhBm25LVfAQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-runtime": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.83.3.tgz", + "integrity": "sha512-JHCJb9ebr9rfJ+LcssFYA2x1qPYuSD/bbePupIGhpMrsla7RCwC/VL3yJ9cSU+nUhU4c9Ixxy8tBta+JbDeZWw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.0", + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-source-map": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.83.3.tgz", + "integrity": "sha512-xkC3qwUBh2psVZgVavo8+r2C9Igkk3DibiOXSAht1aYRRcztEZNFtAMtfSB7sdO2iFMx2Mlyu++cBxz/fhdzQg==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.3", + "@babel/traverse--for-generate-function-map": "npm:@babel/traverse@^7.25.3", + "@babel/types": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-symbolicate": "0.83.3", + "nullthrows": "^1.1.1", + "ob1": "0.83.3", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro-symbolicate": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.83.3.tgz", + "integrity": "sha512-F/YChgKd6KbFK3eUR5HdUsfBqVsanf5lNTwFd4Ca7uuxnHgBC3kR/Hba/RGkenR3pZaGNp5Bu9ZqqP52Wyhomw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-source-map": "0.83.3", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-symbolicate/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro-transform-plugins": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.83.3.tgz", + "integrity": "sha512-eRGoKJU6jmqOakBMH5kUB7VitEWiNrDzBHpYbkBXW7C5fUGeOd2CyqrosEzbMK5VMiZYyOcNFEphvxk3OXey2A==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.3", + "flow-enums-runtime": "^0.0.6", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro-transform-worker": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.83.3.tgz", + "integrity": "sha512-Ztekew9t/gOIMZX1tvJOgX7KlSLL5kWykl0Iwu2cL2vKMKVALRl1hysyhUw0vjpAvLFx+Kfq9VLjnHIkW32fPA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.3", + "@babel/types": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "metro": "0.83.3", + "metro-babel-transformer": "0.83.3", + "metro-cache": "0.83.3", + "metro-cache-key": "0.83.3", + "metro-minify-terser": "0.83.3", + "metro-source-map": "0.83.3", + "metro-transform-plugins": "0.83.3", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/metro/node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "license": "MIT" + }, + "node_modules/metro/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/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/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true, + "license": "ISC" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "license": "MIT" + }, + "node_modules/node-emoji": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", + "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "license": "MIT" + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/nullthrows": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", + "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", + "license": "MIT" + }, + "node_modules/ob1": { + "version": "0.83.3", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.83.3.tgz", + "integrity": "sha512-egUxXCDwoWG06NGCS5s5AdcpnumHKJlfd3HH06P3m9TEMwwScfcY35wpQxbm9oHof+dM/lVH9Rfyu1elTVelSA==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=20.19.4" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/passport": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/passport/-/passport-0.7.0.tgz", + "integrity": "sha512-cPLl+qZpSc+ireUvt+IzqbED1cHHkDoVYMo30jbJIdOOjQ1MQYZBPiNvmi8UM6lJuOpTPXJGZQk0DtC4y61MYQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "passport-strategy": "1.x.x", + "pause": "0.0.1", + "utils-merge": "^1.0.1" + }, + "engines": { + "node": ">= 0.4.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jaredhanson" + } + }, + "node_modules/passport-jwt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/passport-jwt/-/passport-jwt-4.0.1.tgz", + "integrity": "sha512-UCKMDYhNuGOBE9/9Ycuoyh7vP6jpeTp/+sfMJl7nLff/t6dps+iaeE0hhNkKN8/HZHcJ7lCdOyDxHdDoxoSvdQ==", + "license": "MIT", + "dependencies": { + "jsonwebtoken": "^9.0.0", + "passport-strategy": "^1.0.0" + } + }, + "node_modules/passport-strategy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/path-to-regexp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" + }, + "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", + "peer": true, + "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/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.1.tgz", + "integrity": "sha512-xUXwsxNjwTQ8K3GnT4pCJm+xq3RUPQbmkYJTP5aFIfNIvbcc/4MUxgBaaRSZJ6yGJZiGSyYlM6MzwTsRk8SYCg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz", + "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "license": "MIT", + "dependencies": { + "asap": "~2.0.6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", + "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", + "license": "MIT", + "dependencies": { + "inherits": "~2.0.3" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "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/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", + "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-devtools-core": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-6.1.5.tgz", + "integrity": "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA==", + "license": "MIT", + "dependencies": { + "shell-quote": "^1.6.1", + "ws": "^7" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-native": { + "version": "0.83.1", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.83.1.tgz", + "integrity": "sha512-mL1q5HPq5cWseVhWRLl+Fwvi5z1UO+3vGOpjr+sHFwcUletPRZ5Kv+d0tUfqHmvi73/53NjlQqX1Pyn4GguUfA==", + "license": "MIT", + "dependencies": { + "@jest/create-cache-key-function": "^29.7.0", + "@react-native/assets-registry": "0.83.1", + "@react-native/codegen": "0.83.1", + "@react-native/community-cli-plugin": "0.83.1", + "@react-native/gradle-plugin": "0.83.1", + "@react-native/js-polyfills": "0.83.1", + "@react-native/normalize-colors": "0.83.1", + "@react-native/virtualized-lists": "0.83.1", + "abort-controller": "^3.0.0", + "anser": "^1.4.9", + "ansi-regex": "^5.0.0", + "babel-jest": "^29.7.0", + "babel-plugin-syntax-hermes-parser": "0.32.0", + "base64-js": "^1.5.1", + "commander": "^12.0.0", + "flow-enums-runtime": "^0.0.6", + "glob": "^7.1.1", + "hermes-compiler": "0.14.0", + "invariant": "^2.2.4", + "jest-environment-node": "^29.7.0", + "memoize-one": "^5.0.0", + "metro-runtime": "^0.83.3", + "metro-source-map": "^0.83.3", + "nullthrows": "^1.1.1", + "pretty-format": "^29.7.0", + "promise": "^8.3.0", + "react-devtools-core": "^6.1.5", + "react-refresh": "^0.14.0", + "regenerator-runtime": "^0.13.2", + "scheduler": "0.27.0", + "semver": "^7.1.3", + "stacktrace-parser": "^0.1.10", + "whatwg-fetch": "^3.0.0", + "ws": "^7.5.10", + "yargs": "^17.6.2" + }, + "bin": { + "react-native": "cli.js" + }, + "engines": { + "node": ">= 20.19.4" + }, + "peerDependencies": { + "@types/react": "^19.1.1", + "react": "^19.2.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-native/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/react-native/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/react-native/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/react-native/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/react-refresh": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", + "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "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", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/readdirp/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "license": "MIT" + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sha.js": { + "version": "2.4.12", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", + "integrity": "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==", + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.0" + }, + "bin": { + "sha.js": "bin.js" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, + "node_modules/sql-highlight": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sql-highlight/-/sql-highlight-6.1.0.tgz", + "integrity": "sha512-ed7OK4e9ywpE7pgRMkMQmZDPKSVdm0oX5IEtZiKnFucSF0zu6c80GZBe38UqHuVhTWJ9xsKgSMjCG2bml86KvA==", + "funding": [ + "https://github.com/scriptcoded/sql-highlight?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/scriptcoded" + } + ], + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "license": "MIT" + }, + "node_modules/stacktrace-parser": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", + "integrity": "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/stacktrace-parser/node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stripe": { + "version": "20.1.1", + "resolved": "https://registry.npmjs.org/stripe/-/stripe-20.1.1.tgz", + "integrity": "sha512-yD2jgS2QfqQOXxF3ByB/BcRTGChor/OxhK1211AvQPkzkTV7qCg7z/whOdhNCX0AZkNjBpicoViqC5TMvaxM9w==", + "license": "MIT", + "dependencies": { + "qs": "^6.14.1" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@types/node": ">=16" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/stripe/node_modules/qs": { + "version": "6.14.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", + "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strtok3": { + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz", + "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==", + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/superagent": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", + "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", + "deprecated": "Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net", + "dev": true, + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.4", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.1.2", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.0", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=6.4.0 <13 || >=14" + } + }, + "node_modules/superagent/node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/supertest": { + "version": "6.3.4", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.4.tgz", + "integrity": "sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==", + "deprecated": "Please upgrade to supertest v7.1.3+, see release notes at https://github.com/forwardemail/supertest/releases/tag/v7.1.3 - maintenance is supported by Forward Email @ https://forwardemail.net", + "dev": true, + "license": "MIT", + "dependencies": { + "methods": "^1.1.2", + "superagent": "^8.1.2" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/swagger-ui-dist": { + "version": "5.17.14", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.17.14.tgz", + "integrity": "sha512-CVbSfaLpstV65OnSjbXfVd6Sta3q3F7Cj/yYuvHMp1P90LztOLs6PfUnKEVAeiIVQt9u2SaPwv0LiH/OyMjHRw==", + "license": "Apache-2.0" + }, + "node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/synckit": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, + "node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/terser": { + "version": "5.44.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", + "integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==", + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.15", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.15.tgz", + "integrity": "sha512-PGkOdpRFK+rb1TzVz+msVhw4YMRT9txLF4kRqvJhGhCM324xuR3REBSHALN+l+sAhKUmz0aotnjp5D+P83mLhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "jest-worker": "^27.4.5", + "schema-utils": "^4.3.0", + "serialize-javascript": "^6.0.2", + "terser": "^5.31.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/terser-webpack-plugin/node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/terser-webpack-plugin/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "license": "MIT" + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "license": "BSD-3-Clause" + }, + "node_modules/to-buffer": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz", + "integrity": "sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==", + "license": "MIT", + "dependencies": { + "isarray": "^2.0.5", + "safe-buffer": "^5.2.1", + "typed-array-buffer": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/token-types": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", + "license": "MIT", + "dependencies": { + "@borewit/text-codec": "^0.1.0", + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-jest": { + "version": "29.4.6", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.6.tgz", + "integrity": "sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "^0.2.6", + "fast-json-stable-stringify": "^2.1.0", + "handlebars": "^4.7.8", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.7.3", + "type-fest": "^4.41.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0 || ^30.0.0", + "@jest/types": "^29.0.0 || ^30.0.0", + "babel-jest": "^29.0.0 || ^30.0.0", + "jest": "^29.0.0 || ^30.0.0", + "jest-util": "^29.0.0 || ^30.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jest-util": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ts-loader": { + "version": "9.5.4", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.4.tgz", + "integrity": "sha512-nCz0rEwunlTZiy6rXFByQU1kVVpCIgUpc/psFiKVrUwrizdnIbRFu8w7bxhUF0X613DYwT4XzrZHpVyMe758hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4", + "source-map": "^0.7.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "typescript": "*", + "webpack": "^5.0.0" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "devOptional": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tsconfig-paths-webpack-plugin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.2.0.tgz", + "integrity": "sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.7.0", + "tapable": "^2.2.1", + "tsconfig-paths": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, + "node_modules/typeorm": { + "version": "0.3.28", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.28.tgz", + "integrity": "sha512-6GH7wXhtfq2D33ZuRXYwIsl/qM5685WZcODZb7noOOcRMteM9KF2x2ap3H0EBjnSV0VO4gNAfJT5Ukp0PkOlvg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@sqltools/formatter": "^1.2.5", + "ansis": "^4.2.0", + "app-root-path": "^3.1.0", + "buffer": "^6.0.3", + "dayjs": "^1.11.19", + "debug": "^4.4.3", + "dedent": "^1.7.0", + "dotenv": "^16.6.1", + "glob": "^10.5.0", + "reflect-metadata": "^0.2.2", + "sha.js": "^2.4.12", + "sql-highlight": "^6.1.0", + "tslib": "^2.8.1", + "uuid": "^11.1.0", + "yargs": "^17.7.2" + }, + "bin": { + "typeorm": "cli.js", + "typeorm-ts-node-commonjs": "cli-ts-node-commonjs.js", + "typeorm-ts-node-esm": "cli-ts-node-esm.js" + }, + "engines": { + "node": ">=16.13.0" + }, + "funding": { + "url": "https://opencollective.com/typeorm" + }, + "peerDependencies": { + "@google-cloud/spanner": "^5.18.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "@sap/hana-client": "^2.14.22", + "better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0", + "ioredis": "^5.0.4", + "mongodb": "^5.8.0 || ^6.0.0", + "mssql": "^9.1.1 || ^10.0.0 || ^11.0.0 || ^12.0.0", + "mysql2": "^2.2.5 || ^3.0.1", + "oracledb": "^6.3.0", + "pg": "^8.5.1", + "pg-native": "^3.0.0", + "pg-query-stream": "^4.0.0", + "redis": "^3.1.1 || ^4.0.0 || ^5.0.14", + "sql.js": "^1.4.0", + "sqlite3": "^5.0.3", + "ts-node": "^10.7.0", + "typeorm-aurora-data-api-driver": "^2.0.0 || ^3.0.0" + }, + "peerDependenciesMeta": { + "@google-cloud/spanner": { + "optional": true + }, + "@sap/hana-client": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "mongodb": { + "optional": true + }, + "mssql": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-native": { + "optional": true + }, + "pg-query-stream": { + "optional": true + }, + "redis": { + "optional": true + }, + "sql.js": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "ts-node": { + "optional": true + }, + "typeorm-aurora-data-api-driver": { + "optional": true + } + } + }, + "node_modules/typeorm/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/typeorm/node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/typeorm/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typeorm/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typeorm/node_modules/uuid": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/uid": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", + "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", + "license": "MIT", + "dependencies": { + "@lukeed/csprng": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/uint8array-extras": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.2.tgz", + "integrity": "sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "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", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validator": { + "version": "13.15.23", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.23.tgz", + "integrity": "sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vlq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", + "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", + "license": "MIT" + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/watchpack": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.4.tgz", + "integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/webpack": { + "version": "5.103.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.103.0.tgz", + "integrity": "sha512-HU1JOuV1OavsZ+mfigY0j8d1TgQgbZ6M+J75zDkpEAwYeXjWSqrGJtgnPblJjd/mAyTNQ7ygw0MiKOn6etz8yw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.8", + "@types/json-schema": "^7.0.15", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.15.0", + "acorn-import-phases": "^1.0.3", + "browserslist": "^4.26.3", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.3", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.3.1", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^4.3.3", + "tapable": "^2.3.0", + "terser-webpack-plugin": "^5.3.11", + "watchpack": "^2.4.4", + "webpack-sources": "^3.3.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-node-externals": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz", + "integrity": "sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/webpack-sources": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz", + "integrity": "sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/webpack/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/webpack/node_modules/schema-utils": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/whatwg-fetch": { + "version": "3.6.20", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", + "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", + "license": "MIT" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-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/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..c09ba4c --- /dev/null +++ b/package.json @@ -0,0 +1,91 @@ +{ + "name": "michangarrito-backend", + "version": "1.0.0", + "description": "MiChangarrito - POS inteligente para micro-negocios con WhatsApp y LLM", + "author": "ISEM", + "private": true, + "license": "MIT", + "scripts": { + "build": "nest build", + "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "start": "nest start", + "start:dev": "nest start --watch", + "start:debug": "nest start --debug --watch", + "start:prod": "node dist/main", + "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", + "test": "jest", + "test:watch": "jest --watch", + "test:cov": "jest --coverage", + "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", + "test:e2e": "jest --config ./test/jest-e2e.json", + "typeorm": "typeorm-ts-node-commonjs", + "migration:generate": "npm run typeorm -- migration:generate -d src/database/data-source.ts", + "migration:run": "npm run typeorm -- migration:run -d src/database/data-source.ts", + "migration:revert": "npm run typeorm -- migration:revert -d src/database/data-source.ts" + }, + "dependencies": { + "@nestjs/common": "^11.1.0", + "@nestjs/config": "^3.3.0", + "@nestjs/core": "^11.1.0", + "@nestjs/jwt": "^11.0.1", + "@nestjs/passport": "^11.0.5", + "@nestjs/platform-express": "^11.1.0", + "@nestjs/swagger": "^8.1.0", + "@nestjs/typeorm": "^11.0.0", + "@react-native-community/netinfo": "^11.4.1", + "bcrypt": "^5.1.1", + "class-transformer": "^0.5.1", + "class-validator": "^0.14.2", + "helmet": "^8.0.0", + "passport": "^0.7.0", + "passport-jwt": "^4.0.1", + "pg": "^8.13.0", + "reflect-metadata": "^0.2.2", + "rxjs": "^7.8.1", + "stripe": "^20.1.1", + "typeorm": "^0.3.22", + "uuid": "^11.0.0" + }, + "devDependencies": { + "@nestjs/cli": "^11.0.0", + "@nestjs/schematics": "^11.0.0", + "@nestjs/testing": "^11.1.0", + "@types/bcrypt": "^5.0.2", + "@types/express": "^4.17.21", + "@types/jest": "^29.5.11", + "@types/node": "^20.10.8", + "@types/passport-jwt": "^4.0.0", + "@types/uuid": "^9.0.7", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.19.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", + "jest": "^29.7.0", + "prettier": "^3.2.4", + "source-map-support": "^0.5.21", + "supertest": "^6.3.4", + "ts-jest": "^29.1.1", + "ts-loader": "^9.5.1", + "ts-node": "^10.9.2", + "tsconfig-paths": "^4.2.0", + "typescript": "^5.3.3" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "json", + "ts" + ], + "rootDir": "src", + "testRegex": ".*\\.spec\\.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + }, + "collectCoverageFrom": [ + "**/*.(t|j)s" + ], + "coverageDirectory": "../coverage", + "testEnvironment": "node" + } +} diff --git a/src/app.module.ts b/src/app.module.ts new file mode 100644 index 0000000..33fb69a --- /dev/null +++ b/src/app.module.ts @@ -0,0 +1,69 @@ +import { Module } from '@nestjs/common'; +import { ConfigModule, ConfigService } from '@nestjs/config'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { AuthModule } from './modules/auth/auth.module'; +import { ProductsModule } from './modules/products/products.module'; +import { CategoriesModule } from './modules/categories/categories.module'; +import { SalesModule } from './modules/sales/sales.module'; +import { PaymentsModule } from './modules/payments/payments.module'; +import { CustomersModule } from './modules/customers/customers.module'; +import { InventoryModule } from './modules/inventory/inventory.module'; +import { OrdersModule } from './modules/orders/orders.module'; +import { SubscriptionsModule } from './modules/subscriptions/subscriptions.module'; +import { MessagingModule } from './modules/messaging/messaging.module'; +import { BillingModule } from './modules/billing/billing.module'; +import { IntegrationsModule } from './modules/integrations/integrations.module'; +import { ReferralsModule } from './modules/referrals/referrals.module'; +import { CodiSpeiModule } from './modules/codi-spei/codi-spei.module'; +import { WidgetsModule } from './modules/widgets/widgets.module'; +import { InvoicesModule } from './modules/invoices/invoices.module'; +import { MarketplaceModule } from './modules/marketplace/marketplace.module'; + +@Module({ + imports: [ + // Configuration + ConfigModule.forRoot({ + isGlobal: true, + envFilePath: ['.env.local', '.env'], + }), + + // Database + TypeOrmModule.forRootAsync({ + imports: [ConfigModule], + inject: [ConfigService], + useFactory: (configService: ConfigService) => ({ + type: 'postgres', + host: configService.get('DB_HOST', 'localhost'), + port: configService.get('DB_PORT', 5432), + username: configService.get('DB_USERNAME', 'michangarrito_dev'), + password: configService.get('DB_PASSWORD', 'MCh_dev_2025_secure'), + database: configService.get('DB_DATABASE', 'michangarrito_dev'), + schema: configService.get('DB_SCHEMA', 'public'), + autoLoadEntities: true, + synchronize: false, // Disabled - using manual SQL schemas + logging: configService.get('NODE_ENV') === 'development', + ssl: configService.get('DB_SSL') === 'true' ? { rejectUnauthorized: false } : false, + }), + }), + + // Feature Modules + AuthModule, + ProductsModule, + CategoriesModule, + SalesModule, + PaymentsModule, + CustomersModule, + InventoryModule, + OrdersModule, + SubscriptionsModule, + MessagingModule, + BillingModule, + IntegrationsModule, + ReferralsModule, + CodiSpeiModule, + WidgetsModule, + InvoicesModule, + MarketplaceModule, + ], +}) +export class AppModule {} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..ed8921b --- /dev/null +++ b/src/main.ts @@ -0,0 +1,80 @@ +import { NestFactory } from '@nestjs/core'; +import { ValidationPipe } from '@nestjs/common'; +import { ConfigService } from '@nestjs/config'; +import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; +import helmet from 'helmet'; +import { AppModule } from './app.module'; + +async function bootstrap() { + const app = await NestFactory.create(AppModule); + const configService = app.get(ConfigService); + + // Security + app.use(helmet()); + + // CORS + app.enableCors({ + origin: configService.get('CORS_ORIGIN', 'http://localhost:3140'), + credentials: true, + }); + + // Global prefix (without versioning - controllers define their own version) + app.setGlobalPrefix('api'); + + // Validation + app.useGlobalPipes( + new ValidationPipe({ + whitelist: true, + forbidNonWhitelisted: true, + transform: true, + transformOptions: { + enableImplicitConversion: true, + }, + }), + ); + + // Swagger Documentation + const config = new DocumentBuilder() + .setTitle('MiChangarrito API') + .setDescription( + 'POS inteligente para micro-negocios con integración WhatsApp y LLM. Target: Changarros, tienditas, fondas.', + ) + .setVersion('1.0') + .addBearerAuth() + .addTag('auth', 'Autenticación y registro') + .addTag('products', 'Gestión de productos') + .addTag('categories', 'Categorías de productos') + .addTag('sales', 'Ventas y tickets') + .addTag('inventory', 'Control de inventario') + .addTag('customers', 'Clientes y fiados') + .addTag('orders', 'Pedidos por WhatsApp') + .addTag('payments', 'Métodos de pago') + .addTag('subscriptions', 'Planes y tokens') + .addTag('messaging', 'WhatsApp y notificaciones') + .addTag('reports', 'Reportes y analytics') + .build(); + + const document = SwaggerModule.createDocument(app, config); + SwaggerModule.setup('docs', app, document, { + swaggerOptions: { + persistAuthorization: true, + }, + }); + + const port = configService.get('PORT', 3000); + await app.listen(port); + + console.log(` +╔══════════════════════════════════════════════════════════════╗ +║ MICHANGARRITO API ║ +║ POS Inteligente para Micro-Negocios ║ +╠══════════════════════════════════════════════════════════════╣ +║ Status: Running ║ +║ Port: ${port} ║ +║ Environment: ${configService.get('NODE_ENV', 'development')} ║ +║ Docs: http://localhost:${port}/docs ║ +╚══════════════════════════════════════════════════════════════╝ + `); +} + +bootstrap(); diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts new file mode 100644 index 0000000..c3cdcc8 --- /dev/null +++ b/src/modules/auth/auth.controller.ts @@ -0,0 +1,110 @@ +import { + Controller, + Post, + Body, + HttpCode, + HttpStatus, + UseGuards, + Request, +} from '@nestjs/common'; +import { + ApiTags, + ApiOperation, + ApiResponse, + ApiBearerAuth, +} from '@nestjs/swagger'; +import { AuthService } from './auth.service'; +import { RegisterDto, LoginDto, RefreshTokenDto } from './dto/register.dto'; +import { JwtAuthGuard } from './guards/jwt-auth.guard'; + +@ApiTags('auth') +@Controller('v1/auth') +export class AuthController { + constructor(private readonly authService: AuthService) {} + + @Post('register') + @ApiOperation({ + summary: 'Registrar nuevo negocio', + description: 'Crea un nuevo tenant y usuario con periodo de prueba de 14 días', + }) + @ApiResponse({ + status: 201, + description: 'Registro exitoso', + schema: { + properties: { + accessToken: { type: 'string' }, + refreshToken: { type: 'string' }, + user: { + type: 'object', + properties: { + id: { type: 'string' }, + name: { type: 'string' }, + isOwner: { type: 'boolean' }, + }, + }, + tenant: { + type: 'object', + properties: { + id: { type: 'string' }, + businessName: { type: 'string' }, + plan: { type: 'string' }, + subscriptionStatus: { type: 'string' }, + trialEndsAt: { type: 'string', format: 'date-time' }, + }, + }, + }, + }, + }) + @ApiResponse({ status: 409, description: 'Teléfono ya registrado' }) + async register(@Body() dto: RegisterDto) { + return this.authService.register(dto); + } + + @Post('login') + @HttpCode(HttpStatus.OK) + @ApiOperation({ + summary: 'Iniciar sesión', + description: 'Autenticación con teléfono y PIN', + }) + @ApiResponse({ + status: 200, + description: 'Login exitoso', + }) + @ApiResponse({ status: 401, description: 'Credenciales inválidas' }) + async login(@Body() dto: LoginDto) { + return this.authService.login(dto); + } + + @Post('refresh') + @HttpCode(HttpStatus.OK) + @ApiOperation({ + summary: 'Refrescar token', + description: 'Obtiene un nuevo access token usando el refresh token', + }) + @ApiResponse({ + status: 200, + description: 'Token refrescado exitosamente', + }) + @ApiResponse({ status: 401, description: 'Token inválido o expirado' }) + async refreshToken(@Body() dto: RefreshTokenDto) { + return this.authService.refreshToken(dto.refreshToken); + } + + @Post('change-pin') + @UseGuards(JwtAuthGuard) + @ApiBearerAuth() + @HttpCode(HttpStatus.OK) + @ApiOperation({ + summary: 'Cambiar PIN', + description: 'Cambiar el PIN de acceso', + }) + @ApiResponse({ status: 200, description: 'PIN cambiado exitosamente' }) + @ApiResponse({ status: 401, description: 'PIN actual incorrecto' }) + async changePin( + @Request() req: { user: { sub: string } }, + @Body() body: { currentPin: string; newPin: string }, + ) { + await this.authService.changePin(req.user.sub, body.currentPin, body.newPin); + return { message: 'PIN cambiado exitosamente' }; + } +} diff --git a/src/modules/auth/auth.module.ts b/src/modules/auth/auth.module.ts new file mode 100644 index 0000000..8dd49e6 --- /dev/null +++ b/src/modules/auth/auth.module.ts @@ -0,0 +1,32 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { JwtModule } from '@nestjs/jwt'; +import { PassportModule } from '@nestjs/passport'; +import { ConfigModule, ConfigService } from '@nestjs/config'; +import { AuthController } from './auth.controller'; +import { AuthService } from './auth.service'; +import { Tenant } from './entities/tenant.entity'; +import { User } from './entities/user.entity'; +import { JwtStrategy } from './strategies/jwt.strategy'; +import { JwtAuthGuard } from './guards/jwt-auth.guard'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([Tenant, User]), + PassportModule.register({ defaultStrategy: 'jwt' }), + JwtModule.registerAsync({ + imports: [ConfigModule], + inject: [ConfigService], + useFactory: (configService: ConfigService) => ({ + secret: configService.get('JWT_SECRET'), + signOptions: { + expiresIn: configService.get('JWT_EXPIRES_IN', '24h'), + }, + }), + }), + ], + controllers: [AuthController], + providers: [AuthService, JwtStrategy, JwtAuthGuard], + exports: [AuthService, JwtAuthGuard, TypeOrmModule], +}) +export class AuthModule {} diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.ts new file mode 100644 index 0000000..67bf831 --- /dev/null +++ b/src/modules/auth/auth.service.ts @@ -0,0 +1,252 @@ +import { + Injectable, + ConflictException, + UnauthorizedException, + BadRequestException, +} from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { JwtService } from '@nestjs/jwt'; +import { ConfigService } from '@nestjs/config'; +import * as bcrypt from 'bcrypt'; +import { Tenant } from './entities/tenant.entity'; +import { User } from './entities/user.entity'; +import { RegisterDto, LoginDto } from './dto/register.dto'; + +export interface TokenPayload { + sub: string; + tenantId: string; + phone: string; + role: string; +} + +export interface AuthResponse { + accessToken: string; + refreshToken: string; + user: { + id: string; + name: string; + role: string; + phone: string; + }; + tenant: { + id: string; + name: string; + slug: string; + businessType: string; + subscriptionStatus: string; + }; +} + +@Injectable() +export class AuthService { + constructor( + @InjectRepository(Tenant) + private readonly tenantRepository: Repository, + @InjectRepository(User) + private readonly userRepository: Repository, + private readonly jwtService: JwtService, + private readonly configService: ConfigService, + ) {} + + private generateSlug(name: string): string { + return name + .toLowerCase() + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .replace(/[^a-z0-9]+/g, '-') + .replace(/(^-|-$)/g, '') + .substring(0, 45) + '-' + Date.now().toString(36).slice(-4); + } + + async register(dto: RegisterDto): Promise { + // Check if phone already registered + const existingTenant = await this.tenantRepository.findOne({ + where: { phone: dto.phone }, + }); + + if (existingTenant) { + throw new ConflictException('Este teléfono ya está registrado'); + } + + // Hash PIN + const pinHash = await bcrypt.hash(dto.pin, 10); + + // Generate unique slug + const slug = this.generateSlug(dto.name); + + // Create tenant + const tenant = this.tenantRepository.create({ + name: dto.name, + slug, + businessType: dto.businessType, + phone: dto.phone, + email: dto.email, + address: dto.address, + city: dto.city, + whatsappNumber: dto.whatsapp || dto.phone, + subscriptionStatus: 'trial', + status: 'active', + }); + + const savedTenant = await this.tenantRepository.save(tenant); + + // Create user (owner) + const user = this.userRepository.create({ + tenantId: savedTenant.id, + phone: dto.phone, + name: dto.ownerName, + pinHash, + role: 'owner', + status: 'active', + }); + + const savedUser = await this.userRepository.save(user); + + // Generate tokens + return this.generateTokens(savedUser, savedTenant); + } + + async login(dto: LoginDto): Promise { + // Find user by phone (users table has phone) + const user = await this.userRepository.findOne({ + where: { phone: dto.phone }, + }); + + if (!user) { + throw new UnauthorizedException('Teléfono o PIN incorrectos'); + } + + // Find tenant + const tenant = await this.tenantRepository.findOne({ + where: { id: user.tenantId }, + }); + + if (!tenant) { + throw new UnauthorizedException('Teléfono o PIN incorrectos'); + } + + // Check subscription status + if (tenant.subscriptionStatus === 'cancelled') { + throw new UnauthorizedException('Tu suscripción ha sido cancelada'); + } + + if (tenant.subscriptionStatus === 'suspended' || tenant.status === 'suspended') { + throw new UnauthorizedException('Tu cuenta está suspendida. Contacta soporte.'); + } + + // Check user status + if (user.status !== 'active') { + throw new UnauthorizedException('Tu cuenta está inactiva'); + } + + // Check if locked + if (user.lockedUntil && user.lockedUntil > new Date()) { + throw new UnauthorizedException('Cuenta bloqueada temporalmente. Intenta más tarde.'); + } + + // Verify PIN + const isValidPin = await bcrypt.compare(dto.pin, user.pinHash); + + if (!isValidPin) { + // Increment failed attempts + user.failedAttempts = (user.failedAttempts || 0) + 1; + if (user.failedAttempts >= 5) { + user.lockedUntil = new Date(Date.now() + 15 * 60 * 1000); // 15 minutes + } + await this.userRepository.save(user); + throw new UnauthorizedException('Teléfono o PIN incorrectos'); + } + + // Reset failed attempts and update last login + user.failedAttempts = 0; + user.lockedUntil = null; + user.lastLoginAt = new Date(); + await this.userRepository.save(user); + + // Generate tokens + return this.generateTokens(user, tenant); + } + + async refreshToken(refreshToken: string): Promise { + try { + const payload = this.jwtService.verify(refreshToken, { + secret: this.configService.get('JWT_SECRET'), + }); + + const user = await this.userRepository.findOne({ + where: { id: payload.sub }, + }); + + if (!user) { + throw new UnauthorizedException('Token inválido'); + } + + const tenant = await this.tenantRepository.findOne({ + where: { id: user.tenantId }, + }); + + if (!tenant) { + throw new UnauthorizedException('Token inválido'); + } + + return this.generateTokens(user, tenant); + } catch { + throw new UnauthorizedException('Token inválido o expirado'); + } + } + + async changePin(userId: string, currentPin: string, newPin: string): Promise { + const user = await this.userRepository.findOne({ + where: { id: userId }, + }); + + if (!user) { + throw new BadRequestException('Usuario no encontrado'); + } + + const isValidPin = await bcrypt.compare(currentPin, user.pinHash); + + if (!isValidPin) { + throw new UnauthorizedException('PIN actual incorrecto'); + } + + user.pinHash = await bcrypt.hash(newPin, 10); + await this.userRepository.save(user); + } + + private generateTokens(user: User, tenant: Tenant): AuthResponse { + const payload: TokenPayload = { + sub: user.id, + tenantId: tenant.id, + phone: user.phone, + role: user.role, + }; + + const accessToken = this.jwtService.sign(payload, { + expiresIn: this.configService.get('JWT_EXPIRES_IN', '24h'), + }); + + const refreshToken = this.jwtService.sign(payload, { + expiresIn: this.configService.get('JWT_REFRESH_EXPIRES_IN', '7d'), + }); + + return { + accessToken, + refreshToken, + user: { + id: user.id, + name: user.name, + role: user.role, + phone: user.phone, + }, + tenant: { + id: tenant.id, + name: tenant.name, + slug: tenant.slug, + businessType: tenant.businessType, + subscriptionStatus: tenant.subscriptionStatus, + }, + }; + } +} diff --git a/src/modules/auth/dto/register.dto.ts b/src/modules/auth/dto/register.dto.ts new file mode 100644 index 0000000..a3566e5 --- /dev/null +++ b/src/modules/auth/dto/register.dto.ts @@ -0,0 +1,144 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { + IsString, + IsNotEmpty, + MinLength, + MaxLength, + IsOptional, + IsEmail, + Matches, +} from 'class-validator'; + +export class RegisterDto { + @ApiProperty({ + description: 'Nombre del negocio', + example: 'Tacos El Güero', + minLength: 2, + maxLength: 100, + }) + @IsString() + @IsNotEmpty() + @MinLength(2) + @MaxLength(100) + name: string; + + @ApiProperty({ + description: 'Nombre del propietario', + example: 'Juan Pérez', + minLength: 2, + maxLength: 100, + }) + @IsString() + @IsNotEmpty() + @MinLength(2) + @MaxLength(100) + ownerName: string; + + @ApiProperty({ + description: 'Tipo de negocio', + example: 'tiendita', + enum: ['tiendita', 'fonda', 'taqueria', 'abarrotes', 'tortilleria', 'otro'], + }) + @IsString() + @IsNotEmpty() + @MaxLength(50) + businessType: string; + + @ApiProperty({ + description: 'Teléfono (10 dígitos)', + example: '5512345678', + }) + @IsString() + @IsNotEmpty() + @Matches(/^[0-9]{10}$/, { + message: 'El teléfono debe tener exactamente 10 dígitos', + }) + phone: string; + + @ApiProperty({ + description: 'PIN de acceso rápido (4-6 dígitos)', + example: '1234', + minLength: 4, + maxLength: 6, + }) + @IsString() + @IsNotEmpty() + @Matches(/^[0-9]{4,6}$/, { + message: 'El PIN debe tener entre 4 y 6 dígitos', + }) + pin: string; + + @ApiProperty({ + description: 'Número de WhatsApp (opcional)', + example: '5512345678', + required: false, + }) + @IsOptional() + @IsString() + @Matches(/^[0-9]{10}$/, { + message: 'El WhatsApp debe tener exactamente 10 dígitos', + }) + whatsapp?: string; + + @ApiProperty({ + description: 'Email (opcional)', + example: 'juan@ejemplo.com', + required: false, + }) + @IsOptional() + @IsEmail({}, { message: 'Email inválido' }) + email?: string; + + @ApiProperty({ + description: 'Dirección del negocio (opcional)', + example: 'Calle Principal #123, Colonia Centro', + required: false, + }) + @IsOptional() + @IsString() + @MaxLength(500) + address?: string; + + @ApiProperty({ + description: 'Ciudad (opcional)', + example: 'Ciudad de México', + required: false, + }) + @IsOptional() + @IsString() + @MaxLength(50) + city?: string; +} + +export class LoginDto { + @ApiProperty({ + description: 'Teléfono registrado', + example: '5512345678', + }) + @IsString() + @IsNotEmpty() + @Matches(/^[0-9]{10}$/, { + message: 'El teléfono debe tener exactamente 10 dígitos', + }) + phone: string; + + @ApiProperty({ + description: 'PIN de acceso', + example: '1234', + }) + @IsString() + @IsNotEmpty() + @Matches(/^[0-9]{4,6}$/, { + message: 'El PIN debe tener entre 4 y 6 dígitos', + }) + pin: string; +} + +export class RefreshTokenDto { + @ApiProperty({ + description: 'Token de refresco', + }) + @IsString() + @IsNotEmpty() + refreshToken: string; +} diff --git a/src/modules/auth/entities/tenant.entity.ts b/src/modules/auth/entities/tenant.entity.ts new file mode 100644 index 0000000..196b996 --- /dev/null +++ b/src/modules/auth/entities/tenant.entity.ts @@ -0,0 +1,113 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + OneToMany, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { User } from './user.entity'; + +export enum SubscriptionStatus { + TRIAL = 'trial', + ACTIVE = 'active', + SUSPENDED = 'suspended', + CANCELLED = 'cancelled', +} + +export enum TenantStatus { + ACTIVE = 'active', + INACTIVE = 'inactive', + SUSPENDED = 'suspended', +} + +@Entity({ schema: 'public', name: 'tenants' }) +export class Tenant { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ length: 100 }) + name: string; + + @Column({ length: 50, unique: true }) + slug: string; + + @Column({ name: 'business_type', length: 50 }) + businessType: string; + + @Column({ length: 20 }) + phone: string; + + @Column({ length: 100, nullable: true }) + email: string; + + @Column({ type: 'text', nullable: true }) + address: string; + + @Column({ length: 50, nullable: true }) + city: string; + + @Column({ length: 50, nullable: true }) + state: string; + + @Column({ name: 'zip_code', length: 10, nullable: true }) + zipCode: string; + + @Column({ length: 50, default: 'America/Mexico_City' }) + timezone: string; + + @Column({ length: 3, default: 'MXN' }) + currency: string; + + @Column({ name: 'tax_rate', type: 'decimal', precision: 5, scale: 2, default: 16.0 }) + taxRate: number; + + @Column({ name: 'tax_included', default: true }) + taxIncluded: boolean; + + @Column({ name: 'whatsapp_number', length: 20, nullable: true }) + whatsappNumber: string; + + @Column({ name: 'whatsapp_verified', default: false }) + whatsappVerified: boolean; + + @Column({ name: 'uses_platform_number', default: true }) + usesPlatformNumber: boolean; + + @Column({ name: 'preferred_llm_provider', length: 20, default: 'openai' }) + preferredLlmProvider: string; + + @Column({ name: 'preferred_payment_provider', length: 20, default: 'stripe' }) + preferredPaymentProvider: string; + + @Column({ name: 'current_plan_id', type: 'uuid', nullable: true }) + currentPlanId: string; + + @Column({ + name: 'subscription_status', + length: 20, + default: 'trial', + }) + subscriptionStatus: string; + + @Column({ + length: 20, + default: 'active', + }) + status: string; + + @Column({ name: 'onboarding_completed', default: false }) + onboardingCompleted: boolean; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @OneToMany(() => User, (user) => user.tenant) + users: User[]; +} diff --git a/src/modules/auth/entities/user.entity.ts b/src/modules/auth/entities/user.entity.ts new file mode 100644 index 0000000..0399a9a --- /dev/null +++ b/src/modules/auth/entities/user.entity.ts @@ -0,0 +1,78 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Tenant } from './tenant.entity'; + +export enum UserRole { + OWNER = 'owner', + ADMIN = 'admin', + EMPLOYEE = 'employee', +} + +export enum UserStatus { + ACTIVE = 'active', + INACTIVE = 'inactive', + SUSPENDED = 'suspended', +} + +@Entity({ schema: 'auth', name: 'users' }) +export class User { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ length: 20 }) + phone: string; + + @Column({ length: 100, nullable: true }) + email: string; + + @Column({ length: 100 }) + name: string; + + @Column({ name: 'pin_hash', length: 255, nullable: true }) + pinHash: string; + + @Column({ name: 'biometric_enabled', default: false }) + biometricEnabled: boolean; + + @Column({ name: 'biometric_key', type: 'text', nullable: true }) + biometricKey: string; + + @Column({ length: 20, default: 'owner' }) + role: string; + + @Column({ type: 'jsonb', default: {} }) + permissions: Record; + + @Column({ length: 20, default: 'active' }) + status: string; + + @Column({ name: 'last_login_at', type: 'timestamptz', nullable: true }) + lastLoginAt: Date; + + @Column({ name: 'failed_attempts', default: 0 }) + failedAttempts: number; + + @Column({ name: 'locked_until', type: 'timestamptz', nullable: true }) + lockedUntil: Date; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => Tenant, (tenant) => tenant.users) + @JoinColumn({ name: 'tenant_id' }) + tenant: Tenant; +} diff --git a/src/modules/auth/guards/jwt-auth.guard.ts b/src/modules/auth/guards/jwt-auth.guard.ts new file mode 100644 index 0000000..0f4e152 --- /dev/null +++ b/src/modules/auth/guards/jwt-auth.guard.ts @@ -0,0 +1,16 @@ +import { Injectable, ExecutionContext, UnauthorizedException } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; + +@Injectable() +export class JwtAuthGuard extends AuthGuard('jwt') { + canActivate(context: ExecutionContext) { + return super.canActivate(context); + } + + handleRequest(err: Error | null, user: TUser): TUser { + if (err || !user) { + throw err || new UnauthorizedException('Token inválido o expirado'); + } + return user; + } +} diff --git a/src/modules/auth/strategies/jwt.strategy.ts b/src/modules/auth/strategies/jwt.strategy.ts new file mode 100644 index 0000000..00411db --- /dev/null +++ b/src/modules/auth/strategies/jwt.strategy.ts @@ -0,0 +1,39 @@ +import { Injectable, UnauthorizedException } from '@nestjs/common'; +import { PassportStrategy } from '@nestjs/passport'; +import { ExtractJwt, Strategy } from 'passport-jwt'; +import { ConfigService } from '@nestjs/config'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { User } from '../entities/user.entity'; +import { TokenPayload } from '../auth.service'; + +@Injectable() +export class JwtStrategy extends PassportStrategy(Strategy) { + constructor( + private readonly configService: ConfigService, + @InjectRepository(User) + private readonly userRepository: Repository, + ) { + super({ + jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), + ignoreExpiration: false, + secretOrKey: configService.get('JWT_SECRET'), + }); + } + + async validate(payload: TokenPayload) { + const user = await this.userRepository.findOne({ + where: { id: payload.sub }, + }); + + if (!user) { + throw new UnauthorizedException('Usuario no encontrado'); + } + + return { + sub: payload.sub, + tenantId: payload.tenantId, + phone: payload.phone, + }; + } +} diff --git a/src/modules/billing/billing.controller.ts b/src/modules/billing/billing.controller.ts new file mode 100644 index 0000000..b5ac3e4 --- /dev/null +++ b/src/modules/billing/billing.controller.ts @@ -0,0 +1,86 @@ +import { + Controller, + Get, + Post, + Body, + UseGuards, + Request, + Query, +} from '@nestjs/common'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { BillingService } from './billing.service'; + +@Controller('billing') +@UseGuards(JwtAuthGuard) +export class BillingController { + constructor(private readonly billingService: BillingService) {} + + @Get('plans') + async getPlans() { + return this.billingService.getPlans(); + } + + @Get('token-packages') + async getTokenPackages() { + return this.billingService.getTokenPackages(); + } + + @Get('summary') + async getBillingSummary(@Request() req: any) { + return this.billingService.getBillingSummary(req.user.tenantId); + } + + @Get('token-balance') + async getTokenBalance(@Request() req: any) { + const balance = await this.billingService.getTokenBalance(req.user.tenantId); + return balance || { availableTokens: 0, usedTokens: 0, totalTokens: 0 }; + } + + @Get('token-usage') + async getTokenUsage( + @Request() req: any, + @Query('limit') limit?: string + ) { + return this.billingService.getTokenUsageHistory( + req.user.tenantId, + limit ? parseInt(limit, 10) : 50 + ); + } + + @Post('checkout/subscription') + async createSubscriptionCheckout( + @Request() req: any, + @Body() body: { planCode: string; successUrl: string; cancelUrl: string } + ) { + return this.billingService.createSubscriptionCheckout( + req.user.tenantId, + body.planCode, + body.successUrl, + body.cancelUrl + ); + } + + @Post('checkout/tokens') + async createTokenCheckout( + @Request() req: any, + @Body() body: { packageCode: string; successUrl: string; cancelUrl: string } + ) { + return this.billingService.createTokenPurchaseCheckout( + req.user.tenantId, + body.packageCode, + body.successUrl, + body.cancelUrl + ); + } + + @Post('portal') + async createPortalSession( + @Request() req: any, + @Body() body: { returnUrl: string } + ) { + return this.billingService.createPortalSession( + req.user.tenantId, + body.returnUrl + ); + } +} diff --git a/src/modules/billing/billing.module.ts b/src/modules/billing/billing.module.ts new file mode 100644 index 0000000..cdef188 --- /dev/null +++ b/src/modules/billing/billing.module.ts @@ -0,0 +1,27 @@ +import { Module } from '@nestjs/common'; +import { ConfigModule } from '@nestjs/config'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { BillingService } from './billing.service'; +import { BillingController } from './billing.controller'; +import { StripeService } from './stripe.service'; +import { WebhooksController } from './webhooks.controller'; +import { Subscription } from '../subscriptions/entities/subscription.entity'; +import { Plan } from '../subscriptions/entities/plan.entity'; +import { TokenBalance } from '../subscriptions/entities/token-balance.entity'; +import { TokenUsage } from '../subscriptions/entities/token-usage.entity'; + +@Module({ + imports: [ + ConfigModule, + TypeOrmModule.forFeature([ + Subscription, + Plan, + TokenBalance, + TokenUsage, + ]), + ], + controllers: [BillingController, WebhooksController], + providers: [BillingService, StripeService], + exports: [BillingService, StripeService], +}) +export class BillingModule {} diff --git a/src/modules/billing/billing.service.ts b/src/modules/billing/billing.service.ts new file mode 100644 index 0000000..462281e --- /dev/null +++ b/src/modules/billing/billing.service.ts @@ -0,0 +1,299 @@ +import { Injectable, Logger, NotFoundException, BadRequestException } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { StripeService } from './stripe.service'; +import { Subscription, SubscriptionStatus } from '../subscriptions/entities/subscription.entity'; +import { Plan } from '../subscriptions/entities/plan.entity'; +import { TokenBalance } from '../subscriptions/entities/token-balance.entity'; +import { TokenUsage } from '../subscriptions/entities/token-usage.entity'; + +export interface TokenPackage { + code: string; + name: string; + tokens: number; + priceMxn: number; + stripePriceId?: string; +} + +@Injectable() +export class BillingService { + private readonly logger = new Logger(BillingService.name); + + // Token packages configuration + private readonly tokenPackages: TokenPackage[] = [ + { code: 'tokens_1000', name: '1,000 Tokens', tokens: 1000, priceMxn: 29 }, + { code: 'tokens_3000', name: '3,000 Tokens', tokens: 3000, priceMxn: 69 }, + { code: 'tokens_8000', name: '8,000 Tokens', tokens: 8000, priceMxn: 149 }, + { code: 'tokens_20000', name: '20,000 Tokens', tokens: 20000, priceMxn: 299 }, + ]; + + constructor( + private stripeService: StripeService, + @InjectRepository(Subscription) + private subscriptionRepo: Repository, + @InjectRepository(Plan) + private planRepo: Repository, + @InjectRepository(TokenBalance) + private tokenBalanceRepo: Repository, + @InjectRepository(TokenUsage) + private tokenUsageRepo: Repository, + ) {} + + // Get available plans + async getPlans(): Promise { + return this.planRepo.find({ + where: { status: 'active' }, + order: { priceMonthly: 'ASC' }, + }); + } + + // Get token packages + getTokenPackages(): TokenPackage[] { + return this.tokenPackages; + } + + // Create checkout session for subscription + async createSubscriptionCheckout( + tenantId: string, + planCode: string, + successUrl: string, + cancelUrl: string + ): Promise<{ checkoutUrl: string }> { + const plan = await this.planRepo.findOne({ where: { code: planCode, status: 'active' } }); + if (!plan || !plan.stripePriceIdMonthly) { + throw new NotFoundException('Plan no encontrado'); + } + + const subscription = await this.subscriptionRepo.findOne({ where: { tenantId } }); + if (!subscription?.stripeCustomerId) { + throw new BadRequestException('Cliente de Stripe no configurado'); + } + + const session = await this.stripeService.createCheckoutSession({ + customerId: subscription.stripeCustomerId, + priceId: plan.stripePriceIdMonthly, + mode: 'subscription', + successUrl, + cancelUrl, + metadata: { tenantId, planCode }, + }); + + return { checkoutUrl: session.url! }; + } + + // Create checkout session for token purchase + async createTokenPurchaseCheckout( + tenantId: string, + packageCode: string, + successUrl: string, + cancelUrl: string + ): Promise<{ checkoutUrl: string }> { + const tokenPackage = this.tokenPackages.find((p) => p.code === packageCode); + if (!tokenPackage) { + throw new NotFoundException('Paquete de tokens no encontrado'); + } + + const subscription = await this.subscriptionRepo.findOne({ where: { tenantId } }); + if (!subscription?.stripeCustomerId) { + throw new BadRequestException('Cliente de Stripe no configurado'); + } + + // For token purchases, we'll create a payment intent + const paymentIntent = await this.stripeService.createPaymentIntent({ + amount: tokenPackage.priceMxn * 100, // Convert to cents + customerId: subscription.stripeCustomerId, + metadata: { + tenantId, + packageCode, + tokens: tokenPackage.tokens.toString(), + }, + }); + + // In production, you'd return a checkout session URL + // For now, return the client secret for custom payment form + return { checkoutUrl: paymentIntent.client_secret! }; + } + + // Create customer portal session + async createPortalSession( + tenantId: string, + returnUrl: string + ): Promise<{ portalUrl: string }> { + const subscription = await this.subscriptionRepo.findOne({ where: { tenantId } }); + if (!subscription?.stripeCustomerId) { + throw new BadRequestException('Cliente de Stripe no configurado'); + } + + const session = await this.stripeService.createPortalSession({ + customerId: subscription.stripeCustomerId, + returnUrl, + }); + + return { portalUrl: session.url }; + } + + // Handle successful subscription payment + async handleSubscriptionCreated( + stripeSubscriptionId: string, + stripeCustomerId: string, + stripePriceId: string + ): Promise { + // Try to find plan by monthly or yearly price ID + let plan = await this.planRepo.findOne({ where: { stripePriceIdMonthly: stripePriceId } }); + if (!plan) { + plan = await this.planRepo.findOne({ where: { stripePriceIdYearly: stripePriceId } }); + } + if (!plan) { + this.logger.warn(`Plan not found for price: ${stripePriceId}`); + return; + } + + // Find subscription by customer ID + const subscription = await this.subscriptionRepo.findOne({ + where: { stripeCustomerId }, + }); + + if (subscription) { + subscription.planId = plan.id; + subscription.stripeSubscriptionId = stripeSubscriptionId; + subscription.status = SubscriptionStatus.ACTIVE; + subscription.currentPeriodStart = new Date(); + subscription.currentPeriodEnd = new Date(Date.now() + 30 * 24 * 60 * 60 * 1000); // +30 days + await this.subscriptionRepo.save(subscription); + + // Add plan tokens to balance + if (plan.includedTokens > 0) { + await this.addTokensToBalance(subscription.tenantId, plan.includedTokens, 'subscription'); + } + + this.logger.log(`Subscription activated for tenant: ${subscription.tenantId}`); + } + } + + // Handle subscription cancelled + async handleSubscriptionCancelled(stripeSubscriptionId: string): Promise { + const subscription = await this.subscriptionRepo.findOne({ + where: { stripeSubscriptionId }, + }); + + if (subscription) { + subscription.status = SubscriptionStatus.CANCELLED; + subscription.cancelledAt = new Date(); + await this.subscriptionRepo.save(subscription); + + this.logger.log(`Subscription cancelled for tenant: ${subscription.tenantId}`); + } + } + + // Handle token purchase completed + async handleTokenPurchase( + tenantId: string, + packageCode: string, + tokens: number + ): Promise { + await this.addTokensToBalance(tenantId, tokens, 'purchase'); + this.logger.log(`Added ${tokens} tokens to tenant: ${tenantId}`); + } + + // Token Management + async getTokenBalance(tenantId: string): Promise { + return this.tokenBalanceRepo.findOne({ where: { tenantId } }); + } + + async addTokensToBalance( + tenantId: string, + tokens: number, + source: 'subscription' | 'purchase' | 'bonus' + ): Promise { + let balance = await this.tokenBalanceRepo.findOne({ where: { tenantId } }); + + if (!balance) { + balance = this.tokenBalanceRepo.create({ + tenantId, + usedTokens: 0, + availableTokens: 0, + }); + } + + balance.availableTokens += tokens; + + return this.tokenBalanceRepo.save(balance); + } + + async consumeTokens( + tenantId: string, + tokens: number, + action: string, + description?: string + ): Promise { + const balance = await this.tokenBalanceRepo.findOne({ where: { tenantId } }); + + if (!balance || balance.availableTokens < tokens) { + return false; + } + + // Update balance + balance.usedTokens += tokens; + balance.availableTokens -= tokens; + await this.tokenBalanceRepo.save(balance); + + // Record usage + const usage = this.tokenUsageRepo.create({ + tenantId, + tokensUsed: tokens, + action, + description, + }); + await this.tokenUsageRepo.save(usage); + + return true; + } + + async getTokenUsageHistory( + tenantId: string, + limit = 50 + ): Promise { + return this.tokenUsageRepo.find({ + where: { tenantId }, + order: { createdAt: 'DESC' }, + take: limit, + }); + } + + // Get billing summary + async getBillingSummary(tenantId: string): Promise<{ + subscription: Subscription | null; + plan: Plan | null; + tokenBalance: TokenBalance | null; + invoices: any[]; + }> { + const subscription = await this.subscriptionRepo.findOne({ + where: { tenantId }, + relations: ['plan'], + }); + + const tokenBalance = await this.getTokenBalance(tenantId); + + let invoices: any[] = []; + if (subscription?.stripeCustomerId) { + try { + invoices = await this.stripeService.listInvoices(subscription.stripeCustomerId, 5); + } catch (error) { + this.logger.warn('Could not fetch invoices from Stripe'); + } + } + + return { + subscription, + plan: subscription?.plan || null, + tokenBalance, + invoices: invoices.map((inv) => ({ + id: inv.id, + amount: inv.amount_paid / 100, + status: inv.status, + date: new Date(inv.created * 1000), + pdfUrl: inv.invoice_pdf, + })), + }; + } +} diff --git a/src/modules/billing/stripe.service.ts b/src/modules/billing/stripe.service.ts new file mode 100644 index 0000000..02c5e56 --- /dev/null +++ b/src/modules/billing/stripe.service.ts @@ -0,0 +1,223 @@ +import { Injectable, Logger } from '@nestjs/common'; +import { ConfigService } from '@nestjs/config'; +import Stripe from 'stripe'; + +@Injectable() +export class StripeService { + private readonly logger = new Logger(StripeService.name); + private stripe: Stripe; + + constructor(private configService: ConfigService) { + const secretKey = this.configService.get('STRIPE_SECRET_KEY'); + + if (!secretKey) { + this.logger.warn('STRIPE_SECRET_KEY not configured - billing features disabled'); + return; + } + + this.stripe = new Stripe(secretKey); + } + + private ensureStripe(): void { + if (!this.stripe) { + throw new Error('Stripe not configured'); + } + } + + // Customer Management + async createCustomer(params: { + email?: string; + phone: string; + name: string; + tenantId: string; + }): Promise { + this.ensureStripe(); + + return this.stripe.customers.create({ + email: params.email, + phone: params.phone, + name: params.name, + metadata: { + tenantId: params.tenantId, + }, + }); + } + + async getCustomer(customerId: string): Promise { + this.ensureStripe(); + + try { + const customer = await this.stripe.customers.retrieve(customerId); + return customer.deleted ? null : customer as Stripe.Customer; + } catch (error) { + return null; + } + } + + // Subscription Management + async createSubscription(params: { + customerId: string; + priceId: string; + trialDays?: number; + }): Promise { + this.ensureStripe(); + + const subscriptionParams: Stripe.SubscriptionCreateParams = { + customer: params.customerId, + items: [{ price: params.priceId }], + payment_behavior: 'default_incomplete', + payment_settings: { + save_default_payment_method: 'on_subscription', + }, + expand: ['latest_invoice.payment_intent'], + }; + + if (params.trialDays) { + subscriptionParams.trial_period_days = params.trialDays; + } + + return this.stripe.subscriptions.create(subscriptionParams); + } + + async cancelSubscription(subscriptionId: string): Promise { + this.ensureStripe(); + + return this.stripe.subscriptions.cancel(subscriptionId); + } + + async getSubscription(subscriptionId: string): Promise { + this.ensureStripe(); + + try { + return await this.stripe.subscriptions.retrieve(subscriptionId); + } catch (error) { + return null; + } + } + + async updateSubscription( + subscriptionId: string, + params: Stripe.SubscriptionUpdateParams + ): Promise { + this.ensureStripe(); + + return this.stripe.subscriptions.update(subscriptionId, params); + } + + // Payment Intent (for one-time purchases like token packages) + async createPaymentIntent(params: { + amount: number; // in cents (MXN) + customerId: string; + metadata?: Record; + }): Promise { + this.ensureStripe(); + + return this.stripe.paymentIntents.create({ + amount: params.amount, + currency: 'mxn', + customer: params.customerId, + metadata: params.metadata || {}, + automatic_payment_methods: { + enabled: true, + }, + }); + } + + // Checkout Session (for hosted checkout) + async createCheckoutSession(params: { + customerId: string; + priceId: string; + mode: 'subscription' | 'payment'; + successUrl: string; + cancelUrl: string; + metadata?: Record; + }): Promise { + this.ensureStripe(); + + return this.stripe.checkout.sessions.create({ + customer: params.customerId, + mode: params.mode, + line_items: [{ price: params.priceId, quantity: 1 }], + success_url: params.successUrl, + cancel_url: params.cancelUrl, + metadata: params.metadata || {}, + locale: 'es', + payment_method_types: params.mode === 'subscription' + ? ['card'] + : ['card', 'oxxo'], + }); + } + + // Customer Portal (for managing subscriptions) + async createPortalSession(params: { + customerId: string; + returnUrl: string; + }): Promise { + this.ensureStripe(); + + return this.stripe.billingPortal.sessions.create({ + customer: params.customerId, + return_url: params.returnUrl, + }); + } + + // Webhook signature verification + constructWebhookEvent( + payload: string | Buffer, + signature: string, + webhookSecret: string + ): Stripe.Event { + this.ensureStripe(); + + return this.stripe.webhooks.constructEvent(payload, signature, webhookSecret); + } + + // Products and Prices (for initial setup) + async createProduct(params: { + name: string; + description?: string; + metadata?: Record; + }): Promise { + this.ensureStripe(); + + return this.stripe.products.create({ + name: params.name, + description: params.description, + metadata: params.metadata || {}, + }); + } + + async createPrice(params: { + productId: string; + unitAmount: number; // in cents + recurring?: { interval: 'month' | 'year' }; + metadata?: Record; + }): Promise { + this.ensureStripe(); + + const priceParams: Stripe.PriceCreateParams = { + product: params.productId, + unit_amount: params.unitAmount, + currency: 'mxn', + metadata: params.metadata || {}, + }; + + if (params.recurring) { + priceParams.recurring = params.recurring; + } + + return this.stripe.prices.create(priceParams); + } + + // List invoices + async listInvoices(customerId: string, limit = 10): Promise { + this.ensureStripe(); + + const invoices = await this.stripe.invoices.list({ + customer: customerId, + limit, + }); + + return invoices.data; + } +} diff --git a/src/modules/billing/webhooks.controller.ts b/src/modules/billing/webhooks.controller.ts new file mode 100644 index 0000000..a40c4af --- /dev/null +++ b/src/modules/billing/webhooks.controller.ts @@ -0,0 +1,119 @@ +import { + Controller, + Post, + Headers, + RawBodyRequest, + Req, + Logger, + HttpCode, +} from '@nestjs/common'; +import { ConfigService } from '@nestjs/config'; +import { Request } from 'express'; +import Stripe from 'stripe'; +import { StripeService } from './stripe.service'; +import { BillingService } from './billing.service'; + +@Controller('webhooks') +export class WebhooksController { + private readonly logger = new Logger(WebhooksController.name); + + constructor( + private stripeService: StripeService, + private billingService: BillingService, + private configService: ConfigService, + ) {} + + @Post('stripe') + @HttpCode(200) + async handleStripeWebhook( + @Req() req: RawBodyRequest, + @Headers('stripe-signature') signature: string, + ) { + const webhookSecret = this.configService.get('STRIPE_WEBHOOK_SECRET'); + + if (!webhookSecret) { + this.logger.warn('STRIPE_WEBHOOK_SECRET not configured'); + return { received: true }; + } + + let event: Stripe.Event; + + try { + event = this.stripeService.constructWebhookEvent( + req.rawBody!, + signature, + webhookSecret, + ); + } catch (err: any) { + this.logger.error(`Webhook signature verification failed: ${err.message}`); + return { error: 'Invalid signature' }; + } + + this.logger.log(`Received Stripe event: ${event.type}`); + + try { + switch (event.type) { + case 'customer.subscription.created': + case 'customer.subscription.updated': { + const subscription = event.data.object as Stripe.Subscription; + await this.billingService.handleSubscriptionCreated( + subscription.id, + subscription.customer as string, + subscription.items.data[0].price.id, + ); + break; + } + + case 'customer.subscription.deleted': { + const subscription = event.data.object as Stripe.Subscription; + await this.billingService.handleSubscriptionCancelled(subscription.id); + break; + } + + case 'payment_intent.succeeded': { + const paymentIntent = event.data.object as Stripe.PaymentIntent; + const metadata = paymentIntent.metadata; + + // Check if this is a token purchase + if (metadata.packageCode && metadata.tenantId && metadata.tokens) { + await this.billingService.handleTokenPurchase( + metadata.tenantId, + metadata.packageCode, + parseInt(metadata.tokens, 10), + ); + } + break; + } + + case 'invoice.payment_succeeded': { + const invoice = event.data.object as Stripe.Invoice; + this.logger.log(`Invoice paid: ${invoice.id}`); + // Could trigger email notification here + break; + } + + case 'invoice.payment_failed': { + const invoice = event.data.object as Stripe.Invoice; + this.logger.warn(`Invoice payment failed: ${invoice.id}`); + // Could trigger email notification or suspend service + break; + } + + case 'checkout.session.completed': { + const session = event.data.object as Stripe.Checkout.Session; + this.logger.log(`Checkout completed: ${session.id}`); + // Additional handling if needed + break; + } + + default: + this.logger.debug(`Unhandled event type: ${event.type}`); + } + } catch (error: any) { + this.logger.error(`Error processing webhook: ${error.message}`); + // Still return 200 to prevent Stripe from retrying + } + + return { received: true }; + } +} diff --git a/src/modules/categories/categories.controller.ts b/src/modules/categories/categories.controller.ts new file mode 100644 index 0000000..cb7b761 --- /dev/null +++ b/src/modules/categories/categories.controller.ts @@ -0,0 +1,95 @@ +import { + Controller, + Get, + Post, + Put, + Patch, + Delete, + Body, + Param, + Query, + UseGuards, + Request, + ParseUUIDPipe, + HttpCode, + HttpStatus, +} from '@nestjs/common'; +import { + ApiTags, + ApiOperation, + ApiResponse, + ApiBearerAuth, + ApiParam, +} from '@nestjs/swagger'; +import { CategoriesService } from './categories.service'; +import { CreateCategoryDto, UpdateCategoryDto } from './dto/category.dto'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; + +@ApiTags('categories') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/categories') +export class CategoriesController { + constructor(private readonly categoriesService: CategoriesService) {} + + @Get() + @ApiOperation({ summary: 'Listar categorías' }) + async findAll( + @Request() req: { user: { tenantId: string } }, + @Query('includeInactive') includeInactive?: boolean, + ) { + return this.categoriesService.findAll(req.user.tenantId, includeInactive); + } + + @Get(':id') + @ApiOperation({ summary: 'Obtener categoría por ID' }) + @ApiParam({ name: 'id', description: 'ID de la categoría' }) + async findOne( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.categoriesService.findOne(req.user.tenantId, id); + } + + @Post() + @ApiOperation({ summary: 'Crear categoría' }) + @ApiResponse({ status: 201, description: 'Categoría creada' }) + async create( + @Request() req: { user: { tenantId: string } }, + @Body() dto: CreateCategoryDto, + ) { + return this.categoriesService.create(req.user.tenantId, dto); + } + + @Put(':id') + @ApiOperation({ summary: 'Actualizar categoría' }) + @ApiParam({ name: 'id', description: 'ID de la categoría' }) + async update( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + @Body() dto: UpdateCategoryDto, + ) { + return this.categoriesService.update(req.user.tenantId, id, dto); + } + + @Patch(':id/toggle-active') + @ApiOperation({ summary: 'Activar/desactivar categoría' }) + @ApiParam({ name: 'id', description: 'ID de la categoría' }) + async toggleActive( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.categoriesService.toggleActive(req.user.tenantId, id); + } + + @Delete(':id') + @HttpCode(HttpStatus.NO_CONTENT) + @ApiOperation({ summary: 'Eliminar categoría' }) + @ApiParam({ name: 'id', description: 'ID de la categoría' }) + async delete( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + await this.categoriesService.delete(req.user.tenantId, id); + } +} diff --git a/src/modules/categories/categories.module.ts b/src/modules/categories/categories.module.ts new file mode 100644 index 0000000..67734cf --- /dev/null +++ b/src/modules/categories/categories.module.ts @@ -0,0 +1,17 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { CategoriesController } from './categories.controller'; +import { CategoriesService } from './categories.service'; +import { Category } from './entities/category.entity'; +import { AuthModule } from '../auth/auth.module'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([Category]), + AuthModule, + ], + controllers: [CategoriesController], + providers: [CategoriesService], + exports: [CategoriesService, TypeOrmModule], +}) +export class CategoriesModule {} diff --git a/src/modules/categories/categories.service.ts b/src/modules/categories/categories.service.ts new file mode 100644 index 0000000..21fee6e --- /dev/null +++ b/src/modules/categories/categories.service.ts @@ -0,0 +1,101 @@ +import { + Injectable, + NotFoundException, + ConflictException, + BadRequestException, +} from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { Category } from './entities/category.entity'; +import { CreateCategoryDto, UpdateCategoryDto } from './dto/category.dto'; + +const MAX_CATEGORIES = 20; + +@Injectable() +export class CategoriesService { + constructor( + @InjectRepository(Category) + private readonly categoryRepository: Repository, + ) {} + + async findAll(tenantId: string, includeInactive = false): Promise { + const where: Record = { tenantId }; + + if (!includeInactive) { + where.status = 'active'; + } + + return this.categoryRepository.find({ + where, + order: { sortOrder: 'ASC', name: 'ASC' }, + }); + } + + async findOne(tenantId: string, id: string): Promise { + const category = await this.categoryRepository.findOne({ + where: { id, tenantId }, + }); + + if (!category) { + throw new NotFoundException('Categoría no encontrada'); + } + + return category; + } + + async create(tenantId: string, dto: CreateCategoryDto): Promise { + // Check limit + const count = await this.categoryRepository.count({ where: { tenantId } }); + + if (count >= MAX_CATEGORIES) { + throw new BadRequestException( + `Has alcanzado el límite de ${MAX_CATEGORIES} categorías`, + ); + } + + // Check name uniqueness + const existing = await this.categoryRepository.findOne({ + where: { tenantId, name: dto.name }, + }); + + if (existing) { + throw new ConflictException('Ya existe una categoría con ese nombre'); + } + + const category = this.categoryRepository.create({ + ...dto, + tenantId, + }); + + return this.categoryRepository.save(category); + } + + async update(tenantId: string, id: string, dto: UpdateCategoryDto): Promise { + const category = await this.findOne(tenantId, id); + + // Check name uniqueness if changed + if (dto.name && dto.name !== category.name) { + const existing = await this.categoryRepository.findOne({ + where: { tenantId, name: dto.name }, + }); + + if (existing) { + throw new ConflictException('Ya existe una categoría con ese nombre'); + } + } + + Object.assign(category, dto); + return this.categoryRepository.save(category); + } + + async delete(tenantId: string, id: string): Promise { + const category = await this.findOne(tenantId, id); + await this.categoryRepository.remove(category); + } + + async toggleActive(tenantId: string, id: string): Promise { + const category = await this.findOne(tenantId, id); + category.status = category.status === 'active' ? 'inactive' : 'active'; + return this.categoryRepository.save(category); + } +} diff --git a/src/modules/categories/dto/category.dto.ts b/src/modules/categories/dto/category.dto.ts new file mode 100644 index 0000000..cb05033 --- /dev/null +++ b/src/modules/categories/dto/category.dto.ts @@ -0,0 +1,54 @@ +import { IsString, IsOptional, IsNumber, MaxLength } from 'class-validator'; + +export class CreateCategoryDto { + @IsString() + @MaxLength(50) + name: string; + + @IsOptional() + @IsString() + description?: string; + + @IsOptional() + @IsString() + @MaxLength(7) + color?: string; + + @IsOptional() + @IsString() + @MaxLength(50) + icon?: string; + + @IsOptional() + @IsNumber() + sortOrder?: number; +} + +export class UpdateCategoryDto { + @IsOptional() + @IsString() + @MaxLength(50) + name?: string; + + @IsOptional() + @IsString() + description?: string; + + @IsOptional() + @IsString() + @MaxLength(7) + color?: string; + + @IsOptional() + @IsString() + @MaxLength(50) + icon?: string; + + @IsOptional() + @IsNumber() + sortOrder?: number; + + @IsOptional() + @IsString() + status?: string; +} diff --git a/src/modules/categories/entities/category.entity.ts b/src/modules/categories/entities/category.entity.ts new file mode 100644 index 0000000..8aa4654 --- /dev/null +++ b/src/modules/categories/entities/category.entity.ts @@ -0,0 +1,46 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + OneToMany, +} from 'typeorm'; +import { Product } from '../../products/entities/product.entity'; + +@Entity({ schema: 'catalog', name: 'categories' }) +export class Category { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ length: 50 }) + name: string; + + @Column({ type: 'text', nullable: true }) + description: string; + + @Column({ length: 50, nullable: true }) + icon: string; + + @Column({ length: 7, nullable: true }) + color: string; + + @Column({ name: 'sort_order', default: 0 }) + sortOrder: number; + + @Column({ length: 20, default: 'active' }) + status: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @OneToMany(() => Product, (product) => product.category) + products: Product[]; +} diff --git a/src/modules/codi-spei/codi-spei.controller.ts b/src/modules/codi-spei/codi-spei.controller.ts new file mode 100644 index 0000000..d1a1211 --- /dev/null +++ b/src/modules/codi-spei/codi-spei.controller.ts @@ -0,0 +1,111 @@ +import { + Controller, + Get, + Post, + Body, + Param, + Query, + UseGuards, + Request, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { CodiSpeiService } from './codi-spei.service'; +import { GenerateQrDto } from './dto/generate-qr.dto'; + +@ApiTags('codi-spei') +@Controller('v1') +export class CodiSpeiController { + constructor(private readonly codiSpeiService: CodiSpeiService) {} + + // ==================== CODI ==================== + + @Post('codi/generate-qr') + @ApiBearerAuth() + @UseGuards(JwtAuthGuard) + @ApiOperation({ summary: 'Generar QR CoDi para cobro' }) + generateQr(@Request() req, @Body() dto: GenerateQrDto) { + return this.codiSpeiService.generateQr(req.user.tenantId, dto); + } + + @Get('codi/status/:id') + @ApiBearerAuth() + @UseGuards(JwtAuthGuard) + @ApiOperation({ summary: 'Obtener estado de transaccion CoDi' }) + getCodiStatus(@Param('id') id: string) { + return this.codiSpeiService.getCodiStatus(id); + } + + @Get('codi/transactions') + @ApiBearerAuth() + @UseGuards(JwtAuthGuard) + @ApiOperation({ summary: 'Listar transacciones CoDi' }) + @ApiQuery({ name: 'limit', required: false }) + getCodiTransactions(@Request() req, @Query('limit') limit?: number) { + return this.codiSpeiService.getCodiTransactions(req.user.tenantId, limit); + } + + @Post('codi/webhook') + @ApiOperation({ summary: 'Webhook para confirmacion CoDi' }) + async codiWebhook(@Body() payload: any) { + await this.codiSpeiService.handleCodiWebhook(payload); + return { success: true }; + } + + // ==================== SPEI ==================== + + @Get('spei/clabe') + @ApiBearerAuth() + @UseGuards(JwtAuthGuard) + @ApiOperation({ summary: 'Obtener CLABE virtual del tenant' }) + async getClabe(@Request() req) { + const account = await this.codiSpeiService.getVirtualAccount(req.user.tenantId); + if (!account) { + return { clabe: null, message: 'No tiene CLABE virtual configurada' }; + } + return { + clabe: account.clabe, + beneficiaryName: account.beneficiaryName, + status: account.status, + }; + } + + @Post('spei/create-clabe') + @ApiBearerAuth() + @UseGuards(JwtAuthGuard) + @ApiOperation({ summary: 'Crear CLABE virtual para el tenant' }) + createClabe(@Request() req, @Body() body: { beneficiaryName: string }) { + return this.codiSpeiService.createVirtualAccount( + req.user.tenantId, + body.beneficiaryName, + ); + } + + @Get('spei/transactions') + @ApiBearerAuth() + @UseGuards(JwtAuthGuard) + @ApiOperation({ summary: 'Listar transacciones SPEI recibidas' }) + @ApiQuery({ name: 'limit', required: false }) + getSpeiTransactions(@Request() req, @Query('limit') limit?: number) { + return this.codiSpeiService.getSpeiTransactions(req.user.tenantId, limit); + } + + @Post('spei/webhook') + @ApiOperation({ summary: 'Webhook para notificacion SPEI' }) + async speiWebhook(@Body() payload: any) { + await this.codiSpeiService.handleSpeiWebhook(payload.clabe, payload); + return { success: true }; + } + + // ==================== SUMMARY ==================== + + @Get('payments/summary') + @ApiBearerAuth() + @UseGuards(JwtAuthGuard) + @ApiOperation({ summary: 'Resumen de pagos CoDi/SPEI del dia' }) + @ApiQuery({ name: 'date', required: false }) + async getSummary(@Request() req, @Query('date') date?: string) { + const targetDate = date ? new Date(date) : undefined; + return this.codiSpeiService.getSummary(req.user.tenantId, targetDate); + } +} diff --git a/src/modules/codi-spei/codi-spei.module.ts b/src/modules/codi-spei/codi-spei.module.ts new file mode 100644 index 0000000..a301490 --- /dev/null +++ b/src/modules/codi-spei/codi-spei.module.ts @@ -0,0 +1,17 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { CodiSpeiController } from './codi-spei.controller'; +import { CodiSpeiService } from './codi-spei.service'; +import { VirtualAccount } from './entities/virtual-account.entity'; +import { CodiTransaction } from './entities/codi-transaction.entity'; +import { SpeiTransaction } from './entities/spei-transaction.entity'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([VirtualAccount, CodiTransaction, SpeiTransaction]), + ], + controllers: [CodiSpeiController], + providers: [CodiSpeiService], + exports: [CodiSpeiService], +}) +export class CodiSpeiModule {} diff --git a/src/modules/codi-spei/codi-spei.service.ts b/src/modules/codi-spei/codi-spei.service.ts new file mode 100644 index 0000000..4c8f570 --- /dev/null +++ b/src/modules/codi-spei/codi-spei.service.ts @@ -0,0 +1,263 @@ +import { + Injectable, + NotFoundException, + BadRequestException, +} from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository, DataSource, LessThan } from 'typeorm'; +import { VirtualAccount, VirtualAccountStatus } from './entities/virtual-account.entity'; +import { CodiTransaction, CodiTransactionStatus } from './entities/codi-transaction.entity'; +import { SpeiTransaction, SpeiTransactionStatus } from './entities/spei-transaction.entity'; +import { GenerateQrDto } from './dto/generate-qr.dto'; + +@Injectable() +export class CodiSpeiService { + constructor( + @InjectRepository(VirtualAccount) + private readonly virtualAccountRepo: Repository, + @InjectRepository(CodiTransaction) + private readonly codiRepo: Repository, + @InjectRepository(SpeiTransaction) + private readonly speiRepo: Repository, + private readonly dataSource: DataSource, + ) {} + + // ==================== VIRTUAL ACCOUNTS (CLABE) ==================== + + async getVirtualAccount(tenantId: string): Promise { + return this.virtualAccountRepo.findOne({ + where: { tenantId, status: VirtualAccountStatus.ACTIVE }, + }); + } + + async createVirtualAccount( + tenantId: string, + beneficiaryName: string, + provider: string = 'stp', + ): Promise { + // Check if already has one + const existing = await this.getVirtualAccount(tenantId); + if (existing) { + return existing; + } + + // In production, this would call the provider API to create a CLABE + // For now, generate a mock CLABE + const mockClabe = `646180${Math.floor(Math.random() * 1000000000000).toString().padStart(12, '0')}`; + + const account = this.virtualAccountRepo.create({ + tenantId, + provider, + clabe: mockClabe, + beneficiaryName, + status: VirtualAccountStatus.ACTIVE, + }); + + return this.virtualAccountRepo.save(account); + } + + // ==================== CODI ==================== + + async generateQr(tenantId: string, dto: GenerateQrDto): Promise { + // Generate unique reference + const result = await this.dataSource.query( + `SELECT generate_codi_reference($1) as reference`, + [tenantId], + ); + const reference = result[0].reference; + + // Set expiry (5 minutes) + const expiresAt = new Date(); + expiresAt.setMinutes(expiresAt.getMinutes() + 5); + + // In production, this would call Banxico/PAC API to generate real CoDi QR + // For now, generate mock QR data + const qrData = JSON.stringify({ + type: 'codi', + amount: dto.amount, + reference, + merchant: tenantId, + expires: expiresAt.toISOString(), + }); + + const transaction = this.codiRepo.create({ + tenantId, + saleId: dto.saleId, + qrData, + amount: dto.amount, + reference, + description: dto.description || `Cobro ${reference}`, + status: CodiTransactionStatus.PENDING, + expiresAt, + }); + + return this.codiRepo.save(transaction); + } + + async getCodiStatus(id: string): Promise { + const transaction = await this.codiRepo.findOne({ where: { id } }); + if (!transaction) { + throw new NotFoundException('Transaccion CoDi no encontrada'); + } + + // Check if expired + if ( + transaction.status === CodiTransactionStatus.PENDING && + new Date() > transaction.expiresAt + ) { + transaction.status = CodiTransactionStatus.EXPIRED; + await this.codiRepo.save(transaction); + } + + return transaction; + } + + async confirmCodi(id: string, providerData: any): Promise { + const transaction = await this.getCodiStatus(id); + + if (transaction.status !== CodiTransactionStatus.PENDING) { + throw new BadRequestException(`Transaccion no esta pendiente: ${transaction.status}`); + } + + transaction.status = CodiTransactionStatus.CONFIRMED; + transaction.confirmedAt = new Date(); + transaction.providerResponse = providerData; + + return this.codiRepo.save(transaction); + } + + async getCodiTransactions( + tenantId: string, + limit = 50, + ): Promise { + return this.codiRepo.find({ + where: { tenantId }, + order: { createdAt: 'DESC' }, + take: limit, + }); + } + + // ==================== SPEI ==================== + + async getSpeiTransactions( + tenantId: string, + limit = 50, + ): Promise { + return this.speiRepo.find({ + where: { tenantId }, + order: { receivedAt: 'DESC' }, + take: limit, + }); + } + + async receiveSpei( + tenantId: string, + data: { + amount: number; + senderClabe?: string; + senderName?: string; + senderRfc?: string; + senderBank?: string; + reference?: string; + trackingKey?: string; + providerData?: any; + }, + ): Promise { + const account = await this.getVirtualAccount(tenantId); + + const transaction = this.speiRepo.create({ + tenantId, + virtualAccountId: account?.id, + amount: data.amount, + senderClabe: data.senderClabe, + senderName: data.senderName, + senderRfc: data.senderRfc, + senderBank: data.senderBank, + reference: data.reference, + trackingKey: data.trackingKey, + status: SpeiTransactionStatus.RECEIVED, + receivedAt: new Date(), + providerData: data.providerData, + }); + + return this.speiRepo.save(transaction); + } + + async reconcileSpei(id: string, saleId: string): Promise { + const transaction = await this.speiRepo.findOne({ where: { id } }); + if (!transaction) { + throw new NotFoundException('Transaccion SPEI no encontrada'); + } + + transaction.saleId = saleId; + transaction.status = SpeiTransactionStatus.RECONCILED; + transaction.reconciledAt = new Date(); + + return this.speiRepo.save(transaction); + } + + // ==================== STATS ==================== + + async getSummary(tenantId: string, date?: Date) { + const targetDate = date || new Date(); + const dateStr = targetDate.toISOString().split('T')[0]; + + const result = await this.dataSource.query( + `SELECT * FROM get_codi_spei_summary($1, $2::date)`, + [tenantId, dateStr], + ); + + return result[0] || { + codi_count: 0, + codi_total: 0, + spei_count: 0, + spei_total: 0, + }; + } + + // ==================== WEBHOOKS ==================== + + async handleCodiWebhook(payload: any): Promise { + // In production, validate webhook signature + // Find transaction by reference and confirm + const { reference, status, transactionId } = payload; + + const transaction = await this.codiRepo.findOne({ + where: { reference }, + }); + + if (!transaction) { + throw new NotFoundException('Transaccion no encontrada'); + } + + if (status === 'confirmed') { + await this.confirmCodi(transaction.id, { + providerTransactionId: transactionId, + ...payload, + }); + } + } + + async handleSpeiWebhook(clabe: string, payload: any): Promise { + // Find virtual account by CLABE + const account = await this.virtualAccountRepo.findOne({ + where: { clabe }, + }); + + if (!account) { + throw new NotFoundException('Cuenta virtual no encontrada'); + } + + // Record incoming SPEI + await this.receiveSpei(account.tenantId, { + amount: payload.amount, + senderClabe: payload.senderClabe, + senderName: payload.senderName, + senderRfc: payload.senderRfc, + senderBank: payload.senderBank, + reference: payload.reference, + trackingKey: payload.trackingKey, + providerData: payload, + }); + } +} diff --git a/src/modules/codi-spei/dto/generate-qr.dto.ts b/src/modules/codi-spei/dto/generate-qr.dto.ts new file mode 100644 index 0000000..5c1d1b6 --- /dev/null +++ b/src/modules/codi-spei/dto/generate-qr.dto.ts @@ -0,0 +1,31 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { IsNumber, IsString, IsOptional, Min, Max } from 'class-validator'; + +export class GenerateQrDto { + @ApiProperty({ + example: 150.5, + description: 'Monto a cobrar', + }) + @IsNumber() + @Min(1) + @Max(8000) // CoDi max limit + amount: number; + + @ApiProperty({ + example: 'Venta #123', + description: 'Descripcion del cobro', + required: false, + }) + @IsString() + @IsOptional() + description?: string; + + @ApiProperty({ + example: 'sale-uuid', + description: 'ID de la venta asociada', + required: false, + }) + @IsString() + @IsOptional() + saleId?: string; +} diff --git a/src/modules/codi-spei/entities/codi-transaction.entity.ts b/src/modules/codi-spei/entities/codi-transaction.entity.ts new file mode 100644 index 0000000..62b65dd --- /dev/null +++ b/src/modules/codi-spei/entities/codi-transaction.entity.ts @@ -0,0 +1,66 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, +} from 'typeorm'; + +export enum CodiTransactionStatus { + PENDING = 'pending', + CONFIRMED = 'confirmed', + EXPIRED = 'expired', + CANCELLED = 'cancelled', +} + +@Entity({ schema: 'sales', name: 'codi_transactions' }) +export class CodiTransaction { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'sale_id', nullable: true }) + saleId: string; + + @Column({ name: 'qr_data', type: 'text' }) + qrData: string; + + @Column({ name: 'qr_image_url', type: 'text', nullable: true }) + qrImageUrl: string; + + @Column({ type: 'decimal', precision: 10, scale: 2 }) + amount: number; + + @Column({ length: 50, nullable: true }) + reference: string; + + @Column({ length: 200, nullable: true }) + description: string; + + @Column({ + type: 'varchar', + length: 20, + default: CodiTransactionStatus.PENDING, + }) + status: CodiTransactionStatus; + + @Column({ name: 'expires_at', type: 'timestamptz' }) + expiresAt: Date; + + @Column({ name: 'confirmed_at', type: 'timestamptz', nullable: true }) + confirmedAt: Date; + + @Column({ name: 'provider_transaction_id', length: 100, nullable: true }) + providerTransactionId: string; + + @Column({ name: 'provider_response', type: 'jsonb', nullable: true }) + providerResponse: Record; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; +} diff --git a/src/modules/codi-spei/entities/spei-transaction.entity.ts b/src/modules/codi-spei/entities/spei-transaction.entity.ts new file mode 100644 index 0000000..bf01856 --- /dev/null +++ b/src/modules/codi-spei/entities/spei-transaction.entity.ts @@ -0,0 +1,82 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { VirtualAccount } from './virtual-account.entity'; + +export enum SpeiTransactionStatus { + RECEIVED = 'received', + RECONCILED = 'reconciled', + DISPUTED = 'disputed', +} + +@Entity({ schema: 'sales', name: 'spei_transactions' }) +export class SpeiTransaction { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'virtual_account_id', nullable: true }) + virtualAccountId: string; + + @Column({ name: 'sale_id', nullable: true }) + saleId: string; + + @Column({ type: 'decimal', precision: 10, scale: 2 }) + amount: number; + + @Column({ name: 'sender_clabe', length: 18, nullable: true }) + senderClabe: string; + + @Column({ name: 'sender_name', length: 100, nullable: true }) + senderName: string; + + @Column({ name: 'sender_rfc', length: 13, nullable: true }) + senderRfc: string; + + @Column({ name: 'sender_bank', length: 50, nullable: true }) + senderBank: string; + + @Column({ length: 50, nullable: true }) + reference: string; + + @Column({ length: 200, nullable: true }) + description: string; + + @Column({ name: 'tracking_key', length: 50, nullable: true }) + trackingKey: string; + + @Column({ + type: 'varchar', + length: 20, + default: SpeiTransactionStatus.RECEIVED, + }) + status: SpeiTransactionStatus; + + @Column({ name: 'received_at', type: 'timestamptz' }) + receivedAt: Date; + + @Column({ name: 'reconciled_at', type: 'timestamptz', nullable: true }) + reconciledAt: Date; + + @Column({ name: 'provider_data', type: 'jsonb', nullable: true }) + providerData: Record; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => VirtualAccount) + @JoinColumn({ name: 'virtual_account_id' }) + virtualAccount: VirtualAccount; +} diff --git a/src/modules/codi-spei/entities/virtual-account.entity.ts b/src/modules/codi-spei/entities/virtual-account.entity.ts new file mode 100644 index 0000000..4b215af --- /dev/null +++ b/src/modules/codi-spei/entities/virtual-account.entity.ts @@ -0,0 +1,47 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, +} from 'typeorm'; + +export enum VirtualAccountStatus { + ACTIVE = 'active', + SUSPENDED = 'suspended', + CLOSED = 'closed', +} + +@Entity({ schema: 'sales', name: 'virtual_accounts' }) +export class VirtualAccount { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ length: 20, default: 'stp' }) + provider: string; + + @Column({ length: 18, unique: true }) + clabe: string; + + @Column({ name: 'beneficiary_name', length: 100, nullable: true }) + beneficiaryName: string; + + @Column({ + type: 'varchar', + length: 20, + default: VirtualAccountStatus.ACTIVE, + }) + status: VirtualAccountStatus; + + @Column({ type: 'jsonb', nullable: true }) + metadata: Record; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; +} diff --git a/src/modules/customers/customers.controller.ts b/src/modules/customers/customers.controller.ts new file mode 100644 index 0000000..a0af009 --- /dev/null +++ b/src/modules/customers/customers.controller.ts @@ -0,0 +1,107 @@ +import { + Controller, + Get, + Post, + Put, + Patch, + Param, + Body, + Query, + UseGuards, + Request, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { CustomersService } from './customers.service'; +import { CreateCustomerDto, UpdateCustomerDto, CreateFiadoDto, PayFiadoDto } from './dto/customer.dto'; + +@ApiTags('customers') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/customers') +export class CustomersController { + constructor(private readonly customersService: CustomersService) {} + + // ==================== CUSTOMERS ==================== + + @Get() + @ApiOperation({ summary: 'Listar todos los clientes' }) + findAll(@Request() req) { + return this.customersService.findAll(req.user.tenantId); + } + + @Get('with-fiados') + @ApiOperation({ summary: 'Listar clientes con fiado habilitado' }) + getWithFiados(@Request() req) { + return this.customersService.getWithFiados(req.user.tenantId); + } + + @Get('phone/:phone') + @ApiOperation({ summary: 'Buscar cliente por teléfono' }) + findByPhone(@Request() req, @Param('phone') phone: string) { + return this.customersService.findByPhone(req.user.tenantId, phone); + } + + @Get(':id') + @ApiOperation({ summary: 'Obtener cliente por ID' }) + findOne(@Request() req, @Param('id') id: string) { + return this.customersService.findOne(req.user.tenantId, id); + } + + @Get(':id/stats') + @ApiOperation({ summary: 'Obtener estadísticas del cliente' }) + getStats(@Request() req, @Param('id') id: string) { + return this.customersService.getCustomerStats(req.user.tenantId, id); + } + + @Post() + @ApiOperation({ summary: 'Crear nuevo cliente' }) + create(@Request() req, @Body() dto: CreateCustomerDto) { + return this.customersService.create(req.user.tenantId, dto); + } + + @Put(':id') + @ApiOperation({ summary: 'Actualizar cliente' }) + update(@Request() req, @Param('id') id: string, @Body() dto: UpdateCustomerDto) { + return this.customersService.update(req.user.tenantId, id, dto); + } + + @Patch(':id/toggle-active') + @ApiOperation({ summary: 'Activar/desactivar cliente' }) + toggleActive(@Request() req, @Param('id') id: string) { + return this.customersService.toggleActive(req.user.tenantId, id); + } + + // ==================== FIADOS ==================== + + @Get('fiados/all') + @ApiOperation({ summary: 'Listar todos los fiados' }) + @ApiQuery({ name: 'customerId', required: false }) + getFiados(@Request() req, @Query('customerId') customerId?: string) { + return this.customersService.getFiados(req.user.tenantId, customerId); + } + + @Get('fiados/pending') + @ApiOperation({ summary: 'Listar fiados pendientes' }) + getPendingFiados(@Request() req) { + return this.customersService.getPendingFiados(req.user.tenantId); + } + + @Post('fiados') + @ApiOperation({ summary: 'Crear nuevo fiado' }) + createFiado(@Request() req, @Body() dto: CreateFiadoDto) { + return this.customersService.createFiado(req.user.tenantId, dto); + } + + @Post('fiados/:id/pay') + @ApiOperation({ summary: 'Registrar pago de fiado' }) + payFiado(@Request() req, @Param('id') id: string, @Body() dto: PayFiadoDto) { + return this.customersService.payFiado(req.user.tenantId, id, dto, req.user.id); + } + + @Patch('fiados/:id/cancel') + @ApiOperation({ summary: 'Cancelar fiado' }) + cancelFiado(@Request() req, @Param('id') id: string) { + return this.customersService.cancelFiado(req.user.tenantId, id); + } +} diff --git a/src/modules/customers/customers.module.ts b/src/modules/customers/customers.module.ts new file mode 100644 index 0000000..f5e01c7 --- /dev/null +++ b/src/modules/customers/customers.module.ts @@ -0,0 +1,15 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { CustomersController } from './customers.controller'; +import { CustomersService } from './customers.service'; +import { Customer } from './entities/customer.entity'; +import { Fiado } from './entities/fiado.entity'; +import { FiadoPayment } from './entities/fiado-payment.entity'; + +@Module({ + imports: [TypeOrmModule.forFeature([Customer, Fiado, FiadoPayment])], + controllers: [CustomersController], + providers: [CustomersService], + exports: [CustomersService], +}) +export class CustomersModule {} diff --git a/src/modules/customers/customers.service.ts b/src/modules/customers/customers.service.ts new file mode 100644 index 0000000..6cde645 --- /dev/null +++ b/src/modules/customers/customers.service.ts @@ -0,0 +1,231 @@ +import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { Customer } from './entities/customer.entity'; +import { Fiado, FiadoStatus } from './entities/fiado.entity'; +import { FiadoPayment } from './entities/fiado-payment.entity'; +import { CreateCustomerDto, UpdateCustomerDto, CreateFiadoDto, PayFiadoDto } from './dto/customer.dto'; + +@Injectable() +export class CustomersService { + constructor( + @InjectRepository(Customer) + private readonly customerRepo: Repository, + @InjectRepository(Fiado) + private readonly fiadoRepo: Repository, + @InjectRepository(FiadoPayment) + private readonly fiadoPaymentRepo: Repository, + ) {} + + // ==================== CUSTOMERS ==================== + + async findAll(tenantId: string): Promise { + return this.customerRepo.find({ + where: { tenantId, status: 'active' }, + order: { name: 'ASC' }, + }); + } + + async findOne(tenantId: string, id: string): Promise { + const customer = await this.customerRepo.findOne({ + where: { id, tenantId }, + relations: ['fiados'], + }); + if (!customer) { + throw new NotFoundException('Cliente no encontrado'); + } + return customer; + } + + async findByPhone(tenantId: string, phone: string): Promise { + return this.customerRepo.findOne({ + where: { tenantId, phone }, + }); + } + + async create(tenantId: string, dto: CreateCustomerDto): Promise { + const customer = this.customerRepo.create({ + ...dto, + tenantId, + }); + return this.customerRepo.save(customer); + } + + async update(tenantId: string, id: string, dto: UpdateCustomerDto): Promise { + const customer = await this.findOne(tenantId, id); + Object.assign(customer, dto); + return this.customerRepo.save(customer); + } + + async toggleActive(tenantId: string, id: string): Promise { + const customer = await this.findOne(tenantId, id); + customer.status = customer.status === 'active' ? 'inactive' : 'active'; + return this.customerRepo.save(customer); + } + + async getWithFiados(tenantId: string): Promise { + return this.customerRepo.find({ + where: { tenantId, fiadoEnabled: true }, + order: { currentFiadoBalance: 'DESC' }, + }); + } + + // ==================== FIADOS ==================== + + async createFiado(tenantId: string, dto: CreateFiadoDto): Promise { + const customer = await this.findOne(tenantId, dto.customerId); + + if (!customer.fiadoEnabled) { + throw new BadRequestException('El cliente no tiene habilitado el fiado'); + } + + const newBalance = Number(customer.currentFiadoBalance) + dto.amount; + if (customer.fiadoLimit > 0 && newBalance > customer.fiadoLimit) { + throw new BadRequestException( + `El fiado excede el límite. Límite: $${customer.fiadoLimit}, Balance actual: $${customer.currentFiadoBalance}`, + ); + } + + const fiado = this.fiadoRepo.create({ + tenantId, + customerId: dto.customerId, + saleId: dto.saleId, + amount: dto.amount, + remainingAmount: dto.amount, + description: dto.description, + dueDate: dto.dueDate ? new Date(dto.dueDate) : null, + status: FiadoStatus.PENDING, + }); + + await this.fiadoRepo.save(fiado); + + // Update customer balance + customer.currentFiadoBalance = newBalance; + await this.customerRepo.save(customer); + + return fiado; + } + + async getFiados(tenantId: string, customerId?: string): Promise { + const where: any = { tenantId }; + if (customerId) { + where.customerId = customerId; + } + + return this.fiadoRepo.find({ + where, + relations: ['customer', 'payments'], + order: { createdAt: 'DESC' }, + }); + } + + async getPendingFiados(tenantId: string): Promise { + return this.fiadoRepo.find({ + where: [ + { tenantId, status: FiadoStatus.PENDING }, + { tenantId, status: FiadoStatus.PARTIAL }, + ], + relations: ['customer'], + order: { createdAt: 'ASC' }, + }); + } + + async payFiado(tenantId: string, fiadoId: string, dto: PayFiadoDto, userId?: string): Promise { + const fiado = await this.fiadoRepo.findOne({ + where: { id: fiadoId, tenantId }, + relations: ['customer'], + }); + + if (!fiado) { + throw new NotFoundException('Fiado no encontrado'); + } + + if (fiado.status === FiadoStatus.PAID) { + throw new BadRequestException('Este fiado ya está pagado'); + } + + if (dto.amount > Number(fiado.remainingAmount)) { + throw new BadRequestException( + `El monto excede el saldo pendiente: $${fiado.remainingAmount}`, + ); + } + + // Create payment record + const payment = this.fiadoPaymentRepo.create({ + fiadoId, + amount: dto.amount, + paymentMethod: dto.paymentMethod || 'cash', + notes: dto.notes, + receivedBy: userId, + }); + await this.fiadoPaymentRepo.save(payment); + + // Update fiado + fiado.paidAmount = Number(fiado.paidAmount) + dto.amount; + fiado.remainingAmount = Number(fiado.remainingAmount) - dto.amount; + + if (fiado.remainingAmount <= 0) { + fiado.status = FiadoStatus.PAID; + fiado.paidAt = new Date(); + } else { + fiado.status = FiadoStatus.PARTIAL; + } + + await this.fiadoRepo.save(fiado); + + // Update customer balance + const customer = fiado.customer; + customer.currentFiadoBalance = Number(customer.currentFiadoBalance) - dto.amount; + await this.customerRepo.save(customer); + + return fiado; + } + + async cancelFiado(tenantId: string, fiadoId: string): Promise { + const fiado = await this.fiadoRepo.findOne({ + where: { id: fiadoId, tenantId }, + relations: ['customer'], + }); + + if (!fiado) { + throw new NotFoundException('Fiado no encontrado'); + } + + if (fiado.status === FiadoStatus.PAID) { + throw new BadRequestException('No se puede cancelar un fiado pagado'); + } + + // Restore customer balance + const customer = fiado.customer; + customer.currentFiadoBalance = Number(customer.currentFiadoBalance) - Number(fiado.remainingAmount); + await this.customerRepo.save(customer); + + fiado.status = FiadoStatus.CANCELLED; + return this.fiadoRepo.save(fiado); + } + + // ==================== STATS ==================== + + async getCustomerStats(tenantId: string, customerId: string) { + const customer = await this.findOne(tenantId, customerId); + + const pendingFiados = await this.fiadoRepo.count({ + where: [ + { customerId, status: FiadoStatus.PENDING }, + { customerId, status: FiadoStatus.PARTIAL }, + ], + }); + + return { + customer, + stats: { + totalPurchases: customer.totalPurchases, + purchaseCount: customer.purchaseCount, + fiadoBalance: customer.currentFiadoBalance, + fiadoLimit: customer.fiadoLimit, + fiadoAvailable: Math.max(0, Number(customer.fiadoLimit) - Number(customer.currentFiadoBalance)), + pendingFiados, + }, + }; + } +} diff --git a/src/modules/customers/dto/customer.dto.ts b/src/modules/customers/dto/customer.dto.ts new file mode 100644 index 0000000..a4bfff8 --- /dev/null +++ b/src/modules/customers/dto/customer.dto.ts @@ -0,0 +1,103 @@ +import { ApiProperty, ApiPropertyOptional, PartialType } from '@nestjs/swagger'; +import { + IsString, + IsOptional, + IsBoolean, + IsNumber, + IsEmail, + MaxLength, + Min, + IsUUID, +} from 'class-validator'; + +export class CreateCustomerDto { + @ApiProperty({ description: 'Nombre del cliente', example: 'Juan Pérez' }) + @IsString() + @MaxLength(200) + name: string; + + @ApiPropertyOptional({ description: 'Teléfono', example: '5512345678' }) + @IsOptional() + @IsString() + @MaxLength(20) + phone?: string; + + @ApiPropertyOptional({ description: 'WhatsApp', example: '5512345678' }) + @IsOptional() + @IsString() + @MaxLength(20) + whatsapp?: string; + + @ApiPropertyOptional({ description: 'Email', example: 'juan@email.com' }) + @IsOptional() + @IsEmail() + @MaxLength(255) + email?: string; + + @ApiPropertyOptional({ description: 'Dirección' }) + @IsOptional() + @IsString() + address?: string; + + @ApiPropertyOptional({ description: 'Notas adicionales' }) + @IsOptional() + @IsString() + notes?: string; + + @ApiPropertyOptional({ description: 'Habilitar fiado', default: false }) + @IsOptional() + @IsBoolean() + fiadoEnabled?: boolean; + + @ApiPropertyOptional({ description: 'Límite de fiado', example: 500 }) + @IsOptional() + @IsNumber() + @Min(0) + fiadoLimit?: number; +} + +export class UpdateCustomerDto extends PartialType(CreateCustomerDto) {} + +export class CreateFiadoDto { + @ApiProperty({ description: 'ID del cliente' }) + @IsUUID() + customerId: string; + + @ApiPropertyOptional({ description: 'ID de la venta asociada' }) + @IsOptional() + @IsUUID() + saleId?: string; + + @ApiProperty({ description: 'Monto del fiado', example: 150.5 }) + @IsNumber() + @Min(0.01) + amount: number; + + @ApiPropertyOptional({ description: 'Descripción del fiado' }) + @IsOptional() + @IsString() + description?: string; + + @ApiPropertyOptional({ description: 'Fecha de vencimiento' }) + @IsOptional() + @IsString() + dueDate?: string; +} + +export class PayFiadoDto { + @ApiProperty({ description: 'Monto a pagar', example: 50 }) + @IsNumber() + @Min(0.01) + amount: number; + + @ApiPropertyOptional({ description: 'Método de pago', default: 'cash' }) + @IsOptional() + @IsString() + @MaxLength(20) + paymentMethod?: string; + + @ApiPropertyOptional({ description: 'Notas del pago' }) + @IsOptional() + @IsString() + notes?: string; +} diff --git a/src/modules/customers/entities/customer.entity.ts b/src/modules/customers/entities/customer.entity.ts new file mode 100644 index 0000000..6f58e60 --- /dev/null +++ b/src/modules/customers/entities/customer.entity.ts @@ -0,0 +1,76 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + OneToMany, +} from 'typeorm'; +import { Fiado } from './fiado.entity'; + +@Entity({ schema: 'customers', name: 'customers' }) +export class Customer { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ length: 100 }) + name: string; + + @Column({ length: 20, nullable: true }) + phone: string; + + @Column({ length: 100, nullable: true }) + email: string; + + @Column({ type: 'text', nullable: true }) + address: string; + + @Column({ name: 'address_reference', type: 'text', nullable: true }) + addressReference: string; + + @Column({ type: 'decimal', precision: 10, scale: 8, nullable: true }) + latitude: number; + + @Column({ type: 'decimal', precision: 11, scale: 8, nullable: true }) + longitude: number; + + @Column({ name: 'fiado_enabled', default: true }) + fiadoEnabled: boolean; + + @Column({ name: 'fiado_limit', type: 'decimal', precision: 10, scale: 2, nullable: true }) + fiadoLimit: number; + + @Column({ name: 'current_fiado_balance', type: 'decimal', precision: 10, scale: 2, default: 0 }) + currentFiadoBalance: number; + + @Column({ name: 'total_purchases', type: 'decimal', precision: 12, scale: 2, default: 0 }) + totalPurchases: number; + + @Column({ name: 'purchase_count', default: 0 }) + purchaseCount: number; + + @Column({ name: 'last_purchase_at', type: 'timestamptz', nullable: true }) + lastPurchaseAt: Date; + + @Column({ name: 'whatsapp_opt_in', default: false }) + whatsappOptIn: boolean; + + @Column({ type: 'text', nullable: true }) + notes: string; + + @Column({ length: 20, default: 'active' }) + status: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @OneToMany(() => Fiado, (fiado) => fiado.customer) + fiados: Fiado[]; +} diff --git a/src/modules/customers/entities/fiado-payment.entity.ts b/src/modules/customers/entities/fiado-payment.entity.ts new file mode 100644 index 0000000..f726d6d --- /dev/null +++ b/src/modules/customers/entities/fiado-payment.entity.ts @@ -0,0 +1,38 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Fiado } from './fiado.entity'; + +@Entity({ schema: 'customers', name: 'fiado_payments' }) +export class FiadoPayment { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'fiado_id' }) + fiadoId: string; + + @Column({ type: 'decimal', precision: 10, scale: 2 }) + amount: number; + + @Column({ name: 'payment_method', length: 20, default: 'cash' }) + paymentMethod: string; + + @Column({ type: 'text', nullable: true }) + notes: string; + + @Column({ name: 'received_by', nullable: true }) + receivedBy: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @ManyToOne(() => Fiado, (fiado) => fiado.payments) + @JoinColumn({ name: 'fiado_id' }) + fiado: Fiado; +} diff --git a/src/modules/customers/entities/fiado.entity.ts b/src/modules/customers/entities/fiado.entity.ts new file mode 100644 index 0000000..99d06a0 --- /dev/null +++ b/src/modules/customers/entities/fiado.entity.ts @@ -0,0 +1,73 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + OneToMany, + JoinColumn, +} from 'typeorm'; +import { Customer } from './customer.entity'; +import { FiadoPayment } from './fiado-payment.entity'; + +export enum FiadoStatus { + PENDING = 'pending', + PARTIAL = 'partial', + PAID = 'paid', + CANCELLED = 'cancelled', +} + +@Entity({ schema: 'customers', name: 'fiados' }) +export class Fiado { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'customer_id' }) + customerId: string; + + @Column({ name: 'sale_id', nullable: true }) + saleId: string; + + @Column({ type: 'decimal', precision: 10, scale: 2 }) + amount: number; + + @Column({ name: 'paid_amount', type: 'decimal', precision: 10, scale: 2, default: 0 }) + paidAmount: number; + + @Column({ name: 'remaining_amount', type: 'decimal', precision: 10, scale: 2 }) + remainingAmount: number; + + @Column({ type: 'text', nullable: true }) + description: string; + + @Column({ + type: 'varchar', + length: 20, + default: FiadoStatus.PENDING, + }) + status: FiadoStatus; + + @Column({ name: 'due_date', type: 'date', nullable: true }) + dueDate: Date; + + @Column({ name: 'paid_at', type: 'timestamptz', nullable: true }) + paidAt: Date; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => Customer, (customer) => customer.fiados) + @JoinColumn({ name: 'customer_id' }) + customer: Customer; + + @OneToMany(() => FiadoPayment, (payment) => payment.fiado) + payments: FiadoPayment[]; +} diff --git a/src/modules/integrations/controllers/integrations.controller.ts b/src/modules/integrations/controllers/integrations.controller.ts new file mode 100644 index 0000000..411286e --- /dev/null +++ b/src/modules/integrations/controllers/integrations.controller.ts @@ -0,0 +1,263 @@ +import { + Controller, + Get, + Post, + Put, + Delete, + Body, + Param, + UseGuards, + Request, + HttpCode, + HttpStatus, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../../auth/guards/jwt-auth.guard'; +import { TenantIntegrationsService } from '../services/tenant-integrations.service'; +import { + UpsertWhatsAppCredentialsDto, + UpsertLLMCredentialsDto, + CreateIntegrationCredentialDto, + IntegrationCredentialResponseDto, + IntegrationStatusResponseDto, +} from '../dto/integration-credentials.dto'; +import { + IntegrationType, + IntegrationProvider, +} from '../entities/tenant-integration-credential.entity'; + +@ApiTags('Integrations') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('integrations') +export class IntegrationsController { + constructor(private readonly integrationsService: TenantIntegrationsService) {} + + // ========================================================================= + // STATUS + // ========================================================================= + + @Get('status') + @ApiOperation({ summary: 'Obtener estado de todas las integraciones del tenant' }) + @ApiResponse({ status: 200, type: IntegrationStatusResponseDto }) + async getStatus(@Request() req): Promise { + return this.integrationsService.getIntegrationStatus(req.user.tenantId); + } + + // ========================================================================= + // WHATSAPP + // ========================================================================= + + @Get('whatsapp') + @ApiOperation({ summary: 'Obtener configuración de WhatsApp' }) + async getWhatsAppConfig(@Request() req) { + const credential = await this.integrationsService.getCredential( + req.user.tenantId, + IntegrationType.WHATSAPP, + IntegrationProvider.META, + ); + + if (!credential) { + return { + configured: false, + usesPlatformNumber: true, + message: 'Usando número de plataforma compartido', + }; + } + + return { + configured: true, + usesPlatformNumber: false, + isVerified: credential.isVerified, + lastVerifiedAt: credential.lastVerifiedAt, + // No exponer credenciales sensibles + hasAccessToken: !!credential.credentials?.['accessToken'], + phoneNumberId: credential.credentials?.['phoneNumberId'], + }; + } + + @Put('whatsapp') + @ApiOperation({ summary: 'Configurar credenciales de WhatsApp propias' }) + async upsertWhatsAppCredentials( + @Request() req, + @Body() dto: UpsertWhatsAppCredentialsDto, + ) { + const credential = await this.integrationsService.upsertCredential( + req.user.tenantId, + IntegrationType.WHATSAPP, + IntegrationProvider.META, + { + accessToken: dto.credentials.accessToken, + phoneNumberId: dto.credentials.phoneNumberId, + businessAccountId: dto.credentials.businessAccountId, + verifyToken: dto.credentials.verifyToken, + }, + {}, + req.user.sub, + ); + + // Registrar el número de WhatsApp para resolución en webhooks + if (dto.credentials.phoneNumberId) { + await this.integrationsService.registerWhatsAppNumber( + req.user.tenantId, + dto.credentials.phoneNumberId, + dto.phoneNumber, + dto.displayName, + ); + } + + return { + success: true, + message: 'Credenciales de WhatsApp configuradas', + id: credential.id, + }; + } + + @Delete('whatsapp') + @HttpCode(HttpStatus.NO_CONTENT) + @ApiOperation({ summary: 'Eliminar credenciales de WhatsApp (volver a usar plataforma)' }) + async deleteWhatsAppCredentials(@Request() req) { + await this.integrationsService.deleteCredential( + req.user.tenantId, + IntegrationType.WHATSAPP, + IntegrationProvider.META, + ); + } + + // ========================================================================= + // LLM + // ========================================================================= + + @Get('llm') + @ApiOperation({ summary: 'Obtener configuración de LLM' }) + async getLLMConfig(@Request() req) { + const credentials = await this.integrationsService.getCredentials(req.user.tenantId); + const llmCred = credentials.find( + (c) => c.integrationType === IntegrationType.LLM && c.isActive, + ); + + if (!llmCred) { + return { + configured: false, + usesPlatformDefault: true, + message: 'Usando configuración LLM de plataforma', + }; + } + + return { + configured: true, + usesPlatformDefault: false, + provider: llmCred.provider, + isVerified: llmCred.isVerified, + config: { + model: llmCred.config?.['model'], + maxTokens: llmCred.config?.['maxTokens'], + temperature: llmCred.config?.['temperature'], + hasSystemPrompt: !!llmCred.config?.['systemPrompt'], + }, + // No exponer API key + hasApiKey: !!llmCred.credentials?.['apiKey'], + }; + } + + @Put('llm') + @ApiOperation({ summary: 'Configurar credenciales de LLM propias' }) + async upsertLLMCredentials(@Request() req, @Body() dto: UpsertLLMCredentialsDto) { + const credential = await this.integrationsService.upsertCredential( + req.user.tenantId, + IntegrationType.LLM, + dto.provider, + { apiKey: dto.credentials.apiKey }, + dto.config || {}, + req.user.sub, + ); + + return { + success: true, + message: 'Credenciales de LLM configuradas', + id: credential.id, + provider: dto.provider, + }; + } + + @Delete('llm/:provider') + @HttpCode(HttpStatus.NO_CONTENT) + @ApiOperation({ summary: 'Eliminar credenciales de LLM (volver a usar plataforma)' }) + async deleteLLMCredentials( + @Request() req, + @Param('provider') provider: IntegrationProvider, + ) { + await this.integrationsService.deleteCredential( + req.user.tenantId, + IntegrationType.LLM, + provider, + ); + } + + // ========================================================================= + // GENERIC CRUD + // ========================================================================= + + @Get('credentials') + @ApiOperation({ summary: 'Obtener todas las credenciales del tenant' }) + async getAllCredentials(@Request() req): Promise { + const credentials = await this.integrationsService.getCredentials(req.user.tenantId); + + return credentials.map((c) => ({ + id: c.id, + integrationType: c.integrationType, + provider: c.provider, + hasCredentials: !!c.credentials && Object.keys(c.credentials).length > 0, + isActive: c.isActive, + isVerified: c.isVerified, + lastVerifiedAt: c.lastVerifiedAt, + verificationError: c.verificationError, + config: c.config, + createdAt: c.createdAt, + updatedAt: c.updatedAt, + })); + } + + @Post('credentials') + @ApiOperation({ summary: 'Crear credencial de integración genérica' }) + async createCredential( + @Request() req, + @Body() dto: CreateIntegrationCredentialDto, + ) { + const credential = await this.integrationsService.upsertCredential( + req.user.tenantId, + dto.integrationType, + dto.provider, + dto.credentials, + dto.config, + req.user.sub, + ); + + return { + success: true, + message: 'Credencial creada', + id: credential.id, + }; + } + + @Put('credentials/:type/:provider/toggle') + @ApiOperation({ summary: 'Activar/desactivar una credencial' }) + async toggleCredential( + @Request() req, + @Param('type') type: IntegrationType, + @Param('provider') provider: IntegrationProvider, + @Body() body: { isActive: boolean }, + ) { + const credential = await this.integrationsService.toggleCredential( + req.user.tenantId, + type, + provider, + body.isActive, + ); + + return { + success: true, + isActive: credential.isActive, + }; + } +} diff --git a/src/modules/integrations/controllers/internal-integrations.controller.ts b/src/modules/integrations/controllers/internal-integrations.controller.ts new file mode 100644 index 0000000..5578fb6 --- /dev/null +++ b/src/modules/integrations/controllers/internal-integrations.controller.ts @@ -0,0 +1,137 @@ +import { + Controller, + Get, + Param, + Headers, + UnauthorizedException, + NotFoundException, +} from '@nestjs/common'; +import { ConfigService } from '@nestjs/config'; +import { ApiTags, ApiOperation, ApiResponse, ApiHeader } from '@nestjs/swagger'; +import { TenantIntegrationsService } from '../services/tenant-integrations.service'; +import { + IntegrationType, + IntegrationProvider, +} from '../entities/tenant-integration-credential.entity'; + +/** + * Internal API for whatsapp-service to fetch tenant credentials + * Protected by X-Internal-Key header + */ +@ApiTags('Internal - Integrations') +@Controller('internal/integrations') +export class InternalIntegrationsController { + constructor( + private readonly integrationsService: TenantIntegrationsService, + private readonly configService: ConfigService, + ) {} + + private validateInternalKey(internalKey: string): void { + const expectedKey = this.configService.get('INTERNAL_API_KEY'); + if (!expectedKey || internalKey !== expectedKey) { + throw new UnauthorizedException('Invalid internal API key'); + } + } + + @Get(':tenantId/whatsapp') + @ApiOperation({ summary: 'Get WhatsApp credentials for a tenant (internal use)' }) + @ApiHeader({ name: 'X-Internal-Key', required: true }) + @ApiResponse({ status: 200, description: 'Credentials returned' }) + @ApiResponse({ status: 401, description: 'Invalid internal key' }) + @ApiResponse({ status: 404, description: 'Tenant not found or not configured' }) + async getWhatsAppCredentials( + @Param('tenantId') tenantId: string, + @Headers('x-internal-key') internalKey: string, + ) { + this.validateInternalKey(internalKey); + + const credential = await this.integrationsService.getCredential( + tenantId, + IntegrationType.WHATSAPP, + IntegrationProvider.META, + ); + + if (!credential || !credential.isActive) { + return { + configured: false, + message: 'WhatsApp not configured for this tenant', + }; + } + + return { + configured: true, + credentials: { + accessToken: credential.credentials?.['accessToken'], + phoneNumberId: credential.credentials?.['phoneNumberId'], + businessAccountId: credential.credentials?.['businessAccountId'], + verifyToken: credential.credentials?.['verifyToken'], + }, + }; + } + + @Get(':tenantId/llm') + @ApiOperation({ summary: 'Get LLM configuration for a tenant (internal use)' }) + @ApiHeader({ name: 'X-Internal-Key', required: true }) + @ApiResponse({ status: 200, description: 'Configuration returned' }) + @ApiResponse({ status: 401, description: 'Invalid internal key' }) + async getLLMConfig( + @Param('tenantId') tenantId: string, + @Headers('x-internal-key') internalKey: string, + ) { + this.validateInternalKey(internalKey); + + // Get all LLM credentials and find the active one + const credentials = await this.integrationsService.getCredentials(tenantId); + const llmCredential = credentials.find( + (c) => c.integrationType === IntegrationType.LLM && c.isActive, + ); + + if (!llmCredential) { + return { + configured: false, + message: 'LLM not configured for this tenant', + }; + } + + return { + configured: true, + provider: llmCredential.provider, + credentials: { + apiKey: llmCredential.credentials?.['apiKey'], + }, + config: { + model: llmCredential.config?.['model'], + maxTokens: llmCredential.config?.['maxTokens'], + temperature: llmCredential.config?.['temperature'], + baseUrl: llmCredential.config?.['baseUrl'], + systemPrompt: llmCredential.config?.['systemPrompt'], + }, + }; + } + + @Get('resolve-tenant/:phoneNumberId') + @ApiOperation({ summary: 'Resolve tenant ID from WhatsApp phone number ID' }) + @ApiHeader({ name: 'X-Internal-Key', required: true }) + @ApiResponse({ status: 200, description: 'Tenant ID returned' }) + @ApiResponse({ status: 401, description: 'Invalid internal key' }) + async resolveTenantFromPhoneNumberId( + @Param('phoneNumberId') phoneNumberId: string, + @Headers('x-internal-key') internalKey: string, + ) { + this.validateInternalKey(internalKey); + + const tenantId = await this.integrationsService.resolveTenantFromPhoneNumberId(phoneNumberId); + + if (!tenantId) { + return { + found: false, + message: 'No tenant found for this phone number ID', + }; + } + + return { + found: true, + tenantId, + }; + } +} diff --git a/src/modules/integrations/dto/integration-credentials.dto.ts b/src/modules/integrations/dto/integration-credentials.dto.ts new file mode 100644 index 0000000..ed7bda2 --- /dev/null +++ b/src/modules/integrations/dto/integration-credentials.dto.ts @@ -0,0 +1,182 @@ +import { IsEnum, IsOptional, IsObject, IsBoolean, IsString, ValidateNested } from 'class-validator'; +import { Type } from 'class-transformer'; +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { IntegrationType, IntegrationProvider } from '../entities/tenant-integration-credential.entity'; + +// DTO para credenciales de WhatsApp +export class WhatsAppCredentialsDto { + @ApiProperty({ description: 'Access Token de Meta/WhatsApp Business API' }) + @IsString() + accessToken: string; + + @ApiProperty({ description: 'Phone Number ID de WhatsApp Business' }) + @IsString() + phoneNumberId: string; + + @ApiPropertyOptional({ description: 'Business Account ID de WhatsApp' }) + @IsOptional() + @IsString() + businessAccountId?: string; + + @ApiPropertyOptional({ description: 'Verify Token para webhook' }) + @IsOptional() + @IsString() + verifyToken?: string; +} + +// DTO para credenciales de LLM +export class LLMCredentialsDto { + @ApiProperty({ description: 'API Key del proveedor LLM' }) + @IsString() + apiKey: string; +} + +// DTO para configuración de LLM +export class LLMConfigDto { + @ApiPropertyOptional({ description: 'Modelo a usar', example: 'gpt-4o-mini' }) + @IsOptional() + @IsString() + model?: string; + + @ApiPropertyOptional({ description: 'Máximo de tokens', example: 1000 }) + @IsOptional() + maxTokens?: number; + + @ApiPropertyOptional({ description: 'Temperatura (0-2)', example: 0.7 }) + @IsOptional() + temperature?: number; + + @ApiPropertyOptional({ description: 'System prompt personalizado' }) + @IsOptional() + @IsString() + systemPrompt?: string; + + @ApiPropertyOptional({ description: 'Base URL del API (para OpenRouter/Azure)' }) + @IsOptional() + @IsString() + baseUrl?: string; +} + +// DTO para crear/actualizar credenciales de WhatsApp +export class UpsertWhatsAppCredentialsDto { + @ApiProperty({ type: WhatsAppCredentialsDto }) + @ValidateNested() + @Type(() => WhatsAppCredentialsDto) + credentials: WhatsAppCredentialsDto; + + @ApiPropertyOptional({ description: 'Número de teléfono para display' }) + @IsOptional() + @IsString() + phoneNumber?: string; + + @ApiPropertyOptional({ description: 'Nombre para display' }) + @IsOptional() + @IsString() + displayName?: string; +} + +// DTO para crear/actualizar credenciales de LLM +export class UpsertLLMCredentialsDto { + @ApiProperty({ enum: IntegrationProvider, description: 'Proveedor LLM' }) + @IsEnum(IntegrationProvider) + provider: IntegrationProvider; + + @ApiProperty({ type: LLMCredentialsDto }) + @ValidateNested() + @Type(() => LLMCredentialsDto) + credentials: LLMCredentialsDto; + + @ApiPropertyOptional({ type: LLMConfigDto }) + @IsOptional() + @ValidateNested() + @Type(() => LLMConfigDto) + config?: LLMConfigDto; +} + +// DTO genérico para crear credenciales +export class CreateIntegrationCredentialDto { + @ApiProperty({ enum: IntegrationType }) + @IsEnum(IntegrationType) + integrationType: IntegrationType; + + @ApiProperty({ enum: IntegrationProvider }) + @IsEnum(IntegrationProvider) + provider: IntegrationProvider; + + @ApiProperty({ description: 'Credenciales específicas del proveedor' }) + @IsObject() + credentials: Record; + + @ApiPropertyOptional({ description: 'Configuración adicional' }) + @IsOptional() + @IsObject() + config?: Record; + + @ApiPropertyOptional({ description: 'Activar inmediatamente' }) + @IsOptional() + @IsBoolean() + isActive?: boolean; +} + +// DTO de respuesta para credenciales (sin datos sensibles) +export class IntegrationCredentialResponseDto { + @ApiProperty() + id: string; + + @ApiProperty({ enum: IntegrationType }) + integrationType: IntegrationType; + + @ApiProperty({ enum: IntegrationProvider }) + provider: IntegrationProvider; + + @ApiProperty({ description: 'Indica si hay credenciales configuradas' }) + hasCredentials: boolean; + + @ApiProperty() + isActive: boolean; + + @ApiProperty() + isVerified: boolean; + + @ApiPropertyOptional() + lastVerifiedAt?: Date; + + @ApiPropertyOptional() + verificationError?: string; + + @ApiProperty() + config: Record; + + @ApiProperty() + createdAt: Date; + + @ApiProperty() + updatedAt: Date; +} + +// DTO de respuesta para estado de integraciones +export class IntegrationStatusResponseDto { + @ApiProperty() + whatsapp: { + configured: boolean; + usesPlatformNumber: boolean; + provider: string; + isVerified: boolean; + }; + + @ApiProperty() + llm: { + configured: boolean; + usesPlatformDefault: boolean; + provider: string; + model: string; + isVerified: boolean; + }; + + @ApiProperty() + payments: { + stripe: { configured: boolean; isVerified: boolean }; + mercadopago: { configured: boolean; isVerified: boolean }; + clip: { configured: boolean; isVerified: boolean }; + }; +} diff --git a/src/modules/integrations/entities/tenant-integration-credential.entity.ts b/src/modules/integrations/entities/tenant-integration-credential.entity.ts new file mode 100644 index 0000000..49dbd38 --- /dev/null +++ b/src/modules/integrations/entities/tenant-integration-credential.entity.ts @@ -0,0 +1,120 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + JoinColumn, + Unique, +} from 'typeorm'; +import { Tenant } from '../../auth/entities/tenant.entity'; + +export enum IntegrationType { + WHATSAPP = 'whatsapp', + LLM = 'llm', + STRIPE = 'stripe', + MERCADOPAGO = 'mercadopago', + CLIP = 'clip', +} + +export enum IntegrationProvider { + // WhatsApp + META = 'meta', + // LLM + OPENAI = 'openai', + OPENROUTER = 'openrouter', + ANTHROPIC = 'anthropic', + OLLAMA = 'ollama', + AZURE_OPENAI = 'azure_openai', + // Payments + STRIPE = 'stripe', + MERCADOPAGO = 'mercadopago', + CLIP = 'clip', +} + +// Tipos de credenciales para WhatsApp +export interface WhatsAppCredentials { + accessToken: string; + phoneNumberId: string; + businessAccountId?: string; + verifyToken?: string; +} + +// Tipos de credenciales para LLM +export interface LLMCredentials { + apiKey: string; +} + +// Tipos de configuración para LLM +export interface LLMConfig { + model?: string; + maxTokens?: number; + temperature?: number; + systemPrompt?: string; + baseUrl?: string; +} + +// Tipos de credenciales para Stripe +export interface StripeCredentials { + secretKey: string; + publishableKey?: string; + webhookSecret?: string; +} + +@Entity({ schema: 'public', name: 'tenant_integration_credentials' }) +@Unique(['tenantId', 'integrationType', 'provider']) +export class TenantIntegrationCredential { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id', type: 'uuid' }) + tenantId: string; + + @ManyToOne(() => Tenant, { onDelete: 'CASCADE' }) + @JoinColumn({ name: 'tenant_id' }) + tenant: Tenant; + + @Column({ + name: 'integration_type', + type: 'enum', + enum: IntegrationType, + }) + integrationType: IntegrationType; + + @Column({ + type: 'enum', + enum: IntegrationProvider, + }) + provider: IntegrationProvider; + + @Column({ type: 'jsonb', default: {} }) + credentials: WhatsAppCredentials | LLMCredentials | StripeCredentials | Record; + + @Column({ type: 'jsonb', default: {} }) + config: LLMConfig | Record; + + @Column({ name: 'is_active', default: true }) + isActive: boolean; + + @Column({ name: 'is_verified', default: false }) + isVerified: boolean; + + @Column({ name: 'last_verified_at', type: 'timestamptz', nullable: true }) + lastVerifiedAt: Date; + + @Column({ name: 'verification_error', type: 'text', nullable: true }) + verificationError: string; + + @Column({ name: 'created_by', type: 'uuid', nullable: true }) + createdBy: string; + + @Column({ name: 'updated_by', type: 'uuid', nullable: true }) + updatedBy: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; +} diff --git a/src/modules/integrations/entities/tenant-whatsapp-number.entity.ts b/src/modules/integrations/entities/tenant-whatsapp-number.entity.ts new file mode 100644 index 0000000..8839337 --- /dev/null +++ b/src/modules/integrations/entities/tenant-whatsapp-number.entity.ts @@ -0,0 +1,42 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, + Unique, +} from 'typeorm'; +import { Tenant } from '../../auth/entities/tenant.entity'; + +@Entity({ schema: 'public', name: 'tenant_whatsapp_numbers' }) +@Unique(['tenantId', 'phoneNumberId']) +export class TenantWhatsAppNumber { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id', type: 'uuid' }) + tenantId: string; + + @ManyToOne(() => Tenant, { onDelete: 'CASCADE' }) + @JoinColumn({ name: 'tenant_id' }) + tenant: Tenant; + + @Column({ name: 'phone_number_id', length: 50, unique: true }) + phoneNumberId: string; + + @Column({ name: 'phone_number', length: 20, nullable: true }) + phoneNumber: string; + + @Column({ name: 'display_name', length: 100, nullable: true }) + displayName: string; + + @Column({ name: 'is_platform_number', default: false }) + isPlatformNumber: boolean; + + @Column({ name: 'is_active', default: true }) + isActive: boolean; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; +} diff --git a/src/modules/integrations/integrations.module.ts b/src/modules/integrations/integrations.module.ts new file mode 100644 index 0000000..fb52ee0 --- /dev/null +++ b/src/modules/integrations/integrations.module.ts @@ -0,0 +1,24 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { ConfigModule } from '@nestjs/config'; +import { TenantIntegrationCredential } from './entities/tenant-integration-credential.entity'; +import { TenantWhatsAppNumber } from './entities/tenant-whatsapp-number.entity'; +import { Tenant } from '../auth/entities/tenant.entity'; +import { TenantIntegrationsService } from './services/tenant-integrations.service'; +import { IntegrationsController } from './controllers/integrations.controller'; +import { InternalIntegrationsController } from './controllers/internal-integrations.controller'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([ + TenantIntegrationCredential, + TenantWhatsAppNumber, + Tenant, + ]), + ConfigModule, + ], + controllers: [IntegrationsController, InternalIntegrationsController], + providers: [TenantIntegrationsService], + exports: [TenantIntegrationsService], +}) +export class IntegrationsModule {} diff --git a/src/modules/integrations/services/tenant-integrations.service.ts b/src/modules/integrations/services/tenant-integrations.service.ts new file mode 100644 index 0000000..61c0bf0 --- /dev/null +++ b/src/modules/integrations/services/tenant-integrations.service.ts @@ -0,0 +1,424 @@ +import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { ConfigService } from '@nestjs/config'; +import { + TenantIntegrationCredential, + IntegrationType, + IntegrationProvider, + WhatsAppCredentials, + LLMCredentials, + LLMConfig, +} from '../entities/tenant-integration-credential.entity'; +import { TenantWhatsAppNumber } from '../entities/tenant-whatsapp-number.entity'; +import { Tenant } from '../../auth/entities/tenant.entity'; + +// Interfaces para credenciales resueltas +export interface ResolvedWhatsAppCredentials { + accessToken: string; + phoneNumberId: string; + businessAccountId?: string; + verifyToken?: string; + isFromPlatform: boolean; + tenantId?: string; +} + +export interface ResolvedLLMConfig { + apiKey: string; + provider: string; + model: string; + maxTokens: number; + temperature: number; + baseUrl: string; + systemPrompt?: string; + isFromPlatform: boolean; + tenantId?: string; +} + +@Injectable() +export class TenantIntegrationsService { + constructor( + @InjectRepository(TenantIntegrationCredential) + private readonly credentialRepo: Repository, + @InjectRepository(TenantWhatsAppNumber) + private readonly whatsappNumberRepo: Repository, + @InjectRepository(Tenant) + private readonly tenantRepo: Repository, + private readonly configService: ConfigService, + ) {} + + // ========================================================================= + // WHATSAPP CREDENTIALS + // ========================================================================= + + /** + * Obtiene las credenciales de WhatsApp para un tenant + * Si el tenant no tiene credenciales propias, retorna las de plataforma + */ + async getWhatsAppCredentials(tenantId: string): Promise { + // Buscar credenciales del tenant + const tenantCredential = await this.credentialRepo.findOne({ + where: { + tenantId, + integrationType: IntegrationType.WHATSAPP, + provider: IntegrationProvider.META, + isActive: true, + }, + }); + + if (tenantCredential && tenantCredential.credentials) { + const creds = tenantCredential.credentials as WhatsAppCredentials; + if (creds.accessToken && creds.phoneNumberId) { + return { + accessToken: creds.accessToken, + phoneNumberId: creds.phoneNumberId, + businessAccountId: creds.businessAccountId, + verifyToken: creds.verifyToken, + isFromPlatform: false, + tenantId, + }; + } + } + + // Fallback a credenciales de plataforma + return this.getPlatformWhatsAppCredentials(); + } + + /** + * Obtiene las credenciales de WhatsApp de la plataforma (fallback) + */ + getPlatformWhatsAppCredentials(): ResolvedWhatsAppCredentials { + const accessToken = this.configService.get('WHATSAPP_ACCESS_TOKEN'); + const phoneNumberId = this.configService.get('WHATSAPP_PHONE_NUMBER_ID'); + + if (!accessToken || !phoneNumberId) { + throw new BadRequestException('WhatsApp platform credentials not configured'); + } + + return { + accessToken, + phoneNumberId, + businessAccountId: this.configService.get('WHATSAPP_BUSINESS_ACCOUNT_ID'), + verifyToken: this.configService.get('WHATSAPP_VERIFY_TOKEN'), + isFromPlatform: true, + }; + } + + /** + * Resuelve el tenant desde un phoneNumberId de webhook + */ + async resolveTenantFromPhoneNumberId(phoneNumberId: string): Promise { + // Primero buscar en la tabla de números de WhatsApp + const whatsappNumber = await this.whatsappNumberRepo.findOne({ + where: { phoneNumberId, isActive: true }, + }); + + if (whatsappNumber) { + return whatsappNumber.tenantId; + } + + // Si es el número de plataforma, retornar null (se manejará diferente) + const platformPhoneNumberId = this.configService.get('WHATSAPP_PHONE_NUMBER_ID'); + if (phoneNumberId === platformPhoneNumberId) { + return null; // Es un mensaje al número de plataforma + } + + // Buscar en credenciales de tenant + const credential = await this.credentialRepo.findOne({ + where: { + integrationType: IntegrationType.WHATSAPP, + isActive: true, + }, + }); + + if (credential) { + const creds = credential.credentials as WhatsAppCredentials; + if (creds.phoneNumberId === phoneNumberId) { + return credential.tenantId; + } + } + + return null; + } + + // ========================================================================= + // LLM CREDENTIALS + // ========================================================================= + + /** + * Obtiene la configuración LLM para un tenant + * Si el tenant no tiene configuración propia, retorna la de plataforma + */ + async getLLMConfig(tenantId: string): Promise { + // Buscar credenciales del tenant + const tenant = await this.tenantRepo.findOne({ where: { id: tenantId } }); + const preferredProvider = tenant?.preferredLlmProvider || 'openai'; + + const tenantCredential = await this.credentialRepo.findOne({ + where: { + tenantId, + integrationType: IntegrationType.LLM, + isActive: true, + }, + }); + + if (tenantCredential && tenantCredential.credentials) { + const creds = tenantCredential.credentials as LLMCredentials; + const config = tenantCredential.config as LLMConfig; + + if (creds.apiKey) { + return { + apiKey: creds.apiKey, + provider: tenantCredential.provider, + model: config.model || this.getDefaultModel(tenantCredential.provider), + maxTokens: config.maxTokens || 1000, + temperature: config.temperature || 0.7, + baseUrl: config.baseUrl || this.getDefaultBaseUrl(tenantCredential.provider), + systemPrompt: config.systemPrompt, + isFromPlatform: false, + tenantId, + }; + } + } + + // Fallback a configuración de plataforma + return this.getPlatformLLMConfig(); + } + + /** + * Obtiene la configuración LLM de la plataforma (fallback) + */ + getPlatformLLMConfig(): ResolvedLLMConfig { + const apiKey = this.configService.get('OPENAI_API_KEY') || + this.configService.get('LLM_API_KEY'); + const provider = this.configService.get('LLM_PROVIDER', 'openai'); + + if (!apiKey) { + throw new BadRequestException('LLM platform credentials not configured'); + } + + return { + apiKey, + provider, + model: this.configService.get('LLM_MODEL', 'gpt-4o-mini'), + maxTokens: parseInt(this.configService.get('LLM_MAX_TOKENS', '1000')), + temperature: parseFloat(this.configService.get('LLM_TEMPERATURE', '0.7')), + baseUrl: this.configService.get('LLM_BASE_URL', 'https://api.openai.com/v1'), + isFromPlatform: true, + }; + } + + private getDefaultModel(provider: IntegrationProvider): string { + const defaults: Record = { + [IntegrationProvider.OPENAI]: 'gpt-4o-mini', + [IntegrationProvider.OPENROUTER]: 'anthropic/claude-3-haiku', + [IntegrationProvider.ANTHROPIC]: 'claude-3-haiku-20240307', + [IntegrationProvider.OLLAMA]: 'llama2', + [IntegrationProvider.AZURE_OPENAI]: 'gpt-4o-mini', + }; + return defaults[provider] || 'gpt-4o-mini'; + } + + private getDefaultBaseUrl(provider: IntegrationProvider): string { + const defaults: Record = { + [IntegrationProvider.OPENAI]: 'https://api.openai.com/v1', + [IntegrationProvider.OPENROUTER]: 'https://openrouter.ai/api/v1', + [IntegrationProvider.ANTHROPIC]: 'https://api.anthropic.com/v1', + [IntegrationProvider.OLLAMA]: 'http://localhost:11434/v1', + }; + return defaults[provider] || 'https://api.openai.com/v1'; + } + + // ========================================================================= + // CRUD OPERATIONS + // ========================================================================= + + /** + * Crea o actualiza credenciales de integración + */ + async upsertCredential( + tenantId: string, + integrationType: IntegrationType, + provider: IntegrationProvider, + credentials: Record, + config?: Record, + userId?: string, + ): Promise { + let credential = await this.credentialRepo.findOne({ + where: { tenantId, integrationType, provider }, + }); + + if (credential) { + credential.credentials = credentials; + credential.config = config || credential.config; + credential.updatedBy = userId; + credential.isVerified = false; // Resetear verificación al cambiar credenciales + } else { + credential = this.credentialRepo.create({ + tenantId, + integrationType, + provider, + credentials, + config: config || {}, + createdBy: userId, + updatedBy: userId, + }); + } + + return this.credentialRepo.save(credential); + } + + /** + * Obtiene todas las credenciales de un tenant + */ + async getCredentials(tenantId: string): Promise { + return this.credentialRepo.find({ + where: { tenantId }, + order: { integrationType: 'ASC', provider: 'ASC' }, + }); + } + + /** + * Obtiene una credencial específica + */ + async getCredential( + tenantId: string, + integrationType: IntegrationType, + provider: IntegrationProvider, + ): Promise { + return this.credentialRepo.findOne({ + where: { tenantId, integrationType, provider }, + }); + } + + /** + * Elimina una credencial + */ + async deleteCredential( + tenantId: string, + integrationType: IntegrationType, + provider: IntegrationProvider, + ): Promise { + await this.credentialRepo.delete({ tenantId, integrationType, provider }); + } + + /** + * Activa o desactiva una credencial + */ + async toggleCredential( + tenantId: string, + integrationType: IntegrationType, + provider: IntegrationProvider, + isActive: boolean, + ): Promise { + const credential = await this.credentialRepo.findOne({ + where: { tenantId, integrationType, provider }, + }); + + if (!credential) { + throw new NotFoundException('Credential not found'); + } + + credential.isActive = isActive; + return this.credentialRepo.save(credential); + } + + /** + * Obtiene el estado de todas las integraciones de un tenant + */ + async getIntegrationStatus(tenantId: string): Promise<{ + whatsapp: { configured: boolean; usesPlatformNumber: boolean; provider: string; isVerified: boolean }; + llm: { configured: boolean; usesPlatformDefault: boolean; provider: string; model: string; isVerified: boolean }; + payments: { + stripe: { configured: boolean; isVerified: boolean }; + mercadopago: { configured: boolean; isVerified: boolean }; + clip: { configured: boolean; isVerified: boolean }; + }; + }> { + const credentials = await this.getCredentials(tenantId); + const tenant = await this.tenantRepo.findOne({ where: { id: tenantId } }); + + const whatsappCred = credentials.find( + (c) => c.integrationType === IntegrationType.WHATSAPP && c.isActive, + ); + const llmCred = credentials.find( + (c) => c.integrationType === IntegrationType.LLM && c.isActive, + ); + + const stripeCred = credentials.find( + (c) => c.integrationType === IntegrationType.STRIPE && c.isActive, + ); + const mercadopagoCred = credentials.find( + (c) => c.integrationType === IntegrationType.MERCADOPAGO && c.isActive, + ); + const clipCred = credentials.find( + (c) => c.integrationType === IntegrationType.CLIP && c.isActive, + ); + + return { + whatsapp: { + configured: !!whatsappCred, + usesPlatformNumber: tenant?.usesPlatformNumber ?? true, + provider: whatsappCred?.provider || 'meta', + isVerified: whatsappCred?.isVerified ?? false, + }, + llm: { + configured: !!llmCred, + usesPlatformDefault: !llmCred, + provider: llmCred?.provider || tenant?.preferredLlmProvider || 'openai', + model: (llmCred?.config as LLMConfig)?.model || 'gpt-4o-mini', + isVerified: llmCred?.isVerified ?? false, + }, + payments: { + stripe: { + configured: !!stripeCred, + isVerified: stripeCred?.isVerified ?? false, + }, + mercadopago: { + configured: !!mercadopagoCred, + isVerified: mercadopagoCred?.isVerified ?? false, + }, + clip: { + configured: !!clipCred, + isVerified: clipCred?.isVerified ?? false, + }, + }, + }; + } + + // ========================================================================= + // WHATSAPP NUMBER MAPPING + // ========================================================================= + + /** + * Registra un número de WhatsApp para un tenant + */ + async registerWhatsAppNumber( + tenantId: string, + phoneNumberId: string, + phoneNumber?: string, + displayName?: string, + isPlatformNumber = false, + ): Promise { + let mapping = await this.whatsappNumberRepo.findOne({ + where: { phoneNumberId }, + }); + + if (mapping) { + mapping.tenantId = tenantId; + mapping.phoneNumber = phoneNumber || mapping.phoneNumber; + mapping.displayName = displayName || mapping.displayName; + mapping.isPlatformNumber = isPlatformNumber; + } else { + mapping = this.whatsappNumberRepo.create({ + tenantId, + phoneNumberId, + phoneNumber, + displayName, + isPlatformNumber, + }); + } + + return this.whatsappNumberRepo.save(mapping); + } +} diff --git a/src/modules/inventory/dto/inventory.dto.ts b/src/modules/inventory/dto/inventory.dto.ts new file mode 100644 index 0000000..3d012ab --- /dev/null +++ b/src/modules/inventory/dto/inventory.dto.ts @@ -0,0 +1,64 @@ +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { IsString, IsNumber, IsOptional, IsUUID, IsEnum, Min } from 'class-validator'; +import { MovementType } from '../entities/inventory-movement.entity'; + +export class CreateMovementDto { + @ApiProperty({ description: 'ID del producto' }) + @IsUUID() + productId: string; + + @ApiProperty({ enum: MovementType, description: 'Tipo de movimiento' }) + @IsEnum(MovementType) + movementType: MovementType; + + @ApiProperty({ description: 'Cantidad (positiva para entrada, negativa para salida)', example: 10 }) + @IsNumber() + quantity: number; + + @ApiPropertyOptional({ description: 'Costo unitario', example: 15.5 }) + @IsOptional() + @IsNumber() + @Min(0) + unitCost?: number; + + @ApiPropertyOptional({ description: 'Tipo de referencia (sale, purchase, etc.)' }) + @IsOptional() + @IsString() + referenceType?: string; + + @ApiPropertyOptional({ description: 'ID de referencia' }) + @IsOptional() + @IsUUID() + referenceId?: string; + + @ApiPropertyOptional({ description: 'Notas' }) + @IsOptional() + @IsString() + notes?: string; +} + +export class AdjustStockDto { + @ApiProperty({ description: 'ID del producto' }) + @IsUUID() + productId: string; + + @ApiProperty({ description: 'Nueva cantidad en stock', example: 50 }) + @IsNumber() + @Min(0) + newQuantity: number; + + @ApiPropertyOptional({ description: 'Razón del ajuste' }) + @IsOptional() + @IsString() + reason?: string; +} + +export class StockQueryDto { + @ApiPropertyOptional({ description: 'Solo productos con bajo stock' }) + @IsOptional() + lowStock?: boolean; + + @ApiPropertyOptional({ description: 'Solo productos sin stock' }) + @IsOptional() + outOfStock?: boolean; +} diff --git a/src/modules/inventory/entities/inventory-movement.entity.ts b/src/modules/inventory/entities/inventory-movement.entity.ts new file mode 100644 index 0000000..434bf82 --- /dev/null +++ b/src/modules/inventory/entities/inventory-movement.entity.ts @@ -0,0 +1,69 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Product } from '../../products/entities/product.entity'; + +export enum MovementType { + PURCHASE = 'purchase', + SALE = 'sale', + ADJUSTMENT = 'adjustment', + LOSS = 'loss', + RETURN = 'return', + TRANSFER = 'transfer', +} + +@Entity({ schema: 'inventory', name: 'inventory_movements' }) +export class InventoryMovement { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'product_id' }) + productId: string; + + @Column({ + name: 'movement_type', + type: 'varchar', + length: 20, + }) + movementType: MovementType; + + @Column({ type: 'decimal', precision: 10, scale: 3 }) + quantity: number; + + @Column({ name: 'quantity_before', type: 'decimal', precision: 10, scale: 3 }) + quantityBefore: number; + + @Column({ name: 'quantity_after', type: 'decimal', precision: 10, scale: 3 }) + quantityAfter: number; + + @Column({ name: 'unit_cost', type: 'decimal', precision: 10, scale: 2, nullable: true }) + unitCost: number; + + @Column({ name: 'reference_type', length: 20, nullable: true }) + referenceType: string; + + @Column({ name: 'reference_id', nullable: true }) + referenceId: string; + + @Column({ type: 'text', nullable: true }) + notes: string; + + @Column({ name: 'created_by', nullable: true }) + createdBy: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @ManyToOne(() => Product) + @JoinColumn({ name: 'product_id' }) + product: Product; +} diff --git a/src/modules/inventory/entities/stock-alert.entity.ts b/src/modules/inventory/entities/stock-alert.entity.ts new file mode 100644 index 0000000..ca86d50 --- /dev/null +++ b/src/modules/inventory/entities/stock-alert.entity.ts @@ -0,0 +1,64 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Product } from '../../products/entities/product.entity'; + +export enum AlertType { + LOW_STOCK = 'low_stock', + OUT_OF_STOCK = 'out_of_stock', + EXPIRING = 'expiring', +} + +export enum AlertStatus { + ACTIVE = 'active', + RESOLVED = 'resolved', + DISMISSED = 'dismissed', +} + +@Entity({ schema: 'inventory', name: 'stock_alerts' }) +export class StockAlert { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'product_id' }) + productId: string; + + @Column({ + name: 'alert_type', + type: 'varchar', + length: 20, + }) + alertType: AlertType; + + @Column({ + type: 'varchar', + length: 20, + default: AlertStatus.ACTIVE, + }) + status: AlertStatus; + + @Column({ name: 'current_stock', type: 'decimal', precision: 10, scale: 3 }) + currentStock: number; + + @Column({ name: 'threshold', type: 'decimal', precision: 10, scale: 3 }) + threshold: number; + + @Column({ name: 'resolved_at', type: 'timestamptz', nullable: true }) + resolvedAt: Date; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @ManyToOne(() => Product) + @JoinColumn({ name: 'product_id' }) + product: Product; +} diff --git a/src/modules/inventory/inventory.controller.ts b/src/modules/inventory/inventory.controller.ts new file mode 100644 index 0000000..950fdd3 --- /dev/null +++ b/src/modules/inventory/inventory.controller.ts @@ -0,0 +1,91 @@ +import { + Controller, + Get, + Post, + Patch, + Param, + Body, + Query, + UseGuards, + Request, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { InventoryService } from './inventory.service'; +import { CreateMovementDto, AdjustStockDto } from './dto/inventory.dto'; + +@ApiTags('inventory') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/inventory') +export class InventoryController { + constructor(private readonly inventoryService: InventoryService) {} + + // ==================== MOVEMENTS ==================== + + @Get('movements') + @ApiOperation({ summary: 'Listar movimientos de inventario' }) + @ApiQuery({ name: 'productId', required: false }) + @ApiQuery({ name: 'limit', required: false }) + getMovements( + @Request() req, + @Query('productId') productId?: string, + @Query('limit') limit?: number, + ) { + return this.inventoryService.getMovements(req.user.tenantId, productId, limit); + } + + @Get('movements/product/:productId') + @ApiOperation({ summary: 'Historial de movimientos de un producto' }) + getProductHistory(@Request() req, @Param('productId') productId: string) { + return this.inventoryService.getProductHistory(req.user.tenantId, productId); + } + + @Post('movements') + @ApiOperation({ summary: 'Registrar movimiento de inventario' }) + createMovement(@Request() req, @Body() dto: CreateMovementDto) { + return this.inventoryService.createMovement(req.user.tenantId, dto, req.user.id); + } + + @Post('adjust') + @ApiOperation({ summary: 'Ajustar stock de un producto' }) + adjustStock(@Request() req, @Body() dto: AdjustStockDto) { + return this.inventoryService.adjustStock(req.user.tenantId, dto, req.user.id); + } + + // ==================== ALERTS ==================== + + @Get('alerts') + @ApiOperation({ summary: 'Listar alertas activas de stock' }) + getAlerts(@Request() req) { + return this.inventoryService.getActiveAlerts(req.user.tenantId); + } + + @Patch('alerts/:id/dismiss') + @ApiOperation({ summary: 'Descartar una alerta' }) + dismissAlert(@Request() req, @Param('id') id: string) { + return this.inventoryService.dismissAlert(req.user.tenantId, id); + } + + // ==================== LOW STOCK ==================== + + @Get('low-stock') + @ApiOperation({ summary: 'Productos con bajo stock' }) + getLowStock(@Request() req) { + return this.inventoryService.getLowStockProducts(req.user.tenantId); + } + + @Get('out-of-stock') + @ApiOperation({ summary: 'Productos sin stock' }) + getOutOfStock(@Request() req) { + return this.inventoryService.getOutOfStockProducts(req.user.tenantId); + } + + // ==================== STATS ==================== + + @Get('stats') + @ApiOperation({ summary: 'Estadísticas de inventario' }) + getStats(@Request() req) { + return this.inventoryService.getInventoryStats(req.user.tenantId); + } +} diff --git a/src/modules/inventory/inventory.module.ts b/src/modules/inventory/inventory.module.ts new file mode 100644 index 0000000..6fa678f --- /dev/null +++ b/src/modules/inventory/inventory.module.ts @@ -0,0 +1,15 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { InventoryController } from './inventory.controller'; +import { InventoryService } from './inventory.service'; +import { InventoryMovement } from './entities/inventory-movement.entity'; +import { StockAlert } from './entities/stock-alert.entity'; +import { Product } from '../products/entities/product.entity'; + +@Module({ + imports: [TypeOrmModule.forFeature([InventoryMovement, StockAlert, Product])], + controllers: [InventoryController], + providers: [InventoryService], + exports: [InventoryService], +}) +export class InventoryModule {} diff --git a/src/modules/inventory/inventory.service.ts b/src/modules/inventory/inventory.service.ts new file mode 100644 index 0000000..6bb2c1b --- /dev/null +++ b/src/modules/inventory/inventory.service.ts @@ -0,0 +1,232 @@ +import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository, LessThanOrEqual } from 'typeorm'; +import { InventoryMovement, MovementType } from './entities/inventory-movement.entity'; +import { StockAlert, AlertType, AlertStatus } from './entities/stock-alert.entity'; +import { Product } from '../products/entities/product.entity'; +import { CreateMovementDto, AdjustStockDto } from './dto/inventory.dto'; + +@Injectable() +export class InventoryService { + constructor( + @InjectRepository(InventoryMovement) + private readonly movementRepo: Repository, + @InjectRepository(StockAlert) + private readonly alertRepo: Repository, + @InjectRepository(Product) + private readonly productRepo: Repository, + ) {} + + // ==================== MOVEMENTS ==================== + + async createMovement(tenantId: string, dto: CreateMovementDto, userId?: string): Promise { + const product = await this.productRepo.findOne({ + where: { id: dto.productId, tenantId }, + }); + + if (!product) { + throw new NotFoundException('Producto no encontrado'); + } + + const quantityBefore = Number(product.stockQuantity); + const quantityAfter = quantityBefore + dto.quantity; + + if (quantityAfter < 0) { + throw new BadRequestException( + `Stock insuficiente. Disponible: ${quantityBefore}, Solicitado: ${Math.abs(dto.quantity)}`, + ); + } + + // Create movement record + const movement = this.movementRepo.create({ + tenantId, + productId: dto.productId, + movementType: dto.movementType, + quantity: dto.quantity, + quantityBefore, + quantityAfter, + unitCost: dto.unitCost, + referenceType: dto.referenceType, + referenceId: dto.referenceId, + notes: dto.notes, + createdBy: userId, + }); + + await this.movementRepo.save(movement); + + // Update product stock + product.stockQuantity = quantityAfter; + await this.productRepo.save(product); + + // Check for alerts + await this.checkStockAlerts(tenantId, product); + + return movement; + } + + async adjustStock(tenantId: string, dto: AdjustStockDto, userId?: string): Promise { + const product = await this.productRepo.findOne({ + where: { id: dto.productId, tenantId }, + }); + + if (!product) { + throw new NotFoundException('Producto no encontrado'); + } + + const quantityBefore = Number(product.stockQuantity); + const difference = dto.newQuantity - quantityBefore; + + return this.createMovement( + tenantId, + { + productId: dto.productId, + movementType: MovementType.ADJUSTMENT, + quantity: difference, + notes: dto.reason || `Ajuste de inventario: ${quantityBefore} -> ${dto.newQuantity}`, + }, + userId, + ); + } + + async getMovements(tenantId: string, productId?: string, limit = 50): Promise { + const where: any = { tenantId }; + if (productId) { + where.productId = productId; + } + + return this.movementRepo.find({ + where, + relations: ['product'], + order: { createdAt: 'DESC' }, + take: limit, + }); + } + + async getProductHistory(tenantId: string, productId: string): Promise { + return this.movementRepo.find({ + where: { tenantId, productId }, + order: { createdAt: 'DESC' }, + }); + } + + // ==================== ALERTS ==================== + + async checkStockAlerts(tenantId: string, product: Product): Promise { + const currentStock = Number(product.stockQuantity); + const threshold = Number(product.lowStockThreshold); + + // Resolve existing alerts if stock is restored + if (currentStock > threshold) { + await this.alertRepo.update( + { productId: product.id, status: AlertStatus.ACTIVE }, + { status: AlertStatus.RESOLVED, resolvedAt: new Date() }, + ); + return; + } + + // Check for existing active alert + const existingAlert = await this.alertRepo.findOne({ + where: { productId: product.id, status: AlertStatus.ACTIVE }, + }); + + if (existingAlert) { + existingAlert.currentStock = currentStock; + await this.alertRepo.save(existingAlert); + return; + } + + // Create new alert + const alertType = currentStock <= 0 ? AlertType.OUT_OF_STOCK : AlertType.LOW_STOCK; + const alert = this.alertRepo.create({ + tenantId, + productId: product.id, + alertType, + currentStock, + threshold, + }); + + await this.alertRepo.save(alert); + } + + async getActiveAlerts(tenantId: string): Promise { + return this.alertRepo.find({ + where: { tenantId, status: AlertStatus.ACTIVE }, + relations: ['product'], + order: { createdAt: 'DESC' }, + }); + } + + async dismissAlert(tenantId: string, alertId: string): Promise { + const alert = await this.alertRepo.findOne({ + where: { id: alertId, tenantId }, + }); + + if (!alert) { + throw new NotFoundException('Alerta no encontrada'); + } + + alert.status = AlertStatus.DISMISSED; + return this.alertRepo.save(alert); + } + + // ==================== LOW STOCK ==================== + + async getLowStockProducts(tenantId: string): Promise { + return this.productRepo + .createQueryBuilder('product') + .where('product.tenant_id = :tenantId', { tenantId }) + .andWhere('product.track_inventory = true') + .andWhere('product.stock_quantity <= product.low_stock_threshold') + .andWhere("product.status = 'active'") + .orderBy('product.stock_quantity', 'ASC') + .getMany(); + } + + async getOutOfStockProducts(tenantId: string): Promise { + return this.productRepo.find({ + where: { + tenantId, + trackInventory: true, + stockQuantity: LessThanOrEqual(0), + status: 'active', + }, + order: { name: 'ASC' }, + }); + } + + // ==================== STATS ==================== + + async getInventoryStats(tenantId: string) { + const products = await this.productRepo.find({ + where: { tenantId, trackInventory: true, status: 'active' }, + }); + + let totalValue = 0; + let lowStockCount = 0; + let outOfStockCount = 0; + + for (const product of products) { + const stock = Number(product.stockQuantity); + const cost = Number(product.costPrice) || 0; + totalValue += stock * cost; + + if (stock <= 0) { + outOfStockCount++; + } else if (stock <= Number(product.lowStockThreshold)) { + lowStockCount++; + } + } + + const activeAlerts = await this.alertRepo.count({ + where: { tenantId, status: AlertStatus.ACTIVE }, + }); + + return { + totalProducts: products.length, + totalValue, + lowStockCount, + outOfStockCount, + activeAlerts, + }; + } +} diff --git a/src/modules/invoices/dto/create-invoice.dto.ts b/src/modules/invoices/dto/create-invoice.dto.ts new file mode 100644 index 0000000..3c01de0 --- /dev/null +++ b/src/modules/invoices/dto/create-invoice.dto.ts @@ -0,0 +1,120 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { + IsString, + IsNumber, + IsOptional, + IsArray, + ValidateNested, + Length, + IsEmail, + Min, +} from 'class-validator'; +import { Type } from 'class-transformer'; + +export class InvoiceItemDto { + @ApiProperty({ example: '50202301', description: 'Clave producto/servicio SAT' }) + @IsString() + @Length(8, 8) + claveProdServ: string; + + @ApiProperty({ example: 'Coca-Cola 600ml', description: 'Descripcion del producto' }) + @IsString() + descripcion: string; + + @ApiProperty({ example: 2, description: 'Cantidad' }) + @IsNumber() + @Min(0.000001) + cantidad: number; + + @ApiProperty({ example: 'H87', description: 'Clave unidad SAT' }) + @IsString() + @Length(2, 3) + claveUnidad: string; + + @ApiProperty({ example: 'Pieza', description: 'Descripcion de la unidad', required: false }) + @IsString() + @IsOptional() + unidad?: string; + + @ApiProperty({ example: 18.00, description: 'Valor unitario' }) + @IsNumber() + @Min(0) + valorUnitario: number; + + @ApiProperty({ example: 0, description: 'Descuento', required: false }) + @IsNumber() + @IsOptional() + descuento?: number; + + @ApiProperty({ example: 'product-uuid', description: 'ID del producto', required: false }) + @IsString() + @IsOptional() + productId?: string; +} + +export class CreateInvoiceDto { + @ApiProperty({ example: 'sale-uuid', description: 'ID de la venta asociada', required: false }) + @IsString() + @IsOptional() + saleId?: string; + + // Receptor + @ApiProperty({ example: 'XAXX010101000', description: 'RFC del receptor' }) + @IsString() + @Length(12, 13) + receptorRfc: string; + + @ApiProperty({ example: 'Juan Perez', description: 'Nombre o razon social' }) + @IsString() + receptorNombre: string; + + @ApiProperty({ example: '601', description: 'Regimen fiscal del receptor', required: false }) + @IsString() + @IsOptional() + @Length(3, 3) + receptorRegimenFiscal?: string; + + @ApiProperty({ example: '06600', description: 'Codigo postal del receptor' }) + @IsString() + @Length(5, 5) + receptorCodigoPostal: string; + + @ApiProperty({ example: 'G03', description: 'Uso del CFDI' }) + @IsString() + @Length(3, 4) + receptorUsoCfdi: string; + + @ApiProperty({ example: 'cliente@email.com', description: 'Email para envio', required: false }) + @IsEmail() + @IsOptional() + receptorEmail?: string; + + // Pago + @ApiProperty({ example: '01', description: 'Forma de pago SAT (01=Efectivo, 04=Tarjeta)' }) + @IsString() + @Length(2, 2) + formaPago: string; + + @ApiProperty({ example: 'PUE', description: 'Metodo de pago (PUE=Una sola exhibicion)' }) + @IsString() + @Length(3, 3) + metodoPago: string; + + @ApiProperty({ example: 'Contado', description: 'Condiciones de pago', required: false }) + @IsString() + @IsOptional() + condicionesPago?: string; + + // Items + @ApiProperty({ type: [InvoiceItemDto], description: 'Conceptos de la factura' }) + @IsArray() + @ValidateNested({ each: true }) + @Type(() => InvoiceItemDto) + items: InvoiceItemDto[]; + + // Opcional + @ApiProperty({ description: 'Notas adicionales', required: false }) + @IsString() + @IsOptional() + notes?: string; +} diff --git a/src/modules/invoices/entities/invoice-item.entity.ts b/src/modules/invoices/entities/invoice-item.entity.ts new file mode 100644 index 0000000..f5de32c --- /dev/null +++ b/src/modules/invoices/entities/invoice-item.entity.ts @@ -0,0 +1,64 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Invoice } from './invoice.entity'; + +@Entity({ schema: 'billing', name: 'invoice_items' }) +export class InvoiceItem { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'invoice_id' }) + invoiceId: string; + + @Column({ name: 'product_id', nullable: true }) + productId: string; + + // Clave SAT + @Column({ name: 'clave_prod_serv', length: 8 }) + claveProdServ: string; + + @Column({ name: 'no_identificacion', length: 100, nullable: true }) + noIdentificacion: string; + + // Descripcion + @Column({ length: 1000 }) + descripcion: string; + + // Cantidad + @Column({ type: 'decimal', precision: 12, scale: 6 }) + cantidad: number; + + @Column({ name: 'clave_unidad', length: 3 }) + claveUnidad: string; + + @Column({ length: 20, nullable: true }) + unidad: string; + + // Precios + @Column({ name: 'valor_unitario', type: 'decimal', precision: 12, scale: 6 }) + valorUnitario: number; + + @Column({ type: 'decimal', precision: 12, scale: 2, default: 0 }) + descuento: number; + + @Column({ type: 'decimal', precision: 12, scale: 2 }) + importe: number; + + // Objeto de impuesto + @Column({ name: 'objeto_imp', length: 2, default: '02' }) + objetoImp: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @ManyToOne(() => Invoice, (invoice) => invoice.items) + @JoinColumn({ name: 'invoice_id' }) + invoice: Invoice; +} diff --git a/src/modules/invoices/entities/invoice.entity.ts b/src/modules/invoices/entities/invoice.entity.ts new file mode 100644 index 0000000..7b06a5f --- /dev/null +++ b/src/modules/invoices/entities/invoice.entity.ts @@ -0,0 +1,152 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + OneToMany, +} from 'typeorm'; +import { InvoiceItem } from './invoice-item.entity'; + +export enum InvoiceType { + INGRESO = 'I', + EGRESO = 'E', + TRASLADO = 'T', + PAGO = 'P', + NOMINA = 'N', +} + +export enum InvoiceStatus { + DRAFT = 'draft', + PENDING = 'pending', + STAMPED = 'stamped', + SENT = 'sent', + CANCELLED = 'cancelled', +} + +@Entity({ schema: 'billing', name: 'invoices' }) +export class Invoice { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'sale_id', nullable: true }) + saleId: string; + + // Tipo + @Column({ name: 'tipo_comprobante', length: 1, default: InvoiceType.INGRESO }) + tipoComprobante: InvoiceType; + + // Folio fiscal + @Column({ length: 36, unique: true, nullable: true }) + uuid: string; + + @Column({ length: 10, nullable: true }) + serie: string; + + @Column({ nullable: true }) + folio: number; + + // Receptor + @Column({ name: 'receptor_rfc', length: 13 }) + receptorRfc: string; + + @Column({ name: 'receptor_nombre', length: 200 }) + receptorNombre: string; + + @Column({ name: 'receptor_regimen_fiscal', length: 3, nullable: true }) + receptorRegimenFiscal: string; + + @Column({ name: 'receptor_codigo_postal', length: 5 }) + receptorCodigoPostal: string; + + @Column({ name: 'receptor_uso_cfdi', length: 4 }) + receptorUsoCfdi: string; + + @Column({ name: 'receptor_email', length: 200, nullable: true }) + receptorEmail: string; + + // Montos + @Column({ type: 'decimal', precision: 12, scale: 2 }) + subtotal: number; + + @Column({ type: 'decimal', precision: 12, scale: 2, default: 0 }) + descuento: number; + + @Column({ name: 'total_impuestos_trasladados', type: 'decimal', precision: 12, scale: 2, default: 0 }) + totalImpuestosTrasladados: number; + + @Column({ name: 'total_impuestos_retenidos', type: 'decimal', precision: 12, scale: 2, default: 0 }) + totalImpuestosRetenidos: number; + + @Column({ type: 'decimal', precision: 12, scale: 2 }) + total: number; + + // Pago + @Column({ name: 'forma_pago', length: 2 }) + formaPago: string; + + @Column({ name: 'metodo_pago', length: 3 }) + metodoPago: string; + + @Column({ name: 'condiciones_pago', length: 100, nullable: true }) + condicionesPago: string; + + // Moneda + @Column({ length: 3, default: 'MXN' }) + moneda: string; + + @Column({ name: 'tipo_cambio', type: 'decimal', precision: 10, scale: 6, default: 1 }) + tipoCambio: number; + + // Archivos + @Column({ name: 'xml_url', type: 'text', nullable: true }) + xmlUrl: string; + + @Column({ name: 'pdf_url', type: 'text', nullable: true }) + pdfUrl: string; + + @Column({ name: 'qr_url', type: 'text', nullable: true }) + qrUrl: string; + + // Estado + @Column({ + type: 'varchar', + length: 20, + default: InvoiceStatus.DRAFT, + }) + status: InvoiceStatus; + + // Cancelacion + @Column({ name: 'cancelled_at', type: 'timestamptz', nullable: true }) + cancelledAt: Date; + + @Column({ name: 'cancel_reason', length: 2, nullable: true }) + cancelReason: string; + + @Column({ name: 'cancel_uuid_replacement', length: 36, nullable: true }) + cancelUuidReplacement: string; + + // Timbrado + @Column({ name: 'stamped_at', type: 'timestamptz', nullable: true }) + stampedAt: Date; + + @Column({ name: 'pac_response', type: 'jsonb', nullable: true }) + pacResponse: Record; + + // Metadata + @Column({ type: 'text', nullable: true }) + notes: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @OneToMany(() => InvoiceItem, (item) => item.invoice) + items: InvoiceItem[]; +} diff --git a/src/modules/invoices/entities/tax-config.entity.ts b/src/modules/invoices/entities/tax-config.entity.ts new file mode 100644 index 0000000..1cba897 --- /dev/null +++ b/src/modules/invoices/entities/tax-config.entity.ts @@ -0,0 +1,87 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, +} from 'typeorm'; + +export enum TaxConfigStatus { + PENDING = 'pending', + ACTIVE = 'active', + SUSPENDED = 'suspended', +} + +@Entity({ schema: 'billing', name: 'tax_configs' }) +export class TaxConfig { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id', unique: true }) + tenantId: string; + + // Datos fiscales + @Column({ length: 13 }) + rfc: string; + + @Column({ name: 'razon_social', length: 200 }) + razonSocial: string; + + @Column({ name: 'regimen_fiscal', length: 3 }) + regimenFiscal: string; + + @Column({ name: 'codigo_postal', length: 5 }) + codigoPostal: string; + + // CSD (encrypted fields) + @Column({ name: 'csd_certificate', type: 'text', nullable: true }) + csdCertificate: string; + + @Column({ name: 'csd_private_key_encrypted', type: 'text', nullable: true }) + csdPrivateKeyEncrypted: string; + + @Column({ name: 'csd_password_encrypted', type: 'text', nullable: true }) + csdPasswordEncrypted: string; + + @Column({ name: 'csd_valid_from', type: 'timestamptz', nullable: true }) + csdValidFrom: Date; + + @Column({ name: 'csd_valid_to', type: 'timestamptz', nullable: true }) + csdValidTo: Date; + + // PAC + @Column({ name: 'pac_provider', length: 20, default: 'facturapi' }) + pacProvider: string; + + @Column({ name: 'pac_api_key_encrypted', type: 'text', nullable: true }) + pacApiKeyEncrypted: string; + + @Column({ name: 'pac_sandbox', default: true }) + pacSandbox: boolean; + + // Configuracion + @Column({ length: 10, default: 'A' }) + serie: string; + + @Column({ name: 'folio_actual', default: 1 }) + folioActual: number; + + @Column({ name: 'auto_send_email', default: true }) + autoSendEmail: boolean; + + @Column({ name: 'logo_url', type: 'text', nullable: true }) + logoUrl: string; + + @Column({ + type: 'varchar', + length: 20, + default: TaxConfigStatus.PENDING, + }) + status: TaxConfigStatus; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; +} diff --git a/src/modules/invoices/invoices.controller.ts b/src/modules/invoices/invoices.controller.ts new file mode 100644 index 0000000..370e296 --- /dev/null +++ b/src/modules/invoices/invoices.controller.ts @@ -0,0 +1,117 @@ +import { + Controller, + Get, + Post, + Body, + Param, + Query, + Request, + UseGuards, + ParseUUIDPipe, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { InvoicesService } from './invoices.service'; +import { CreateInvoiceDto } from './dto/create-invoice.dto'; +import { TaxConfig } from './entities/tax-config.entity'; +import { InvoiceStatus } from './entities/invoice.entity'; + +@ApiTags('Invoices') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('invoices') +export class InvoicesController { + constructor(private readonly invoicesService: InvoicesService) {} + + // ==================== TAX CONFIG ==================== + + @Get('tax-config') + @ApiOperation({ summary: 'Obtener configuracion fiscal del tenant' }) + async getTaxConfig(@Request() req): Promise { + return this.invoicesService.getTaxConfig(req.user.tenantId); + } + + @Post('tax-config') + @ApiOperation({ summary: 'Guardar/actualizar configuracion fiscal' }) + async saveTaxConfig( + @Request() req, + @Body() data: Partial, + ): Promise { + return this.invoicesService.saveTaxConfig(req.user.tenantId, data); + } + + // ==================== INVOICES ==================== + + @Post() + @ApiOperation({ summary: 'Crear nueva factura' }) + async createInvoice( + @Request() req, + @Body() dto: CreateInvoiceDto, + ) { + return this.invoicesService.createInvoice(req.user.tenantId, dto); + } + + @Get() + @ApiOperation({ summary: 'Listar facturas del tenant' }) + @ApiQuery({ name: 'status', required: false, enum: InvoiceStatus }) + @ApiQuery({ name: 'from', required: false, type: String }) + @ApiQuery({ name: 'to', required: false, type: String }) + @ApiQuery({ name: 'limit', required: false, type: Number }) + async getInvoices( + @Request() req, + @Query('status') status?: InvoiceStatus, + @Query('from') from?: string, + @Query('to') to?: string, + @Query('limit') limit?: number, + ) { + return this.invoicesService.getInvoices(req.user.tenantId, { + status, + from: from ? new Date(from) : undefined, + to: to ? new Date(to) : undefined, + limit: limit ? Number(limit) : undefined, + }); + } + + @Get('summary') + @ApiOperation({ summary: 'Obtener resumen de facturacion del mes' }) + @ApiQuery({ name: 'month', required: false, type: String, description: 'YYYY-MM-DD' }) + async getSummary( + @Request() req, + @Query('month') month?: string, + ) { + return this.invoicesService.getSummary( + req.user.tenantId, + month ? new Date(month) : undefined, + ); + } + + @Get(':id') + @ApiOperation({ summary: 'Obtener factura por ID' }) + async getInvoice(@Param('id', ParseUUIDPipe) id: string) { + return this.invoicesService.getInvoice(id); + } + + @Post(':id/stamp') + @ApiOperation({ summary: 'Timbrar factura (enviar al SAT)' }) + async stampInvoice(@Param('id', ParseUUIDPipe) id: string) { + return this.invoicesService.stampInvoice(id); + } + + @Post(':id/cancel') + @ApiOperation({ summary: 'Cancelar factura' }) + async cancelInvoice( + @Param('id', ParseUUIDPipe) id: string, + @Body() body: { reason: string; uuidReplacement?: string }, + ) { + return this.invoicesService.cancelInvoice(id, body.reason, body.uuidReplacement); + } + + @Post(':id/send') + @ApiOperation({ summary: 'Enviar factura por email' }) + async sendInvoice( + @Param('id', ParseUUIDPipe) id: string, + @Body() body: { email?: string }, + ) { + return this.invoicesService.sendInvoice(id, body.email); + } +} diff --git a/src/modules/invoices/invoices.module.ts b/src/modules/invoices/invoices.module.ts new file mode 100644 index 0000000..448571a --- /dev/null +++ b/src/modules/invoices/invoices.module.ts @@ -0,0 +1,17 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { TaxConfig } from './entities/tax-config.entity'; +import { Invoice } from './entities/invoice.entity'; +import { InvoiceItem } from './entities/invoice-item.entity'; +import { InvoicesService } from './invoices.service'; +import { InvoicesController } from './invoices.controller'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([TaxConfig, Invoice, InvoiceItem]), + ], + controllers: [InvoicesController], + providers: [InvoicesService], + exports: [InvoicesService], +}) +export class InvoicesModule {} diff --git a/src/modules/invoices/invoices.service.ts b/src/modules/invoices/invoices.service.ts new file mode 100644 index 0000000..4a38b05 --- /dev/null +++ b/src/modules/invoices/invoices.service.ts @@ -0,0 +1,252 @@ +import { + Injectable, + NotFoundException, + BadRequestException, +} from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository, DataSource } from 'typeorm'; +import { TaxConfig, TaxConfigStatus } from './entities/tax-config.entity'; +import { Invoice, InvoiceStatus, InvoiceType } from './entities/invoice.entity'; +import { InvoiceItem } from './entities/invoice-item.entity'; +import { CreateInvoiceDto } from './dto/create-invoice.dto'; + +@Injectable() +export class InvoicesService { + constructor( + @InjectRepository(TaxConfig) + private readonly taxConfigRepo: Repository, + @InjectRepository(Invoice) + private readonly invoiceRepo: Repository, + @InjectRepository(InvoiceItem) + private readonly itemRepo: Repository, + private readonly dataSource: DataSource, + ) {} + + // ==================== TAX CONFIG ==================== + + async getTaxConfig(tenantId: string): Promise { + return this.taxConfigRepo.findOne({ where: { tenantId } }); + } + + async saveTaxConfig( + tenantId: string, + data: Partial, + ): Promise { + let config = await this.getTaxConfig(tenantId); + + if (config) { + Object.assign(config, data); + } else { + config = this.taxConfigRepo.create({ tenantId, ...data }); + } + + return this.taxConfigRepo.save(config); + } + + // ==================== INVOICES ==================== + + async createInvoice(tenantId: string, dto: CreateInvoiceDto): Promise { + const taxConfig = await this.getTaxConfig(tenantId); + if (!taxConfig || taxConfig.status !== TaxConfigStatus.ACTIVE) { + throw new BadRequestException('Configuracion fiscal no activa'); + } + + // Calculate totals + let subtotal = 0; + let totalIva = 0; + + for (const item of dto.items) { + const importe = item.cantidad * item.valorUnitario - (item.descuento || 0); + subtotal += importe; + // IVA 16% + totalIva += importe * 0.16; + } + + const total = subtotal + totalIva; + + // Get next folio + const folioResult = await this.dataSource.query( + `SELECT get_next_invoice_folio($1, $2) as folio`, + [tenantId, taxConfig.serie], + ); + const folio = folioResult[0].folio; + + // Create invoice + const invoice = this.invoiceRepo.create({ + tenantId, + saleId: dto.saleId, + tipoComprobante: InvoiceType.INGRESO, + serie: taxConfig.serie, + folio, + receptorRfc: dto.receptorRfc.toUpperCase(), + receptorNombre: dto.receptorNombre, + receptorRegimenFiscal: dto.receptorRegimenFiscal, + receptorCodigoPostal: dto.receptorCodigoPostal, + receptorUsoCfdi: dto.receptorUsoCfdi, + receptorEmail: dto.receptorEmail, + subtotal, + totalImpuestosTrasladados: totalIva, + total, + formaPago: dto.formaPago, + metodoPago: dto.metodoPago, + condicionesPago: dto.condicionesPago, + status: InvoiceStatus.DRAFT, + notes: dto.notes, + }); + + await this.invoiceRepo.save(invoice); + + // Create items + for (const itemDto of dto.items) { + const importe = itemDto.cantidad * itemDto.valorUnitario - (itemDto.descuento || 0); + + const item = this.itemRepo.create({ + invoiceId: invoice.id, + productId: itemDto.productId, + claveProdServ: itemDto.claveProdServ, + descripcion: itemDto.descripcion, + cantidad: itemDto.cantidad, + claveUnidad: itemDto.claveUnidad, + unidad: itemDto.unidad, + valorUnitario: itemDto.valorUnitario, + descuento: itemDto.descuento || 0, + importe, + }); + + await this.itemRepo.save(item); + } + + return this.getInvoice(invoice.id); + } + + async getInvoice(id: string): Promise { + const invoice = await this.invoiceRepo.findOne({ + where: { id }, + relations: ['items'], + }); + + if (!invoice) { + throw new NotFoundException('Factura no encontrada'); + } + + return invoice; + } + + async getInvoices( + tenantId: string, + options?: { + status?: InvoiceStatus; + from?: Date; + to?: Date; + limit?: number; + }, + ): Promise { + const query = this.invoiceRepo.createQueryBuilder('invoice') + .where('invoice.tenant_id = :tenantId', { tenantId }) + .leftJoinAndSelect('invoice.items', 'items') + .orderBy('invoice.created_at', 'DESC'); + + if (options?.status) { + query.andWhere('invoice.status = :status', { status: options.status }); + } + + if (options?.from) { + query.andWhere('invoice.created_at >= :from', { from: options.from }); + } + + if (options?.to) { + query.andWhere('invoice.created_at <= :to', { to: options.to }); + } + + if (options?.limit) { + query.limit(options.limit); + } + + return query.getMany(); + } + + async stampInvoice(id: string): Promise { + const invoice = await this.getInvoice(id); + + if (invoice.status !== InvoiceStatus.DRAFT && invoice.status !== InvoiceStatus.PENDING) { + throw new BadRequestException(`No se puede timbrar factura con estado: ${invoice.status}`); + } + + const taxConfig = await this.getTaxConfig(invoice.tenantId); + if (!taxConfig) { + throw new BadRequestException('Configuracion fiscal no encontrada'); + } + + // In production, this would call the PAC API (Facturapi, etc.) + // For now, generate mock UUID + const mockUuid = `${Date.now().toString(36)}-${Math.random().toString(36).substr(2, 9)}`.toUpperCase(); + + invoice.uuid = mockUuid; + invoice.status = InvoiceStatus.STAMPED; + invoice.stampedAt = new Date(); + invoice.pacResponse = { + provider: taxConfig.pacProvider, + sandbox: taxConfig.pacSandbox, + timestamp: new Date().toISOString(), + }; + + return this.invoiceRepo.save(invoice); + } + + async cancelInvoice( + id: string, + reason: string, + uuidReplacement?: string, + ): Promise { + const invoice = await this.getInvoice(id); + + if (invoice.status !== InvoiceStatus.STAMPED && invoice.status !== InvoiceStatus.SENT) { + throw new BadRequestException(`No se puede cancelar factura con estado: ${invoice.status}`); + } + + // In production, this would call the PAC API to cancel + invoice.status = InvoiceStatus.CANCELLED; + invoice.cancelledAt = new Date(); + invoice.cancelReason = reason; + invoice.cancelUuidReplacement = uuidReplacement; + + return this.invoiceRepo.save(invoice); + } + + async sendInvoice(id: string, email?: string): Promise { + const invoice = await this.getInvoice(id); + + if (invoice.status !== InvoiceStatus.STAMPED) { + throw new BadRequestException('Solo se pueden enviar facturas timbradas'); + } + + const targetEmail = email || invoice.receptorEmail; + if (!targetEmail) { + throw new BadRequestException('No hay email de destino'); + } + + // In production, this would send the email with PDF and XML + invoice.status = InvoiceStatus.SENT; + + return this.invoiceRepo.save(invoice); + } + + // ==================== SUMMARY ==================== + + async getSummary(tenantId: string, month?: Date) { + const targetMonth = month || new Date(); + const monthStr = targetMonth.toISOString().split('T')[0]; + + const result = await this.dataSource.query( + `SELECT * FROM get_invoice_summary($1, $2::date)`, + [tenantId, monthStr], + ); + + return result[0] || { + total_invoices: 0, + total_amount: 0, + total_cancelled: 0, + by_status: {}, + }; + } +} diff --git a/src/modules/marketplace/dto/create-supplier-order.dto.ts b/src/modules/marketplace/dto/create-supplier-order.dto.ts new file mode 100644 index 0000000..8853418 --- /dev/null +++ b/src/modules/marketplace/dto/create-supplier-order.dto.ts @@ -0,0 +1,74 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { + IsString, + IsNumber, + IsOptional, + IsArray, + ValidateNested, + IsUUID, + Min, + IsDateString, +} from 'class-validator'; +import { Type } from 'class-transformer'; + +export class SupplierOrderItemDto { + @ApiProperty({ description: 'ID del producto del proveedor' }) + @IsUUID() + productId: string; + + @ApiProperty({ example: 10, description: 'Cantidad a ordenar' }) + @IsNumber() + @Min(1) + quantity: number; + + @ApiProperty({ description: 'Notas para este item', required: false }) + @IsString() + @IsOptional() + notes?: string; +} + +export class CreateSupplierOrderDto { + @ApiProperty({ description: 'ID del proveedor' }) + @IsUUID() + supplierId: string; + + @ApiProperty({ type: [SupplierOrderItemDto], description: 'Items del pedido' }) + @IsArray() + @ValidateNested({ each: true }) + @Type(() => SupplierOrderItemDto) + items: SupplierOrderItemDto[]; + + @ApiProperty({ description: 'Direccion de entrega' }) + @IsString() + deliveryAddress: string; + + @ApiProperty({ description: 'Ciudad', required: false }) + @IsString() + @IsOptional() + deliveryCity?: string; + + @ApiProperty({ description: 'Codigo postal', required: false }) + @IsString() + @IsOptional() + deliveryZip?: string; + + @ApiProperty({ description: 'Telefono de contacto', required: false }) + @IsString() + @IsOptional() + deliveryPhone?: string; + + @ApiProperty({ description: 'Nombre de contacto', required: false }) + @IsString() + @IsOptional() + deliveryContact?: string; + + @ApiProperty({ description: 'Fecha solicitada de entrega (YYYY-MM-DD)', required: false }) + @IsDateString() + @IsOptional() + requestedDate?: string; + + @ApiProperty({ description: 'Notas adicionales', required: false }) + @IsString() + @IsOptional() + notes?: string; +} diff --git a/src/modules/marketplace/dto/create-supplier-review.dto.ts b/src/modules/marketplace/dto/create-supplier-review.dto.ts new file mode 100644 index 0000000..3c594b8 --- /dev/null +++ b/src/modules/marketplace/dto/create-supplier-review.dto.ts @@ -0,0 +1,57 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { + IsString, + IsNumber, + IsOptional, + IsUUID, + Min, + Max, +} from 'class-validator'; + +export class CreateSupplierReviewDto { + @ApiProperty({ description: 'ID del proveedor' }) + @IsUUID() + supplierId: string; + + @ApiProperty({ description: 'ID de la orden (opcional)', required: false }) + @IsUUID() + @IsOptional() + orderId?: string; + + @ApiProperty({ example: 5, description: 'Rating general (1-5)' }) + @IsNumber() + @Min(1) + @Max(5) + rating: number; + + @ApiProperty({ description: 'Titulo de la resena', required: false }) + @IsString() + @IsOptional() + title?: string; + + @ApiProperty({ description: 'Comentario', required: false }) + @IsString() + @IsOptional() + comment?: string; + + @ApiProperty({ description: 'Rating de calidad (1-5)', required: false }) + @IsNumber() + @Min(1) + @Max(5) + @IsOptional() + ratingQuality?: number; + + @ApiProperty({ description: 'Rating de entrega (1-5)', required: false }) + @IsNumber() + @Min(1) + @Max(5) + @IsOptional() + ratingDelivery?: number; + + @ApiProperty({ description: 'Rating de precio (1-5)', required: false }) + @IsNumber() + @Min(1) + @Max(5) + @IsOptional() + ratingPrice?: number; +} diff --git a/src/modules/marketplace/entities/supplier-favorites.entity.ts b/src/modules/marketplace/entities/supplier-favorites.entity.ts new file mode 100644 index 0000000..d3254fc --- /dev/null +++ b/src/modules/marketplace/entities/supplier-favorites.entity.ts @@ -0,0 +1,30 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, + Unique, +} from 'typeorm'; +import { Supplier } from './supplier.entity'; + +@Entity({ name: 'supplier_favorites', schema: 'marketplace' }) +@Unique(['tenant_id', 'supplier_id']) +export class SupplierFavorites { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column('uuid') + tenant_id: string; + + @Column('uuid') + supplier_id: string; + + @CreateDateColumn() + created_at: Date; + + @ManyToOne(() => Supplier) + @JoinColumn({ name: 'supplier_id' }) + supplier: Supplier; +} diff --git a/src/modules/marketplace/entities/supplier-order-item.entity.ts b/src/modules/marketplace/entities/supplier-order-item.entity.ts new file mode 100644 index 0000000..1976e95 --- /dev/null +++ b/src/modules/marketplace/entities/supplier-order-item.entity.ts @@ -0,0 +1,52 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { SupplierOrder } from './supplier-order.entity'; +import { SupplierProduct } from './supplier-product.entity'; + +@Entity({ schema: 'marketplace', name: 'supplier_order_items' }) +export class SupplierOrderItem { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'order_id' }) + orderId: string; + + @Column({ name: 'product_id' }) + productId: string; + + @Column({ name: 'product_name', length: 300 }) + productName: string; + + @Column({ name: 'product_sku', length: 100, nullable: true }) + productSku: string; + + @Column({ type: 'int' }) + quantity: number; + + @Column({ name: 'unit_price', type: 'decimal', precision: 10, scale: 2 }) + unitPrice: number; + + @Column({ type: 'decimal', precision: 12, scale: 2 }) + total: number; + + @Column({ type: 'text', nullable: true }) + notes: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @ManyToOne(() => SupplierOrder, (order) => order.items) + @JoinColumn({ name: 'order_id' }) + order: SupplierOrder; + + @ManyToOne(() => SupplierProduct) + @JoinColumn({ name: 'product_id' }) + product: SupplierProduct; +} diff --git a/src/modules/marketplace/entities/supplier-order.entity.ts b/src/modules/marketplace/entities/supplier-order.entity.ts new file mode 100644 index 0000000..0c6db7b --- /dev/null +++ b/src/modules/marketplace/entities/supplier-order.entity.ts @@ -0,0 +1,112 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + OneToMany, + JoinColumn, +} from 'typeorm'; +import { Supplier } from './supplier.entity'; +import { SupplierOrderItem } from './supplier-order-item.entity'; + +export enum SupplierOrderStatus { + PENDING = 'pending', + CONFIRMED = 'confirmed', + PREPARING = 'preparing', + SHIPPED = 'shipped', + DELIVERED = 'delivered', + CANCELLED = 'cancelled', + REJECTED = 'rejected', +} + +@Entity({ schema: 'marketplace', name: 'supplier_orders' }) +export class SupplierOrder { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'supplier_id' }) + supplierId: string; + + @Column({ name: 'order_number', type: 'int', generated: 'increment' }) + orderNumber: number; + + @Column({ + type: 'varchar', + length: 30, + default: SupplierOrderStatus.PENDING, + }) + status: SupplierOrderStatus; + + @Column({ type: 'decimal', precision: 12, scale: 2 }) + subtotal: number; + + @Column({ name: 'delivery_fee', type: 'decimal', precision: 10, scale: 2, default: 0 }) + deliveryFee: number; + + @Column({ type: 'decimal', precision: 10, scale: 2, default: 0 }) + discount: number; + + @Column({ type: 'decimal', precision: 12, scale: 2 }) + total: number; + + @Column({ name: 'delivery_address', type: 'text' }) + deliveryAddress: string; + + @Column({ name: 'delivery_city', length: 100, nullable: true }) + deliveryCity: string; + + @Column({ name: 'delivery_zip', length: 10, nullable: true }) + deliveryZip: string; + + @Column({ name: 'delivery_phone', length: 20, nullable: true }) + deliveryPhone: string; + + @Column({ name: 'delivery_contact', length: 200, nullable: true }) + deliveryContact: string; + + @Column({ name: 'requested_date', type: 'date', nullable: true }) + requestedDate: Date; + + @Column({ name: 'confirmed_date', type: 'date', nullable: true }) + confirmedDate: Date; + + @Column({ name: 'estimated_delivery', type: 'timestamptz', nullable: true }) + estimatedDelivery: Date; + + @Column({ name: 'delivered_at', type: 'timestamptz', nullable: true }) + deliveredAt: Date; + + @Column({ type: 'text', nullable: true }) + notes: string; + + @Column({ name: 'supplier_notes', type: 'text', nullable: true }) + supplierNotes: string; + + @Column({ name: 'cancelled_at', type: 'timestamptz', nullable: true }) + cancelledAt: Date; + + @Column({ name: 'cancel_reason', type: 'text', nullable: true }) + cancelReason: string; + + @Column({ name: 'cancelled_by', length: 20, nullable: true }) + cancelledBy: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => Supplier, (supplier) => supplier.orders) + @JoinColumn({ name: 'supplier_id' }) + supplier: Supplier; + + @OneToMany(() => SupplierOrderItem, (item) => item.order) + items: SupplierOrderItem[]; +} diff --git a/src/modules/marketplace/entities/supplier-product.entity.ts b/src/modules/marketplace/entities/supplier-product.entity.ts new file mode 100644 index 0000000..f6e156c --- /dev/null +++ b/src/modules/marketplace/entities/supplier-product.entity.ts @@ -0,0 +1,72 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Supplier } from './supplier.entity'; + +@Entity({ schema: 'marketplace', name: 'supplier_products' }) +export class SupplierProduct { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'supplier_id' }) + supplierId: string; + + @Column({ length: 300 }) + name: string; + + @Column({ type: 'text', nullable: true }) + description: string; + + @Column({ length: 100, nullable: true }) + sku: string; + + @Column({ length: 50, nullable: true }) + barcode: string; + + @Column({ length: 100, nullable: true }) + category: string; + + @Column({ length: 100, nullable: true }) + subcategory: string; + + @Column({ name: 'image_url', type: 'text', nullable: true }) + imageUrl: string; + + @Column({ name: 'unit_price', type: 'decimal', precision: 10, scale: 2 }) + unitPrice: number; + + @Column({ name: 'unit_type', length: 50, default: 'pieza' }) + unitType: string; + + @Column({ name: 'min_quantity', default: 1 }) + minQuantity: number; + + @Column({ name: 'tiered_pricing', type: 'jsonb', default: '[]' }) + tieredPricing: { min: number; price: number }[]; + + @Column({ name: 'in_stock', default: true }) + inStock: boolean; + + @Column({ name: 'stock_quantity', nullable: true }) + stockQuantity: number; + + @Column({ default: true }) + active: boolean; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => Supplier, (supplier) => supplier.products) + @JoinColumn({ name: 'supplier_id' }) + supplier: Supplier; +} diff --git a/src/modules/marketplace/entities/supplier-review.entity.ts b/src/modules/marketplace/entities/supplier-review.entity.ts new file mode 100644 index 0000000..d6fced8 --- /dev/null +++ b/src/modules/marketplace/entities/supplier-review.entity.ts @@ -0,0 +1,71 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Supplier } from './supplier.entity'; +import { SupplierOrder } from './supplier-order.entity'; + +@Entity({ schema: 'marketplace', name: 'supplier_reviews' }) +export class SupplierReview { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'supplier_id' }) + supplierId: string; + + @Column({ name: 'order_id', nullable: true }) + orderId: string; + + @Column({ type: 'int' }) + rating: number; + + @Column({ length: 200, nullable: true }) + title: string; + + @Column({ type: 'text', nullable: true }) + comment: string; + + @Column({ name: 'rating_quality', type: 'int', nullable: true }) + ratingQuality: number; + + @Column({ name: 'rating_delivery', type: 'int', nullable: true }) + ratingDelivery: number; + + @Column({ name: 'rating_price', type: 'int', nullable: true }) + ratingPrice: number; + + @Column({ name: 'supplier_response', type: 'text', nullable: true }) + supplierResponse: string; + + @Column({ name: 'responded_at', type: 'timestamptz', nullable: true }) + respondedAt: Date; + + @Column({ default: false }) + verified: boolean; + + @Column({ length: 20, default: 'active' }) + status: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => Supplier, (supplier) => supplier.reviews) + @JoinColumn({ name: 'supplier_id' }) + supplier: Supplier; + + @ManyToOne(() => SupplierOrder, { nullable: true }) + @JoinColumn({ name: 'order_id' }) + order: SupplierOrder; +} diff --git a/src/modules/marketplace/entities/supplier.entity.ts b/src/modules/marketplace/entities/supplier.entity.ts new file mode 100644 index 0000000..ecc3bbc --- /dev/null +++ b/src/modules/marketplace/entities/supplier.entity.ts @@ -0,0 +1,124 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + OneToMany, +} from 'typeorm'; +import { SupplierProduct } from './supplier-product.entity'; +import { SupplierOrder } from './supplier-order.entity'; +import { SupplierReview } from './supplier-review.entity'; + +export enum SupplierStatus { + PENDING = 'pending', + ACTIVE = 'active', + SUSPENDED = 'suspended', + INACTIVE = 'inactive', +} + +@Entity({ schema: 'marketplace', name: 'suppliers' }) +export class Supplier { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ length: 200 }) + name: string; + + @Column({ name: 'legal_name', length: 300, nullable: true }) + legalName: string; + + @Column({ length: 13, nullable: true }) + rfc: string; + + @Column({ type: 'text', array: true, default: '{}' }) + categories: string[]; + + @Column({ name: 'coverage_zones', type: 'text', array: true, default: '{}' }) + coverageZones: string[]; + + @Column({ name: 'contact_name', length: 200, nullable: true }) + contactName: string; + + @Column({ name: 'contact_phone', length: 20, nullable: true }) + contactPhone: string; + + @Column({ name: 'contact_email', length: 200, nullable: true }) + contactEmail: string; + + @Column({ name: 'contact_whatsapp', length: 20, nullable: true }) + contactWhatsapp: string; + + @Column({ type: 'text', nullable: true }) + address: string; + + @Column({ length: 100, nullable: true }) + city: string; + + @Column({ length: 100, nullable: true }) + state: string; + + @Column({ name: 'zip_code', length: 10, nullable: true }) + zipCode: string; + + @Column({ name: 'logo_url', type: 'text', nullable: true }) + logoUrl: string; + + @Column({ name: 'banner_url', type: 'text', nullable: true }) + bannerUrl: string; + + @Column({ type: 'text', nullable: true }) + description: string; + + @Column({ name: 'min_order_amount', type: 'decimal', precision: 10, scale: 2, default: 0 }) + minOrderAmount: number; + + @Column({ name: 'delivery_fee', type: 'decimal', precision: 10, scale: 2, default: 0 }) + deliveryFee: number; + + @Column({ name: 'free_delivery_min', type: 'decimal', precision: 10, scale: 2, nullable: true }) + freeDeliveryMin: number; + + @Column({ name: 'delivery_days', type: 'text', array: true, default: '{}' }) + deliveryDays: string[]; + + @Column({ name: 'lead_time_days', default: 1 }) + leadTimeDays: number; + + @Column({ default: false }) + verified: boolean; + + @Column({ name: 'verified_at', type: 'timestamptz', nullable: true }) + verifiedAt: Date; + + @Column({ type: 'decimal', precision: 2, scale: 1, default: 0 }) + rating: number; + + @Column({ name: 'total_reviews', default: 0 }) + totalReviews: number; + + @Column({ name: 'total_orders', default: 0 }) + totalOrders: number; + + @Column({ type: 'varchar', length: 20, default: SupplierStatus.PENDING }) + status: SupplierStatus; + + @Column({ name: 'user_id', nullable: true }) + userId: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @OneToMany(() => SupplierProduct, (product) => product.supplier) + products: SupplierProduct[]; + + @OneToMany(() => SupplierOrder, (order) => order.supplier) + orders: SupplierOrder[]; + + @OneToMany(() => SupplierReview, (review) => review.supplier) + reviews: SupplierReview[]; +} diff --git a/src/modules/marketplace/marketplace.controller.ts b/src/modules/marketplace/marketplace.controller.ts new file mode 100644 index 0000000..bf200ad --- /dev/null +++ b/src/modules/marketplace/marketplace.controller.ts @@ -0,0 +1,180 @@ +import { + Controller, + Get, + Post, + Put, + Delete, + Body, + Param, + Query, + Request, + UseGuards, + ParseUUIDPipe, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { MarketplaceService } from './marketplace.service'; +import { CreateSupplierOrderDto } from './dto/create-supplier-order.dto'; +import { CreateSupplierReviewDto } from './dto/create-supplier-review.dto'; +import { SupplierOrderStatus } from './entities/supplier-order.entity'; + +@ApiTags('Marketplace') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('marketplace') +export class MarketplaceController { + constructor(private readonly marketplaceService: MarketplaceService) {} + + // ==================== SUPPLIERS ==================== + + @Get('suppliers') + @ApiOperation({ summary: 'Listar proveedores' }) + @ApiQuery({ name: 'category', required: false }) + @ApiQuery({ name: 'zipCode', required: false }) + @ApiQuery({ name: 'search', required: false }) + @ApiQuery({ name: 'limit', required: false, type: Number }) + async findSuppliers( + @Query('category') category?: string, + @Query('zipCode') zipCode?: string, + @Query('search') search?: string, + @Query('limit') limit?: number, + ) { + return this.marketplaceService.findSuppliers({ + category, + zipCode, + search, + limit: limit ? Number(limit) : undefined, + }); + } + + @Get('suppliers/:id') + @ApiOperation({ summary: 'Obtener detalle de proveedor' }) + async getSupplier(@Param('id', ParseUUIDPipe) id: string) { + return this.marketplaceService.getSupplier(id); + } + + @Get('suppliers/:id/products') + @ApiOperation({ summary: 'Obtener productos de un proveedor' }) + @ApiQuery({ name: 'category', required: false }) + @ApiQuery({ name: 'search', required: false }) + @ApiQuery({ name: 'inStock', required: false, type: Boolean }) + async getSupplierProducts( + @Param('id', ParseUUIDPipe) id: string, + @Query('category') category?: string, + @Query('search') search?: string, + @Query('inStock') inStock?: boolean, + ) { + return this.marketplaceService.getSupplierProducts(id, { + category, + search, + inStock, + }); + } + + @Get('suppliers/:id/reviews') + @ApiOperation({ summary: 'Obtener resenas de un proveedor' }) + @ApiQuery({ name: 'limit', required: false, type: Number }) + @ApiQuery({ name: 'offset', required: false, type: Number }) + async getSupplierReviews( + @Param('id', ParseUUIDPipe) id: string, + @Query('limit') limit?: number, + @Query('offset') offset?: number, + ) { + return this.marketplaceService.getReviews(id, { + limit: limit ? Number(limit) : undefined, + offset: offset ? Number(offset) : undefined, + }); + } + + // ==================== ORDERS ==================== + + @Post('orders') + @ApiOperation({ summary: 'Crear pedido a proveedor' }) + async createOrder( + @Request() req, + @Body() dto: CreateSupplierOrderDto, + ) { + return this.marketplaceService.createOrder(req.user.tenantId, dto); + } + + @Get('orders') + @ApiOperation({ summary: 'Listar mis pedidos' }) + @ApiQuery({ name: 'status', required: false, enum: SupplierOrderStatus }) + @ApiQuery({ name: 'supplierId', required: false }) + @ApiQuery({ name: 'limit', required: false, type: Number }) + async getOrders( + @Request() req, + @Query('status') status?: SupplierOrderStatus, + @Query('supplierId') supplierId?: string, + @Query('limit') limit?: number, + ) { + return this.marketplaceService.getOrders(req.user.tenantId, { + status, + supplierId, + limit: limit ? Number(limit) : undefined, + }); + } + + @Get('orders/:id') + @ApiOperation({ summary: 'Obtener detalle de pedido' }) + async getOrder(@Param('id', ParseUUIDPipe) id: string) { + return this.marketplaceService.getOrder(id); + } + + @Put('orders/:id/cancel') + @ApiOperation({ summary: 'Cancelar pedido' }) + async cancelOrder( + @Request() req, + @Param('id', ParseUUIDPipe) id: string, + @Body() body: { reason: string }, + ) { + return this.marketplaceService.cancelOrder(id, req.user.tenantId, body.reason); + } + + // ==================== REVIEWS ==================== + + @Post('reviews') + @ApiOperation({ summary: 'Crear resena de proveedor' }) + async createReview( + @Request() req, + @Body() dto: CreateSupplierReviewDto, + ) { + return this.marketplaceService.createReview(req.user.tenantId, dto); + } + + // ==================== FAVORITES ==================== + + @Get('favorites') + @ApiOperation({ summary: 'Obtener proveedores favoritos' }) + async getFavorites(@Request() req) { + return this.marketplaceService.getFavorites(req.user.tenantId); + } + + @Post('favorites/:supplierId') + @ApiOperation({ summary: 'Agregar proveedor a favoritos' }) + async addFavorite( + @Request() req, + @Param('supplierId', ParseUUIDPipe) supplierId: string, + ) { + await this.marketplaceService.addFavorite(req.user.tenantId, supplierId); + return { message: 'Agregado a favoritos' }; + } + + @Delete('favorites/:supplierId') + @ApiOperation({ summary: 'Quitar proveedor de favoritos' }) + async removeFavorite( + @Request() req, + @Param('supplierId', ParseUUIDPipe) supplierId: string, + ) { + await this.marketplaceService.removeFavorite(req.user.tenantId, supplierId); + return { message: 'Eliminado de favoritos' }; + } + + // ==================== STATS ==================== + + @Get('stats') + @ApiOperation({ summary: 'Obtener estadisticas del marketplace' }) + async getStats() { + return this.marketplaceService.getMarketplaceStats(); + } +} diff --git a/src/modules/marketplace/marketplace.module.ts b/src/modules/marketplace/marketplace.module.ts new file mode 100644 index 0000000..3b0df6f --- /dev/null +++ b/src/modules/marketplace/marketplace.module.ts @@ -0,0 +1,27 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { Supplier } from './entities/supplier.entity'; +import { SupplierProduct } from './entities/supplier-product.entity'; +import { SupplierOrder } from './entities/supplier-order.entity'; +import { SupplierOrderItem } from './entities/supplier-order-item.entity'; +import { SupplierReview } from './entities/supplier-review.entity'; +import { SupplierFavorites } from './entities/supplier-favorites.entity'; +import { MarketplaceService } from './marketplace.service'; +import { MarketplaceController } from './marketplace.controller'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([ + Supplier, + SupplierProduct, + SupplierOrder, + SupplierOrderItem, + SupplierReview, + SupplierFavorites, + ]), + ], + controllers: [MarketplaceController], + providers: [MarketplaceService], + exports: [MarketplaceService], +}) +export class MarketplaceModule {} diff --git a/src/modules/marketplace/marketplace.service.ts b/src/modules/marketplace/marketplace.service.ts new file mode 100644 index 0000000..a5e271d --- /dev/null +++ b/src/modules/marketplace/marketplace.service.ts @@ -0,0 +1,455 @@ +import { + Injectable, + NotFoundException, + BadRequestException, +} from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository, DataSource } from 'typeorm'; +import { Supplier, SupplierStatus } from './entities/supplier.entity'; +import { SupplierProduct } from './entities/supplier-product.entity'; +import { SupplierOrder, SupplierOrderStatus } from './entities/supplier-order.entity'; +import { SupplierOrderItem } from './entities/supplier-order-item.entity'; +import { SupplierReview } from './entities/supplier-review.entity'; +import { CreateSupplierOrderDto } from './dto/create-supplier-order.dto'; +import { CreateSupplierReviewDto } from './dto/create-supplier-review.dto'; + +@Injectable() +export class MarketplaceService { + constructor( + @InjectRepository(Supplier) + private readonly supplierRepo: Repository, + @InjectRepository(SupplierProduct) + private readonly productRepo: Repository, + @InjectRepository(SupplierOrder) + private readonly orderRepo: Repository, + @InjectRepository(SupplierOrderItem) + private readonly orderItemRepo: Repository, + @InjectRepository(SupplierReview) + private readonly reviewRepo: Repository, + private readonly dataSource: DataSource, + ) {} + + // ==================== SUPPLIERS ==================== + + async findSuppliers(options?: { + category?: string; + zipCode?: string; + search?: string; + limit?: number; + }): Promise { + const query = this.supplierRepo.createQueryBuilder('supplier') + .where('supplier.status = :status', { status: SupplierStatus.ACTIVE }) + .orderBy('supplier.rating', 'DESC') + .addOrderBy('supplier.total_orders', 'DESC'); + + if (options?.category) { + query.andWhere(':category = ANY(supplier.categories)', { + category: options.category, + }); + } + + if (options?.zipCode) { + query.andWhere( + '(supplier.coverage_zones = \'{}\' OR :zipCode = ANY(supplier.coverage_zones))', + { zipCode: options.zipCode }, + ); + } + + if (options?.search) { + query.andWhere( + '(supplier.name ILIKE :search OR supplier.description ILIKE :search)', + { search: `%${options.search}%` }, + ); + } + + if (options?.limit) { + query.limit(options.limit); + } + + return query.getMany(); + } + + async getSupplier(id: string): Promise { + const supplier = await this.supplierRepo.findOne({ + where: { id }, + relations: ['products', 'reviews'], + }); + + if (!supplier) { + throw new NotFoundException('Proveedor no encontrado'); + } + + return supplier; + } + + async getSupplierProducts( + supplierId: string, + options?: { + category?: string; + search?: string; + inStock?: boolean; + }, + ): Promise { + const query = this.productRepo.createQueryBuilder('product') + .where('product.supplier_id = :supplierId', { supplierId }) + .andWhere('product.active = true') + .orderBy('product.category', 'ASC') + .addOrderBy('product.name', 'ASC'); + + if (options?.category) { + query.andWhere('product.category = :category', { category: options.category }); + } + + if (options?.search) { + query.andWhere( + '(product.name ILIKE :search OR product.description ILIKE :search)', + { search: `%${options.search}%` }, + ); + } + + if (options?.inStock !== undefined) { + query.andWhere('product.in_stock = :inStock', { inStock: options.inStock }); + } + + return query.getMany(); + } + + // ==================== ORDERS ==================== + + async createOrder( + tenantId: string, + dto: CreateSupplierOrderDto, + ): Promise { + const supplier = await this.supplierRepo.findOne({ + where: { id: dto.supplierId, status: SupplierStatus.ACTIVE }, + }); + + if (!supplier) { + throw new NotFoundException('Proveedor no encontrado o no activo'); + } + + // Get products and calculate totals + const productIds = dto.items.map((item) => item.productId); + const products = await this.productRepo.findByIds(productIds); + + if (products.length !== productIds.length) { + throw new BadRequestException('Algunos productos no fueron encontrados'); + } + + // Create product map for easy lookup + const productMap = new Map(products.map((p) => [p.id, p])); + + // Validate min quantities and calculate subtotal + let subtotal = 0; + for (const item of dto.items) { + const product = productMap.get(item.productId); + if (!product) { + throw new BadRequestException(`Producto ${item.productId} no encontrado`); + } + + if (item.quantity < product.minQuantity) { + throw new BadRequestException( + `Cantidad minima para ${product.name} es ${product.minQuantity}`, + ); + } + + if (!product.inStock) { + throw new BadRequestException(`${product.name} no esta disponible`); + } + + // Calculate price based on tiered pricing + let unitPrice = Number(product.unitPrice); + if (product.tieredPricing && product.tieredPricing.length > 0) { + for (const tier of product.tieredPricing.sort((a, b) => b.min - a.min)) { + if (item.quantity >= tier.min) { + unitPrice = tier.price; + break; + } + } + } + + subtotal += unitPrice * item.quantity; + } + + // Calculate delivery fee + let deliveryFee = Number(supplier.deliveryFee); + if (supplier.freeDeliveryMin && subtotal >= Number(supplier.freeDeliveryMin)) { + deliveryFee = 0; + } + + // Check minimum order + if (subtotal < Number(supplier.minOrderAmount)) { + throw new BadRequestException( + `Pedido minimo es $${supplier.minOrderAmount}`, + ); + } + + const total = subtotal + deliveryFee; + + // Create order + const order = this.orderRepo.create({ + tenantId, + supplierId: dto.supplierId, + status: SupplierOrderStatus.PENDING, + subtotal, + deliveryFee, + total, + deliveryAddress: dto.deliveryAddress, + deliveryCity: dto.deliveryCity, + deliveryZip: dto.deliveryZip, + deliveryPhone: dto.deliveryPhone, + deliveryContact: dto.deliveryContact, + requestedDate: dto.requestedDate ? new Date(dto.requestedDate) : null, + notes: dto.notes, + }); + + await this.orderRepo.save(order); + + // Create order items + for (const item of dto.items) { + const product = productMap.get(item.productId); + + let unitPrice = Number(product.unitPrice); + if (product.tieredPricing && product.tieredPricing.length > 0) { + for (const tier of product.tieredPricing.sort((a, b) => b.min - a.min)) { + if (item.quantity >= tier.min) { + unitPrice = tier.price; + break; + } + } + } + + const orderItem = this.orderItemRepo.create({ + orderId: order.id, + productId: item.productId, + productName: product.name, + productSku: product.sku, + quantity: item.quantity, + unitPrice, + total: unitPrice * item.quantity, + notes: item.notes, + }); + + await this.orderItemRepo.save(orderItem); + } + + return this.getOrder(order.id); + } + + async getOrder(id: string): Promise { + const order = await this.orderRepo.findOne({ + where: { id }, + relations: ['items', 'supplier'], + }); + + if (!order) { + throw new NotFoundException('Pedido no encontrado'); + } + + return order; + } + + async getOrders( + tenantId: string, + options?: { + status?: SupplierOrderStatus; + supplierId?: string; + limit?: number; + }, + ): Promise { + const query = this.orderRepo.createQueryBuilder('order') + .where('order.tenant_id = :tenantId', { tenantId }) + .leftJoinAndSelect('order.supplier', 'supplier') + .leftJoinAndSelect('order.items', 'items') + .orderBy('order.created_at', 'DESC'); + + if (options?.status) { + query.andWhere('order.status = :status', { status: options.status }); + } + + if (options?.supplierId) { + query.andWhere('order.supplier_id = :supplierId', { supplierId: options.supplierId }); + } + + if (options?.limit) { + query.limit(options.limit); + } + + return query.getMany(); + } + + async updateOrderStatus( + id: string, + status: SupplierOrderStatus, + notes?: string, + ): Promise { + const order = await this.getOrder(id); + + // Validate status transitions + const validTransitions: Record = { + [SupplierOrderStatus.PENDING]: [SupplierOrderStatus.CONFIRMED, SupplierOrderStatus.CANCELLED, SupplierOrderStatus.REJECTED], + [SupplierOrderStatus.CONFIRMED]: [SupplierOrderStatus.PREPARING, SupplierOrderStatus.CANCELLED], + [SupplierOrderStatus.PREPARING]: [SupplierOrderStatus.SHIPPED, SupplierOrderStatus.CANCELLED], + [SupplierOrderStatus.SHIPPED]: [SupplierOrderStatus.DELIVERED, SupplierOrderStatus.CANCELLED], + [SupplierOrderStatus.DELIVERED]: [], + [SupplierOrderStatus.CANCELLED]: [], + [SupplierOrderStatus.REJECTED]: [], + }; + + if (!validTransitions[order.status].includes(status)) { + throw new BadRequestException( + `No se puede cambiar estado de ${order.status} a ${status}`, + ); + } + + order.status = status; + + if (status === SupplierOrderStatus.CONFIRMED) { + order.confirmedDate = new Date(); + } + + if (status === SupplierOrderStatus.DELIVERED) { + order.deliveredAt = new Date(); + } + + if (status === SupplierOrderStatus.CANCELLED || status === SupplierOrderStatus.REJECTED) { + order.cancelledAt = new Date(); + order.cancelReason = notes; + } + + if (notes) { + order.supplierNotes = notes; + } + + return this.orderRepo.save(order); + } + + async cancelOrder( + id: string, + tenantId: string, + reason: string, + ): Promise { + const order = await this.getOrder(id); + + if (order.tenantId !== tenantId) { + throw new BadRequestException('No autorizado'); + } + + if (![SupplierOrderStatus.PENDING, SupplierOrderStatus.CONFIRMED].includes(order.status)) { + throw new BadRequestException('No se puede cancelar el pedido en este estado'); + } + + order.status = SupplierOrderStatus.CANCELLED; + order.cancelledAt = new Date(); + order.cancelReason = reason; + order.cancelledBy = 'tenant'; + + return this.orderRepo.save(order); + } + + // ==================== REVIEWS ==================== + + async createReview( + tenantId: string, + dto: CreateSupplierReviewDto, + ): Promise { + const supplier = await this.supplierRepo.findOne({ + where: { id: dto.supplierId }, + }); + + if (!supplier) { + throw new NotFoundException('Proveedor no encontrado'); + } + + // Check if order exists and belongs to tenant + let verified = false; + if (dto.orderId) { + const order = await this.orderRepo.findOne({ + where: { id: dto.orderId, tenantId, supplierId: dto.supplierId }, + }); + + if (!order) { + throw new BadRequestException('Orden no encontrada'); + } + + if (order.status === SupplierOrderStatus.DELIVERED) { + verified = true; + } + } + + const review = this.reviewRepo.create({ + tenantId, + supplierId: dto.supplierId, + orderId: dto.orderId, + rating: dto.rating, + title: dto.title, + comment: dto.comment, + ratingQuality: dto.ratingQuality, + ratingDelivery: dto.ratingDelivery, + ratingPrice: dto.ratingPrice, + verified, + }); + + return this.reviewRepo.save(review); + } + + async getReviews( + supplierId: string, + options?: { + limit?: number; + offset?: number; + }, + ): Promise { + return this.reviewRepo.find({ + where: { supplierId, status: 'active' }, + order: { createdAt: 'DESC' }, + take: options?.limit || 20, + skip: options?.offset || 0, + }); + } + + // ==================== FAVORITES ==================== + + async addFavorite(tenantId: string, supplierId: string): Promise { + await this.dataSource.query( + `INSERT INTO marketplace.supplier_favorites (tenant_id, supplier_id) + VALUES ($1, $2) ON CONFLICT DO NOTHING`, + [tenantId, supplierId], + ); + } + + async removeFavorite(tenantId: string, supplierId: string): Promise { + await this.dataSource.query( + `DELETE FROM marketplace.supplier_favorites WHERE tenant_id = $1 AND supplier_id = $2`, + [tenantId, supplierId], + ); + } + + async getFavorites(tenantId: string): Promise { + const result = await this.dataSource.query( + `SELECT s.* FROM marketplace.suppliers s + JOIN marketplace.supplier_favorites f ON s.id = f.supplier_id + WHERE f.tenant_id = $1`, + [tenantId], + ); + + return result; + } + + // ==================== STATS ==================== + + async getMarketplaceStats() { + const result = await this.dataSource.query( + `SELECT * FROM marketplace.get_marketplace_stats()`, + ); + + return result[0] || { + total_suppliers: 0, + active_suppliers: 0, + total_products: 0, + total_orders: 0, + total_gmv: 0, + avg_rating: 0, + }; + } +} diff --git a/src/modules/messaging/entities/conversation.entity.ts b/src/modules/messaging/entities/conversation.entity.ts new file mode 100644 index 0000000..86d0927 --- /dev/null +++ b/src/modules/messaging/entities/conversation.entity.ts @@ -0,0 +1,52 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + OneToMany, +} from 'typeorm'; +import { Message } from './message.entity'; + +@Entity({ schema: 'messaging', name: 'conversations' }) +export class Conversation { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'phone_number', length: 20 }) + phoneNumber: string; + + @Column({ name: 'contact_name', length: 100, nullable: true }) + contactName: string; + + @Column({ name: 'conversation_type', length: 20 }) + conversationType: string; // 'order', 'support', 'general' + + @Column({ length: 20, default: 'active' }) + status: string; + + @Column({ name: 'last_message_at', type: 'timestamptz', nullable: true }) + lastMessageAt: Date; + + @Column({ name: 'last_message_preview', type: 'text', nullable: true }) + lastMessagePreview: string; + + @Column({ name: 'unread_count', default: 0 }) + unreadCount: number; + + @Column({ name: 'wa_conversation_id', length: 100, nullable: true }) + waConversationId: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @OneToMany(() => Message, (message) => message.conversation) + messages: Message[]; +} diff --git a/src/modules/messaging/entities/message.entity.ts b/src/modules/messaging/entities/message.entity.ts new file mode 100644 index 0000000..1837476 --- /dev/null +++ b/src/modules/messaging/entities/message.entity.ts @@ -0,0 +1,87 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Conversation } from './conversation.entity'; + +export enum MessageDirection { + INBOUND = 'inbound', + OUTBOUND = 'outbound', +} + +export enum MessageType { + TEXT = 'text', + IMAGE = 'image', + AUDIO = 'audio', + DOCUMENT = 'document', + LOCATION = 'location', + INTERACTIVE = 'interactive', + TEMPLATE = 'template', +} + +@Entity({ schema: 'messaging', name: 'messages' }) +export class Message { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'conversation_id' }) + conversationId: string; + + @Column({ + type: 'varchar', + length: 10, + }) + direction: MessageDirection; + + @Column({ + name: 'message_type', + type: 'varchar', + length: 20, + }) + messageType: MessageType; + + @Column({ type: 'text', nullable: true }) + content: string; + + @Column({ name: 'media_url', type: 'text', nullable: true }) + mediaUrl: string; + + @Column({ name: 'media_mime_type', length: 50, nullable: true }) + mediaMimeType: string; + + @Column({ name: 'processed_by_llm', default: false }) + processedByLlm: boolean; + + @Column({ name: 'llm_response_id', nullable: true }) + llmResponseId: string; + + @Column({ name: 'tokens_used', nullable: true }) + tokensUsed: number; + + @Column({ name: 'wa_message_id', length: 100, nullable: true }) + waMessageId: string; + + @Column({ name: 'wa_status', length: 20, nullable: true }) + waStatus: string; // 'sent', 'delivered', 'read', 'failed' + + @Column({ name: 'wa_timestamp', type: 'timestamptz', nullable: true }) + waTimestamp: Date; + + @Column({ name: 'error_code', length: 20, nullable: true }) + errorCode: string; + + @Column({ name: 'error_message', type: 'text', nullable: true }) + errorMessage: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @ManyToOne(() => Conversation, (conv) => conv.messages, { onDelete: 'CASCADE' }) + @JoinColumn({ name: 'conversation_id' }) + conversation: Conversation; +} diff --git a/src/modules/messaging/entities/notification.entity.ts b/src/modules/messaging/entities/notification.entity.ts new file mode 100644 index 0000000..78f5d61 --- /dev/null +++ b/src/modules/messaging/entities/notification.entity.ts @@ -0,0 +1,51 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, +} from 'typeorm'; + +@Entity({ schema: 'messaging', name: 'notifications' }) +export class Notification { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'user_id', nullable: true }) + userId: string; + + @Column({ name: 'notification_type', length: 50 }) + notificationType: string; // 'order_new', 'low_stock', 'fiado_due', etc. + + @Column({ type: 'text', array: true }) + channels: string[]; // ['push', 'whatsapp', 'email'] + + @Column({ length: 100 }) + title: string; + + @Column({ type: 'text' }) + body: string; + + @Column({ type: 'jsonb', nullable: true }) + data: Record; + + @Column({ name: 'push_sent', default: false }) + pushSent: boolean; + + @Column({ name: 'push_sent_at', type: 'timestamptz', nullable: true }) + pushSentAt: Date; + + @Column({ name: 'whatsapp_sent', default: false }) + whatsappSent: boolean; + + @Column({ name: 'whatsapp_sent_at', type: 'timestamptz', nullable: true }) + whatsappSentAt: Date; + + @Column({ name: 'read_at', type: 'timestamptz', nullable: true }) + readAt: Date; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; +} diff --git a/src/modules/messaging/messaging.controller.ts b/src/modules/messaging/messaging.controller.ts new file mode 100644 index 0000000..f30d430 --- /dev/null +++ b/src/modules/messaging/messaging.controller.ts @@ -0,0 +1,74 @@ +import { + Controller, + Get, + Post, + Patch, + Param, + Body, + Query, + UseGuards, + Request, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { MessagingService } from './messaging.service'; + +@ApiTags('messaging') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/messaging') +export class MessagingController { + constructor(private readonly messagingService: MessagingService) {} + + // ==================== CONVERSATIONS ==================== + + @Get('conversations') + @ApiOperation({ summary: 'Listar conversaciones' }) + getConversations(@Request() req) { + return this.messagingService.getConversations(req.user.tenantId); + } + + @Get('conversations/:id') + @ApiOperation({ summary: 'Obtener conversación con mensajes' }) + getConversation(@Request() req, @Param('id') id: string) { + return this.messagingService.getConversation(req.user.tenantId, id); + } + + @Get('conversations/:id/messages') + @ApiOperation({ summary: 'Obtener mensajes de una conversación' }) + @ApiQuery({ name: 'limit', required: false }) + getMessages(@Param('id') id: string, @Query('limit') limit?: number) { + return this.messagingService.getMessages(id, limit); + } + + @Patch('conversations/:id/read') + @ApiOperation({ summary: 'Marcar conversación como leída' }) + markAsRead(@Request() req, @Param('id') id: string) { + return this.messagingService.markAsRead(req.user.tenantId, id); + } + + // ==================== NOTIFICATIONS ==================== + + @Get('notifications') + @ApiOperation({ summary: 'Listar notificaciones' }) + @ApiQuery({ name: 'unreadOnly', required: false }) + getNotifications(@Request() req, @Query('unreadOnly') unreadOnly?: boolean) { + return this.messagingService.getNotifications( + req.user.tenantId, + req.user.id, + unreadOnly, + ); + } + + @Get('notifications/count') + @ApiOperation({ summary: 'Contador de notificaciones no leídas' }) + getUnreadCount(@Request() req) { + return this.messagingService.getUnreadCount(req.user.tenantId, req.user.id); + } + + @Patch('notifications/:id/read') + @ApiOperation({ summary: 'Marcar notificación como leída' }) + markNotificationRead(@Param('id') id: string) { + return this.messagingService.markNotificationRead(id); + } +} diff --git a/src/modules/messaging/messaging.module.ts b/src/modules/messaging/messaging.module.ts new file mode 100644 index 0000000..fe66072 --- /dev/null +++ b/src/modules/messaging/messaging.module.ts @@ -0,0 +1,15 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { MessagingController } from './messaging.controller'; +import { MessagingService } from './messaging.service'; +import { Conversation } from './entities/conversation.entity'; +import { Message } from './entities/message.entity'; +import { Notification } from './entities/notification.entity'; + +@Module({ + imports: [TypeOrmModule.forFeature([Conversation, Message, Notification])], + controllers: [MessagingController], + providers: [MessagingService], + exports: [MessagingService], +}) +export class MessagingModule {} diff --git a/src/modules/messaging/messaging.service.ts b/src/modules/messaging/messaging.service.ts new file mode 100644 index 0000000..e84feb9 --- /dev/null +++ b/src/modules/messaging/messaging.service.ts @@ -0,0 +1,181 @@ +import { Injectable, NotFoundException } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { Conversation } from './entities/conversation.entity'; +import { Message, MessageDirection, MessageType } from './entities/message.entity'; +import { Notification } from './entities/notification.entity'; + +@Injectable() +export class MessagingService { + constructor( + @InjectRepository(Conversation) + private readonly conversationRepo: Repository, + @InjectRepository(Message) + private readonly messageRepo: Repository, + @InjectRepository(Notification) + private readonly notificationRepo: Repository, + ) {} + + // ==================== CONVERSATIONS ==================== + + async getConversations(tenantId: string): Promise { + return this.conversationRepo.find({ + where: { tenantId }, + order: { lastMessageAt: 'DESC' }, + }); + } + + async getConversation(tenantId: string, id: string): Promise { + const conversation = await this.conversationRepo.findOne({ + where: { id, tenantId }, + relations: ['messages'], + }); + + if (!conversation) { + throw new NotFoundException('Conversación no encontrada'); + } + + return conversation; + } + + async findOrCreateConversation( + tenantId: string, + phoneNumber: string, + contactName?: string, + ): Promise { + let conversation = await this.conversationRepo.findOne({ + where: { tenantId, phoneNumber }, + }); + + if (!conversation) { + conversation = this.conversationRepo.create({ + tenantId, + phoneNumber, + contactName, + conversationType: 'general', + status: 'active', + }); + await this.conversationRepo.save(conversation); + } + + return conversation; + } + + // ==================== MESSAGES ==================== + + async getMessages(conversationId: string, limit = 50): Promise { + return this.messageRepo.find({ + where: { conversationId }, + order: { createdAt: 'DESC' }, + take: limit, + }); + } + + async addMessage( + conversationId: string, + direction: MessageDirection, + content: string, + type: MessageType = MessageType.TEXT, + metadata?: { + waMessageId?: string; + mediaUrl?: string; + mediaMimeType?: string; + }, + ): Promise { + const conversation = await this.conversationRepo.findOne({ + where: { id: conversationId }, + }); + + if (!conversation) { + throw new NotFoundException('Conversación no encontrada'); + } + + const message = this.messageRepo.create({ + conversationId, + direction, + messageType: type, + content, + waMessageId: metadata?.waMessageId, + mediaUrl: metadata?.mediaUrl, + mediaMimeType: metadata?.mediaMimeType, + }); + + await this.messageRepo.save(message); + + // Update conversation + conversation.lastMessageAt = new Date(); + conversation.lastMessagePreview = content?.substring(0, 100); + + if (direction === MessageDirection.INBOUND) { + conversation.unreadCount += 1; + } + + await this.conversationRepo.save(conversation); + + return message; + } + + async markAsRead(tenantId: string, conversationId: string): Promise { + const conversation = await this.getConversation(tenantId, conversationId); + conversation.unreadCount = 0; + return this.conversationRepo.save(conversation); + } + + // ==================== NOTIFICATIONS ==================== + + async getNotifications(tenantId: string, userId?: string, unreadOnly = false): Promise { + const where: any = { tenantId }; + if (userId) { + where.userId = userId; + } + if (unreadOnly) { + where.readAt = null; + } + + return this.notificationRepo.find({ + where, + order: { createdAt: 'DESC' }, + take: 50, + }); + } + + async createNotification( + tenantId: string, + data: { + userId?: string; + notificationType: string; + channels: string[]; + title: string; + body: string; + data?: Record; + }, + ): Promise { + const notification = this.notificationRepo.create({ + tenantId, + ...data, + }); + + return this.notificationRepo.save(notification); + } + + async markNotificationRead(notificationId: string): Promise { + const notification = await this.notificationRepo.findOne({ + where: { id: notificationId }, + }); + + if (!notification) { + throw new NotFoundException('Notificación no encontrada'); + } + + notification.readAt = new Date(); + return this.notificationRepo.save(notification); + } + + async getUnreadCount(tenantId: string, userId?: string): Promise { + const where: any = { tenantId, readAt: null }; + if (userId) { + where.userId = userId; + } + return this.notificationRepo.count({ where }); + } +} diff --git a/src/modules/orders/dto/order.dto.ts b/src/modules/orders/dto/order.dto.ts new file mode 100644 index 0000000..22dd83a --- /dev/null +++ b/src/modules/orders/dto/order.dto.ts @@ -0,0 +1,112 @@ +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { + IsString, + IsNumber, + IsOptional, + IsUUID, + IsEnum, + IsArray, + ValidateNested, + Min, + MaxLength, +} from 'class-validator'; +import { Type } from 'class-transformer'; +import { OrderChannel, OrderType, OrderStatus } from '../entities/order.entity'; + +export class OrderItemDto { + @ApiPropertyOptional({ description: 'ID del producto' }) + @IsOptional() + @IsUUID() + productId?: string; + + @ApiProperty({ description: 'Nombre del producto' }) + @IsString() + @MaxLength(100) + productName: string; + + @ApiProperty({ description: 'Cantidad', example: 2 }) + @IsNumber() + @Min(0.001) + quantity: number; + + @ApiProperty({ description: 'Precio unitario', example: 25.5 }) + @IsNumber() + @Min(0) + unitPrice: number; + + @ApiPropertyOptional({ description: 'Notas del item' }) + @IsOptional() + @IsString() + notes?: string; +} + +export class CreateOrderDto { + @ApiPropertyOptional({ description: 'ID del cliente' }) + @IsOptional() + @IsUUID() + customerId?: string; + + @ApiPropertyOptional({ enum: OrderChannel, default: OrderChannel.WHATSAPP }) + @IsOptional() + @IsEnum(OrderChannel) + channel?: OrderChannel; + + @ApiPropertyOptional({ enum: OrderType, default: OrderType.PICKUP }) + @IsOptional() + @IsEnum(OrderType) + orderType?: OrderType; + + @ApiProperty({ type: [OrderItemDto], description: 'Items del pedido' }) + @IsArray() + @ValidateNested({ each: true }) + @Type(() => OrderItemDto) + items: OrderItemDto[]; + + @ApiPropertyOptional({ description: 'Cargo por delivery', default: 0 }) + @IsOptional() + @IsNumber() + @Min(0) + deliveryFee?: number; + + @ApiPropertyOptional({ description: 'Descuento', default: 0 }) + @IsOptional() + @IsNumber() + @Min(0) + discountAmount?: number; + + @ApiPropertyOptional({ description: 'Dirección de entrega' }) + @IsOptional() + @IsString() + deliveryAddress?: string; + + @ApiPropertyOptional({ description: 'Notas de entrega' }) + @IsOptional() + @IsString() + deliveryNotes?: string; + + @ApiPropertyOptional({ description: 'Notas del cliente' }) + @IsOptional() + @IsString() + customerNotes?: string; + + @ApiPropertyOptional({ description: 'Método de pago' }) + @IsOptional() + @IsString() + paymentMethod?: string; +} + +export class UpdateOrderStatusDto { + @ApiProperty({ enum: OrderStatus, description: 'Nuevo estado' }) + @IsEnum(OrderStatus) + status: OrderStatus; + + @ApiPropertyOptional({ description: 'Razón (para cancelación)' }) + @IsOptional() + @IsString() + reason?: string; + + @ApiPropertyOptional({ description: 'Notas internas' }) + @IsOptional() + @IsString() + internalNotes?: string; +} diff --git a/src/modules/orders/entities/order-item.entity.ts b/src/modules/orders/entities/order-item.entity.ts new file mode 100644 index 0000000..8e9af83 --- /dev/null +++ b/src/modules/orders/entities/order-item.entity.ts @@ -0,0 +1,49 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Order } from './order.entity'; +import { Product } from '../../products/entities/product.entity'; + +@Entity({ schema: 'orders', name: 'order_items' }) +export class OrderItem { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'order_id' }) + orderId: string; + + @Column({ name: 'product_id', nullable: true }) + productId: string; + + @Column({ name: 'product_name', length: 100 }) + productName: string; + + @Column({ type: 'decimal', precision: 10, scale: 3 }) + quantity: number; + + @Column({ name: 'unit_price', type: 'decimal', precision: 10, scale: 2 }) + unitPrice: number; + + @Column({ type: 'decimal', precision: 10, scale: 2 }) + subtotal: number; + + @Column({ type: 'text', nullable: true }) + notes: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @ManyToOne(() => Order, (order) => order.items, { onDelete: 'CASCADE' }) + @JoinColumn({ name: 'order_id' }) + order: Order; + + @ManyToOne(() => Product, { nullable: true }) + @JoinColumn({ name: 'product_id' }) + product: Product; +} diff --git a/src/modules/orders/entities/order.entity.ts b/src/modules/orders/entities/order.entity.ts new file mode 100644 index 0000000..1bff508 --- /dev/null +++ b/src/modules/orders/entities/order.entity.ts @@ -0,0 +1,137 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + OneToMany, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { OrderItem } from './order-item.entity'; +import { Customer } from '../../customers/entities/customer.entity'; + +export enum OrderStatus { + PENDING = 'pending', + CONFIRMED = 'confirmed', + PREPARING = 'preparing', + READY = 'ready', + DELIVERED = 'delivered', + COMPLETED = 'completed', + CANCELLED = 'cancelled', +} + +export enum OrderChannel { + WHATSAPP = 'whatsapp', + WEB = 'web', + APP = 'app', + POS = 'pos', +} + +export enum OrderType { + PICKUP = 'pickup', + DELIVERY = 'delivery', + DINE_IN = 'dine_in', +} + +@Entity({ schema: 'orders', name: 'orders' }) +export class Order { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'customer_id', nullable: true }) + customerId: string; + + @Column({ name: 'order_number', length: 20 }) + orderNumber: string; + + @Column({ + type: 'varchar', + length: 20, + default: OrderChannel.WHATSAPP, + }) + channel: OrderChannel; + + @Column({ type: 'decimal', precision: 10, scale: 2 }) + subtotal: number; + + @Column({ name: 'delivery_fee', type: 'decimal', precision: 10, scale: 2, default: 0 }) + deliveryFee: number; + + @Column({ name: 'discount_amount', type: 'decimal', precision: 10, scale: 2, default: 0 }) + discountAmount: number; + + @Column({ type: 'decimal', precision: 10, scale: 2 }) + total: number; + + @Column({ + name: 'order_type', + type: 'varchar', + length: 20, + default: OrderType.PICKUP, + }) + orderType: OrderType; + + @Column({ name: 'delivery_address', type: 'text', nullable: true }) + deliveryAddress: string; + + @Column({ name: 'delivery_notes', type: 'text', nullable: true }) + deliveryNotes: string; + + @Column({ name: 'estimated_delivery_at', type: 'timestamptz', nullable: true }) + estimatedDeliveryAt: Date; + + @Column({ + type: 'varchar', + length: 20, + default: OrderStatus.PENDING, + }) + status: OrderStatus; + + @Column({ name: 'payment_status', length: 20, default: 'pending' }) + paymentStatus: string; + + @Column({ name: 'payment_method', length: 20, nullable: true }) + paymentMethod: string; + + @Column({ name: 'confirmed_at', type: 'timestamptz', nullable: true }) + confirmedAt: Date; + + @Column({ name: 'preparing_at', type: 'timestamptz', nullable: true }) + preparingAt: Date; + + @Column({ name: 'ready_at', type: 'timestamptz', nullable: true }) + readyAt: Date; + + @Column({ name: 'completed_at', type: 'timestamptz', nullable: true }) + completedAt: Date; + + @Column({ name: 'cancelled_at', type: 'timestamptz', nullable: true }) + cancelledAt: Date; + + @Column({ name: 'cancelled_reason', type: 'text', nullable: true }) + cancelledReason: string; + + @Column({ name: 'customer_notes', type: 'text', nullable: true }) + customerNotes: string; + + @Column({ name: 'internal_notes', type: 'text', nullable: true }) + internalNotes: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @OneToMany(() => OrderItem, (item) => item.order, { cascade: true }) + items: OrderItem[]; + + @ManyToOne(() => Customer, { nullable: true }) + @JoinColumn({ name: 'customer_id' }) + customer: Customer; +} diff --git a/src/modules/orders/orders.controller.ts b/src/modules/orders/orders.controller.ts new file mode 100644 index 0000000..00341bc --- /dev/null +++ b/src/modules/orders/orders.controller.ts @@ -0,0 +1,122 @@ +import { + Controller, + Get, + Post, + Patch, + Param, + Body, + Query, + UseGuards, + Request, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { OrdersService } from './orders.service'; +import { CreateOrderDto, UpdateOrderStatusDto } from './dto/order.dto'; +import { OrderStatus } from './entities/order.entity'; + +@ApiTags('orders') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/orders') +export class OrdersController { + constructor(private readonly ordersService: OrdersService) {} + + @Get() + @ApiOperation({ summary: 'Listar pedidos' }) + @ApiQuery({ name: 'status', enum: OrderStatus, required: false }) + findAll(@Request() req, @Query('status') status?: OrderStatus) { + return this.ordersService.findAll(req.user.tenantId, status); + } + + @Get('active') + @ApiOperation({ summary: 'Pedidos activos (pendientes, preparando, listos)' }) + getActive(@Request() req) { + return this.ordersService.getActiveOrders(req.user.tenantId); + } + + @Get('today') + @ApiOperation({ summary: 'Pedidos de hoy' }) + getToday(@Request() req) { + return this.ordersService.getTodayOrders(req.user.tenantId); + } + + @Get('stats') + @ApiOperation({ summary: 'Estadísticas de pedidos' }) + getStats(@Request() req) { + return this.ordersService.getOrderStats(req.user.tenantId); + } + + @Get('number/:orderNumber') + @ApiOperation({ summary: 'Buscar por número de pedido' }) + findByNumber(@Request() req, @Param('orderNumber') orderNumber: string) { + return this.ordersService.findByOrderNumber(req.user.tenantId, orderNumber); + } + + @Get(':id') + @ApiOperation({ summary: 'Obtener pedido por ID' }) + findOne(@Request() req, @Param('id') id: string) { + return this.ordersService.findOne(req.user.tenantId, id); + } + + @Post() + @ApiOperation({ summary: 'Crear nuevo pedido' }) + create(@Request() req, @Body() dto: CreateOrderDto) { + return this.ordersService.create(req.user.tenantId, dto); + } + + @Patch(':id/status') + @ApiOperation({ summary: 'Actualizar estado del pedido' }) + updateStatus( + @Request() req, + @Param('id') id: string, + @Body() dto: UpdateOrderStatusDto, + ) { + return this.ordersService.updateStatus(req.user.tenantId, id, dto); + } + + @Patch(':id/confirm') + @ApiOperation({ summary: 'Confirmar pedido' }) + confirm(@Request() req, @Param('id') id: string) { + return this.ordersService.updateStatus(req.user.tenantId, id, { + status: OrderStatus.CONFIRMED, + }); + } + + @Patch(':id/prepare') + @ApiOperation({ summary: 'Marcar como preparando' }) + prepare(@Request() req, @Param('id') id: string) { + return this.ordersService.updateStatus(req.user.tenantId, id, { + status: OrderStatus.PREPARING, + }); + } + + @Patch(':id/ready') + @ApiOperation({ summary: 'Marcar como listo' }) + ready(@Request() req, @Param('id') id: string) { + return this.ordersService.updateStatus(req.user.tenantId, id, { + status: OrderStatus.READY, + }); + } + + @Patch(':id/complete') + @ApiOperation({ summary: 'Completar pedido' }) + complete(@Request() req, @Param('id') id: string) { + return this.ordersService.updateStatus(req.user.tenantId, id, { + status: OrderStatus.COMPLETED, + }); + } + + @Patch(':id/cancel') + @ApiOperation({ summary: 'Cancelar pedido' }) + cancel( + @Request() req, + @Param('id') id: string, + @Body('reason') reason?: string, + ) { + return this.ordersService.updateStatus(req.user.tenantId, id, { + status: OrderStatus.CANCELLED, + reason, + }); + } +} diff --git a/src/modules/orders/orders.module.ts b/src/modules/orders/orders.module.ts new file mode 100644 index 0000000..da5493d --- /dev/null +++ b/src/modules/orders/orders.module.ts @@ -0,0 +1,14 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { OrdersController } from './orders.controller'; +import { OrdersService } from './orders.service'; +import { Order } from './entities/order.entity'; +import { OrderItem } from './entities/order-item.entity'; + +@Module({ + imports: [TypeOrmModule.forFeature([Order, OrderItem])], + controllers: [OrdersController], + providers: [OrdersService], + exports: [OrdersService], +}) +export class OrdersModule {} diff --git a/src/modules/orders/orders.service.ts b/src/modules/orders/orders.service.ts new file mode 100644 index 0000000..cad8bd0 --- /dev/null +++ b/src/modules/orders/orders.service.ts @@ -0,0 +1,224 @@ +import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository, Between } from 'typeorm'; +import { Order, OrderStatus, OrderChannel } from './entities/order.entity'; +import { OrderItem } from './entities/order-item.entity'; +import { CreateOrderDto, UpdateOrderStatusDto } from './dto/order.dto'; + +@Injectable() +export class OrdersService { + constructor( + @InjectRepository(Order) + private readonly orderRepo: Repository, + @InjectRepository(OrderItem) + private readonly orderItemRepo: Repository, + ) {} + + private generateOrderNumber(): string { + const now = new Date(); + const dateStr = now.toISOString().slice(2, 10).replace(/-/g, ''); + const random = Math.floor(Math.random() * 1000).toString().padStart(3, '0'); + return `P${dateStr}-${random}`; + } + + async create(tenantId: string, dto: CreateOrderDto): Promise { + // Calculate totals + let subtotal = 0; + const items = dto.items.map((item) => { + const itemSubtotal = item.quantity * item.unitPrice; + subtotal += itemSubtotal; + return { + ...item, + subtotal: itemSubtotal, + }; + }); + + const deliveryFee = dto.deliveryFee || 0; + const discountAmount = dto.discountAmount || 0; + const total = subtotal + deliveryFee - discountAmount; + + const order = this.orderRepo.create({ + tenantId, + orderNumber: this.generateOrderNumber(), + customerId: dto.customerId, + channel: dto.channel || OrderChannel.WHATSAPP, + orderType: dto.orderType, + subtotal, + deliveryFee, + discountAmount, + total, + deliveryAddress: dto.deliveryAddress, + deliveryNotes: dto.deliveryNotes, + customerNotes: dto.customerNotes, + paymentMethod: dto.paymentMethod, + status: OrderStatus.PENDING, + items: items.map((item) => this.orderItemRepo.create(item)), + }); + + return this.orderRepo.save(order); + } + + async findAll(tenantId: string, status?: OrderStatus): Promise { + const where: any = { tenantId }; + if (status) { + where.status = status; + } + + return this.orderRepo.find({ + where, + relations: ['items', 'customer'], + order: { createdAt: 'DESC' }, + }); + } + + async findOne(tenantId: string, id: string): Promise { + const order = await this.orderRepo.findOne({ + where: { id, tenantId }, + relations: ['items', 'customer'], + }); + + if (!order) { + throw new NotFoundException('Pedido no encontrado'); + } + + return order; + } + + async findByOrderNumber(tenantId: string, orderNumber: string): Promise { + const order = await this.orderRepo.findOne({ + where: { orderNumber, tenantId }, + relations: ['items', 'customer'], + }); + + if (!order) { + throw new NotFoundException('Pedido no encontrado'); + } + + return order; + } + + async getActiveOrders(tenantId: string): Promise { + return this.orderRepo.find({ + where: [ + { tenantId, status: OrderStatus.PENDING }, + { tenantId, status: OrderStatus.CONFIRMED }, + { tenantId, status: OrderStatus.PREPARING }, + { tenantId, status: OrderStatus.READY }, + ], + relations: ['items', 'customer'], + order: { createdAt: 'ASC' }, + }); + } + + async getTodayOrders(tenantId: string): Promise { + const today = new Date(); + today.setHours(0, 0, 0, 0); + const tomorrow = new Date(today); + tomorrow.setDate(tomorrow.getDate() + 1); + + return this.orderRepo.find({ + where: { + tenantId, + createdAt: Between(today, tomorrow), + }, + relations: ['items', 'customer'], + order: { createdAt: 'DESC' }, + }); + } + + async updateStatus(tenantId: string, id: string, dto: UpdateOrderStatusDto): Promise { + const order = await this.findOne(tenantId, id); + + // Validate status transition + this.validateStatusTransition(order.status, dto.status); + + order.status = dto.status; + + // Update timestamps based on status + const now = new Date(); + switch (dto.status) { + case OrderStatus.CONFIRMED: + order.confirmedAt = now; + break; + case OrderStatus.PREPARING: + order.preparingAt = now; + break; + case OrderStatus.READY: + order.readyAt = now; + break; + case OrderStatus.COMPLETED: + case OrderStatus.DELIVERED: + order.completedAt = now; + break; + case OrderStatus.CANCELLED: + order.cancelledAt = now; + order.cancelledReason = dto.reason; + break; + } + + if (dto.internalNotes) { + order.internalNotes = dto.internalNotes; + } + + return this.orderRepo.save(order); + } + + private validateStatusTransition(currentStatus: OrderStatus, newStatus: OrderStatus): void { + const validTransitions: Record = { + [OrderStatus.PENDING]: [OrderStatus.CONFIRMED, OrderStatus.CANCELLED], + [OrderStatus.CONFIRMED]: [OrderStatus.PREPARING, OrderStatus.CANCELLED], + [OrderStatus.PREPARING]: [OrderStatus.READY, OrderStatus.CANCELLED], + [OrderStatus.READY]: [OrderStatus.DELIVERED, OrderStatus.COMPLETED, OrderStatus.CANCELLED], + [OrderStatus.DELIVERED]: [OrderStatus.COMPLETED], + [OrderStatus.COMPLETED]: [], + [OrderStatus.CANCELLED]: [], + }; + + if (!validTransitions[currentStatus].includes(newStatus)) { + throw new BadRequestException( + `No se puede cambiar de ${currentStatus} a ${newStatus}`, + ); + } + } + + async getOrderStats(tenantId: string) { + const today = new Date(); + today.setHours(0, 0, 0, 0); + const tomorrow = new Date(today); + tomorrow.setDate(tomorrow.getDate() + 1); + + const [ + todayOrders, + pendingCount, + preparingCount, + readyCount, + ] = await Promise.all([ + this.orderRepo.count({ + where: { tenantId, createdAt: Between(today, tomorrow) }, + }), + this.orderRepo.count({ where: { tenantId, status: OrderStatus.PENDING } }), + this.orderRepo.count({ where: { tenantId, status: OrderStatus.PREPARING } }), + this.orderRepo.count({ where: { tenantId, status: OrderStatus.READY } }), + ]); + + const todaySales = await this.orderRepo + .createQueryBuilder('order') + .select('SUM(order.total)', 'total') + .where('order.tenant_id = :tenantId', { tenantId }) + .andWhere('order.created_at >= :today', { today }) + .andWhere('order.created_at < :tomorrow', { tomorrow }) + .andWhere('order.status NOT IN (:...statuses)', { + statuses: [OrderStatus.CANCELLED], + }) + .getRawOne(); + + return { + todayOrders, + todaySales: Number(todaySales?.total) || 0, + pending: pendingCount, + preparing: preparingCount, + ready: readyCount, + activeTotal: pendingCount + preparingCount + readyCount, + }; + } +} diff --git a/src/modules/payments/entities/payment-method.entity.ts b/src/modules/payments/entities/payment-method.entity.ts new file mode 100644 index 0000000..38eeb51 --- /dev/null +++ b/src/modules/payments/entities/payment-method.entity.ts @@ -0,0 +1,36 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, +} from 'typeorm'; + +@Entity({ schema: 'sales', name: 'payments' }) +export class PaymentMethod { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ length: 20 }) + code: string; + + @Column({ length: 100 }) + name: string; + + @Column({ length: 50, default: 'banknote' }) + icon: string; + + @Column({ name: 'is_default', default: false }) + isDefault: boolean; + + @Column({ name: 'is_active', default: true }) + isActive: boolean; + + @Column({ name: 'sort_order', default: 0 }) + sortOrder: number; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; +} diff --git a/src/modules/payments/payments.controller.ts b/src/modules/payments/payments.controller.ts new file mode 100644 index 0000000..fec32cf --- /dev/null +++ b/src/modules/payments/payments.controller.ts @@ -0,0 +1,77 @@ +import { + Controller, + Get, + Post, + Patch, + Param, + UseGuards, + Request, + ParseUUIDPipe, +} from '@nestjs/common'; +import { + ApiTags, + ApiOperation, + ApiResponse, + ApiBearerAuth, + ApiParam, +} from '@nestjs/swagger'; +import { PaymentsService } from './payments.service'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; + +@ApiTags('payments') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/payment-methods') +export class PaymentsController { + constructor(private readonly paymentsService: PaymentsService) {} + + @Get() + @ApiOperation({ summary: 'Listar métodos de pago' }) + @ApiResponse({ status: 200, description: 'Lista de métodos de pago' }) + async findAll(@Request() req: { user: { tenantId: string } }) { + return this.paymentsService.findAll(req.user.tenantId); + } + + @Get('default') + @ApiOperation({ summary: 'Obtener método de pago por defecto' }) + async getDefault(@Request() req: { user: { tenantId: string } }) { + return this.paymentsService.getDefault(req.user.tenantId); + } + + @Get(':id') + @ApiOperation({ summary: 'Obtener método de pago por ID' }) + @ApiParam({ name: 'id', description: 'ID del método de pago' }) + async findOne( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.paymentsService.findOne(req.user.tenantId, id); + } + + @Post('initialize') + @ApiOperation({ summary: 'Inicializar métodos de pago por defecto' }) + @ApiResponse({ status: 201, description: 'Métodos de pago inicializados' }) + async initialize(@Request() req: { user: { tenantId: string } }) { + return this.paymentsService.initializeForTenant(req.user.tenantId); + } + + @Patch(':id/toggle-active') + @ApiOperation({ summary: 'Activar/desactivar método de pago' }) + @ApiParam({ name: 'id', description: 'ID del método de pago' }) + async toggleActive( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.paymentsService.toggleActive(req.user.tenantId, id); + } + + @Patch(':id/set-default') + @ApiOperation({ summary: 'Establecer como método de pago por defecto' }) + @ApiParam({ name: 'id', description: 'ID del método de pago' }) + async setDefault( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.paymentsService.setDefault(req.user.tenantId, id); + } +} diff --git a/src/modules/payments/payments.module.ts b/src/modules/payments/payments.module.ts new file mode 100644 index 0000000..99b529a --- /dev/null +++ b/src/modules/payments/payments.module.ts @@ -0,0 +1,17 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { PaymentsController } from './payments.controller'; +import { PaymentsService } from './payments.service'; +import { PaymentMethod } from './entities/payment-method.entity'; +import { AuthModule } from '../auth/auth.module'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([PaymentMethod]), + AuthModule, + ], + controllers: [PaymentsController], + providers: [PaymentsService], + exports: [PaymentsService, TypeOrmModule], +}) +export class PaymentsModule {} diff --git a/src/modules/payments/payments.service.ts b/src/modules/payments/payments.service.ts new file mode 100644 index 0000000..ecdfc78 --- /dev/null +++ b/src/modules/payments/payments.service.ts @@ -0,0 +1,84 @@ +import { Injectable, NotFoundException } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { PaymentMethod } from './entities/payment-method.entity'; + +const DEFAULT_PAYMENT_METHODS = [ + { code: 'cash', name: 'Efectivo', icon: 'banknote', isDefault: true, sortOrder: 1 }, + { code: 'card', name: 'Tarjeta', icon: 'credit-card', isDefault: false, sortOrder: 2 }, + { code: 'transfer', name: 'Transferencia', icon: 'smartphone', isDefault: false, sortOrder: 3 }, +]; + +@Injectable() +export class PaymentsService { + constructor( + @InjectRepository(PaymentMethod) + private readonly paymentMethodRepository: Repository, + ) {} + + async findAll(tenantId: string): Promise { + return this.paymentMethodRepository.find({ + where: { tenantId, isActive: true }, + order: { sortOrder: 'ASC' }, + }); + } + + async findOne(tenantId: string, id: string): Promise { + const method = await this.paymentMethodRepository.findOne({ + where: { id, tenantId }, + }); + + if (!method) { + throw new NotFoundException('Método de pago no encontrado'); + } + + return method; + } + + async getDefault(tenantId: string): Promise { + return this.paymentMethodRepository.findOne({ + where: { tenantId, isDefault: true, isActive: true }, + }); + } + + async initializeForTenant(tenantId: string): Promise { + const existing = await this.paymentMethodRepository.count({ + where: { tenantId }, + }); + + if (existing > 0) { + return this.findAll(tenantId); + } + + const methods: PaymentMethod[] = []; + + for (const method of DEFAULT_PAYMENT_METHODS) { + const paymentMethod = this.paymentMethodRepository.create({ + ...method, + tenantId, + }); + methods.push(await this.paymentMethodRepository.save(paymentMethod)); + } + + return methods; + } + + async toggleActive(tenantId: string, id: string): Promise { + const method = await this.findOne(tenantId, id); + method.isActive = !method.isActive; + return this.paymentMethodRepository.save(method); + } + + async setDefault(tenantId: string, id: string): Promise { + // Remove default from all + await this.paymentMethodRepository.update( + { tenantId }, + { isDefault: false }, + ); + + // Set new default + const method = await this.findOne(tenantId, id); + method.isDefault = true; + return this.paymentMethodRepository.save(method); + } +} diff --git a/src/modules/products/dto/product.dto.ts b/src/modules/products/dto/product.dto.ts new file mode 100644 index 0000000..ef788a3 --- /dev/null +++ b/src/modules/products/dto/product.dto.ts @@ -0,0 +1,194 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger'; +import { + IsString, + IsNotEmpty, + IsOptional, + IsNumber, + IsBoolean, + IsUUID, + Min, + MaxLength, + IsUrl, +} from 'class-validator'; + +export class CreateProductDto { + @ApiProperty({ + description: 'Nombre del producto', + example: 'Coca-Cola 600ml', + }) + @IsString() + @IsNotEmpty() + @MaxLength(100) + name: string; + + @ApiProperty({ + description: 'Descripcion del producto', + required: false, + }) + @IsOptional() + @IsString() + description?: string; + + @ApiProperty({ + description: 'Precio de venta', + example: 18.0, + minimum: 0, + }) + @IsNumber() + @Min(0) + price: number; + + @ApiProperty({ + description: 'SKU unico (opcional)', + example: 'COCA-600', + required: false, + }) + @IsOptional() + @IsString() + @MaxLength(50) + sku?: string; + + @ApiProperty({ + description: 'Codigo de barras (opcional)', + example: '7501055306252', + required: false, + }) + @IsOptional() + @IsString() + @MaxLength(50) + barcode?: string; + + @ApiProperty({ + description: 'ID de la categoria', + required: false, + }) + @IsOptional() + @IsUUID() + categoryId?: string; + + @ApiProperty({ + description: 'Costo de compra', + example: 12.0, + required: false, + }) + @IsOptional() + @IsNumber() + @Min(0) + costPrice?: number; + + @ApiProperty({ + description: 'Precio de comparacion (antes)', + example: 20.0, + required: false, + }) + @IsOptional() + @IsNumber() + @Min(0) + comparePrice?: number; + + @ApiProperty({ + description: 'Controlar inventario', + default: true, + }) + @IsOptional() + @IsBoolean() + trackInventory?: boolean; + + @ApiProperty({ + description: 'Cantidad en stock inicial', + example: 100, + required: false, + }) + @IsOptional() + @IsNumber() + stockQuantity?: number; + + @ApiProperty({ + description: 'Umbral de stock bajo', + example: 10, + required: false, + }) + @IsOptional() + @IsNumber() + @Min(0) + lowStockThreshold?: number; + + @ApiProperty({ + description: 'Unidad de medida', + example: 'pieza', + required: false, + }) + @IsOptional() + @IsString() + @MaxLength(20) + unit?: string; + + @ApiProperty({ + description: 'URL de imagen', + required: false, + }) + @IsOptional() + @IsString() + imageUrl?: string; + + @ApiProperty({ + description: 'Producto destacado', + default: false, + }) + @IsOptional() + @IsBoolean() + isFeatured?: boolean; +} + +export class UpdateProductDto extends PartialType(CreateProductDto) { + @ApiProperty({ + description: 'Estado del producto', + example: 'active', + required: false, + }) + @IsOptional() + @IsString() + status?: string; +} + +export class ProductFilterDto { + @ApiProperty({ + description: 'Filtrar por categoria', + required: false, + }) + @IsOptional() + @IsUUID() + categoryId?: string; + + @ApiProperty({ + description: 'Buscar por nombre o SKU', + required: false, + }) + @IsOptional() + @IsString() + search?: string; + + @ApiProperty({ + description: 'Solo favoritos/destacados', + required: false, + }) + @IsOptional() + @IsBoolean() + favorites?: boolean; + + @ApiProperty({ + description: 'Solo activos', + default: true, + }) + @IsOptional() + @IsBoolean() + active?: boolean; + + @ApiProperty({ + description: 'Solo con stock bajo', + required: false, + }) + @IsOptional() + @IsBoolean() + lowStock?: boolean; +} diff --git a/src/modules/products/entities/product.entity.ts b/src/modules/products/entities/product.entity.ts new file mode 100644 index 0000000..3b13232 --- /dev/null +++ b/src/modules/products/entities/product.entity.ts @@ -0,0 +1,75 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Category } from '../../categories/entities/category.entity'; + +@Entity({ schema: 'catalog', name: 'products' }) +export class Product { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'category_id', nullable: true }) + categoryId: string; + + @Column({ length: 100 }) + name: string; + + @Column({ type: 'text', nullable: true }) + description: string; + + @Column({ length: 50, nullable: true }) + sku: string; + + @Column({ length: 50, nullable: true }) + barcode: string; + + @Column({ type: 'decimal', precision: 10, scale: 2 }) + price: number; + + @Column({ name: 'cost_price', type: 'decimal', precision: 10, scale: 2, nullable: true }) + costPrice: number; + + @Column({ name: 'compare_price', type: 'decimal', precision: 10, scale: 2, nullable: true }) + comparePrice: number; + + @Column({ name: 'track_inventory', default: true }) + trackInventory: boolean; + + @Column({ name: 'stock_quantity', type: 'int', default: 0 }) + stockQuantity: number; + + @Column({ name: 'low_stock_threshold', type: 'int', default: 5 }) + lowStockThreshold: number; + + @Column({ length: 20, default: 'pieza' }) + unit: string; + + @Column({ name: 'image_url', type: 'text', nullable: true }) + imageUrl: string; + + @Column({ length: 20, default: 'active' }) + status: string; + + @Column({ name: 'is_featured', default: false }) + isFeatured: boolean; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => Category, (category) => category.products, { nullable: true }) + @JoinColumn({ name: 'category_id' }) + category: Category; +} diff --git a/src/modules/products/products.controller.ts b/src/modules/products/products.controller.ts new file mode 100644 index 0000000..f0b6c05 --- /dev/null +++ b/src/modules/products/products.controller.ts @@ -0,0 +1,147 @@ +import { + Controller, + Get, + Post, + Put, + Patch, + Delete, + Body, + Param, + Query, + UseGuards, + Request, + ParseUUIDPipe, + HttpCode, + HttpStatus, +} from '@nestjs/common'; +import { + ApiTags, + ApiOperation, + ApiResponse, + ApiBearerAuth, + ApiParam, + ApiQuery, +} from '@nestjs/swagger'; +import { ProductsService } from './products.service'; +import { CreateProductDto, UpdateProductDto, ProductFilterDto } from './dto/product.dto'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; + +@ApiTags('products') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/products') +export class ProductsController { + constructor(private readonly productsService: ProductsService) {} + + @Get() + @ApiOperation({ summary: 'Listar productos' }) + @ApiResponse({ status: 200, description: 'Lista de productos' }) + async findAll( + @Request() req: { user: { tenantId: string } }, + @Query() filters: ProductFilterDto, + ) { + return this.productsService.findAll(req.user.tenantId, filters); + } + + @Get('favorites') + @ApiOperation({ summary: 'Obtener productos favoritos' }) + async getFavorites(@Request() req: { user: { tenantId: string } }) { + return this.productsService.findAll(req.user.tenantId, { favorites: true }); + } + + @Get('low-stock') + @ApiOperation({ summary: 'Obtener productos con stock bajo' }) + async getLowStock(@Request() req: { user: { tenantId: string } }) { + return this.productsService.getLowStockProducts(req.user.tenantId); + } + + @Get('barcode/:barcode') + @ApiOperation({ summary: 'Buscar producto por código de barras' }) + @ApiParam({ name: 'barcode', description: 'Código de barras' }) + async findByBarcode( + @Request() req: { user: { tenantId: string } }, + @Param('barcode') barcode: string, + ) { + return this.productsService.findByBarcode(req.user.tenantId, barcode); + } + + @Get(':id') + @ApiOperation({ summary: 'Obtener producto por ID' }) + @ApiParam({ name: 'id', description: 'ID del producto' }) + async findOne( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.productsService.findOne(req.user.tenantId, id); + } + + @Post() + @ApiOperation({ summary: 'Crear producto' }) + @ApiResponse({ status: 201, description: 'Producto creado' }) + @ApiResponse({ status: 409, description: 'SKU o código de barras duplicado' }) + @ApiResponse({ status: 400, description: 'Límite de productos alcanzado' }) + async create( + @Request() req: { user: { tenantId: string } }, + @Body() dto: CreateProductDto, + ) { + return this.productsService.create(req.user.tenantId, dto); + } + + @Put(':id') + @ApiOperation({ summary: 'Actualizar producto' }) + @ApiParam({ name: 'id', description: 'ID del producto' }) + async update( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + @Body() dto: UpdateProductDto, + ) { + return this.productsService.update(req.user.tenantId, id, dto); + } + + @Patch(':id/toggle-active') + @ApiOperation({ summary: 'Activar/desactivar producto' }) + @ApiParam({ name: 'id', description: 'ID del producto' }) + async toggleActive( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.productsService.toggleActive(req.user.tenantId, id); + } + + @Patch(':id/toggle-favorite') + @ApiOperation({ summary: 'Marcar/desmarcar como favorito' }) + @ApiParam({ name: 'id', description: 'ID del producto' }) + async toggleFavorite( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.productsService.toggleFavorite(req.user.tenantId, id); + } + + @Patch(':id/adjust-stock') + @ApiOperation({ summary: 'Ajustar stock manualmente' }) + @ApiParam({ name: 'id', description: 'ID del producto' }) + async adjustStock( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + @Body() body: { adjustment: number; reason?: string }, + ) { + return this.productsService.adjustStock( + req.user.tenantId, + id, + body.adjustment, + body.reason, + ); + } + + @Delete(':id') + @HttpCode(HttpStatus.NO_CONTENT) + @ApiOperation({ summary: 'Eliminar producto' }) + @ApiParam({ name: 'id', description: 'ID del producto' }) + async delete( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + await this.productsService.delete(req.user.tenantId, id); + } +} diff --git a/src/modules/products/products.module.ts b/src/modules/products/products.module.ts new file mode 100644 index 0000000..47fe117 --- /dev/null +++ b/src/modules/products/products.module.ts @@ -0,0 +1,17 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { ProductsController } from './products.controller'; +import { ProductsService } from './products.service'; +import { Product } from './entities/product.entity'; +import { AuthModule } from '../auth/auth.module'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([Product]), + AuthModule, + ], + controllers: [ProductsController], + providers: [ProductsService], + exports: [ProductsService, TypeOrmModule], +}) +export class ProductsModule {} diff --git a/src/modules/products/products.service.ts b/src/modules/products/products.service.ts new file mode 100644 index 0000000..83c995b --- /dev/null +++ b/src/modules/products/products.service.ts @@ -0,0 +1,224 @@ +import { + Injectable, + NotFoundException, + ConflictException, + BadRequestException, +} from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { Product } from './entities/product.entity'; +import { Tenant } from '../auth/entities/tenant.entity'; +import { CreateProductDto, UpdateProductDto, ProductFilterDto } from './dto/product.dto'; + +@Injectable() +export class ProductsService { + constructor( + @InjectRepository(Product) + private readonly productRepository: Repository, + @InjectRepository(Tenant) + private readonly tenantRepository: Repository, + ) {} + + async findAll(tenantId: string, filters: ProductFilterDto): Promise { + const query = this.productRepository + .createQueryBuilder('product') + .leftJoinAndSelect('product.category', 'category') + .where('product.tenantId = :tenantId', { tenantId }); + + if (filters.categoryId) { + query.andWhere('product.categoryId = :categoryId', { + categoryId: filters.categoryId, + }); + } + + if (filters.search) { + query.andWhere( + '(product.name ILIKE :search OR product.sku ILIKE :search OR product.barcode ILIKE :search)', + { search: `%${filters.search}%` }, + ); + } + + if (filters.favorites) { + query.andWhere('product.isFeatured = true'); + } + + if (filters.active !== false) { + query.andWhere("product.status = 'active'"); + } + + if (filters.lowStock) { + query.andWhere('product.trackInventory = true'); + query.andWhere('product.stockQuantity <= product.lowStockThreshold'); + } + + query.orderBy('product.name', 'ASC'); + + return query.getMany(); + } + + async findOne(tenantId: string, id: string): Promise { + const product = await this.productRepository.findOne({ + where: { id, tenantId }, + relations: ['category'], + }); + + if (!product) { + throw new NotFoundException('Producto no encontrado'); + } + + return product; + } + + async findByBarcode(tenantId: string, barcode: string): Promise { + const product = await this.productRepository.findOne({ + where: { barcode, tenantId, status: 'active' }, + relations: ['category'], + }); + + if (!product) { + throw new NotFoundException('Producto no encontrado'); + } + + return product; + } + + async create(tenantId: string, dto: CreateProductDto): Promise { + // Check product limit + const tenant = await this.tenantRepository.findOne({ + where: { id: tenantId }, + }); + + if (!tenant) { + throw new BadRequestException('Tenant no encontrado'); + } + + // Product limit check - limits managed via subscription plans + const MAX_PRODUCTS_DEFAULT = 500; + const productCount = await this.productRepository.count({ + where: { tenantId }, + }); + + if (productCount >= MAX_PRODUCTS_DEFAULT) { + throw new BadRequestException( + `Has alcanzado el límite de ${MAX_PRODUCTS_DEFAULT} productos. Actualiza tu plan.`, + ); + } + + // Check SKU uniqueness + if (dto.sku) { + const existingSku = await this.productRepository.findOne({ + where: { tenantId, sku: dto.sku }, + }); + + if (existingSku) { + throw new ConflictException('Ya existe un producto con ese SKU'); + } + } + + // Check barcode uniqueness + if (dto.barcode) { + const existingBarcode = await this.productRepository.findOne({ + where: { tenantId, barcode: dto.barcode }, + }); + + if (existingBarcode) { + throw new ConflictException('Ya existe un producto con ese código de barras'); + } + } + + const product = this.productRepository.create({ + ...dto, + tenantId, + }); + + return this.productRepository.save(product); + } + + async update(tenantId: string, id: string, dto: UpdateProductDto): Promise { + const product = await this.findOne(tenantId, id); + + // Check SKU uniqueness if changed + if (dto.sku && dto.sku !== product.sku) { + const existingSku = await this.productRepository.findOne({ + where: { tenantId, sku: dto.sku }, + }); + + if (existingSku) { + throw new ConflictException('Ya existe un producto con ese SKU'); + } + } + + // Check barcode uniqueness if changed + if (dto.barcode && dto.barcode !== product.barcode) { + const existingBarcode = await this.productRepository.findOne({ + where: { tenantId, barcode: dto.barcode }, + }); + + if (existingBarcode) { + throw new ConflictException('Ya existe un producto con ese código de barras'); + } + } + + Object.assign(product, dto); + return this.productRepository.save(product); + } + + async delete(tenantId: string, id: string): Promise { + const product = await this.findOne(tenantId, id); + await this.productRepository.remove(product); + } + + async toggleActive(tenantId: string, id: string): Promise { + const product = await this.findOne(tenantId, id); + product.status = product.status === 'active' ? 'inactive' : 'active'; + return this.productRepository.save(product); + } + + async toggleFavorite(tenantId: string, id: string): Promise { + const product = await this.findOne(tenantId, id); + product.isFeatured = !product.isFeatured; + return this.productRepository.save(product); + } + + async adjustStock( + tenantId: string, + id: string, + adjustment: number, + reason?: string, + ): Promise { + const product = await this.findOne(tenantId, id); + + if (!product.trackInventory) { + throw new BadRequestException('Este producto no tiene control de inventario'); + } + + const newQuantity = Number(product.stockQuantity) + adjustment; + + if (newQuantity < 0) { + throw new BadRequestException('No hay suficiente stock disponible'); + } + + product.stockQuantity = newQuantity; + return this.productRepository.save(product); + } + + async getLowStockProducts(tenantId: string): Promise { + return this.productRepository + .createQueryBuilder('product') + .leftJoinAndSelect('product.category', 'category') + .where('product.tenantId = :tenantId', { tenantId }) + .andWhere('product.trackInventory = true') + .andWhere('product.stockQuantity <= product.lowStockThreshold') + .andWhere("product.status = 'active'") + .orderBy('product.stockQuantity', 'ASC') + .getMany(); + } + + async getFavorites(tenantId: string): Promise { + return this.productRepository.find({ + where: { tenantId, isFeatured: true, status: 'active' }, + relations: ['category'], + order: { name: 'ASC' }, + }); + } +} diff --git a/src/modules/referrals/dto/apply-code.dto.ts b/src/modules/referrals/dto/apply-code.dto.ts new file mode 100644 index 0000000..9fb91ac --- /dev/null +++ b/src/modules/referrals/dto/apply-code.dto.ts @@ -0,0 +1,15 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { IsString, Length, Matches } from 'class-validator'; + +export class ApplyCodeDto { + @ApiProperty({ + example: 'MCH-ABC123', + description: 'Codigo de referido a aplicar', + }) + @IsString() + @Length(3, 20) + @Matches(/^[A-Z0-9-]+$/, { + message: 'El codigo solo puede contener letras mayusculas, numeros y guiones', + }) + code: string; +} diff --git a/src/modules/referrals/entities/referral-code.entity.ts b/src/modules/referrals/entities/referral-code.entity.ts new file mode 100644 index 0000000..6823685 --- /dev/null +++ b/src/modules/referrals/entities/referral-code.entity.ts @@ -0,0 +1,31 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, +} from 'typeorm'; + +@Entity({ schema: 'subscriptions', name: 'referral_codes' }) +export class ReferralCode { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ length: 20, unique: true }) + code: string; + + @Column({ default: true }) + active: boolean; + + @Column({ name: 'uses_count', default: 0 }) + usesCount: number; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; +} diff --git a/src/modules/referrals/entities/referral-reward.entity.ts b/src/modules/referrals/entities/referral-reward.entity.ts new file mode 100644 index 0000000..ca36aa1 --- /dev/null +++ b/src/modules/referrals/entities/referral-reward.entity.ts @@ -0,0 +1,70 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Referral } from './referral.entity'; + +export enum RewardType { + FREE_MONTH = 'free_month', + DISCOUNT = 'discount', +} + +export enum RewardStatus { + AVAILABLE = 'available', + USED = 'used', + EXPIRED = 'expired', +} + +@Entity({ schema: 'subscriptions', name: 'referral_rewards' }) +export class ReferralReward { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'referral_id' }) + referralId: string; + + @Column({ + type: 'varchar', + length: 20, + default: RewardType.FREE_MONTH, + }) + type: RewardType; + + @Column({ name: 'months_earned', default: 0 }) + monthsEarned: number; + + @Column({ name: 'months_used', default: 0 }) + monthsUsed: number; + + @Column({ name: 'discount_percent', default: 0 }) + discountPercent: number; + + @Column({ name: 'expires_at', type: 'timestamptz', nullable: true }) + expiresAt: Date; + + @Column({ + type: 'varchar', + length: 20, + default: RewardStatus.AVAILABLE, + }) + status: RewardStatus; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => Referral) + @JoinColumn({ name: 'referral_id' }) + referral: Referral; +} diff --git a/src/modules/referrals/entities/referral.entity.ts b/src/modules/referrals/entities/referral.entity.ts new file mode 100644 index 0000000..c71c898 --- /dev/null +++ b/src/modules/referrals/entities/referral.entity.ts @@ -0,0 +1,57 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, +} from 'typeorm'; + +export enum ReferralStatus { + PENDING = 'pending', + CONVERTED = 'converted', + REWARDED = 'rewarded', + EXPIRED = 'expired', +} + +@Entity({ schema: 'subscriptions', name: 'referrals' }) +export class Referral { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'referrer_tenant_id' }) + referrerTenantId: string; + + @Column({ name: 'referred_tenant_id', unique: true }) + referredTenantId: string; + + @Column({ name: 'code_used', length: 20 }) + codeUsed: string; + + @Column({ + type: 'varchar', + length: 20, + default: ReferralStatus.PENDING, + }) + status: ReferralStatus; + + @Column({ name: 'referred_discount_applied', default: false }) + referredDiscountApplied: boolean; + + @Column({ name: 'referrer_reward_applied', default: false }) + referrerRewardApplied: boolean; + + @Column({ name: 'converted_at', type: 'timestamptz', nullable: true }) + convertedAt: Date; + + @Column({ name: 'reward_applied_at', type: 'timestamptz', nullable: true }) + rewardAppliedAt: Date; + + @Column({ name: 'expires_at', type: 'timestamptz', nullable: true }) + expiresAt: Date; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; +} diff --git a/src/modules/referrals/referrals.controller.ts b/src/modules/referrals/referrals.controller.ts new file mode 100644 index 0000000..cef4ca6 --- /dev/null +++ b/src/modules/referrals/referrals.controller.ts @@ -0,0 +1,85 @@ +import { + Controller, + Get, + Post, + Body, + Param, + UseGuards, + Request, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiParam } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { ReferralsService } from './referrals.service'; +import { ApplyCodeDto } from './dto/apply-code.dto'; + +@ApiTags('referrals') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/referrals') +export class ReferralsController { + constructor(private readonly referralsService: ReferralsService) {} + + // ==================== CODES ==================== + + @Get('my-code') + @ApiOperation({ summary: 'Obtener mi codigo de referido' }) + getMyCode(@Request() req) { + return this.referralsService.getMyCode(req.user.tenantId); + } + + @Post('generate-code') + @ApiOperation({ summary: 'Generar nuevo codigo de referido' }) + generateCode(@Request() req) { + return this.referralsService.generateCode(req.user.tenantId); + } + + @Get('validate/:code') + @ApiOperation({ summary: 'Validar un codigo de referido' }) + @ApiParam({ name: 'code', description: 'Codigo a validar' }) + validateCode(@Param('code') code: string) { + return this.referralsService.validateCode(code); + } + + // ==================== REFERRALS ==================== + + @Post('apply-code') + @ApiOperation({ summary: 'Aplicar codigo de referido (al registrarse)' }) + applyCode(@Request() req, @Body() dto: ApplyCodeDto) { + return this.referralsService.applyCode(req.user.tenantId, dto.code); + } + + @Get('list') + @ApiOperation({ summary: 'Listar mis referidos' }) + getMyReferrals(@Request() req) { + return this.referralsService.getMyReferrals(req.user.tenantId); + } + + @Get('stats') + @ApiOperation({ summary: 'Estadisticas de referidos' }) + getStats(@Request() req) { + return this.referralsService.getStats(req.user.tenantId); + } + + // ==================== REWARDS ==================== + + @Get('rewards') + @ApiOperation({ summary: 'Mis recompensas de referidos' }) + getRewards(@Request() req) { + return this.referralsService.getMyRewards(req.user.tenantId); + } + + @Get('rewards/available-months') + @ApiOperation({ summary: 'Meses gratis disponibles' }) + getAvailableMonths(@Request() req) { + return this.referralsService.getAvailableMonths(req.user.tenantId); + } + + // ==================== DISCOUNT ==================== + + @Get('discount') + @ApiOperation({ summary: 'Descuento disponible como referido' }) + async getDiscount(@Request() req) { + const discount = await this.referralsService.getReferredDiscount(req.user.tenantId); + return { discountPercent: discount }; + } +} diff --git a/src/modules/referrals/referrals.module.ts b/src/modules/referrals/referrals.module.ts new file mode 100644 index 0000000..c29f8d5 --- /dev/null +++ b/src/modules/referrals/referrals.module.ts @@ -0,0 +1,15 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { ReferralsController } from './referrals.controller'; +import { ReferralsService } from './referrals.service'; +import { ReferralCode } from './entities/referral-code.entity'; +import { Referral } from './entities/referral.entity'; +import { ReferralReward } from './entities/referral-reward.entity'; + +@Module({ + imports: [TypeOrmModule.forFeature([ReferralCode, Referral, ReferralReward])], + controllers: [ReferralsController], + providers: [ReferralsService], + exports: [ReferralsService], +}) +export class ReferralsModule {} diff --git a/src/modules/referrals/referrals.service.ts b/src/modules/referrals/referrals.service.ts new file mode 100644 index 0000000..c905da4 --- /dev/null +++ b/src/modules/referrals/referrals.service.ts @@ -0,0 +1,266 @@ +import { + Injectable, + NotFoundException, + BadRequestException, + ConflictException, +} from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository, DataSource } from 'typeorm'; +import { ReferralCode } from './entities/referral-code.entity'; +import { Referral, ReferralStatus } from './entities/referral.entity'; +import { ReferralReward, RewardType, RewardStatus } from './entities/referral-reward.entity'; + +@Injectable() +export class ReferralsService { + constructor( + @InjectRepository(ReferralCode) + private readonly codeRepo: Repository, + @InjectRepository(Referral) + private readonly referralRepo: Repository, + @InjectRepository(ReferralReward) + private readonly rewardRepo: Repository, + private readonly dataSource: DataSource, + ) {} + + // ==================== CODES ==================== + + async getMyCode(tenantId: string): Promise { + let code = await this.codeRepo.findOne({ where: { tenantId } }); + + if (!code) { + code = await this.generateCode(tenantId); + } + + return code; + } + + async generateCode(tenantId: string): Promise { + // Check if already has a code + const existing = await this.codeRepo.findOne({ where: { tenantId } }); + if (existing) { + return existing; + } + + // Generate unique code using database function + const result = await this.dataSource.query( + `SELECT generate_referral_code('MCH') as code`, + ); + const newCode = result[0].code; + + const referralCode = this.codeRepo.create({ + tenantId, + code: newCode, + active: true, + }); + + return this.codeRepo.save(referralCode); + } + + async validateCode(code: string): Promise { + const referralCode = await this.codeRepo.findOne({ + where: { code: code.toUpperCase(), active: true }, + }); + + if (!referralCode) { + throw new NotFoundException('Codigo de referido no valido o inactivo'); + } + + return referralCode; + } + + // ==================== REFERRALS ==================== + + async applyCode(referredTenantId: string, code: string): Promise { + // Validate code exists + const referralCode = await this.validateCode(code); + + // Cannot refer yourself + if (referralCode.tenantId === referredTenantId) { + throw new BadRequestException('No puedes usar tu propio codigo de referido'); + } + + // Check if already referred + const existingReferral = await this.referralRepo.findOne({ + where: { referredTenantId }, + }); + + if (existingReferral) { + throw new ConflictException('Ya tienes un codigo de referido aplicado'); + } + + // Create referral with 30 day expiry + const expiresAt = new Date(); + expiresAt.setDate(expiresAt.getDate() + 30); + + const referral = this.referralRepo.create({ + referrerTenantId: referralCode.tenantId, + referredTenantId, + codeUsed: referralCode.code, + status: ReferralStatus.PENDING, + expiresAt, + }); + + await this.referralRepo.save(referral); + + // Increment uses count + referralCode.usesCount += 1; + await this.codeRepo.save(referralCode); + + return referral; + } + + async getReferralByReferred(referredTenantId: string): Promise { + return this.referralRepo.findOne({ where: { referredTenantId } }); + } + + async getMyReferrals(tenantId: string): Promise { + return this.referralRepo.find({ + where: { referrerTenantId: tenantId }, + order: { createdAt: 'DESC' }, + }); + } + + async convertReferral(referredTenantId: string): Promise { + const referral = await this.referralRepo.findOne({ + where: { referredTenantId, status: ReferralStatus.PENDING }, + }); + + if (!referral) { + throw new NotFoundException('No se encontro referido pendiente'); + } + + // Check if expired + if (referral.expiresAt && new Date() > referral.expiresAt) { + referral.status = ReferralStatus.EXPIRED; + await this.referralRepo.save(referral); + throw new BadRequestException('El periodo de conversion ha expirado'); + } + + // Mark as converted + referral.status = ReferralStatus.CONVERTED; + referral.convertedAt = new Date(); + await this.referralRepo.save(referral); + + // Create reward for referrer (1 month free) + const expiresAt = new Date(); + expiresAt.setFullYear(expiresAt.getFullYear() + 1); // 1 year to use + + const reward = this.rewardRepo.create({ + tenantId: referral.referrerTenantId, + referralId: referral.id, + type: RewardType.FREE_MONTH, + monthsEarned: 1, + monthsUsed: 0, + expiresAt, + status: RewardStatus.AVAILABLE, + }); + + await this.rewardRepo.save(reward); + + // Update referral as rewarded + referral.status = ReferralStatus.REWARDED; + referral.referrerRewardApplied = true; + referral.rewardAppliedAt = new Date(); + await this.referralRepo.save(referral); + + return referral; + } + + // ==================== REWARDS ==================== + + async getMyRewards(tenantId: string): Promise { + return this.rewardRepo.find({ + where: { tenantId }, + order: { createdAt: 'DESC' }, + }); + } + + async getAvailableMonths(tenantId: string): Promise { + const rewards = await this.rewardRepo.find({ + where: { tenantId, status: RewardStatus.AVAILABLE, type: RewardType.FREE_MONTH }, + }); + + return rewards.reduce((sum, r) => sum + (r.monthsEarned - r.monthsUsed), 0); + } + + async useReferralMonth(tenantId: string): Promise { + // Find first available reward + const reward = await this.rewardRepo.findOne({ + where: { tenantId, status: RewardStatus.AVAILABLE, type: RewardType.FREE_MONTH }, + order: { createdAt: 'ASC' }, + }); + + if (!reward || reward.monthsEarned <= reward.monthsUsed) { + return false; + } + + reward.monthsUsed += 1; + + if (reward.monthsUsed >= reward.monthsEarned) { + reward.status = RewardStatus.USED; + } + + await this.rewardRepo.save(reward); + return true; + } + + // ==================== STATS ==================== + + async getStats(tenantId: string) { + const result = await this.dataSource.query( + `SELECT * FROM get_referral_stats($1)`, + [tenantId], + ); + + const stats = result[0] || { + total_invited: 0, + total_converted: 0, + total_pending: 0, + total_expired: 0, + months_earned: 0, + months_available: 0, + }; + + const code = await this.getMyCode(tenantId); + + return { + code: code.code, + totalInvited: stats.total_invited, + totalConverted: stats.total_converted, + totalPending: stats.total_pending, + totalExpired: stats.total_expired, + monthsEarned: stats.months_earned, + monthsAvailable: stats.months_available, + }; + } + + // ==================== DISCOUNT FOR REFERRED ==================== + + async getReferredDiscount(tenantId: string): Promise { + const referral = await this.referralRepo.findOne({ + where: { + referredTenantId: tenantId, + referredDiscountApplied: false, + status: ReferralStatus.PENDING, + }, + }); + + if (!referral) { + return 0; + } + + // 50% discount for first month + return 50; + } + + async markDiscountApplied(tenantId: string): Promise { + const referral = await this.referralRepo.findOne({ + where: { referredTenantId: tenantId }, + }); + + if (referral) { + referral.referredDiscountApplied = true; + await this.referralRepo.save(referral); + } + } +} diff --git a/src/modules/sales/dto/sale.dto.ts b/src/modules/sales/dto/sale.dto.ts new file mode 100644 index 0000000..15f5c61 --- /dev/null +++ b/src/modules/sales/dto/sale.dto.ts @@ -0,0 +1,161 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { + IsString, + IsNotEmpty, + IsOptional, + IsNumber, + IsUUID, + IsArray, + ValidateNested, + Min, + MaxLength, + Matches, + ArrayMinSize, +} from 'class-validator'; +import { Type } from 'class-transformer'; + +export class SaleItemDto { + @ApiProperty({ + description: 'ID del producto', + required: true, + }) + @IsUUID() + @IsNotEmpty() + productId: string; + + @ApiProperty({ + description: 'Cantidad vendida', + example: 2, + minimum: 0.001, + }) + @IsNumber() + @Min(0.001) + quantity: number; + + @ApiProperty({ + description: 'Descuento en porcentaje (opcional)', + example: 10, + required: false, + }) + @IsOptional() + @IsNumber() + @Min(0) + discountPercent?: number; +} + +export class CreateSaleDto { + @ApiProperty({ + description: 'Lista de productos vendidos', + type: [SaleItemDto], + }) + @IsArray() + @ArrayMinSize(1, { message: 'Debe incluir al menos un producto' }) + @ValidateNested({ each: true }) + @Type(() => SaleItemDto) + items: SaleItemDto[]; + + @ApiProperty({ + description: 'ID del método de pago', + required: false, + }) + @IsOptional() + @IsUUID() + paymentMethodId?: string; + + @ApiProperty({ + description: 'Monto recibido del cliente', + example: 100, + }) + @IsNumber() + @Min(0) + amountReceived: number; + + @ApiProperty({ + description: 'Nombre del cliente (opcional)', + required: false, + }) + @IsOptional() + @IsString() + @MaxLength(200) + customerName?: string; + + @ApiProperty({ + description: 'Teléfono del cliente (opcional)', + required: false, + }) + @IsOptional() + @IsString() + @Matches(/^[0-9]{10}$/, { + message: 'El teléfono debe tener exactamente 10 dígitos', + }) + customerPhone?: string; + + @ApiProperty({ + description: 'Notas adicionales', + required: false, + }) + @IsOptional() + @IsString() + @MaxLength(500) + notes?: string; + + @ApiProperty({ + description: 'Información del dispositivo (auto-llenado)', + required: false, + }) + @IsOptional() + deviceInfo?: Record; +} + +export class CancelSaleDto { + @ApiProperty({ + description: 'Razón de la cancelación', + example: 'Cliente cambió de opinión', + }) + @IsString() + @IsNotEmpty() + @MaxLength(255) + reason: string; +} + +export class SalesFilterDto { + @ApiProperty({ + description: 'Fecha de inicio (YYYY-MM-DD)', + required: false, + }) + @IsOptional() + @IsString() + startDate?: string; + + @ApiProperty({ + description: 'Fecha de fin (YYYY-MM-DD)', + required: false, + }) + @IsOptional() + @IsString() + endDate?: string; + + @ApiProperty({ + description: 'Estado de la venta', + required: false, + }) + @IsOptional() + @IsString() + status?: string; + + @ApiProperty({ + description: 'Número de ticket', + required: false, + }) + @IsOptional() + @IsString() + ticketNumber?: string; + + @ApiProperty({ + description: 'Límite de resultados', + required: false, + }) + @IsOptional() + @IsNumber() + limit?: number; +} diff --git a/src/modules/sales/entities/sale-item.entity.ts b/src/modules/sales/entities/sale-item.entity.ts new file mode 100644 index 0000000..669ada2 --- /dev/null +++ b/src/modules/sales/entities/sale-item.entity.ts @@ -0,0 +1,52 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Sale } from './sale.entity'; +import { Product } from '../../products/entities/product.entity'; + +@Entity({ schema: 'sales', name: 'sale_items' }) +export class SaleItem { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'sale_id' }) + saleId: string; + + @Column({ name: 'product_id', nullable: true }) + productId: string; + + @Column({ name: 'product_name', length: 200 }) + productName: string; + + @Column({ name: 'product_sku', length: 50, nullable: true }) + productSku: string; + + @Column({ type: 'decimal', precision: 12, scale: 3 }) + quantity: number; + + @Column({ name: 'unit_price', type: 'decimal', precision: 12, scale: 2 }) + unitPrice: number; + + @Column({ name: 'discount_percent', type: 'decimal', precision: 5, scale: 2, default: 0 }) + discountPercent: number; + + @Column({ type: 'decimal', precision: 12, scale: 2 }) + subtotal: number; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @ManyToOne(() => Sale, (sale) => sale.items, { onDelete: 'CASCADE' }) + @JoinColumn({ name: 'sale_id' }) + sale: Sale; + + @ManyToOne(() => Product, { nullable: true }) + @JoinColumn({ name: 'product_id' }) + product: Product; +} diff --git a/src/modules/sales/entities/sale.entity.ts b/src/modules/sales/entities/sale.entity.ts new file mode 100644 index 0000000..0271600 --- /dev/null +++ b/src/modules/sales/entities/sale.entity.ts @@ -0,0 +1,86 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + OneToMany, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { SaleItem } from './sale-item.entity'; +import { PaymentMethod } from '../../payments/entities/payment-method.entity'; + +export enum SaleStatus { + COMPLETED = 'completed', + CANCELLED = 'cancelled', + REFUNDED = 'refunded', +} + +@Entity({ schema: 'sales', name: 'sales' }) +export class Sale { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'ticket_number', length: 20 }) + ticketNumber: string; + + @Column({ type: 'decimal', precision: 12, scale: 2 }) + subtotal: number; + + @Column({ name: 'tax_amount', type: 'decimal', precision: 12, scale: 2, default: 0 }) + taxAmount: number; + + @Column({ name: 'discount_amount', type: 'decimal', precision: 12, scale: 2, default: 0 }) + discountAmount: number; + + @Column({ type: 'decimal', precision: 12, scale: 2 }) + total: number; + + @Column({ name: 'payment_method_id', nullable: true }) + paymentMethodId: string; + + @Column({ name: 'amount_received', type: 'decimal', precision: 12, scale: 2 }) + amountReceived: number; + + @Column({ name: 'change_amount', type: 'decimal', precision: 12, scale: 2, default: 0 }) + changeAmount: number; + + @Column({ + type: 'enum', + enum: SaleStatus, + default: SaleStatus.COMPLETED, + }) + status: SaleStatus; + + @Column({ name: 'cancelled_at', type: 'timestamp', nullable: true }) + cancelledAt: Date; + + @Column({ name: 'cancel_reason', length: 255, nullable: true }) + cancelReason: string; + + @Column({ name: 'customer_name', length: 200, nullable: true }) + customerName: string; + + @Column({ name: 'customer_phone', length: 20, nullable: true }) + customerPhone: string; + + @Column({ type: 'text', nullable: true }) + notes: string; + + @Column({ name: 'device_info', type: 'jsonb', nullable: true }) + deviceInfo: Record; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + // Relations + @OneToMany(() => SaleItem, (item) => item.sale, { cascade: true }) + items: SaleItem[]; + + @ManyToOne(() => PaymentMethod, { nullable: true }) + @JoinColumn({ name: 'payment_method_id' }) + paymentMethod: PaymentMethod; +} diff --git a/src/modules/sales/sales.controller.ts b/src/modules/sales/sales.controller.ts new file mode 100644 index 0000000..be3c86c --- /dev/null +++ b/src/modules/sales/sales.controller.ts @@ -0,0 +1,101 @@ +import { + Controller, + Get, + Post, + Body, + Param, + Query, + UseGuards, + Request, + ParseUUIDPipe, + HttpCode, + HttpStatus, +} from '@nestjs/common'; +import { + ApiTags, + ApiOperation, + ApiResponse, + ApiBearerAuth, + ApiParam, +} from '@nestjs/swagger'; +import { SalesService, TodaySummary } from './sales.service'; +import { CreateSaleDto, CancelSaleDto, SalesFilterDto } from './dto/sale.dto'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; + +@ApiTags('sales') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/sales') +export class SalesController { + constructor(private readonly salesService: SalesService) {} + + @Get() + @ApiOperation({ summary: 'Listar ventas' }) + @ApiResponse({ status: 200, description: 'Lista de ventas' }) + async findAll( + @Request() req: { user: { tenantId: string } }, + @Query() filters: SalesFilterDto, + ) { + return this.salesService.findAll(req.user.tenantId, filters); + } + + @Get('today') + @ApiOperation({ summary: 'Resumen de ventas del día' }) + async getTodaySummary(@Request() req: { user: { tenantId: string } }): Promise { + return this.salesService.getTodaySummary(req.user.tenantId); + } + + @Get('recent') + @ApiOperation({ summary: 'Obtener ventas recientes' }) + async getRecentSales( + @Request() req: { user: { tenantId: string } }, + @Query('limit') limit?: number, + ) { + return this.salesService.getRecentSales(req.user.tenantId, limit || 10); + } + + @Get('ticket/:ticketNumber') + @ApiOperation({ summary: 'Buscar venta por número de ticket' }) + @ApiParam({ name: 'ticketNumber', description: 'Número de ticket' }) + async findByTicketNumber( + @Request() req: { user: { tenantId: string } }, + @Param('ticketNumber') ticketNumber: string, + ) { + return this.salesService.findByTicketNumber(req.user.tenantId, ticketNumber); + } + + @Get(':id') + @ApiOperation({ summary: 'Obtener venta por ID' }) + @ApiParam({ name: 'id', description: 'ID de la venta' }) + async findOne( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + ) { + return this.salesService.findOne(req.user.tenantId, id); + } + + @Post() + @ApiOperation({ summary: 'Registrar nueva venta' }) + @ApiResponse({ status: 201, description: 'Venta creada exitosamente' }) + @ApiResponse({ status: 400, description: 'Stock insuficiente o límite alcanzado' }) + async create( + @Request() req: { user: { tenantId: string } }, + @Body() dto: CreateSaleDto, + ) { + return this.salesService.create(req.user.tenantId, dto); + } + + @Post(':id/cancel') + @HttpCode(HttpStatus.OK) + @ApiOperation({ summary: 'Cancelar venta' }) + @ApiParam({ name: 'id', description: 'ID de la venta' }) + @ApiResponse({ status: 200, description: 'Venta cancelada' }) + @ApiResponse({ status: 400, description: 'No se puede cancelar la venta' }) + async cancel( + @Request() req: { user: { tenantId: string } }, + @Param('id', ParseUUIDPipe) id: string, + @Body() dto: CancelSaleDto, + ) { + return this.salesService.cancel(req.user.tenantId, id, dto); + } +} diff --git a/src/modules/sales/sales.module.ts b/src/modules/sales/sales.module.ts new file mode 100644 index 0000000..1497688 --- /dev/null +++ b/src/modules/sales/sales.module.ts @@ -0,0 +1,20 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { SalesController } from './sales.controller'; +import { SalesService } from './sales.service'; +import { Sale } from './entities/sale.entity'; +import { SaleItem } from './entities/sale-item.entity'; +import { AuthModule } from '../auth/auth.module'; +import { ProductsModule } from '../products/products.module'; + +@Module({ + imports: [ + TypeOrmModule.forFeature([Sale, SaleItem]), + AuthModule, + ProductsModule, + ], + controllers: [SalesController], + providers: [SalesService], + exports: [SalesService, TypeOrmModule], +}) +export class SalesModule {} diff --git a/src/modules/sales/sales.service.ts b/src/modules/sales/sales.service.ts new file mode 100644 index 0000000..216a08b --- /dev/null +++ b/src/modules/sales/sales.service.ts @@ -0,0 +1,267 @@ +import { + Injectable, + NotFoundException, + BadRequestException, +} from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository, Between, LessThanOrEqual, MoreThanOrEqual } from 'typeorm'; +import { Sale, SaleStatus } from './entities/sale.entity'; +import { SaleItem } from './entities/sale-item.entity'; +import { Product } from '../products/entities/product.entity'; +import { Tenant } from '../auth/entities/tenant.entity'; +import { CreateSaleDto, CancelSaleDto, SalesFilterDto } from './dto/sale.dto'; + +export interface TodaySummary { + totalSales: number; + totalRevenue: number; + totalTax: number; + avgTicket: number; +} + +@Injectable() +export class SalesService { + constructor( + @InjectRepository(Sale) + private readonly saleRepository: Repository, + @InjectRepository(SaleItem) + private readonly saleItemRepository: Repository, + @InjectRepository(Product) + private readonly productRepository: Repository, + @InjectRepository(Tenant) + private readonly tenantRepository: Repository, + ) {} + + async findAll(tenantId: string, filters: SalesFilterDto): Promise { + const query = this.saleRepository + .createQueryBuilder('sale') + .leftJoinAndSelect('sale.items', 'items') + .leftJoinAndSelect('sale.paymentMethod', 'paymentMethod') + .where('sale.tenantId = :tenantId', { tenantId }); + + if (filters.startDate && filters.endDate) { + query.andWhere('DATE(sale.createdAt) BETWEEN :startDate AND :endDate', { + startDate: filters.startDate, + endDate: filters.endDate, + }); + } else if (filters.startDate) { + query.andWhere('DATE(sale.createdAt) >= :startDate', { + startDate: filters.startDate, + }); + } else if (filters.endDate) { + query.andWhere('DATE(sale.createdAt) <= :endDate', { + endDate: filters.endDate, + }); + } + + if (filters.status) { + query.andWhere('sale.status = :status', { status: filters.status }); + } + + if (filters.ticketNumber) { + query.andWhere('sale.ticketNumber ILIKE :ticketNumber', { + ticketNumber: `%${filters.ticketNumber}%`, + }); + } + + query.orderBy('sale.createdAt', 'DESC'); + + if (filters.limit) { + query.limit(filters.limit); + } + + return query.getMany(); + } + + async findOne(tenantId: string, id: string): Promise { + const sale = await this.saleRepository.findOne({ + where: { id, tenantId }, + relations: ['items', 'paymentMethod'], + }); + + if (!sale) { + throw new NotFoundException('Venta no encontrada'); + } + + return sale; + } + + async findByTicketNumber(tenantId: string, ticketNumber: string): Promise { + const sale = await this.saleRepository.findOne({ + where: { ticketNumber, tenantId }, + relations: ['items', 'paymentMethod'], + }); + + if (!sale) { + throw new NotFoundException('Venta no encontrada'); + } + + return sale; + } + + async create(tenantId: string, dto: CreateSaleDto): Promise { + // Check monthly sales limit + const tenant = await this.tenantRepository.findOne({ + where: { id: tenantId }, + }); + + if (!tenant) { + throw new BadRequestException('Tenant no encontrado'); + } + + // Sales limit check - limits managed via subscription plans + // TODO: Implement proper subscription-based limits when subscriptions module is complete + + // Calculate totals + let subtotal = 0; + const saleItems: Partial[] = []; + + for (const item of dto.items) { + const product = await this.productRepository.findOne({ + where: { id: item.productId, tenantId, status: 'active' }, + }); + + if (!product) { + throw new BadRequestException(`Producto ${item.productId} no encontrado`); + } + + // Check stock if tracking + if (product.trackInventory && Number(product.stockQuantity) < item.quantity) { + throw new BadRequestException( + `Stock insuficiente para ${product.name}. Disponible: ${product.stockQuantity}`, + ); + } + + const itemSubtotal = + Number(product.price) * item.quantity * (1 - (item.discountPercent || 0) / 100); + + saleItems.push({ + productId: product.id, + productName: product.name, + productSku: product.sku, + quantity: item.quantity, + unitPrice: Number(product.price), + discountPercent: item.discountPercent || 0, + subtotal: itemSubtotal, + }); + + subtotal += itemSubtotal; + } + + // Calculate tax (assume 16% IVA included in price) + const taxRate = Number(tenant.taxRate) / 100; + const taxAmount = subtotal - subtotal / (1 + taxRate); + const total = subtotal; + + // Validate payment + if (dto.amountReceived < total) { + throw new BadRequestException( + `Monto recibido ($${dto.amountReceived}) es menor al total ($${total.toFixed(2)})`, + ); + } + + const changeAmount = dto.amountReceived - total; + + // Create sale + const sale = this.saleRepository.create({ + tenantId, + subtotal, + taxAmount, + discountAmount: 0, + total, + paymentMethodId: dto.paymentMethodId, + amountReceived: dto.amountReceived, + changeAmount, + customerName: dto.customerName, + customerPhone: dto.customerPhone, + notes: dto.notes, + deviceInfo: dto.deviceInfo, + status: SaleStatus.COMPLETED, + }); + + const savedSale = await this.saleRepository.save(sale); + + // Create sale items + for (const item of saleItems) { + const saleItem = this.saleItemRepository.create({ + ...item, + saleId: savedSale.id, + }); + await this.saleItemRepository.save(saleItem); + } + + // Return complete sale with items + return this.findOne(tenantId, savedSale.id); + } + + async cancel(tenantId: string, id: string, dto: CancelSaleDto): Promise { + const sale = await this.findOne(tenantId, id); + + if (sale.status !== SaleStatus.COMPLETED) { + throw new BadRequestException('Solo se pueden cancelar ventas completadas'); + } + + // Check if sale is from today (can only cancel same-day sales) + const today = new Date(); + today.setHours(0, 0, 0, 0); + const saleDate = new Date(sale.createdAt); + saleDate.setHours(0, 0, 0, 0); + + if (saleDate.getTime() !== today.getTime()) { + throw new BadRequestException('Solo se pueden cancelar ventas del día actual'); + } + + sale.status = SaleStatus.CANCELLED; + sale.cancelledAt = new Date(); + sale.cancelReason = dto.reason; + + // Restore stock + for (const item of sale.items) { + if (item.productId) { + const product = await this.productRepository.findOne({ + where: { id: item.productId }, + }); + + if (product?.trackInventory) { + product.stockQuantity = Number(product.stockQuantity) + Number(item.quantity); + await this.productRepository.save(product); + } + } + } + + return this.saleRepository.save(sale); + } + + async getTodaySummary(tenantId: string): Promise { + const today = new Date(); + today.setHours(0, 0, 0, 0); + + const result = await this.saleRepository + .createQueryBuilder('sale') + .select([ + 'COUNT(sale.id) as totalSales', + 'COALESCE(SUM(sale.total), 0) as totalRevenue', + 'COALESCE(SUM(sale.taxAmount), 0) as totalTax', + 'COALESCE(AVG(sale.total), 0) as avgTicket', + ]) + .where('sale.tenantId = :tenantId', { tenantId }) + .andWhere('DATE(sale.createdAt) = CURRENT_DATE') + .andWhere('sale.status = :status', { status: SaleStatus.COMPLETED }) + .getRawOne(); + + return { + totalSales: parseInt(result.totalsales, 10) || 0, + totalRevenue: parseFloat(result.totalrevenue) || 0, + totalTax: parseFloat(result.totaltax) || 0, + avgTicket: parseFloat(result.avgticket) || 0, + }; + } + + async getRecentSales(tenantId: string, limit = 10): Promise { + return this.saleRepository.find({ + where: { tenantId }, + relations: ['items', 'paymentMethod'], + order: { createdAt: 'DESC' }, + take: limit, + }); + } +} diff --git a/src/modules/subscriptions/entities/plan.entity.ts b/src/modules/subscriptions/entities/plan.entity.ts new file mode 100644 index 0000000..59f0b41 --- /dev/null +++ b/src/modules/subscriptions/entities/plan.entity.ts @@ -0,0 +1,61 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, +} from 'typeorm'; + +@Entity({ schema: 'subscriptions', name: 'plans' }) +export class Plan { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ length: 50 }) + name: string; + + @Column({ length: 20, unique: true }) + code: string; + + @Column({ type: 'text', nullable: true }) + description: string; + + @Column({ name: 'price_monthly', type: 'decimal', precision: 10, scale: 2 }) + priceMonthly: number; + + @Column({ name: 'price_yearly', type: 'decimal', precision: 10, scale: 2, nullable: true }) + priceYearly: number; + + @Column({ length: 3, default: 'MXN' }) + currency: string; + + @Column({ name: 'included_tokens' }) + includedTokens: number; + + @Column({ type: 'jsonb', nullable: true }) + features: Record; + + @Column({ name: 'max_products', nullable: true }) + maxProducts: number; + + @Column({ name: 'max_users', default: 1 }) + maxUsers: number; + + @Column({ name: 'whatsapp_own_number', default: false }) + whatsappOwnNumber: boolean; + + @Column({ length: 20, default: 'active' }) + status: string; + + @Column({ name: 'stripe_price_id_monthly', length: 100, nullable: true }) + stripePriceIdMonthly: string; + + @Column({ name: 'stripe_price_id_yearly', length: 100, nullable: true }) + stripePriceIdYearly: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; +} diff --git a/src/modules/subscriptions/entities/subscription.entity.ts b/src/modules/subscriptions/entities/subscription.entity.ts new file mode 100644 index 0000000..a9f6645 --- /dev/null +++ b/src/modules/subscriptions/entities/subscription.entity.ts @@ -0,0 +1,75 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + ManyToOne, + JoinColumn, +} from 'typeorm'; +import { Plan } from './plan.entity'; + +export enum SubscriptionStatus { + TRIAL = 'trial', + ACTIVE = 'active', + PAST_DUE = 'past_due', + CANCELLED = 'cancelled', + EXPIRED = 'expired', +} + +@Entity({ schema: 'subscriptions', name: 'subscriptions' }) +export class Subscription { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'plan_id' }) + planId: string; + + @Column({ name: 'billing_cycle', length: 10, default: 'monthly' }) + billingCycle: string; + + @Column({ name: 'current_period_start', type: 'timestamptz' }) + currentPeriodStart: Date; + + @Column({ name: 'current_period_end', type: 'timestamptz' }) + currentPeriodEnd: Date; + + @Column({ + type: 'varchar', + length: 20, + default: SubscriptionStatus.TRIAL, + }) + status: SubscriptionStatus; + + @Column({ name: 'cancel_at_period_end', default: false }) + cancelAtPeriodEnd: boolean; + + @Column({ name: 'cancelled_at', type: 'timestamptz', nullable: true }) + cancelledAt: Date; + + @Column({ name: 'payment_method', length: 20, nullable: true }) + paymentMethod: string; + + @Column({ name: 'stripe_subscription_id', length: 100, nullable: true }) + stripeSubscriptionId: string; + + @Column({ name: 'stripe_customer_id', length: 100, nullable: true }) + stripeCustomerId: string; + + @Column({ name: 'trial_ends_at', type: 'timestamptz', nullable: true }) + trialEndsAt: Date; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; + + // Relations + @ManyToOne(() => Plan) + @JoinColumn({ name: 'plan_id' }) + plan: Plan; +} diff --git a/src/modules/subscriptions/entities/token-balance.entity.ts b/src/modules/subscriptions/entities/token-balance.entity.ts new file mode 100644 index 0000000..c931dec --- /dev/null +++ b/src/modules/subscriptions/entities/token-balance.entity.ts @@ -0,0 +1,27 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + UpdateDateColumn, +} from 'typeorm'; + +@Entity({ schema: 'subscriptions', name: 'tenant_token_balance' }) +export class TokenBalance { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id', unique: true }) + tenantId: string; + + @Column({ name: 'available_tokens', default: 0 }) + availableTokens: number; + + @Column({ name: 'used_tokens', default: 0 }) + usedTokens: number; + + @Column({ name: 'last_reset_at', type: 'timestamptz', nullable: true }) + lastResetAt: Date; + + @UpdateDateColumn({ name: 'updated_at' }) + updatedAt: Date; +} diff --git a/src/modules/subscriptions/entities/token-usage.entity.ts b/src/modules/subscriptions/entities/token-usage.entity.ts new file mode 100644 index 0000000..86bab3a --- /dev/null +++ b/src/modules/subscriptions/entities/token-usage.entity.ts @@ -0,0 +1,42 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, +} from 'typeorm'; + +@Entity({ schema: 'subscriptions', name: 'token_usage' }) +export class TokenUsage { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ name: 'tenant_id' }) + tenantId: string; + + @Column({ name: 'tokens_used' }) + tokensUsed: number; + + @Column({ length: 50 }) + action: string; + + @Column({ type: 'text', nullable: true }) + description: string; + + @Column({ length: 50, nullable: true }) + model: string; + + @Column({ name: 'input_tokens', nullable: true }) + inputTokens: number; + + @Column({ name: 'output_tokens', nullable: true }) + outputTokens: number; + + @Column({ name: 'reference_type', length: 20, nullable: true }) + referenceType: string; + + @Column({ name: 'reference_id', nullable: true }) + referenceId: string; + + @CreateDateColumn({ name: 'created_at' }) + createdAt: Date; +} diff --git a/src/modules/subscriptions/subscriptions.controller.ts b/src/modules/subscriptions/subscriptions.controller.ts new file mode 100644 index 0000000..6dee410 --- /dev/null +++ b/src/modules/subscriptions/subscriptions.controller.ts @@ -0,0 +1,69 @@ +import { + Controller, + Get, + Post, + Param, + Query, + UseGuards, + Request, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { SubscriptionsService } from './subscriptions.service'; + +@ApiTags('subscriptions') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/subscriptions') +export class SubscriptionsController { + constructor(private readonly subscriptionsService: SubscriptionsService) {} + + // ==================== PLANS ==================== + + @Get('plans') + @ApiOperation({ summary: 'Listar planes disponibles' }) + getPlans() { + return this.subscriptionsService.getPlans(); + } + + @Get('plans/:code') + @ApiOperation({ summary: 'Obtener plan por código' }) + getPlan(@Param('code') code: string) { + return this.subscriptionsService.getPlanByCode(code); + } + + // ==================== SUBSCRIPTION ==================== + + @Get('current') + @ApiOperation({ summary: 'Obtener suscripción actual' }) + getCurrent(@Request() req) { + return this.subscriptionsService.getSubscription(req.user.tenantId); + } + + @Get('stats') + @ApiOperation({ summary: 'Estadísticas de suscripción y tokens' }) + getStats(@Request() req) { + return this.subscriptionsService.getSubscriptionStats(req.user.tenantId); + } + + @Post('cancel') + @ApiOperation({ summary: 'Cancelar suscripción al final del período' }) + cancel(@Request() req) { + return this.subscriptionsService.cancelSubscription(req.user.tenantId); + } + + // ==================== TOKENS ==================== + + @Get('tokens/balance') + @ApiOperation({ summary: 'Obtener balance de tokens' }) + getTokenBalance(@Request() req) { + return this.subscriptionsService.getTokenBalance(req.user.tenantId); + } + + @Get('tokens/usage') + @ApiOperation({ summary: 'Historial de uso de tokens' }) + @ApiQuery({ name: 'limit', required: false }) + getTokenUsage(@Request() req, @Query('limit') limit?: number) { + return this.subscriptionsService.getTokenUsage(req.user.tenantId, limit); + } +} diff --git a/src/modules/subscriptions/subscriptions.module.ts b/src/modules/subscriptions/subscriptions.module.ts new file mode 100644 index 0000000..6a652cc --- /dev/null +++ b/src/modules/subscriptions/subscriptions.module.ts @@ -0,0 +1,16 @@ +import { Module } from '@nestjs/common'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { SubscriptionsController } from './subscriptions.controller'; +import { SubscriptionsService } from './subscriptions.service'; +import { Plan } from './entities/plan.entity'; +import { Subscription } from './entities/subscription.entity'; +import { TokenBalance } from './entities/token-balance.entity'; +import { TokenUsage } from './entities/token-usage.entity'; + +@Module({ + imports: [TypeOrmModule.forFeature([Plan, Subscription, TokenBalance, TokenUsage])], + controllers: [SubscriptionsController], + providers: [SubscriptionsService], + exports: [SubscriptionsService], +}) +export class SubscriptionsModule {} diff --git a/src/modules/subscriptions/subscriptions.service.ts b/src/modules/subscriptions/subscriptions.service.ts new file mode 100644 index 0000000..317de80 --- /dev/null +++ b/src/modules/subscriptions/subscriptions.service.ts @@ -0,0 +1,194 @@ +import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { Plan } from './entities/plan.entity'; +import { Subscription, SubscriptionStatus } from './entities/subscription.entity'; +import { TokenBalance } from './entities/token-balance.entity'; +import { TokenUsage } from './entities/token-usage.entity'; + +@Injectable() +export class SubscriptionsService { + constructor( + @InjectRepository(Plan) + private readonly planRepo: Repository, + @InjectRepository(Subscription) + private readonly subscriptionRepo: Repository, + @InjectRepository(TokenBalance) + private readonly tokenBalanceRepo: Repository, + @InjectRepository(TokenUsage) + private readonly tokenUsageRepo: Repository, + ) {} + + // ==================== PLANS ==================== + + async getPlans(): Promise { + return this.planRepo.find({ + where: { status: 'active' }, + order: { priceMonthly: 'ASC' }, + }); + } + + async getPlanByCode(code: string): Promise { + const plan = await this.planRepo.findOne({ where: { code } }); + if (!plan) { + throw new NotFoundException('Plan no encontrado'); + } + return plan; + } + + // ==================== SUBSCRIPTIONS ==================== + + async getSubscription(tenantId: string): Promise { + return this.subscriptionRepo.findOne({ + where: { tenantId }, + relations: ['plan'], + }); + } + + async createSubscription(tenantId: string, planCode: string): Promise { + const plan = await this.getPlanByCode(planCode); + + const now = new Date(); + const periodEnd = new Date(now); + periodEnd.setMonth(periodEnd.getMonth() + 1); + + const trialEnds = new Date(now); + trialEnds.setDate(trialEnds.getDate() + 14); // 14 days trial + + const subscription = this.subscriptionRepo.create({ + tenantId, + planId: plan.id, + currentPeriodStart: now, + currentPeriodEnd: periodEnd, + status: SubscriptionStatus.TRIAL, + trialEndsAt: trialEnds, + }); + + await this.subscriptionRepo.save(subscription); + + // Initialize token balance + await this.initializeTokenBalance(tenantId, plan.includedTokens); + + return subscription; + } + + async cancelSubscription(tenantId: string): Promise { + const subscription = await this.getSubscription(tenantId); + if (!subscription) { + throw new NotFoundException('Suscripción no encontrada'); + } + + subscription.cancelAtPeriodEnd = true; + subscription.cancelledAt = new Date(); + return this.subscriptionRepo.save(subscription); + } + + // ==================== TOKENS ==================== + + async getTokenBalance(tenantId: string): Promise { + let balance = await this.tokenBalanceRepo.findOne({ where: { tenantId } }); + + if (!balance) { + balance = await this.initializeTokenBalance(tenantId, 0); + } + + return balance; + } + + async initializeTokenBalance(tenantId: string, tokens: number): Promise { + const existing = await this.tokenBalanceRepo.findOne({ where: { tenantId } }); + + if (existing) { + existing.availableTokens = tokens; + existing.lastResetAt = new Date(); + return this.tokenBalanceRepo.save(existing); + } + + const balance = this.tokenBalanceRepo.create({ + tenantId, + availableTokens: tokens, + usedTokens: 0, + lastResetAt: new Date(), + }); + + return this.tokenBalanceRepo.save(balance); + } + + async consumeTokens( + tenantId: string, + tokensToUse: number, + action: string, + metadata?: { + description?: string; + model?: string; + inputTokens?: number; + outputTokens?: number; + referenceType?: string; + referenceId?: string; + }, + ): Promise { + const balance = await this.getTokenBalance(tenantId); + + if (balance.availableTokens < tokensToUse) { + throw new BadRequestException( + `Tokens insuficientes. Disponibles: ${balance.availableTokens}, Requeridos: ${tokensToUse}`, + ); + } + + // Record usage + const usage = this.tokenUsageRepo.create({ + tenantId, + tokensUsed: tokensToUse, + action, + ...metadata, + }); + await this.tokenUsageRepo.save(usage); + + // Update balance + balance.availableTokens -= tokensToUse; + balance.usedTokens += tokensToUse; + return this.tokenBalanceRepo.save(balance); + } + + async addTokens(tenantId: string, tokens: number): Promise { + const balance = await this.getTokenBalance(tenantId); + balance.availableTokens += tokens; + return this.tokenBalanceRepo.save(balance); + } + + async getTokenUsage(tenantId: string, limit = 50): Promise { + return this.tokenUsageRepo.find({ + where: { tenantId }, + order: { createdAt: 'DESC' }, + take: limit, + }); + } + + // ==================== STATS ==================== + + async getSubscriptionStats(tenantId: string) { + const subscription = await this.getSubscription(tenantId); + const balance = await this.getTokenBalance(tenantId); + + const daysRemaining = subscription + ? Math.max(0, Math.ceil((subscription.currentPeriodEnd.getTime() - Date.now()) / (1000 * 60 * 60 * 24))) + : 0; + + return { + subscription: subscription + ? { + plan: subscription.plan?.name, + status: subscription.status, + currentPeriodEnd: subscription.currentPeriodEnd, + daysRemaining, + cancelAtPeriodEnd: subscription.cancelAtPeriodEnd, + } + : null, + tokens: { + available: balance.availableTokens, + used: balance.usedTokens, + total: balance.availableTokens + balance.usedTokens, + }, + }; + } +} diff --git a/src/modules/widgets/widgets.controller.ts b/src/modules/widgets/widgets.controller.ts new file mode 100644 index 0000000..43bd948 --- /dev/null +++ b/src/modules/widgets/widgets.controller.ts @@ -0,0 +1,51 @@ +import { + Controller, + Get, + UseGuards, + Request, +} from '@nestjs/common'; +import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; +import { WidgetsService } from './widgets.service'; + +@ApiTags('widgets') +@ApiBearerAuth() +@UseGuards(JwtAuthGuard) +@Controller('v1/widget') +export class WidgetsController { + constructor(private readonly widgetsService: WidgetsService) {} + + @Get('summary') + @ApiOperation({ summary: 'Obtener resumen para widget (optimizado)' }) + getSummary(@Request() req) { + return this.widgetsService.getSummary(req.user.tenantId); + } + + @Get('alerts') + @ApiOperation({ summary: 'Obtener alertas para widget' }) + getAlerts(@Request() req) { + return this.widgetsService.getAlerts(req.user.tenantId); + } + + @Get('quick-actions') + @ApiOperation({ summary: 'Obtener acciones rapidas para widget' }) + getQuickActions() { + return this.widgetsService.getQuickActions(); + } + + @Get('full') + @ApiOperation({ summary: 'Obtener todos los datos del widget en una llamada' }) + async getFullWidgetData(@Request() req) { + const [summary, alerts, quickActions] = await Promise.all([ + this.widgetsService.getSummary(req.user.tenantId), + this.widgetsService.getAlerts(req.user.tenantId), + this.widgetsService.getQuickActions(), + ]); + + return { + summary, + alerts, + quickActions, + }; + } +} diff --git a/src/modules/widgets/widgets.module.ts b/src/modules/widgets/widgets.module.ts new file mode 100644 index 0000000..ba81a0e --- /dev/null +++ b/src/modules/widgets/widgets.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { WidgetsController } from './widgets.controller'; +import { WidgetsService } from './widgets.service'; + +@Module({ + controllers: [WidgetsController], + providers: [WidgetsService], + exports: [WidgetsService], +}) +export class WidgetsModule {} diff --git a/src/modules/widgets/widgets.service.ts b/src/modules/widgets/widgets.service.ts new file mode 100644 index 0000000..031f74c --- /dev/null +++ b/src/modules/widgets/widgets.service.ts @@ -0,0 +1,192 @@ +import { Injectable } from '@nestjs/common'; +import { DataSource } from 'typeorm'; + +export interface WidgetSummary { + salesToday: number; + transactionsCount: number; + pendingOrders: number; + lowStockCount: number; + pendingCredits: number; + updatedAt: string; +} + +export interface WidgetAlert { + type: 'low_stock' | 'pending_order' | 'overdue_credit' | 'new_message'; + title: string; + message: string; + count: number; + priority: 'low' | 'medium' | 'high'; +} + +@Injectable() +export class WidgetsService { + constructor(private readonly dataSource: DataSource) {} + + /** + * Get lightweight summary data for widgets + * Optimized for quick loading on mobile widgets + */ + async getSummary(tenantId: string): Promise { + const today = new Date().toISOString().split('T')[0]; + + // Sales today + const salesResult = await this.dataSource.query( + `SELECT + COALESCE(SUM(total), 0) as total, + COUNT(*) as count + FROM sales.sales + WHERE tenant_id = $1 + AND DATE(created_at) = $2 + AND status = 'completed'`, + [tenantId, today], + ); + + // Pending orders + const ordersResult = await this.dataSource.query( + `SELECT COUNT(*) as count + FROM orders.orders + WHERE tenant_id = $1 + AND status IN ('pending', 'confirmed', 'preparing')`, + [tenantId], + ); + + // Low stock products + const stockResult = await this.dataSource.query( + `SELECT COUNT(*) as count + FROM catalog.products + WHERE tenant_id = $1 + AND stock <= min_stock + AND status = 'active'`, + [tenantId], + ); + + // Pending credits (fiado) + const creditsResult = await this.dataSource.query( + `SELECT COUNT(DISTINCT customer_id) as count + FROM customers.customer_credits + WHERE tenant_id = $1 + AND status = 'active' + AND balance > 0`, + [tenantId], + ); + + return { + salesToday: parseFloat(salesResult[0]?.total || '0'), + transactionsCount: parseInt(salesResult[0]?.count || '0'), + pendingOrders: parseInt(ordersResult[0]?.count || '0'), + lowStockCount: parseInt(stockResult[0]?.count || '0'), + pendingCredits: parseInt(creditsResult[0]?.count || '0'), + updatedAt: new Date().toISOString(), + }; + } + + /** + * Get alerts for widget display + */ + async getAlerts(tenantId: string): Promise { + const alerts: WidgetAlert[] = []; + + // Low stock alerts + const lowStock = await this.dataSource.query( + `SELECT name, stock, min_stock + FROM catalog.products + WHERE tenant_id = $1 + AND stock <= min_stock + AND status = 'active' + ORDER BY stock ASC + LIMIT 5`, + [tenantId], + ); + + if (lowStock.length > 0) { + alerts.push({ + type: 'low_stock', + title: 'Stock bajo', + message: lowStock.length === 1 + ? `${lowStock[0].name}: ${lowStock[0].stock} unidades` + : `${lowStock.length} productos con stock bajo`, + count: lowStock.length, + priority: lowStock.some((p: any) => p.stock === 0) ? 'high' : 'medium', + }); + } + + // Pending orders + const pendingOrders = await this.dataSource.query( + `SELECT COUNT(*) as count + FROM orders.orders + WHERE tenant_id = $1 + AND status = 'pending'`, + [tenantId], + ); + + if (parseInt(pendingOrders[0]?.count || '0') > 0) { + const count = parseInt(pendingOrders[0].count); + alerts.push({ + type: 'pending_order', + title: 'Pedidos pendientes', + message: count === 1 + ? '1 pedido por confirmar' + : `${count} pedidos por confirmar`, + count, + priority: count > 3 ? 'high' : 'medium', + }); + } + + // Overdue credits + const overdueCredits = await this.dataSource.query( + `SELECT COUNT(DISTINCT cc.customer_id) as count + FROM customers.customer_credits cc + WHERE cc.tenant_id = $1 + AND cc.status = 'active' + AND cc.due_date < CURRENT_DATE`, + [tenantId], + ); + + if (parseInt(overdueCredits[0]?.count || '0') > 0) { + const count = parseInt(overdueCredits[0].count); + alerts.push({ + type: 'overdue_credit', + title: 'Fiados vencidos', + message: count === 1 + ? '1 cliente con fiado vencido' + : `${count} clientes con fiado vencido`, + count, + priority: 'high', + }); + } + + return alerts; + } + + /** + * Get quick actions configuration for the widget + */ + getQuickActions() { + return [ + { + id: 'new_sale', + title: 'Nueva Venta', + icon: 'cart', + deepLink: 'michangarrito://pos/new', + }, + { + id: 'scan_product', + title: 'Escanear Producto', + icon: 'barcode', + deepLink: 'michangarrito://scan', + }, + { + id: 'view_orders', + title: 'Ver Pedidos', + icon: 'clipboard', + deepLink: 'michangarrito://orders', + }, + { + id: 'view_inventory', + title: 'Ver Inventario', + icon: 'box', + deepLink: 'michangarrito://inventory', + }, + ]; + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..ef249ca --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "ES2021", + "sourceMap": true, + "outDir": "./dist", + "baseUrl": "./", + "incremental": true, + "skipLibCheck": true, + "strictNullChecks": false, + "noImplicitAny": false, + "strictBindCallApply": false, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "paths": { + "@/*": ["src/*"], + "@modules/*": ["src/modules/*"], + "@common/*": ["src/common/*"], + "@config/*": ["src/config/*"] + } + } +}