From f17434c43dc9f1a03735e775d28a33bff267d757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guirado=20L=C3=A9o?= Date: Tue, 25 Feb 2025 22:45:03 +0100 Subject: [PATCH 1/7] add github actions & some use-cases for stock, reservation & maintenance --- .github/workflows/main.yml | 112 ++++++++++++++++++ .../Domain/Entities/incident.ts | 7 ++ .../Domain/Entities/maintenance.ts | 5 + .../Domain/enums/maintenance.type.enum.ts | 2 +- .../maintenance/create.maintenance.dto.ts | 11 ++ .../maintenance/delete.maintenance.dto.ts | 3 + .../application/dtos/maintenance/index.ts | 5 +- .../dtos/maintenance/read.maintenance.dto.ts | 3 + .../maintenance/update.maintenance.dto.ts | 12 ++ .../ports/incident.repository.interface.ts | 7 ++ .../application/ports/index.ts | 7 +- .../ports/maintenance.repository.interface.ts | 6 +- .../ports/scooter.repository.interface.ts | 9 ++ .../ports/stock.repository.interface.ts | 9 ++ .../maintenance/Plan.maintenance.usecase.ts | 30 +++-- .../maintenance/delete.maintenance.usecase.ts | 24 ++++ .../application/usecases/maintenance/index.ts | 8 ++ .../maintenance/search.maintenance.usecase.ts | 26 ++++ .../searchHistory.maintenance.usecase.ts | 12 +- .../troubleshooting.maintenance.usecase.ts | 48 ++++++-- .../maintenance/update.maintenance.usecase.ts | 0 .../warranty.maintenance.usecase.ts | 11 -- .../create.incident.usecase.ts} | 0 .../incident/delete.incident.usecase.ts | 0 .../incident/search.incident.usecase.ts | 0 .../incident/searchall.incident.usecase.ts | 0 .../incident/update.incident.usecase.ts | 0 .../reservation/delete.reservation.usecase.ts | 0 .../reservation/search.reservation.usecase.ts | 0 .../searchall.reservation.usecase.ts | 0 .../reservation/update.reservation.usecase.ts | 0 .../scooter/create.scooter.usecase.ts | 0 .../scooter/delete.scooter.usecase.ts | 0 .../scooter/getall.scooter.usecase.ts | 0 .../usecases/stock/delete.stock.usecase.ts | 0 35 files changed, 317 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 apis/maintenanceCommand/application/ports/incident.repository.interface.ts create mode 100644 apis/maintenanceCommand/application/ports/scooter.repository.interface.ts create mode 100644 apis/maintenanceCommand/application/ports/stock.repository.interface.ts create mode 100644 apis/maintenanceCommand/application/usecases/maintenance/delete.maintenance.usecase.ts create mode 100644 apis/maintenanceCommand/application/usecases/maintenance/index.ts create mode 100644 apis/maintenanceCommand/application/usecases/maintenance/search.maintenance.usecase.ts rename .github/workflows/ci.yml => apis/maintenanceCommand/application/usecases/maintenance/update.maintenance.usecase.ts (100%) delete mode 100644 apis/maintenanceCommand/application/usecases/maintenance/warranty.maintenance.usecase.ts rename apis/reservationCommand/application/usecases/{reservation/incident.reservation.usecase.ts => incident/create.incident.usecase.ts} (100%) create mode 100644 apis/reservationCommand/application/usecases/incident/delete.incident.usecase.ts create mode 100644 apis/reservationCommand/application/usecases/incident/search.incident.usecase.ts create mode 100644 apis/reservationCommand/application/usecases/incident/searchall.incident.usecase.ts create mode 100644 apis/reservationCommand/application/usecases/incident/update.incident.usecase.ts create mode 100644 apis/reservationCommand/application/usecases/reservation/delete.reservation.usecase.ts create mode 100644 apis/reservationCommand/application/usecases/reservation/search.reservation.usecase.ts create mode 100644 apis/reservationCommand/application/usecases/reservation/searchall.reservation.usecase.ts create mode 100644 apis/reservationCommand/application/usecases/reservation/update.reservation.usecase.ts create mode 100644 apis/stockCommand/application/usecases/scooter/create.scooter.usecase.ts create mode 100644 apis/stockCommand/application/usecases/scooter/delete.scooter.usecase.ts create mode 100644 apis/stockCommand/application/usecases/scooter/getall.scooter.usecase.ts create mode 100644 apis/stockCommand/application/usecases/stock/delete.stock.usecase.ts diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..4dcdacf --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,112 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: [push] + +jobs: + build: + name: node_build_job + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - name: Checkout repository + uses: actions/checkout@v4 # Récupère le code de votre repo + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Move & Install API dependencies + run: cd apis/authCommand && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/authCommand && npm run build --if-present + + - name: Run tests + run: cd apis/authCommand && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install API dependencies + run: cd apis/authQuery && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/authQuery && npm run build --if-present + + - name: Run tests + run: cd apis/authQuery && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install API dependencies + run: cd apis/gateway && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/gateway && npm run build --if-present + + - name: Run tests + run: cd apis/gateway && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install API dependencies + run: cd apis/maintenanceCommand && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/maintenanceCommand && npm run build --if-present + + - name: Run tests + run: cd apis/maintenanceCommand && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install API dependencies + run: cd apis/maintenanceQuery && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/maintenanceQuery && npm run build --if-present + + - name: Run tests + run: cd apis/maintenanceQuery && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install API dependencies + run: cd apis/reservationCommand && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/reservationCommand && npm run build --if-present + + - name: Run tests + run: cd apis/reservationCommand && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install API dependencies + run: cd apis/reservationQuery && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/reservationQuery && npm run build --if-present + + - name: Run tests + run: cd apis/reservationQuery && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install API dependencies + run: cd apis/stockCommand && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/stockCommand && npm run build --if-present + + - name: Run tests + run: cd apis/stockCommand && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install API dependencies + run: cd apis/stockQuery && npm ci # Installe les dépendances du projet + + - name: Build + run: cd apis/stockQuery && npm run build --if-present + + - name: Run tests + run: cd apis/stockQuery && npm run test --if-present # Commande pour lancer vos tests Vitest, modifiez selon votre script de test + + - name: Move & Install Client dependencies + run: cd client && npm ci # Installe les dépendances du projet + + - name: Build + run: cd client && npm run build --if-present \ No newline at end of file diff --git a/apis/maintenanceCommand/Domain/Entities/incident.ts b/apis/maintenanceCommand/Domain/Entities/incident.ts index c4674ee..6e902d7 100644 --- a/apis/maintenanceCommand/Domain/Entities/incident.ts +++ b/apis/maintenanceCommand/Domain/Entities/incident.ts @@ -38,4 +38,11 @@ export class Incident implements IncidentInterface { this.reportedAt = reportedAt; this.resolvedAt = resolvedAt; } + + public timeToResolve(): number { + if (this.resolvedAt) { + return this.resolvedAt.getTime() - this.reportedAt.getTime(); + } + return new Date().getTime() - this.reportedAt.getTime(); + } } diff --git a/apis/maintenanceCommand/Domain/Entities/maintenance.ts b/apis/maintenanceCommand/Domain/Entities/maintenance.ts index 30c999c..a51a286 100644 --- a/apis/maintenanceCommand/Domain/Entities/maintenance.ts +++ b/apis/maintenanceCommand/Domain/Entities/maintenance.ts @@ -8,13 +8,16 @@ export class Maintenance implements MaintenanceInterface { public scooterId: string; public technicianId: string; public type: MaintenanceType; + public warranty: boolean; public date: Date; public details: string; public cost: number; constructor( scooterId: string, + technicianId: string, type: MaintenanceType, + warranty: boolean, date: Date, details: string, cost: number, @@ -22,7 +25,9 @@ export class Maintenance implements MaintenanceInterface { ) { this.id = id; this.scooterId = scooterId; + this.technicianId = technicianId; this.type = type; + this.warranty = warranty; this.date = date; this.details = details; this.cost = cost; diff --git a/apis/maintenanceCommand/Domain/enums/maintenance.type.enum.ts b/apis/maintenanceCommand/Domain/enums/maintenance.type.enum.ts index 6811e02..575d23e 100644 --- a/apis/maintenanceCommand/Domain/enums/maintenance.type.enum.ts +++ b/apis/maintenanceCommand/Domain/enums/maintenance.type.enum.ts @@ -1,4 +1,4 @@ export enum MaintenanceType { PREVENT = 'préventive', - CORRECTIF = 'corrective' + CORRECTIF = 'corrective', } \ No newline at end of file diff --git a/apis/maintenanceCommand/application/dtos/maintenance/create.maintenance.dto.ts b/apis/maintenanceCommand/application/dtos/maintenance/create.maintenance.dto.ts index e69de29..966b986 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/create.maintenance.dto.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/create.maintenance.dto.ts @@ -0,0 +1,11 @@ +import { MaintenanceType } from '../../../domain/enums'; + +export interface CreateMaintenanceDTO { + scooterId: string; + technicianId: string; + type: MaintenanceType; + date: Date; + details: string; + cost: number; + token: string; +} \ No newline at end of file diff --git a/apis/maintenanceCommand/application/dtos/maintenance/delete.maintenance.dto.ts b/apis/maintenanceCommand/application/dtos/maintenance/delete.maintenance.dto.ts index e69de29..acf1955 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/delete.maintenance.dto.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/delete.maintenance.dto.ts @@ -0,0 +1,3 @@ +export interface DeleteMaintenanceDTO { + id: string; +} \ No newline at end of file diff --git a/apis/maintenanceCommand/application/dtos/maintenance/index.ts b/apis/maintenanceCommand/application/dtos/maintenance/index.ts index 1f71d74..f915ea3 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/index.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/index.ts @@ -1 +1,4 @@ -export * from "./create.maintenance.dto"; \ No newline at end of file +export * from "./create.maintenance.dto"; +export * from "./delete.maintenance.dto"; +export * from "./read.maintenance.dto"; +export * from "./update.maintenance.dto"; \ No newline at end of file diff --git a/apis/maintenanceCommand/application/dtos/maintenance/read.maintenance.dto.ts b/apis/maintenanceCommand/application/dtos/maintenance/read.maintenance.dto.ts index e69de29..3b7b319 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/read.maintenance.dto.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/read.maintenance.dto.ts @@ -0,0 +1,3 @@ +export interface ReadMaintenanceDTO { + scooterId: string; +} \ No newline at end of file diff --git a/apis/maintenanceCommand/application/dtos/maintenance/update.maintenance.dto.ts b/apis/maintenanceCommand/application/dtos/maintenance/update.maintenance.dto.ts index e69de29..18ad2aa 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/update.maintenance.dto.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/update.maintenance.dto.ts @@ -0,0 +1,12 @@ +import { MaintenanceType } from '../../../domain/enums'; + +export interface UpdateMaintenanceDTO { + id: string; + token: string; + scooterId?: string; + technicianId?: string; + type?: MaintenanceType; + date?: Date; + details?: string; + cost?: number; +} \ No newline at end of file diff --git a/apis/maintenanceCommand/application/ports/incident.repository.interface.ts b/apis/maintenanceCommand/application/ports/incident.repository.interface.ts new file mode 100644 index 0000000..b1335a0 --- /dev/null +++ b/apis/maintenanceCommand/application/ports/incident.repository.interface.ts @@ -0,0 +1,7 @@ +import { Incident } from '../../domain/entities'; + +export interface IncidentRepositoryInterface { + searchByScooterId(scooterId: string): Promise; + findByTestRideId(testRideId: string): Promise; + save(incident: Incident): Promise; +} \ No newline at end of file diff --git a/apis/maintenanceCommand/application/ports/index.ts b/apis/maintenanceCommand/application/ports/index.ts index ca9c79a..a43f740 100644 --- a/apis/maintenanceCommand/application/ports/index.ts +++ b/apis/maintenanceCommand/application/ports/index.ts @@ -1,11 +1,6 @@ -export * from './auth.service.interface'; export * from './incident.repository.interface.ts'; export * from './maintenance.repository.interface.ts'; -export * from './password.service.interface.ts'; -export * from './rental.repository.interface.ts'; -export * from './reservation.repository.interface.ts'; export * from './scooter.repository.interface.ts'; export * from './stock.repository.interface.ts'; -export * from './user.repository.interface'; export * from './warranty.repository.interface.ts'; -export * from './notification.service.interface.ts'; \ No newline at end of file +export * from './notification.service.interface.ts'; diff --git a/apis/maintenanceCommand/application/ports/maintenance.repository.interface.ts b/apis/maintenanceCommand/application/ports/maintenance.repository.interface.ts index a4be5d3..52cbfa0 100644 --- a/apis/maintenanceCommand/application/ports/maintenance.repository.interface.ts +++ b/apis/maintenanceCommand/application/ports/maintenance.repository.interface.ts @@ -1,6 +1,10 @@ import { Maintenance } from '../../domain/entities'; export interface MaintenanceRepositoryInterface { - findByScooterId(scooterId: string): Promise; save(maintenance: Maintenance): Promise; + searchByScooterId(scooterId: string): Promise; + searchById(id: string): Promise; + searchAll(): Promise; + update(maintenance: Maintenance): Promise; + delete(id: string): Promise; } diff --git a/apis/maintenanceCommand/application/ports/scooter.repository.interface.ts b/apis/maintenanceCommand/application/ports/scooter.repository.interface.ts new file mode 100644 index 0000000..7c29df1 --- /dev/null +++ b/apis/maintenanceCommand/application/ports/scooter.repository.interface.ts @@ -0,0 +1,9 @@ +import { Scooter } from '../../domain/entities'; + +export interface ScooterRepositoryInterface { + findById(id: string): Promise; + findAll(): Promise; + save(scooter: Scooter): Promise; + update(scooter: Scooter): Promise; + delete(id: string): Promise; +} diff --git a/apis/maintenanceCommand/application/ports/stock.repository.interface.ts b/apis/maintenanceCommand/application/ports/stock.repository.interface.ts new file mode 100644 index 0000000..0170f20 --- /dev/null +++ b/apis/maintenanceCommand/application/ports/stock.repository.interface.ts @@ -0,0 +1,9 @@ +import { StockPiece } from '../../domain/entities'; + +export interface StockRepositoryInterface { + findAll(): Promise; + findById(id: string): Promise; + findByName(name: string): Promise; + save(stockPiece: StockPiece): Promise; + update(stockPiece: StockPiece): Promise; +} diff --git a/apis/maintenanceCommand/application/usecases/maintenance/Plan.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecases/maintenance/Plan.maintenance.usecase.ts index 23dd5b5..4b4e87e 100644 --- a/apis/maintenanceCommand/application/usecases/maintenance/Plan.maintenance.usecase.ts +++ b/apis/maintenanceCommand/application/usecases/maintenance/Plan.maintenance.usecase.ts @@ -1,15 +1,25 @@ -import { MaintenanceRepository } from '../../ports'; -import { Maintenance } from '../../../domain/entities'; -import { ScooterRepository } from '../../ports'; -import { Scooter } from '../../../domain/entities'; +import { Maintenance, Scooter, Warranty } from '../../../domain/entities'; import { MaintenanceType } from '../../../domain/enums'; +import { BadRequestError } from '../../../../authCommand/application/errors'; +import { MaintenanceRepositoryInterface, ScooterRepositoryInterface } from '../../ports'; +import { CreateMaintenanceDTO } from '../../dtos/maintenance'; export class PlanifierMaintenanceUseCase { - constructor(private scooterRepo: ScooterRepository, private maintenanceRepo: MaintenanceRepository) {} - async execute(scooterId: string): Promise { - const scooter = await this.scooterRepo.findById(scooterId); - if (!scooter) throw new Error("Scooter introuvable"); + private scooterRepo: ScooterRepositoryInterface; + private maintenanceRepo: MaintenanceRepositoryInterface; + + constructor(scooterRepo: ScooterRepositoryInterface, maintenanceRepo: MaintenanceRepositoryInterface) { + this.scooterRepo = scooterRepo; + this.maintenanceRepo = maintenanceRepo; + } + + async execute(dto: CreateMaintenanceDTO): Promise { + if (!dto || !dto.scooterId || !dto.technicianId) { + throw new BadRequestError(); + } + const scooter = await this.scooterRepo.findById(dto.scooterId); + if (!scooter) throw new BadRequestError(); let needsMaintenance = false; let maintenanceType = MaintenanceType.PREVENT; @@ -28,10 +38,12 @@ export class PlanifierMaintenanceUseCase { if (needsMaintenance) { const maintenance = new Maintenance( scooter.id, + dto.technicianId, maintenanceType, + true, new Date(), details, - 0 // Coût inconnu pour l’instant + 0, ); await this.maintenanceRepo.save(maintenance); } diff --git a/apis/maintenanceCommand/application/usecases/maintenance/delete.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecases/maintenance/delete.maintenance.usecase.ts new file mode 100644 index 0000000..ff5a0fa --- /dev/null +++ b/apis/maintenanceCommand/application/usecases/maintenance/delete.maintenance.usecase.ts @@ -0,0 +1,24 @@ +import { BadRequestError, NotFoundError } from "../../../../authCommand/application/errors"; +import { MaintenanceRepositoryInterface } from "../../ports"; +import { DeleteMaintenanceDTO } from "../../dtos/maintenance"; + + +export class DeleteMaintenanceUseCase { + + private maintenanceRepo: MaintenanceRepositoryInterface; + + constructor(maintenanceRepo: MaintenanceRepositoryInterface) { + this.maintenanceRepo = maintenanceRepo; + } + + async execute(dto: DeleteMaintenanceDTO): Promise { + if (!dto.id) { + throw new BadRequestError(); + } + const maintenance = await this.maintenanceRepo.searchById(dto.id); + if (!maintenance) { + throw new NotFoundError(); + } + await this.maintenanceRepo.delete(maintenance.id); + } +} \ No newline at end of file diff --git a/apis/maintenanceCommand/application/usecases/maintenance/index.ts b/apis/maintenanceCommand/application/usecases/maintenance/index.ts new file mode 100644 index 0000000..b8305cf --- /dev/null +++ b/apis/maintenanceCommand/application/usecases/maintenance/index.ts @@ -0,0 +1,8 @@ +export * from "./Plan.maintenance.usecase"; +export * from "./Alert.maintenance.usecase"; +export * from "./delete.maintenance.usecase"; +export * from "./search.maintenance.usecase"; +export * from "./searchHistory.maintenance.usecase"; +export * from "./troubleshooting.maintenance.usecase"; +export * from "./update.maintenance.usecase"; +export * from "./warranty.maintenance.usecase"; \ No newline at end of file diff --git a/apis/maintenanceCommand/application/usecases/maintenance/search.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecases/maintenance/search.maintenance.usecase.ts new file mode 100644 index 0000000..9cd900f --- /dev/null +++ b/apis/maintenanceCommand/application/usecases/maintenance/search.maintenance.usecase.ts @@ -0,0 +1,26 @@ +import { MaintenanceRepositoryInterface } from "../../ports"; +import { Maintenance } from "../../../domain/entities"; +import { ReadMaintenanceDTO } from "../../dtos/maintenance"; +import { BadRequestError, NotFoundError } from "../../../../authCommand/application/errors"; + + +export class SearchMaintenanceUseCase { + + private maintenanceRepository: MaintenanceRepositoryInterface; + + constructor(maintenanceRepository: MaintenanceRepositoryInterface) { + this.maintenanceRepository = maintenanceRepository; + } + + async execute(dto: ReadMaintenanceDTO): Promise { + if (!dto || !dto.id) { + throw new BadRequestError(); + } + + const maintenance: Maintenance | null = await this.maintenanceRepository.searchById(dto.id); + if (!maintenance) { + throw new NotFoundError(); + } + return maintenance; + } +} \ No newline at end of file diff --git a/apis/maintenanceCommand/application/usecases/maintenance/searchHistory.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecases/maintenance/searchHistory.maintenance.usecase.ts index be50b97..5c4f248 100644 --- a/apis/maintenanceCommand/application/usecases/maintenance/searchHistory.maintenance.usecase.ts +++ b/apis/maintenanceCommand/application/usecases/maintenance/searchHistory.maintenance.usecase.ts @@ -1,10 +1,16 @@ import { Maintenance } from '../../../domain/entities'; -import { MaintenanceRepository } from '../../ports'; +import { MaintenanceRepositoryInterface } from '../../ports'; export class SearchMaintenanceHistory { - constructor(private maintenanceRepo: MaintenanceRepository) {} + + private maintenanceRepo: MaintenanceRepositoryInterface; + + constructor(maintenanceRepo: MaintenanceRepositoryInterface) { + this.maintenanceRepo = maintenanceRepo; + } async execute(scooterId: string): Promise { - return await this.maintenanceRepo.findByScooterId(scooterId); + const maintenances = await this.maintenanceRepo.searchByScooterId(scooterId); + return maintenances; } } diff --git a/apis/maintenanceCommand/application/usecases/maintenance/troubleshooting.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecases/maintenance/troubleshooting.maintenance.usecase.ts index 8941b8a..24bdcb7 100644 --- a/apis/maintenanceCommand/application/usecases/maintenance/troubleshooting.maintenance.usecase.ts +++ b/apis/maintenanceCommand/application/usecases/maintenance/troubleshooting.maintenance.usecase.ts @@ -1,20 +1,52 @@ -import { Incident } from "../../../domain/entities"; -import { IncidentRepository, ScooterRepository } from "../../ports"; +import { Incident, Maintenance } from "../../../domain/entities"; +import { ScooterRepositoryInterface, IncidentRepositoryInterface, MaintenanceRepositoryInterface } from "../../ports"; import { ScooterStatus } from "../../../domain/enums"; +import { BadRequestError } from "../../../../authCommand/application/errors"; +import { ReadMaintenanceDTO } from "../../dtos/maintenance"; export class ReportIncident { - constructor(private incidentRepo: IncidentRepository, private scooterRepo: ScooterRepository) {} - async execute(scooterId: string, description: string): Promise { - const scooter = await this.scooterRepo.findById(scooterId); - if (!scooter) throw new Error("Scooter introuvable"); + private scooterRepo: ScooterRepositoryInterface; + private incidentRepo: IncidentRepositoryInterface; + private maintenanceRepo: MaintenanceRepositoryInterface; - const incident = new Incident(scooterId, description, new Date()); - await this.incidentRepo.save(incident); + constructor(scooterRepo: ScooterRepositoryInterface, incidentRepo: IncidentRepositoryInterface, maintenanceRepo: MaintenanceRepositoryInterface) { + this.scooterRepo = scooterRepo; + this.incidentRepo = incidentRepo; + this.maintenanceRepo = maintenanceRepo; + } + + async execute(dto: ReadMaintenanceDTO): Promise<{ incidents: Incident[], warrantyMaintenances: Maintenance[], noWarrantyMaintenances: Maintenance[], immobilisationTime: number } | Error> { + if (!dto.scooterId) { + throw new BadRequestError(); + } + // Vérifie que le scooter existe + const scooter = await this.scooterRepo.findById(dto.scooterId); + if (!scooter) { + throw new BadRequestError(); + } + + // lire les incidents du scoooter + const incidents = await this.incidentRepo.searchByScooterId(scooter.id); + + // lire les maintenances du scooter + const maintenances = await this.maintenanceRepo.searchByScooterId(scooter.id); + + // lire les réparation sous garantie du scooter + const warrantyMaintenances = maintenances.filter(maintenance => maintenance.warranty === true); + + // lire les réparation hors garantie du scooter + const noWarrantyMaintenances = maintenances.filter(maintenance => maintenance.warranty === false); + + // lire le temps d'immobilisation du scooter + const immobilisationTime = incidents.reduce((acc, incident) => acc + incident.timeToResolve(), 0); // Met le scooter en état "en maintenance" scooter.status = ScooterStatus.MAINTENANCE; await this.scooterRepo.update(scooter); + + // Sortie de la fonction + return { incidents, warrantyMaintenances, noWarrantyMaintenances, immobilisationTime }; } } diff --git a/.github/workflows/ci.yml b/apis/maintenanceCommand/application/usecases/maintenance/update.maintenance.usecase.ts similarity index 100% rename from .github/workflows/ci.yml rename to apis/maintenanceCommand/application/usecases/maintenance/update.maintenance.usecase.ts diff --git a/apis/maintenanceCommand/application/usecases/maintenance/warranty.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecases/maintenance/warranty.maintenance.usecase.ts deleted file mode 100644 index 3af69cc..0000000 --- a/apis/maintenanceCommand/application/usecases/maintenance/warranty.maintenance.usecase.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { WarrantyRepository } from '../../ports'; - - -export class CheckIncidentWarranty { - constructor(private warrantyRepo: WarrantyRepository) {} - - async execute(scooterId: string): Promise { - const warranty = await this.warrantyRepo.findByScooterId(scooterId); - return warranty ? warranty.isValid() : false; - } -} diff --git a/apis/reservationCommand/application/usecases/reservation/incident.reservation.usecase.ts b/apis/reservationCommand/application/usecases/incident/create.incident.usecase.ts similarity index 100% rename from apis/reservationCommand/application/usecases/reservation/incident.reservation.usecase.ts rename to apis/reservationCommand/application/usecases/incident/create.incident.usecase.ts diff --git a/apis/reservationCommand/application/usecases/incident/delete.incident.usecase.ts b/apis/reservationCommand/application/usecases/incident/delete.incident.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/reservationCommand/application/usecases/incident/search.incident.usecase.ts b/apis/reservationCommand/application/usecases/incident/search.incident.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/reservationCommand/application/usecases/incident/searchall.incident.usecase.ts b/apis/reservationCommand/application/usecases/incident/searchall.incident.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/reservationCommand/application/usecases/incident/update.incident.usecase.ts b/apis/reservationCommand/application/usecases/incident/update.incident.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/reservationCommand/application/usecases/reservation/delete.reservation.usecase.ts b/apis/reservationCommand/application/usecases/reservation/delete.reservation.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/reservationCommand/application/usecases/reservation/search.reservation.usecase.ts b/apis/reservationCommand/application/usecases/reservation/search.reservation.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/reservationCommand/application/usecases/reservation/searchall.reservation.usecase.ts b/apis/reservationCommand/application/usecases/reservation/searchall.reservation.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/reservationCommand/application/usecases/reservation/update.reservation.usecase.ts b/apis/reservationCommand/application/usecases/reservation/update.reservation.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/stockCommand/application/usecases/scooter/create.scooter.usecase.ts b/apis/stockCommand/application/usecases/scooter/create.scooter.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/stockCommand/application/usecases/scooter/delete.scooter.usecase.ts b/apis/stockCommand/application/usecases/scooter/delete.scooter.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/stockCommand/application/usecases/scooter/getall.scooter.usecase.ts b/apis/stockCommand/application/usecases/scooter/getall.scooter.usecase.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/stockCommand/application/usecases/stock/delete.stock.usecase.ts b/apis/stockCommand/application/usecases/stock/delete.stock.usecase.ts new file mode 100644 index 0000000..e69de29 From 2417d66c907d7df9c0edaac5fa9b89ba58f3446d Mon Sep 17 00:00:00 2001 From: LeGrizzly Date: Tue, 25 Feb 2025 09:18:16 +0100 Subject: [PATCH 2/7] refactor: update Dockerfiles and clean up unused code; modify nginx configuration and adjust import statements --- .env | 2 +- apis/authCommand/Domain/Entities/index.ts | 16 +- .../Infrastructure/databases/sequelize.ts | 88 +- .../orms/mongoose/user.schema.ts | 2 +- .../Infrastructure/repositories/index.ts | 6 +- .../repositories/mongoose/user.repository.ts | 8 +- .../repositories/sequelize/index.ts | 2 +- .../ports/auth.service.interface.ts | 2 +- apis/authCommand/dockerfile | 25 + apis/authCommand/tsconfig.json | 18 + .../ports/password.service.interface.ts | 2 +- apis/authQuery/dockerfile | 25 + apis/authQuery/tsconfig.json | 18 + apis/gateway/dockerfile | 25 + apis/gateway/index.ts | 30 +- apis/gateway/package-lock.json | 4181 ----------------- apis/gateway/tsconfig.json | 18 + docker-compose.yml | 291 +- nginx/Dockerfile | 4 +- nginx/nginx.conf | 12 +- 20 files changed, 358 insertions(+), 4417 deletions(-) create mode 100644 apis/authCommand/dockerfile create mode 100644 apis/authCommand/tsconfig.json create mode 100644 apis/authQuery/dockerfile create mode 100644 apis/authQuery/tsconfig.json create mode 100644 apis/gateway/dockerfile delete mode 100644 apis/gateway/package-lock.json create mode 100644 apis/gateway/tsconfig.json diff --git a/.env b/.env index 3547da7..3e15d39 100644 --- a/.env +++ b/.env @@ -15,4 +15,4 @@ PGSL_PORT=5432 PGSL_DB=physical-training-management-platform PGSL_USER=4dm1n-F1tn3ss PGSL_PASSWORD=S3cr3t-F1tn3ss -PGSL_URI=postgres://${PGSL_USER}:${PGSL_PASSWORD}@${PGSL_HOST}:${PGSL_PORT}/${PGSL_DB} \ No newline at end of file +PGSL_URI=postgres://${PGSL_USER}:${PGSL_PASSWORD}@${PGSL_HOST}:${PGSL_PORT}/${PGSL_DB} diff --git a/apis/authCommand/Domain/Entities/index.ts b/apis/authCommand/Domain/Entities/index.ts index 6e93025..6eacc25 100644 --- a/apis/authCommand/Domain/Entities/index.ts +++ b/apis/authCommand/Domain/Entities/index.ts @@ -1,9 +1,9 @@ -export * from "./incident" -export * from "./maintenance" -export * from "./rental" -export * from "./reservation" -export * from "./scooter" -export * from "./stockOrder" -export * from "./stockPiece" +// export * from "./incident" +// export * from "./maintenance" +// export * from "./rental" +// export * from "./reservation" +// export * from "./scooter" +// export * from "./stockOrder" +// export * from "./stockPiece" export * from "./user" -export * from "./warranty" \ No newline at end of file +// export * from "./warranty" \ No newline at end of file diff --git a/apis/authCommand/Infrastructure/databases/sequelize.ts b/apis/authCommand/Infrastructure/databases/sequelize.ts index 1da5874..70a1841 100644 --- a/apis/authCommand/Infrastructure/databases/sequelize.ts +++ b/apis/authCommand/Infrastructure/databases/sequelize.ts @@ -1,44 +1,44 @@ -import { config } from "dotenv"; -import { Sequelize } from "sequelize"; -import { UserService } from "./user.service"; -import { Logger } from "../config/logger"; - -config(); -const logger = Logger.get(); - -export class SequelizeService { - private static instance?: SequelizeService; - - readonly sequelize: Sequelize; - readonly userService: UserService; - - private constructor(sequelize: Sequelize) { - this.sequelize = sequelize; - - this.userService = new UserService(this); - } - - public static async get(): Promise { - if (this.instance !== undefined) { - return this.instance; - } - const connection = await this.connect(); - this.instance = new SequelizeService(connection); - return this.instance; - } - - private static async connect(): Promise { - const sequelize = new Sequelize(process.env.POSTGRES_URI as string, { - dialect: "postgres", - logging: false, // Désactiver les logs SQL - }); - - try { - await sequelize.authenticate(); - } catch (error) { - logger.error( new Error("Impossible de se connecter à PostgreSQL :", error)); - } - - return sequelize; - } -} +// import { config } from "dotenv"; +// import { Sequelize } from "sequelize"; +// import { UserService } from "./user.service"; +// import { Logger } from "../../config/logger"; + +// config(); +// const logger = Logger.get(); + +// export class SequelizeService { +// private static instance?: SequelizeService; + +// readonly sequelize: Sequelize; +// readonly userService: UserService; + +// private constructor(sequelize: Sequelize) { +// this.sequelize = sequelize; + +// this.userService = new UserService(this); +// } + +// public static async get(): Promise { +// if (this.instance !== undefined) { +// return this.instance; +// } +// const connection = await this.connect(); +// this.instance = new SequelizeService(connection); +// return this.instance; +// } + +// private static async connect(): Promise { +// const sequelize = new Sequelize(process.env.POSTGRES_URI as string, { +// dialect: "postgres", +// logging: false, // Désactiver les logs SQL +// }); + +// try { +// await sequelize.authenticate(); +// } catch (error) { +// logger.error( new Error("Impossible de se connecter à PostgreSQL :", error)); +// } + +// return sequelize; +// } +// } diff --git a/apis/authCommand/Infrastructure/orms/mongoose/user.schema.ts b/apis/authCommand/Infrastructure/orms/mongoose/user.schema.ts index e877cfa..bf44d76 100644 --- a/apis/authCommand/Infrastructure/orms/mongoose/user.schema.ts +++ b/apis/authCommand/Infrastructure/orms/mongoose/user.schema.ts @@ -48,7 +48,7 @@ export const userSchema = new Schema( role: { type: String, enum: Object.values(Role), - default: Role.Customer, + default: Role.CUSTOMER, }, }, { diff --git a/apis/authCommand/Infrastructure/repositories/index.ts b/apis/authCommand/Infrastructure/repositories/index.ts index da83afc..cbc2e5c 100644 --- a/apis/authCommand/Infrastructure/repositories/index.ts +++ b/apis/authCommand/Infrastructure/repositories/index.ts @@ -1,5 +1,5 @@ -export * from "./repertory-choice"; -export * from "./sequelize/user.repository"; +// export * from "./repertory-choice"; +// export * from "./sequelize/user.repository"; export * from "./mongoose/user.repository"; -export * from "./sequelize"; +// export * from "./sequelize"; export * from "./mongoose"; \ No newline at end of file diff --git a/apis/authCommand/Infrastructure/repositories/mongoose/user.repository.ts b/apis/authCommand/Infrastructure/repositories/mongoose/user.repository.ts index ae3f33f..c260817 100644 --- a/apis/authCommand/Infrastructure/repositories/mongoose/user.repository.ts +++ b/apis/authCommand/Infrastructure/repositories/mongoose/user.repository.ts @@ -1,7 +1,7 @@ import { Model } from "mongoose"; import { UserRepositoryInterface } from "../../../application/ports"; import { User } from "../../../domain/entities"; -import { userSchema } from "../../orm/mongoose"; +import { userSchema } from "../../orms/mongoose"; import { MongooseService } from "../../databases"; export class UserRepository implements UserRepositoryInterface { @@ -32,8 +32,10 @@ export class UserRepository implements UserRepositoryInterface { // TODO: Implement the update method & Cie async update(user: User): Promise { - const userData = await this.model.findByIdAndUpdate - (user.id, { email: user.email, password: user.password, role: user.role }, { new: true }); + const userData = await this.model.findByIdAndUpdate(user.id, { email: user.email, password: user.password, role: user.role }, { new: true }); + if (!userData) { + throw new Error("User not found"); + } return new User(userData.email, userData.id); } async updateRole(id: string, password: string): Promise { diff --git a/apis/authCommand/Infrastructure/repositories/sequelize/index.ts b/apis/authCommand/Infrastructure/repositories/sequelize/index.ts index e7ce7fd..73bac29 100644 --- a/apis/authCommand/Infrastructure/repositories/sequelize/index.ts +++ b/apis/authCommand/Infrastructure/repositories/sequelize/index.ts @@ -1 +1 @@ -export * from "./user.repository"; \ No newline at end of file +// export * from "./user.repository"; \ No newline at end of file diff --git a/apis/authCommand/application/ports/auth.service.interface.ts b/apis/authCommand/application/ports/auth.service.interface.ts index 125c68e..bd0a2fe 100644 --- a/apis/authCommand/application/ports/auth.service.interface.ts +++ b/apis/authCommand/application/ports/auth.service.interface.ts @@ -1,4 +1,4 @@ -import { User } from "../../domain/entities/"; +import { User } from "../../domain/entities"; export interface AuthServiceInterface { generateToken(user: User): string; diff --git a/apis/authCommand/dockerfile b/apis/authCommand/dockerfile new file mode 100644 index 0000000..5272196 --- /dev/null +++ b/apis/authCommand/dockerfile @@ -0,0 +1,25 @@ +FROM node:23.8-alpine3.21 AS base +RUN npm i -g yarn --force + +FROM base AS development +WORKDIR /app +EXPOSE 3000 +ENTRYPOINT ["/bin/sh", "-c", "yarn install && yarn dev"] + +FROM base AS build +WORKDIR /app +COPY package.json yarn.lock* ./ +RUN yarn install --frozen-lockfile +COPY . . +RUN yarn build + +FROM node:23.8-alpine3.21 AS production +WORKDIR /app +ENV NODE_ENV=production + +COPY --from=build /app/package.json /app/yarn.lock* ./ +RUN yarn install --production --frozen-lockfile +COPY --from=build /app/dist ./dist + +EXPOSE 3000 +CMD ["node", "dist/index.js"] diff --git a/apis/authCommand/tsconfig.json b/apis/authCommand/tsconfig.json new file mode 100644 index 0000000..21de0fc --- /dev/null +++ b/apis/authCommand/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es2017", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file diff --git a/apis/authQuery/application/ports/password.service.interface.ts b/apis/authQuery/application/ports/password.service.interface.ts index b32393c..62841cb 100644 --- a/apis/authQuery/application/ports/password.service.interface.ts +++ b/apis/authQuery/application/ports/password.service.interface.ts @@ -1,4 +1,4 @@ -import { User } from "../../domain/entities/"; +import { User } from "../../domain/entities"; export interface PasswordServiceInterface { hash(password: string): Promise; diff --git a/apis/authQuery/dockerfile b/apis/authQuery/dockerfile new file mode 100644 index 0000000..5272196 --- /dev/null +++ b/apis/authQuery/dockerfile @@ -0,0 +1,25 @@ +FROM node:23.8-alpine3.21 AS base +RUN npm i -g yarn --force + +FROM base AS development +WORKDIR /app +EXPOSE 3000 +ENTRYPOINT ["/bin/sh", "-c", "yarn install && yarn dev"] + +FROM base AS build +WORKDIR /app +COPY package.json yarn.lock* ./ +RUN yarn install --frozen-lockfile +COPY . . +RUN yarn build + +FROM node:23.8-alpine3.21 AS production +WORKDIR /app +ENV NODE_ENV=production + +COPY --from=build /app/package.json /app/yarn.lock* ./ +RUN yarn install --production --frozen-lockfile +COPY --from=build /app/dist ./dist + +EXPOSE 3000 +CMD ["node", "dist/index.js"] diff --git a/apis/authQuery/tsconfig.json b/apis/authQuery/tsconfig.json new file mode 100644 index 0000000..eec3b81 --- /dev/null +++ b/apis/authQuery/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es6", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file diff --git a/apis/gateway/dockerfile b/apis/gateway/dockerfile new file mode 100644 index 0000000..5272196 --- /dev/null +++ b/apis/gateway/dockerfile @@ -0,0 +1,25 @@ +FROM node:23.8-alpine3.21 AS base +RUN npm i -g yarn --force + +FROM base AS development +WORKDIR /app +EXPOSE 3000 +ENTRYPOINT ["/bin/sh", "-c", "yarn install && yarn dev"] + +FROM base AS build +WORKDIR /app +COPY package.json yarn.lock* ./ +RUN yarn install --frozen-lockfile +COPY . . +RUN yarn build + +FROM node:23.8-alpine3.21 AS production +WORKDIR /app +ENV NODE_ENV=production + +COPY --from=build /app/package.json /app/yarn.lock* ./ +RUN yarn install --production --frozen-lockfile +COPY --from=build /app/dist ./dist + +EXPOSE 3000 +CMD ["node", "dist/index.js"] diff --git a/apis/gateway/index.ts b/apis/gateway/index.ts index f73e27d..b01a559 100644 --- a/apis/gateway/index.ts +++ b/apis/gateway/index.ts @@ -28,12 +28,12 @@ app.use((req: Request, res: Response, next: NextFunction) => { const authCommand = proxy("http://localhost:8081"); const authQuery = proxy("http://localhost:8082"); -const maintenanceCommand = proxy("http://localhost:8081"); -const maintenanceQuery = proxy("http://localhost:8082"); -const reservationCommand = proxy("http://localhost:8081"); -const reservationQuery = proxy("http://localhost:8082"); -const stockCommand = proxy("http://localhost:8081"); -const stockQuery = proxy("http://localhost:8082"); +// const maintenanceCommand = proxy("http://localhost:8083"); +// const maintenanceQuery = proxy("http://localhost:8084"); +// const reservationCommand = proxy("http://localhost:8085"); +// const reservationQuery = proxy("http://localhost:8086"); +// const stockCommand = proxy("http://localhost:8087"); +// const stockQuery = proxy("http://localhost:8088"); app.use("/doc", swaggerUi.serve, swaggerUi.setup(swaggerSpec)); @@ -43,17 +43,17 @@ app.use("/api/auth", (req: Request, res: Response, next: NextFunction) => { req.method === "GET" ? authQuery(req, res, next) : authCommand(req, res, next); }); -app.use("/api/maintenance", (req: Request, res: Response, next: NextFunction) => { - req.method === "GET" ? maintenanceQuery(req, res, next) : maintenanceCommand(req, res, next); -}); +// app.use("/api/maintenance", (req: Request, res: Response, next: NextFunction) => { +// req.method === "GET" ? maintenanceQuery(req, res, next) : maintenanceCommand(req, res, next); +// }); -app.use("/api/reservation", (req: Request, res: Response, next: NextFunction) => { - req.method === "GET" ? reservationQuery(req, res, next) : reservationCommand(req, res, next); -}); +// app.use("/api/reservation", (req: Request, res: Response, next: NextFunction) => { +// req.method === "GET" ? reservationQuery(req, res, next) : reservationCommand(req, res, next); +// }); -app.use("/api/stock", (req: Request, res: Response, next: NextFunction) => { - req.method === "GET" ? stockQuery(req, res, next) : stockCommand(req, res, next); -}); +// app.use("/api/stock", (req: Request, res: Response, next: NextFunction) => { +// req.method === "GET" ? stockQuery(req, res, next) : stockCommand(req, res, next); +// }); const host = process.env.API_HOST || "localhost"; const port = process.env.API_PORT || 5000; diff --git a/apis/gateway/package-lock.json b/apis/gateway/package-lock.json deleted file mode 100644 index ae6e482..0000000 --- a/apis/gateway/package-lock.json +++ /dev/null @@ -1,4181 +0,0 @@ -{ - "name": "project", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "project", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "bcrypt": "^5.1.1", - "cors": "^2.8.5", - "dotenv": "^16.4.7", - "express": "^4.21.2", - "helmet": "^8.0.0", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.9.6", - "sequelize": "^6.37.5", - "swagger-jsdoc": "^6.2.8", - "swagger-ui-express": "^5.0.1", - "uuid": "^11.0.5", - "winston": "^3.17.0", - "winston-daily-rotate-file": "^5.0.0" - }, - "devDependencies": { - "@types/bcryptjs": "^2.4.6", - "@types/cors": "^2.8.17", - "@types/express": "^5.0.0", - "@types/jsonwebtoken": "^9.0.8", - "@types/sequelize": "^4.28.20", - "@types/swagger-jsdoc": "^6.0.4", - "@types/swagger-ui-express": "^4.1.7", - "eslint": "^9.19.0", - "nodemon": "^3.1.9", - "prettier": "^3.4.2", - "ts-node": "^10.9.2", - "typescript": "^5.7.3" - } - }, - "node_modules/@apidevtools/json-schema-ref-parser": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz", - "integrity": "sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg==", - "license": "MIT", - "dependencies": { - "@jsdevtools/ono": "^7.1.3", - "@types/json-schema": "^7.0.6", - "call-me-maybe": "^1.0.1", - "js-yaml": "^4.1.0" - } - }, - "node_modules/@apidevtools/openapi-schemas": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", - "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/@apidevtools/swagger-methods": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", - "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", - "license": "MIT" - }, - "node_modules/@apidevtools/swagger-parser": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz", - "integrity": "sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==", - "license": "MIT", - "dependencies": { - "@apidevtools/json-schema-ref-parser": "^9.0.6", - "@apidevtools/openapi-schemas": "^2.0.4", - "@apidevtools/swagger-methods": "^3.0.2", - "@jsdevtools/ono": "^7.1.3", - "call-me-maybe": "^1.0.1", - "z-schema": "^5.0.1" - }, - "peerDependencies": { - "openapi-types": ">=7" - } - }, - "node_modules/@colors/colors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", - "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "license": "MIT", - "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==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@dabh/diagnostics": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", - "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", - "license": "MIT", - "dependencies": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", - "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/config-array": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", - "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^2.1.6", - "debug": "^4.3.1", - "minimatch": "^3.1.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/core": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", - "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", - "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "9.20.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz", - "integrity": "sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/object-schema": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/plugin-kit": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", - "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.10.0", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", - "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@humanfs/core": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/node": { - "version": "0.16.6", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", - "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.3.0" - }, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", - "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/@jsdevtools/ono": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", - "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", - "license": "MIT" - }, - "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/@mongodb-js/saslprep": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.2.0.tgz", - "integrity": "sha512-+ywrb0AqkfaYuhHs6LxKWgqbh3I72EpEgESCw37o+9qPx9WTCkgDm2B+eMrwehGtHBWHFU4GXvnSCNiFhhausg==", - "license": "MIT", - "dependencies": { - "sparse-bitfield": "^3.0.3" - } - }, - "node_modules/@scarf/scarf": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.4.0.tgz", - "integrity": "sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ==", - "hasInstallScript": true, - "license": "Apache-2.0" - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", - "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/bcryptjs": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.6.tgz", - "integrity": "sha512-9xlo6R2qDs5uixm0bcIqCeMCE6HiQsIyel9KQySStiyqNl2tnj2mP3DX1Nf56MD6KMenNNlBBsy3LJ7gUEQPXQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/bluebird": { - "version": "3.5.42", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.42.tgz", - "integrity": "sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/body-parser": { - "version": "1.19.5", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", - "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", - "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/continuation-local-storage": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@types/continuation-local-storage/-/continuation-local-storage-3.2.7.tgz", - "integrity": "sha512-Q7dPOymVpRG5Zpz90/o26+OAqOG2Sw+FED7uQmTrJNCF/JAPTylclZofMxZKd6W7g1BDPmT9/C/jX0ZcSNTQwQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/cors": { - "version": "2.8.17", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", - "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", - "license": "MIT", - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/express": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz", - "integrity": "sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^5.0.0", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "node_modules/@types/express-serve-static-core": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", - "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*", - "@types/send": "*" - } - }, - "node_modules/@types/http-errors": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "license": "MIT" - }, - "node_modules/@types/jsonwebtoken": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.8.tgz", - "integrity": "sha512-7fx54m60nLFUVYlxAB1xpe9CBWX2vSrk50Y6ogRJ1v5xxtba7qXTg5BgYDN5dq+yuQQ9HaVlHJyAAt1/mxryFg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/ms": "*", - "@types/node": "*" - } - }, - "node_modules/@types/lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-w/P33JFeySuhN6JLkysYUK2gEmy9kHHFN7E8ro0tkfmlDOgxBDzWEZ/J8cWA+fHqFevpswDTFZnDx+R9lbL6xw==", - "dev": true, - "license": "MIT" - }, - "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/ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", - "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "22.13.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz", - "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==", - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, - "node_modules/@types/qs": { - "version": "6.9.18", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", - "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", - "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/send": { - "version": "0.17.4", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", - "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mime": "^1", - "@types/node": "*" - } - }, - "node_modules/@types/sequelize": { - "version": "4.28.20", - "resolved": "https://registry.npmjs.org/@types/sequelize/-/sequelize-4.28.20.tgz", - "integrity": "sha512-XaGOKRhdizC87hDgQ0u3btxzbejlF+t6Hhvkek1HyphqCI4y7zVBIVAGmuc4cWJqGpxusZ1RiBToHHnNK/Edlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/bluebird": "*", - "@types/continuation-local-storage": "*", - "@types/lodash": "*", - "@types/validator": "*" - } - }, - "node_modules/@types/serve-static": { - "version": "1.15.7", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", - "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/http-errors": "*", - "@types/node": "*", - "@types/send": "*" - } - }, - "node_modules/@types/swagger-jsdoc": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@types/swagger-jsdoc/-/swagger-jsdoc-6.0.4.tgz", - "integrity": "sha512-W+Xw5epcOZrF/AooUM/PccNMSAFOKWZA5dasNyMujTwsBkU74njSJBpvCCJhHAJ95XRMzQrrW844Btu0uoetwQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/swagger-ui-express": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/swagger-ui-express/-/swagger-ui-express-4.1.7.tgz", - "integrity": "sha512-ovLM9dNincXkzH4YwyYpll75vhzPBlWx6La89wwvYH7mHjVpf0X0K/vR/aUM7SRxmr5tt9z7E5XJcjQ46q+S3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/express": "*", - "@types/serve-static": "*" - } - }, - "node_modules/@types/triple-beam": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", - "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "license": "MIT" - }, - "node_modules/@types/validator": { - "version": "13.12.2", - "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.12.2.tgz", - "integrity": "sha512-6SlHBzUW8Jhf3liqrGGXyTJSIFe4nqlJ5A5KaMZ2l/vbM3Wh3KSybots/wfWVzNLK4D1NZluDlSQIbIEPx6oyA==", - "license": "MIT" - }, - "node_modules/@types/webidl-conversions": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", - "license": "MIT" - }, - "node_modules/@types/whatwg-url": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", - "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", - "license": "MIT", - "dependencies": { - "@types/webidl-conversions": "*" - } - }, - "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/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.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-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==", - "dev": 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": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-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==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "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==", - "dev": 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/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "license": "MIT" - }, - "node_modules/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/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/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": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/bson": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.2.tgz", - "integrity": "sha512-5afhLTjqDSA3akH56E+/2J6kTDuSIlBxyXPdQslj9hcIgOUE378xdOfZvC/9q3LifJNI6KR/juZ+d0NRNYBwXg==", - "license": "Apache-2.0", - "engines": { - "node": ">=16.20.1" - } - }, - "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/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-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", - "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/call-me-maybe": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", - "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", - "license": "MIT" - }, - "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/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/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/chokidar/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/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/color": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.3", - "color-string": "^1.6.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "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-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "license": "MIT", - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "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/color/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "license": "MIT" - }, - "node_modules/colorspace": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", - "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", - "license": "MIT", - "dependencies": { - "color": "^3.1.3", - "text-hex": "1.0.x" - } - }, - "node_modules/commander": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", - "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "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/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/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/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/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==", - "dev": 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==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/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.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", - "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/dottie": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.6.tgz", - "integrity": "sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==", - "license": "MIT" - }, - "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/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/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/enabled": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", - "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/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-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/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "9.20.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.0.tgz", - "integrity": "sha512-aL4F8167Hg4IvsW89ejnpTwx+B/UQRzJPGgbIOl+4XqffWsahVVsLEWoZvnrVuwpWmnRd7XeXmQI1zlKcFDteA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.19.0", - "@eslint/core": "^0.11.0", - "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.20.0", - "@eslint/plugin-kit": "^0.2.5", - "@humanfs/node": "^0.16.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.1", - "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.6", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.2.0", - "eslint-visitor-keys": "^4.2.0", - "espree": "^10.3.0", - "esquery": "^1.5.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } - } - }, - "node_modules/eslint-scope": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", - "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", - "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.14.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "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==", - "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/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/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fecha": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", - "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "license": "MIT" - }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/file-stream-rotator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/file-stream-rotator/-/file-stream-rotator-0.6.1.tgz", - "integrity": "sha512-u+dBid4PvZw17PmDeRcNOtCP9CCK/9lRN2w+r1xIS7yOL9JFrIBKTvrYsxT4P0pGtThYTn++QS5ChHaUov3+zQ==", - "license": "MIT", - "dependencies": { - "moment": "^2.29.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==", - "dev": true, - "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": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", - "dev": true, - "license": "ISC" - }, - "node_modules/fn.name": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", - "license": "MIT" - }, - "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-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.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==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/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/get-intrinsic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", - "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "function-bind": "^1.1.2", - "get-proto": "^1.0.0", - "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-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/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/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-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": "8.0.0", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-8.0.0.tgz", - "integrity": "sha512-VyusHLEIIO5mjQPUI1wpOAEu+wl6Q0998jzTxqUYGE45xCIcAxy3MsbEK/yyJUJ3ADeMoB6MornPH6GMWAf+Pw==", - "license": "MIT", - "engines": { - "node": ">=18.0.0" - } - }, - "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/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/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/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "dev": true, - "license": "ISC" - }, - "node_modules/import-fresh": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", - "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflection": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz", - "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", - "engines": [ - "node >= 0.4.0" - ], - "license": "MIT" - }, - "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/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.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "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-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-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-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/js-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/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/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.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "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.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "license": "MIT", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/kareem": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", - "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", - "license": "Apache-2.0", - "engines": { - "node": ">=12.0.0" - } - }, - "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/kuler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", - "license": "MIT" - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" - }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "deprecated": "This package is deprecated. Use the optional chaining (?.) operator instead.", - "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.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.", - "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.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.mergewith": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", - "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", - "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/logform": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", - "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", - "license": "MIT", - "dependencies": { - "@colors/colors": "1.6.0", - "@types/triple-beam": "^1.3.2", - "fecha": "^4.2.0", - "ms": "^2.1.1", - "safe-stable-stringify": "^2.3.1", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "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==", - "dev": true, - "license": "ISC" - }, - "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/memory-pager": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", - "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/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/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/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/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/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/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/moment": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/moment-timezone": { - "version": "0.5.47", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.47.tgz", - "integrity": "sha512-UbNt/JAWS0m/NJOebR0QMRHBk0hu03r5dx9GK8Cs0AS3I81yDcOc9k+DytPItgVvBP7J6Mf6U2n3BPAacAV9oA==", - "license": "MIT", - "dependencies": { - "moment": "^2.29.4" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mongodb": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.13.0.tgz", - "integrity": "sha512-KeESYR5TEaFxOuwRqkOm3XOsMqCSkdeDMjaW5u2nuKfX7rqaofp7JQGoi7sVqQcNJTKuveNbzZtWMstb8ABP6Q==", - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/saslprep": "^1.1.9", - "bson": "^6.10.1", - "mongodb-connection-string-url": "^3.0.0" - }, - "engines": { - "node": ">=16.20.1" - }, - "peerDependencies": { - "@aws-sdk/credential-providers": "^3.188.0", - "@mongodb-js/zstd": "^1.1.0 || ^2.0.0", - "gcp-metadata": "^5.2.0", - "kerberos": "^2.0.1", - "mongodb-client-encryption": ">=6.0.0 <7", - "snappy": "^7.2.2", - "socks": "^2.7.1" - }, - "peerDependenciesMeta": { - "@aws-sdk/credential-providers": { - "optional": true - }, - "@mongodb-js/zstd": { - "optional": true - }, - "gcp-metadata": { - "optional": true - }, - "kerberos": { - "optional": true - }, - "mongodb-client-encryption": { - "optional": true - }, - "snappy": { - "optional": true - }, - "socks": { - "optional": true - } - } - }, - "node_modules/mongodb-connection-string-url": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz", - "integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==", - "license": "Apache-2.0", - "dependencies": { - "@types/whatwg-url": "^11.0.2", - "whatwg-url": "^14.1.0 || ^13.0.0" - } - }, - "node_modules/mongoose": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.10.0.tgz", - "integrity": "sha512-nLhk3Qrv6q/HpD2k1O7kbBqsq+/kmKpdv5KJ+LLhQlII3e1p/SSLoLP6jMuSiU6+iLK7zFw4T1niAk3mA3QVug==", - "license": "MIT", - "dependencies": { - "bson": "^6.10.1", - "kareem": "2.6.3", - "mongodb": "~6.13.0", - "mpath": "0.9.0", - "mquery": "5.0.0", - "ms": "2.1.3", - "sift": "17.1.3" - }, - "engines": { - "node": ">=16.20.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mongoose" - } - }, - "node_modules/mpath": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", - "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/mquery": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", - "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", - "license": "MIT", - "dependencies": { - "debug": "4.x" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "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/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/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-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-fetch/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/node-fetch/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/node-fetch/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/nodemon": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", - "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^4", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^7.5.3", - "simple-update-notifier": "^2.0.0", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "bin": { - "nodemon": "bin/nodemon.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } - }, - "node_modules/nodemon/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/nodemon/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "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==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "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/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/one-time": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", - "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", - "license": "MIT", - "dependencies": { - "fn.name": "1.x.x" - } - }, - "node_modules/openapi-types": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", - "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", - "license": "MIT", - "peer": true - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "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==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "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/pg-connection-string": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.7.0.tgz", - "integrity": "sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==", - "license": "MIT" - }, - "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/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.5.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", - "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "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/pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true, - "license": "MIT" - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "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/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/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/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/retry-as-promised": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-7.0.4.tgz", - "integrity": "sha512-XgmCoxKWkDofwH8WddD0w85ZfqYz+ZHlr5yo+3YUCfycWawU56T5ckWXsScsj5B8tqUcIG67DxXByo3VUgiAdA==", - "license": "MIT" - }, - "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/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/safe-stable-stringify": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", - "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "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/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", - "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/sequelize": { - "version": "6.37.5", - "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.5.tgz", - "integrity": "sha512-10WA4poUb3XWnUROThqL2Apq9C2NhyV1xHPMZuybNMCucDsbbFuKg51jhmyvvAUyUqCiimwTZamc3AHhMoBr2Q==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/sequelize" - } - ], - "license": "MIT", - "dependencies": { - "@types/debug": "^4.1.8", - "@types/validator": "^13.7.17", - "debug": "^4.3.4", - "dottie": "^2.0.6", - "inflection": "^1.13.4", - "lodash": "^4.17.21", - "moment": "^2.29.4", - "moment-timezone": "^0.5.43", - "pg-connection-string": "^2.6.1", - "retry-as-promised": "^7.0.4", - "semver": "^7.5.4", - "sequelize-pool": "^7.1.0", - "toposort-class": "^1.0.1", - "uuid": "^8.3.2", - "validator": "^13.9.0", - "wkx": "^0.5.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependenciesMeta": { - "ibm_db": { - "optional": true - }, - "mariadb": { - "optional": true - }, - "mysql2": { - "optional": true - }, - "oracledb": { - "optional": true - }, - "pg": { - "optional": true - }, - "pg-hstore": { - "optional": true - }, - "snowflake-sdk": { - "optional": true - }, - "sqlite3": { - "optional": true - }, - "tedious": { - "optional": true - } - } - }, - "node_modules/sequelize-pool": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", - "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/sequelize/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "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/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/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/sift": { - "version": "17.1.3", - "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", - "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==", - "license": "MIT" - }, - "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/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "license": "MIT", - "dependencies": { - "is-arrayish": "^0.3.1" - } - }, - "node_modules/simple-update-notifier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", - "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/sparse-bitfield": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", - "license": "MIT", - "dependencies": { - "memory-pager": "^1.0.2" - } - }, - "node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", - "license": "MIT", - "engines": { - "node": "*" - } - }, - "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/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-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-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/swagger-jsdoc": { - "version": "6.2.8", - "resolved": "https://registry.npmjs.org/swagger-jsdoc/-/swagger-jsdoc-6.2.8.tgz", - "integrity": "sha512-VPvil1+JRpmJ55CgAtn8DIcpBs0bL5L3q5bVQvF4tAW/k/9JYSj7dCpaYCAv5rufe0vcCbBRQXGvzpkWjvLklQ==", - "license": "MIT", - "dependencies": { - "commander": "6.2.0", - "doctrine": "3.0.0", - "glob": "7.1.6", - "lodash.mergewith": "^4.6.2", - "swagger-parser": "^10.0.3", - "yaml": "2.0.0-1" - }, - "bin": { - "swagger-jsdoc": "bin/swagger-jsdoc.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/swagger-jsdoc/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "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.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/swagger-parser": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-10.0.3.tgz", - "integrity": "sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==", - "license": "MIT", - "dependencies": { - "@apidevtools/swagger-parser": "10.0.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/swagger-ui-dist": { - "version": "5.18.3", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.18.3.tgz", - "integrity": "sha512-G33HFW0iFNStfY2x6QXO2JYVMrFruc8AZRX0U/L71aA7WeWfX2E5Nm8E/tsipSZJeIZZbSjUDeynLK/wcuNWIw==", - "license": "Apache-2.0", - "dependencies": { - "@scarf/scarf": "=1.4.0" - } - }, - "node_modules/swagger-ui-express": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-5.0.1.tgz", - "integrity": "sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==", - "license": "MIT", - "dependencies": { - "swagger-ui-dist": ">=5.0.0" - }, - "engines": { - "node": ">= v0.10.32" - }, - "peerDependencies": { - "express": ">=4.0.0 || >=5.0.0-beta" - } - }, - "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/text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", - "license": "MIT" - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/toposort-class": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", - "integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==", - "license": "MIT" - }, - "node_modules/touch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", - "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", - "dev": true, - "license": "ISC", - "bin": { - "nodetouch": "bin/nodetouch.js" - } - }, - "node_modules/tr46": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", - "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", - "license": "MIT", - "dependencies": { - "punycode": "^2.3.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/triple-beam": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", - "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", - "license": "MIT", - "engines": { - "node": ">= 14.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==", - "dev": true, - "license": "MIT", - "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/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-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/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undefsafe": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", - "dev": true, - "license": "MIT" - }, - "node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" - }, - "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/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": "11.0.5", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz", - "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/esm/bin/uuid" - } - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true, - "license": "MIT" - }, - "node_modules/validator": { - "version": "13.12.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", - "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==", - "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/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-url": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.1.tgz", - "integrity": "sha512-mDGf9diDad/giZ/Sm9Xi2YcyzaFpbdLpJPr+E9fSkyQ7KpQD4SdFcugkRQYzhmfI4KeV4Qpnn2sKPdo+kmsgRQ==", - "license": "MIT", - "dependencies": { - "tr46": "^5.0.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/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/winston": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", - "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", - "license": "MIT", - "dependencies": { - "@colors/colors": "^1.6.0", - "@dabh/diagnostics": "^2.0.2", - "async": "^3.2.3", - "is-stream": "^2.0.0", - "logform": "^2.7.0", - "one-time": "^1.0.0", - "readable-stream": "^3.4.0", - "safe-stable-stringify": "^2.3.1", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.9.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/winston-daily-rotate-file": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/winston-daily-rotate-file/-/winston-daily-rotate-file-5.0.0.tgz", - "integrity": "sha512-JDjiXXkM5qvwY06733vf09I2wnMXpZEhxEVOSPenZMii+g7pcDcTBt2MRugnoi8BwVSuCT2jfRXBUy+n1Zz/Yw==", - "license": "MIT", - "dependencies": { - "file-stream-rotator": "^0.6.1", - "object-hash": "^3.0.0", - "triple-beam": "^1.4.1", - "winston-transport": "^4.7.0" - }, - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "winston": "^3" - } - }, - "node_modules/winston-transport": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", - "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", - "license": "MIT", - "dependencies": { - "logform": "^2.7.0", - "readable-stream": "^3.6.2", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/wkx": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", - "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "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/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/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/yaml": { - "version": "2.0.0-1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.0.0-1.tgz", - "integrity": "sha512-W7h5dEhywMKenDJh2iX/LABkbFnBxasD27oyXWDS/feDsxiw0dD5ncXdYXgkvAsXIY2MpW/ZKkr9IU30DBdMNQ==", - "license": "ISC", - "engines": { - "node": ">= 6" - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/z-schema": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.5.tgz", - "integrity": "sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==", - "license": "MIT", - "dependencies": { - "lodash.get": "^4.4.2", - "lodash.isequal": "^4.5.0", - "validator": "^13.7.0" - }, - "bin": { - "z-schema": "bin/z-schema" - }, - "engines": { - "node": ">=8.0.0" - }, - "optionalDependencies": { - "commander": "^9.4.1" - } - }, - "node_modules/z-schema/node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", - "license": "MIT", - "optional": true, - "engines": { - "node": "^12.20.0 || >=14" - } - } - } -} diff --git a/apis/gateway/tsconfig.json b/apis/gateway/tsconfig.json new file mode 100644 index 0000000..eec3b81 --- /dev/null +++ b/apis/gateway/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es6", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5d2c635..65d6f14 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,205 +1,196 @@ services: - authCommand: - container_name: authCommand - build: - context: ./apis/authCommand - target: development - env_file: ./api/.env - volumes: - - ./api:/api - ports: - - 5000:5000 - - 8081:80 - - 81:81 - depends_on: - - mongodb - networks: - - mevn - - authQuery: - container_name: authQuery + nginx: build: - context: ./apis/authQuery - target: development - env_file: ./api/.env - volumes: - - ./api:/api + context: ./nginx + dockerfile: Dockerfile ports: - - 5001:5000 - - 8081:80 - - 81:81 + - "8080:8080" depends_on: - - mongodb - networks: - - mevn + - gateway + - authcommand + - authquery gateway: - container_name: gateway build: context: ./apis/gateway - target: development - env_file: ./api/.env - volumes: - - ./api:/api - ports: - - 5002:5000 - - 8081:80 - - 81:81 - depends_on: - - mongodb - networks: - - mevn - - MaintenanceCommand: - container_name: MaintenanceCommand - build: - context: ./apis/MaintenanceCommand - target: development - env_file: ./api/.env - volumes: - - ./api:/api - ports: - - 5003:5000 - - 8081:80 - - 81:81 - depends_on: - - mongodb - networks: - - mevn - - MaintenanceQuery: - container_name: MaintenanceQuery - build: - context: ./apis/MaintenanceQuery - target: development - env_file: ./api/.env + target: production + env_file: .env volumes: - ./api:/api ports: - - 5004:5000 - - 8081:80 - - 81:81 + - "5001:3000" depends_on: - - mongodb - networks: - - mevn + - authcommand + - authquery - ReservationCommand: - container_name: ReservationCommand + authcommand: + container_name: authCommand build: - context: ./apis/ReservationCommand - target: development - env_file: ./api/.env + context: ./apis/authCommand + target: production + env_file: .env volumes: - ./api:/api ports: - - 5005:5000 - - 8081:80 - - 81:81 + - 8081:3000 depends_on: - mongodb networks: - - mevn + - voltride - ReservationQuery: - container_name: ReservationQuery + authquery: + container_name: authQuery build: - context: ./apis/ReservationQuery - target: development - env_file: ./api/.env + context: ./apis/authQuery + target: production + env_file: .env volumes: - ./api:/api ports: - - 5006:5000 - - 8081:80 - - 81:81 + - 8082:3000 depends_on: - mongodb networks: - - mevn + - voltride - stockCommand: - container_name: stockCommand - build: - context: ./apis/stockCommand - target: development - env_file: ./api/.env - volumes: - - ./api:/api - ports: - - 5007:5000 - - 8081:80 - - 81:81 - depends_on: - - mongodb - networks: - - mevn + # MaintenanceCommand: + # container_name: MaintenanceCommand + # build: + # context: ./apis/MaintenanceCommand + # target: development + # env_file: .env + # volumes: + # - ./api:/api + # ports: + # - 8084:80 + # depends_on: + # - mongodb + # networks: + # - voltride + + # MaintenanceQuery: + # container_name: MaintenanceQuery + # build: + # context: ./apis/MaintenanceQuery + # target: development + # env_file: .env + # volumes: + # - ./api:/api + # ports: + # - 8085:80 + # depends_on: + # - mongodb + # networks: + # - voltride - stockQuery: - container_name: stockQuery - build: - context: ./apis/stockQuery - target: development - env_file: ./api/.env - volumes: - - ./api:/api - ports: - - 5008:5000 - - 8081:80 - - 81:81 - depends_on: - - mongodb - networks: - - mevn + # ReservationCommand: + # container_name: ReservationCommand + # build: + # context: ./apis/ReservationCommand + # target: development + # env_file: .env + # volumes: + # - ./api:/api + # ports: + # - 8086:80 + # depends_on: + # - mongodb + # networks: + # - voltride + + # ReservationQuery: + # container_name: ReservationQuery + # build: + # context: ./apis/ReservationQuery + # target: development + # env_file: .env + # volumes: + # - ./api:/api + # ports: + # - 8087:80 + # depends_on: + # - mongodb + # networks: + # - voltride + + # stockCommand: + # container_name: stockCommand + # build: + # context: ./apis/stockCommand + # target: development + # env_file: .env + # volumes: + # - ./api:/api + # ports: + # - 8088:80 + # depends_on: + # - mongodb + # networks: + # - voltride + + # stockQuery: + # container_name: stockQuery + # build: + # context: ./apis/stockQuery + # target: development + # env_file: .env + # volumes: + # - ./api:/api + # ports: + # - 8089:80 + # depends_on: + # - mongodb + # networks: + # - voltride mongodb: image: mongo container_name: mongodb - env_file: ./mongo/.env + env_file: .env ports: - 27017:27017 volumes: - ./mongo/initdb.d/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro - mongo_db:/data/db networks: - - mevn + - voltride mongo-express: image: mongo-express:1.0.2-20-alpine3.19 container_name: mongo-express restart: always - env_file: ./mongo/.env + env_file: .env ports: - - 8082:8081 + - 8181:8081 networks: - - mevn + - voltride depends_on: - mongodb - pgsql: - image: postgres:13.4 - container_name: pgsql - env_file: ./pgsql/.env - ports: - - 5432:5432 - volumes: - - pgsql:/var/lib/postgresql/data - networks: - - mevn + # pgsql: + # image: postgres:13.4 + # container_name: pgsql + # env_file: ./pgsql/.env + # ports: + # - 5432:5432 + # volumes: + # - pgsql:/var/lib/postgresql/data + # networks: + # - voltride - pgadmin: - image: dpage/pgadmin4 - container_name: pgadmin - env_file: ./pgsql/.env - ports: - - 8083:81 - networks: - - mevn - depends_on: - - pgsql + # pgadmin: + # image: dpage/pgadmin4 + # container_name: pgadmin + # env_file: ./pgsql/.env + # ports: + # - 8083:81 + # networks: + # - voltride + # depends_on: + # - pgsql networks: - mevn: + voltride: volumes: - mongo_db: \ No newline at end of file + mongo_db: diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 537990c..744103c 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -1,5 +1,5 @@ -FROM nginx:latest +FROM nginx:alpine3.21 RUN rm /etc/nginx/nginx.conf -COPY nginx.conf /etc/nginx/nginx.conf \ No newline at end of file +COPY nginx.conf /etc/nginx/nginx.conf diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 4b32745..66b3f73 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,16 +1,16 @@ http { - upstream user { + upstream authcommand { server user:8081; } - upstream chat { + upstream authquery { server chat:8082; } - upstream notification { - server notification:8083; - } + # upstream gateway { + # server notification:8083; + # } server { - listen 85; + listen 8080 location /user/ { proxy_pass http://user/; From ecdf9c814565e33e33522c52c3c9610516d61089 Mon Sep 17 00:00:00 2001 From: LeGrizzly Date: Tue, 25 Feb 2025 11:07:46 +0100 Subject: [PATCH 3/7] refactor: simplify database connection logic and remove unused Sequelize imports; update bcrypt dependency --- .../Infrastructure/databases/database.ts | 7 +- .../Infrastructure/databases/index.ts | 2 +- .../controllers/auth/sign-up.controller.ts | 30 ++-- .../Interface/middlewares/bcrypt.ts | 2 +- .../Interface/middlewares/validateRole.ts | 130 ------------------ .../Interface/routes/auth.routes.ts | 4 +- apis/authCommand/package.json | 2 +- .../shared/helpers/password.helper.ts | 2 +- 8 files changed, 30 insertions(+), 149 deletions(-) delete mode 100644 apis/authCommand/Interface/middlewares/validateRole.ts diff --git a/apis/authCommand/Infrastructure/databases/database.ts b/apis/authCommand/Infrastructure/databases/database.ts index bf2bc81..c6c0298 100644 --- a/apis/authCommand/Infrastructure/databases/database.ts +++ b/apis/authCommand/Infrastructure/databases/database.ts @@ -1,10 +1,7 @@ -import { SequelizeService } from "./sequelize"; +// import { SequelizeService } from "./sequelize"; import { MongooseService } from "./mongoose"; -const connectDB = async (DBType: string): Promise => { - if (DBType === "pgsql") { - return await SequelizeService.get(); - }; +const connectDB = async (DBType: string): Promise => { if (DBType === "mongo") { return await MongooseService.get(); }; diff --git a/apis/authCommand/Infrastructure/databases/index.ts b/apis/authCommand/Infrastructure/databases/index.ts index 5b486c3..cdc1e92 100644 --- a/apis/authCommand/Infrastructure/databases/index.ts +++ b/apis/authCommand/Infrastructure/databases/index.ts @@ -1,5 +1,5 @@ export * from "./mongoose"; -export * from "./sequelize"; +// export * from "./sequelize"; // export * from "./redis"; // export * from "./inMemory"; export * from "./database"; diff --git a/apis/authCommand/Interface/controllers/auth/sign-up.controller.ts b/apis/authCommand/Interface/controllers/auth/sign-up.controller.ts index f5b1bf5..a75f073 100644 --- a/apis/authCommand/Interface/controllers/auth/sign-up.controller.ts +++ b/apis/authCommand/Interface/controllers/auth/sign-up.controller.ts @@ -7,16 +7,27 @@ import { RepositoryError } from "../../../application/errors/repository-error"; import { BadRequestError } from "../../../application/errors"; config(); -if (!process.env.DB_TYPE) { - throw new RepositoryError(); // DB_TYPE environment variable is not defined -} -const database = await connectDB(process.env.DB_TYPE); -const userRepo = database && 'userRepository' in database ? await database.userRepository : null; -const tokenService = new TokenHelper(); -if (!userRepo) { - throw new RepositoryError(); // User repository is not available + +let registerUseCaseInstance: RegisterUseCase | null = null; + +async function getRegisterUseCase(): Promise { + if (registerUseCaseInstance) return registerUseCaseInstance; + + if (!process.env.DB_TYPE) { + throw new RepositoryError(); + } + + const database = await connectDB(process.env.DB_TYPE); + const userRepo = database && 'userRepository' in database ? await database.userRepository : null; + + if (!userRepo) { + throw new RepositoryError(); + } + + const tokenService = new TokenHelper(); + registerUseCaseInstance = new RegisterUseCase(userRepo, tokenService); + return registerUseCaseInstance; } -const registerUseCase = new RegisterUseCase(userRepo, tokenService); export class SignUpController { /** @@ -62,6 +73,7 @@ export class SignUpController { throw new BadRequestError(); // Email and password are required } + const registerUseCase = await getRegisterUseCase(); const token = await registerUseCase.execute(req.body); return res.json({token}); diff --git a/apis/authCommand/Interface/middlewares/bcrypt.ts b/apis/authCommand/Interface/middlewares/bcrypt.ts index a607ad6..b5e790f 100644 --- a/apis/authCommand/Interface/middlewares/bcrypt.ts +++ b/apis/authCommand/Interface/middlewares/bcrypt.ts @@ -1,4 +1,4 @@ -import bcrypt from "bcryptjs"; +import bcrypt from "bcrypt"; import { Logger } from "../../config/logger"; const logger = Logger.get(); diff --git a/apis/authCommand/Interface/middlewares/validateRole.ts b/apis/authCommand/Interface/middlewares/validateRole.ts deleted file mode 100644 index 0913353..0000000 --- a/apis/authCommand/Interface/middlewares/validateRole.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { Request, Response, NextFunction } from "express"; -import jwt from "jsonwebtoken"; -import { Role } from "../models"; -import connectDB from "../../infrastructure/databases/database"; -import { config } from "dotenv"; - -config(); -const SECRET_KEY: string | undefined = process.env.JWT_SECRET; - -const getUser = async (req: Request, res: Response) => { - if (!SECRET_KEY) { - res.status(500); - throw new Error("JWT_SECRET is not defined"); - } - - const authHeader = req.headers["authorization"]; - const jwtToken = authHeader && authHeader.split(" ")[1]; - - if (!jwtToken) { - res.status(401); - throw new Error("No token, authorization denied"); - } - - const decoded = jwt.verify(jwtToken, SECRET_KEY) as jwt.JwtPayload; - - const dbType = process.env.DB_TYPE; - if (!dbType) { - res.status(500); - throw new Error("DB_TYPE is not defined"); - } - const database = await connectDB(dbType); - const userRepo = database && 'userRepository' in database ? await database.userRepository : null; - const user = await userRepo.findById(decoded.id); - if (!user) { - res.status(401); - throw new Error("Authentication failed"); - } - return user; -}; - -export const validateRole = async ( - req: Request, - res: Response, - next: NextFunction, - role: Role[] -) => { - try { - const user = await getUser(req, res); - if (role.length === 1) { - if (user.role !== role[0]) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - if (role.length === 2) { - if (user.role !== role[0] && user.role !== role[1]) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - if (role.length === 3) { - if ( - user.role !== role[0] && - user.role !== role[1] && - user.role !== role[2] - ) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - } catch (error) { - if (!res.statusCode) { - res.status(500); - } - next(error); - } -}; - -export const validateRoleAdmin = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin]); -}; -export const validateRoleOwner = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Owner]); -}; -export const validateRoleCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Customer]); -}; -export const validateRoleAdminOwner = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Owner]); -}; -export const validateRoleAdminCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Customer]); -}; -export const validateRoleOwnerCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Owner, Role.Customer]); -}; -export const validateRoleAll = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Owner, Role.Customer]); -}; diff --git a/apis/authCommand/Interface/routes/auth.routes.ts b/apis/authCommand/Interface/routes/auth.routes.ts index fa0a6c8..55d7555 100644 --- a/apis/authCommand/Interface/routes/auth.routes.ts +++ b/apis/authCommand/Interface/routes/auth.routes.ts @@ -4,7 +4,9 @@ import { SignUpController } from "../controllers/auth/sign-up.controller"; const router = express.Router(); const signUpController = new SignUpController(); -router.post("/register", signUpController.register.bind(signUpController)); +router.post("/register", async (req, res, next) => { + await signUpController.register(req, res); +}); // router.post("/change-password", AuthController.changePassword); // router.put("/update", AuthController.update); // router.put("/update-role", AuthController.updateRole); diff --git a/apis/authCommand/package.json b/apis/authCommand/package.json index 62f664d..7492aa1 100644 --- a/apis/authCommand/package.json +++ b/apis/authCommand/package.json @@ -31,7 +31,7 @@ "winston-daily-rotate-file": "^5.0.0" }, "devDependencies": { - "@types/bcryptjs": "^2.4.6", + "@types/bcrypt": "^5.0.2", "@types/cors": "^2.8.17", "@types/express": "^5.0.0", "@types/jsonwebtoken": "^9.0.8", diff --git a/apis/authCommand/shared/helpers/password.helper.ts b/apis/authCommand/shared/helpers/password.helper.ts index b20a22c..8d8ff81 100644 --- a/apis/authCommand/shared/helpers/password.helper.ts +++ b/apis/authCommand/shared/helpers/password.helper.ts @@ -1,4 +1,4 @@ -import bcrypt from 'bcryptjs'; +import bcrypt from 'bcrypt'; import { Logger } from '../../config/logger'; import { PasswordServiceInterface } from '../../application/ports/password.service.interface'; From 7adf9fa45638e22853df1f31df08cd7d8f468742 Mon Sep 17 00:00:00 2001 From: horotopia Date: Tue, 25 Feb 2025 14:46:33 +0100 Subject: [PATCH 4/7] update authQuery --- apis/authCommand/Domain/index.ts | 3 + .../Domain/interfaces/incident.interface.ts | 14 -- apis/authQuery/Domain/interfaces/index.ts | 8 -- .../interfaces/maintenance.interface.ts | 11 -- .../Domain/interfaces/rental.interface.ts | 11 -- .../interfaces/reservation.interface.ts | 8 -- .../Domain/interfaces/scooter.interface.ts | 10 -- .../interfaces/stock.order.interface.ts | 12 -- .../interfaces/stock.piece.interface.ts | 9 -- .../Domain/interfaces/warranty.interface.ts | 10 -- .../controllers/auth/sign-in.controller.ts | 36 +++--- .../controllers/auth/sign-up.controller.ts | 75 ----------- .../authQuery/Interface/middlewares/bcrypt.ts | 4 +- .../Interface/middlewares/errorHandler.ts | 8 +- apis/authQuery/Interface/middlewares/jwt.ts | 4 +- .../Interface/middlewares/validateRole.ts | 122 ------------------ .../authQuery/Interface/routes/auth.routes.ts | 4 +- .../application/dtos/auth/getall.user.dto.ts | 3 + .../application/dtos/auth/getone.user.dto.ts | 4 + apis/authQuery/application/dtos/auth/index.ts | 1 - .../application/errors/bad-request-error.ts | 5 +- .../application/errors/date-time-error.ts | 4 +- .../errors/default-application-error.ts | 11 +- .../errors/email-validation-error.ts | 4 +- .../errors/internal-server-error.ts | 4 +- .../application/errors/not-found-error.ts | 4 +- .../errors/password-validation-error.ts | 6 +- .../application/errors/repository-error.ts | 4 +- .../errors/request-validation-error.ts | 4 +- .../application/errors/sanitizer-error.ts | 4 +- .../application/errors/unauthorized-error.ts | 4 +- .../application/errors/user-exists-error.ts | 4 +- apis/authQuery/application/ports/index.ts | 14 +- .../ports/user.repository.interface.ts | 5 +- .../usecases/auth/getall.user.usecase.ts | 30 +++++ .../usecases/auth/getone.user.usecase.ts | 27 ++++ .../usecases/auth/login.usecase.ts | 10 +- .../infrastructure/databases/database.ts | 16 ++- .../infrastructure/databases/index.ts | 3 +- .../infrastructure/databases/sequelize.ts | 88 ++++++------- .../orms/mongoose/user.schema.ts | 4 +- .../infrastructure/repositories/index.ts | 6 +- .../repositories/mongoose/user.repository.ts | 21 +-- .../repositories/sequelize/index.ts | 2 +- apis/authQuery/package.json | 2 +- .../shared/helpers/password.helper.ts | 9 +- apis/authQuery/tsconfig.json | 11 +- .../dtos/auth/getall.user.dto.d.ts | 3 + .../dtos/auth/getone.user.dto.d.ts | 4 + .../types/application/dtos/auth/index.d.ts | 1 + .../application/dtos/auth/login.user.dto.d.ts | 4 + .../application/errors/bad-request-error.d.ts | 5 + .../application/errors/date-time-error.d.ts | 5 + .../errors/default-application-error.d.ts | 14 ++ .../errors/email-validation-error.d.ts | 5 + .../types/application/errors/index.d.ts | 11 ++ .../errors/internal-server-error.d.ts | 5 + .../application/errors/not-found-error.d.ts | 5 + .../errors/password-validation-error.d.ts | 5 + .../application/errors/repository-error.d.ts | 5 + .../errors/request-validation-error.d.ts | 5 + .../application/errors/sanitizer-error.d.ts | 5 + .../errors/unauthorized-error.d.ts | 5 + .../application/errors/user-exists-error.d.ts | 5 + .../ports/auth.service.interface.d.ts | 5 + .../types/application/ports/index.d.ts | 3 + .../ports/password.service.interface.d.ts | 4 + .../ports/responses/response.interface.d.ts | 4 + .../ports/user.repository.interface.d.ts | 5 + .../usecases/auth/getall.user.usecase.d.ts | 9 ++ .../usecases/auth/getone.user.usecase.d.ts | 8 ++ .../usecases/auth/login.usecase.d.ts | 8 ++ apis/authQuery/types/config/cors.d.ts | 3 + apis/authQuery/types/config/helmet.d.ts | 3 + apis/authQuery/types/config/logger.d.ts | 22 ++++ .../types/domain/entities/index.d.ts | 1 + .../authQuery/types/domain/entities/user.d.ts | 13 ++ apis/authQuery/types/domain/enums/index.d.ts | 1 + .../types/domain/enums/user.role.enum.d.ts | 5 + .../domain/interfaces/incident.interface.d.ts | 13 ++ .../types/domain/interfaces/index.d.ts | 2 + .../interfaces/maintenance.interface.d.ts | 10 ++ .../domain/interfaces/rental.interface.d.ts | 10 ++ .../interfaces/reservation.interface.d.ts | 8 ++ .../domain/interfaces/scooter.interface.d.ts | 9 ++ .../interfaces/stock.order.interface.d.ts | 11 ++ .../interfaces/stock.piece.interface.d.ts | 9 ++ .../interfaces/timestamp.interface.d.ts | 4 + .../domain/interfaces/user.interface.d.ts | 9 ++ .../domain/interfaces/warranty.interface.d.ts | 9 ++ .../infrastructure/databases/adapter.d.ts | 5 + .../infrastructure/databases/database.d.ts | 3 + .../types/infrastructure/databases/index.d.ts | 3 + .../infrastructure/databases/mongoose.d.ts | 14 ++ .../infrastructure/databases/sequelize.d.ts | 0 .../types/infrastructure/orms/adapter.d.ts | 5 + .../infrastructure/orms/mongoose/index.d.ts | 1 + .../orms/mongoose/user.schema.d.ts | 38 ++++++ .../infrastructure/repositories/index.d.ts | 2 + .../repositories/mongoose/index.d.ts | 1 + .../mongoose/user.repository.d.ts | 11 ++ .../repositories/sequelize/index.d.ts | 0 .../sequelize/user.repository.d.ts | 0 .../controllers/auth/sign-in.controller.d.ts | 37 ++++++ .../controllers/auth/sign-up.controller.d.ts | 40 ++++++ .../types/interface/docs/swagger.d.ts | 2 + .../types/interface/middlewares/bcrypt.d.ts | 6 + .../interface/middlewares/errorHandler.d.ts | 3 + .../types/interface/middlewares/jwt.d.ts | 4 + .../interface/middlewares/validateRole.d.ts | 10 ++ .../types/interface/routes/auth.routes.d.ts | 2 + apis/authQuery/types/server.d.ts | 1 + .../types/shared/helpers/password.helper.d.ts | 7 + .../types/shared/helpers/token.helper.d.ts | 8 ++ .../types/shared/validators/env.d.ts | 0 115 files changed, 701 insertions(+), 445 deletions(-) create mode 100644 apis/authCommand/Domain/index.ts delete mode 100644 apis/authQuery/Domain/interfaces/incident.interface.ts delete mode 100644 apis/authQuery/Domain/interfaces/maintenance.interface.ts delete mode 100644 apis/authQuery/Domain/interfaces/rental.interface.ts delete mode 100644 apis/authQuery/Domain/interfaces/reservation.interface.ts delete mode 100644 apis/authQuery/Domain/interfaces/scooter.interface.ts delete mode 100644 apis/authQuery/Domain/interfaces/stock.order.interface.ts delete mode 100644 apis/authQuery/Domain/interfaces/stock.piece.interface.ts delete mode 100644 apis/authQuery/Domain/interfaces/warranty.interface.ts delete mode 100644 apis/authQuery/Interface/controllers/auth/sign-up.controller.ts delete mode 100644 apis/authQuery/Interface/middlewares/validateRole.ts create mode 100644 apis/authQuery/application/dtos/auth/getall.user.dto.ts create mode 100644 apis/authQuery/application/dtos/auth/getone.user.dto.ts create mode 100644 apis/authQuery/application/usecases/auth/getall.user.usecase.ts create mode 100644 apis/authQuery/application/usecases/auth/getone.user.usecase.ts create mode 100644 apis/authQuery/types/application/dtos/auth/getall.user.dto.d.ts create mode 100644 apis/authQuery/types/application/dtos/auth/getone.user.dto.d.ts create mode 100644 apis/authQuery/types/application/dtos/auth/index.d.ts create mode 100644 apis/authQuery/types/application/dtos/auth/login.user.dto.d.ts create mode 100644 apis/authQuery/types/application/errors/bad-request-error.d.ts create mode 100644 apis/authQuery/types/application/errors/date-time-error.d.ts create mode 100644 apis/authQuery/types/application/errors/default-application-error.d.ts create mode 100644 apis/authQuery/types/application/errors/email-validation-error.d.ts create mode 100644 apis/authQuery/types/application/errors/index.d.ts create mode 100644 apis/authQuery/types/application/errors/internal-server-error.d.ts create mode 100644 apis/authQuery/types/application/errors/not-found-error.d.ts create mode 100644 apis/authQuery/types/application/errors/password-validation-error.d.ts create mode 100644 apis/authQuery/types/application/errors/repository-error.d.ts create mode 100644 apis/authQuery/types/application/errors/request-validation-error.d.ts create mode 100644 apis/authQuery/types/application/errors/sanitizer-error.d.ts create mode 100644 apis/authQuery/types/application/errors/unauthorized-error.d.ts create mode 100644 apis/authQuery/types/application/errors/user-exists-error.d.ts create mode 100644 apis/authQuery/types/application/ports/auth.service.interface.d.ts create mode 100644 apis/authQuery/types/application/ports/index.d.ts create mode 100644 apis/authQuery/types/application/ports/password.service.interface.d.ts create mode 100644 apis/authQuery/types/application/ports/responses/response.interface.d.ts create mode 100644 apis/authQuery/types/application/ports/user.repository.interface.d.ts create mode 100644 apis/authQuery/types/application/usecases/auth/getall.user.usecase.d.ts create mode 100644 apis/authQuery/types/application/usecases/auth/getone.user.usecase.d.ts create mode 100644 apis/authQuery/types/application/usecases/auth/login.usecase.d.ts create mode 100644 apis/authQuery/types/config/cors.d.ts create mode 100644 apis/authQuery/types/config/helmet.d.ts create mode 100644 apis/authQuery/types/config/logger.d.ts create mode 100644 apis/authQuery/types/domain/entities/index.d.ts create mode 100644 apis/authQuery/types/domain/entities/user.d.ts create mode 100644 apis/authQuery/types/domain/enums/index.d.ts create mode 100644 apis/authQuery/types/domain/enums/user.role.enum.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/incident.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/index.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/maintenance.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/rental.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/reservation.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/scooter.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/stock.order.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/stock.piece.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/timestamp.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/user.interface.d.ts create mode 100644 apis/authQuery/types/domain/interfaces/warranty.interface.d.ts create mode 100644 apis/authQuery/types/infrastructure/databases/adapter.d.ts create mode 100644 apis/authQuery/types/infrastructure/databases/database.d.ts create mode 100644 apis/authQuery/types/infrastructure/databases/index.d.ts create mode 100644 apis/authQuery/types/infrastructure/databases/mongoose.d.ts create mode 100644 apis/authQuery/types/infrastructure/databases/sequelize.d.ts create mode 100644 apis/authQuery/types/infrastructure/orms/adapter.d.ts create mode 100644 apis/authQuery/types/infrastructure/orms/mongoose/index.d.ts create mode 100644 apis/authQuery/types/infrastructure/orms/mongoose/user.schema.d.ts create mode 100644 apis/authQuery/types/infrastructure/repositories/index.d.ts create mode 100644 apis/authQuery/types/infrastructure/repositories/mongoose/index.d.ts create mode 100644 apis/authQuery/types/infrastructure/repositories/mongoose/user.repository.d.ts create mode 100644 apis/authQuery/types/infrastructure/repositories/sequelize/index.d.ts create mode 100644 apis/authQuery/types/infrastructure/repositories/sequelize/user.repository.d.ts create mode 100644 apis/authQuery/types/interface/controllers/auth/sign-in.controller.d.ts create mode 100644 apis/authQuery/types/interface/controllers/auth/sign-up.controller.d.ts create mode 100644 apis/authQuery/types/interface/docs/swagger.d.ts create mode 100644 apis/authQuery/types/interface/middlewares/bcrypt.d.ts create mode 100644 apis/authQuery/types/interface/middlewares/errorHandler.d.ts create mode 100644 apis/authQuery/types/interface/middlewares/jwt.d.ts create mode 100644 apis/authQuery/types/interface/middlewares/validateRole.d.ts create mode 100644 apis/authQuery/types/interface/routes/auth.routes.d.ts create mode 100644 apis/authQuery/types/server.d.ts create mode 100644 apis/authQuery/types/shared/helpers/password.helper.d.ts create mode 100644 apis/authQuery/types/shared/helpers/token.helper.d.ts create mode 100644 apis/authQuery/types/shared/validators/env.d.ts diff --git a/apis/authCommand/Domain/index.ts b/apis/authCommand/Domain/index.ts new file mode 100644 index 0000000..69a6641 --- /dev/null +++ b/apis/authCommand/Domain/index.ts @@ -0,0 +1,3 @@ +export * from "./entities"; +export * from "./enums"; +export * from "./interfaces"; diff --git a/apis/authQuery/Domain/interfaces/incident.interface.ts b/apis/authQuery/Domain/interfaces/incident.interface.ts deleted file mode 100644 index 5365e1f..0000000 --- a/apis/authQuery/Domain/interfaces/incident.interface.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IncidentStatus } from "../enums"; - -export interface IncidentInterface { - id: string; - scooterId: string; - customerId: string; - ReservationId: string; - description: string; - location: string; - severity: number; - status: IncidentStatus; - reportedAt: Date; - resolvedAt: Date | null; -} diff --git a/apis/authQuery/Domain/interfaces/index.ts b/apis/authQuery/Domain/interfaces/index.ts index 2172d91..15b951b 100644 --- a/apis/authQuery/Domain/interfaces/index.ts +++ b/apis/authQuery/Domain/interfaces/index.ts @@ -1,10 +1,2 @@ -export * from "./incident.interface"; -export * from "./maintenance.interface"; -export * from "./rental.interface"; -export * from "./reservation.interface"; -export * from "./scooter.interface"; -export * from "./stock.order.interface"; -export * from "./stock.piece.interface"; export * from "./timestamp.interface"; export * from "./user.interface"; -export * from "./warranty.interface"; diff --git a/apis/authQuery/Domain/interfaces/maintenance.interface.ts b/apis/authQuery/Domain/interfaces/maintenance.interface.ts deleted file mode 100644 index b41d310..0000000 --- a/apis/authQuery/Domain/interfaces/maintenance.interface.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { MaintenanceType } from "../enums"; - -export interface MaintenanceInterface { - id: string; - scooterId: string; - technicianId: string; - type: MaintenanceType; - date: Date; - details: string; - cost: number; -} \ No newline at end of file diff --git a/apis/authQuery/Domain/interfaces/rental.interface.ts b/apis/authQuery/Domain/interfaces/rental.interface.ts deleted file mode 100644 index 31be012..0000000 --- a/apis/authQuery/Domain/interfaces/rental.interface.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { RentalStatus } from "../enums"; - -export interface RentalInterface { - id: string; - scooterId: string; - customerId: string; - startDate: Date; - endDate?: Date | undefined; - status: RentalStatus; - totalPrice?: number; -} \ No newline at end of file diff --git a/apis/authQuery/Domain/interfaces/reservation.interface.ts b/apis/authQuery/Domain/interfaces/reservation.interface.ts deleted file mode 100644 index 156aa6d..0000000 --- a/apis/authQuery/Domain/interfaces/reservation.interface.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface ReservationInterface { - id: string; - customerId: string; - scooterId: string; - date: Date; - duration: number; - location: string; -} \ No newline at end of file diff --git a/apis/authQuery/Domain/interfaces/scooter.interface.ts b/apis/authQuery/Domain/interfaces/scooter.interface.ts deleted file mode 100644 index 3b63af4..0000000 --- a/apis/authQuery/Domain/interfaces/scooter.interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ScooterStatus } from "../enums"; - -export interface ScooterInterface { - id: string; - model: string; - status: ScooterStatus; - lastMaintenanceDate: Date; - totalKilometers: number; - chargeCycles: number; -} \ No newline at end of file diff --git a/apis/authQuery/Domain/interfaces/stock.order.interface.ts b/apis/authQuery/Domain/interfaces/stock.order.interface.ts deleted file mode 100644 index 49322c4..0000000 --- a/apis/authQuery/Domain/interfaces/stock.order.interface.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { StockOrderStatus } from "../enums"; - -export interface StockOrderInterface { - id: string; - partnerName: string; - supplier: string; - quantity: number; - unitPrice: number; - orderDate: Date; - deliveryDate?: Date; - status: StockOrderStatus; -} \ No newline at end of file diff --git a/apis/authQuery/Domain/interfaces/stock.piece.interface.ts b/apis/authQuery/Domain/interfaces/stock.piece.interface.ts deleted file mode 100644 index dd01824..0000000 --- a/apis/authQuery/Domain/interfaces/stock.piece.interface.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface StockPieceInterface { - id: string; - name: string; - category: string; - quantity: number; - minThreshold: number; - supplier: string; - unitPrice: number; -} \ No newline at end of file diff --git a/apis/authQuery/Domain/interfaces/warranty.interface.ts b/apis/authQuery/Domain/interfaces/warranty.interface.ts deleted file mode 100644 index 5cc9c52..0000000 --- a/apis/authQuery/Domain/interfaces/warranty.interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { WarrantyStatus } from "../enums"; - -export interface WarrantyInterface { - id: string; - scooterId: string; // Garantie liée à un scooter spécifique - coveredParts: string[]; // Liste des pièces couvertes (batterie, moteur, etc.) - startDate: Date; - endDate: Date; - status: WarrantyStatus; -} \ No newline at end of file diff --git a/apis/authQuery/Interface/controllers/auth/sign-in.controller.ts b/apis/authQuery/Interface/controllers/auth/sign-in.controller.ts index 6f7352e..03e79e5 100644 --- a/apis/authQuery/Interface/controllers/auth/sign-in.controller.ts +++ b/apis/authQuery/Interface/controllers/auth/sign-in.controller.ts @@ -1,5 +1,5 @@ import { Request, Response, NextFunction } from "express"; -import { LoginUseCase } from '../../../application/usecases/auth/login.usecase'; +import { LoginUseCase } from "../../../application/usecases/auth/login.usecase"; import { config } from "dotenv"; import { TokenHelper } from "../../../shared/helpers/token.helper"; import connectDB from "../../../infrastructure/databases/database"; @@ -7,20 +7,9 @@ import { RepositoryError } from "../../../application/errors/repository-error"; import { BadRequestError } from "../../../application/errors"; config(); -if (!process.env.DB_TYPE) { - throw new RepositoryError(); // DB_TYPE environment variable is not defined -} -const database = await connectDB(process.env.DB_TYPE); -const userRepo = database && 'userRepository' in database ? await database.userRepository : null; -const tokenService = new TokenHelper(); -if (!userRepo) { - throw new RepositoryError(); // User repository is not available -} -const loginUseCase = new LoginUseCase(userRepo, tokenService); export class SignInController { - -/** + /** * @swagger * /api/auth/login: * post: @@ -54,8 +43,22 @@ export class SignInController { * description: User not found */ - async login(req: Request, res: Response, next: NextFunction) : Promise { + async login(req: Request, res: Response): Promise { try { + if (!process.env.DB_TYPE) { + throw new RepositoryError(); // DB_TYPE environment variable is not defined + } + const database = await connectDB(process.env.DB_TYPE); + const userRepo = + database && "userRepository" in database + ? await database.userRepository + : null; + const tokenService = new TokenHelper(); + if (!userRepo) { + throw new RepositoryError(); // User repository is not available + } + const loginUseCase = new LoginUseCase(userRepo, tokenService); + if ( !req.body || typeof req.body.email !== "string" || @@ -66,8 +69,7 @@ export class SignInController { } const token = await loginUseCase.execute(req.body); - return res.status(201).json({token}); - + return res.status(201).json({ token }); } catch (error) { if (!res.statusCode) { res.status(500); @@ -75,4 +77,4 @@ export class SignInController { return res; } } -} \ No newline at end of file +} diff --git a/apis/authQuery/Interface/controllers/auth/sign-up.controller.ts b/apis/authQuery/Interface/controllers/auth/sign-up.controller.ts deleted file mode 100644 index a49b371..0000000 --- a/apis/authQuery/Interface/controllers/auth/sign-up.controller.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Request, Response, NextFunction } from "express"; -import { RegisterUseCase } from '../../../application/usecases/auth/register.usecase'; -import { config } from "dotenv"; -import { TokenHelper } from "../../../shared/helpers/token.helper"; -import connectDB from "../../../infrastructure/databases/database"; -import { RepositoryError } from "../../../application/errors/repository-error"; -import { BadRequestError } from "../../../application/errors"; - -config(); -if (!process.env.DB_TYPE) { - throw new RepositoryError(); // DB_TYPE environment variable is not defined -} -const database = await connectDB(process.env.DB_TYPE); -const userRepo = database && 'userRepository' in database ? await database.userRepository : null; -const tokenService = new TokenHelper(); -if (!userRepo) { - throw new RepositoryError(); // User repository is not available -} -const registerUseCase = new RegisterUseCase(userRepo, tokenService); - -export class SignInController { - /** - * @swagger - * /auth/register: - * post: - * summary: Register a new user - * tags: [Auth] - * requestBody: - * required: true - * content: - * application/json: - * schema: - * type: object - * required: - * - email - * - password - * properties: - * email: - * type: string - * description: The user's email - * password: - * type: string - * description: The user's password - * responses: - * 201: - * description: The created user - * content: - * application/json: - * schema: - * $ref: '#/components/schemas/User' - * 400: - * description: Email and password are required - * 409: - * description: Email already exists - * 500: - * description: Internal server error - */ - async register(req: Request, res: Response): Promise { - try { - if (!req.body || !req.body.email || !req.body.password) { - res.status(400); - throw new BadRequestError(); // Email and password are required - } - - const token = await registerUseCase.execute(req.body); - return res.json({token}); - - } catch (error) { - if (!res.statusCode) { - res.status(500); - } - return res; - } - } -} \ No newline at end of file diff --git a/apis/authQuery/Interface/middlewares/bcrypt.ts b/apis/authQuery/Interface/middlewares/bcrypt.ts index 50c773d..b5e790f 100644 --- a/apis/authQuery/Interface/middlewares/bcrypt.ts +++ b/apis/authQuery/Interface/middlewares/bcrypt.ts @@ -1,5 +1,5 @@ -import bcrypt from "bcryptjs"; -import { Logger } from "../config/logger"; +import bcrypt from "bcrypt"; +import { Logger } from "../../config/logger"; const logger = Logger.get(); diff --git a/apis/authQuery/Interface/middlewares/errorHandler.ts b/apis/authQuery/Interface/middlewares/errorHandler.ts index 46f2be4..3bcb268 100644 --- a/apis/authQuery/Interface/middlewares/errorHandler.ts +++ b/apis/authQuery/Interface/middlewares/errorHandler.ts @@ -1,5 +1,5 @@ import { NextFunction, Request, Response } from "express"; -import { Logger } from "../config/logger"; +import { Logger } from "../../config/logger"; const logger = Logger.get(); @@ -9,13 +9,13 @@ const errorHandler = () => { if (statusCode === 500) { logger.error( new Error( - `${statusCode}: ${req.method} ${req.url} - clientIP: ${req.ip}, errorStack: ${err.stack}, url: ${req.originalUrl}, method: ${req.method}, ip: ${req.ip}` - ) + `${statusCode}: ${req.method} ${req.url} - clientIP: ${req.ip}, errorStack: ${err.stack}, url: ${req.originalUrl}, method: ${req.method}, ip: ${req.ip}`, + ), ); } if ([400, 401, 403, 404, 409].includes(statusCode)) { logger.warn( - `${statusCode}: ${req.method} ${req.url} - clientIP: ${req.ip}, errorMessage: ${err.message}, url: ${req.originalUrl}, method: ${req.method}, ip: ${req.ip}` + `${statusCode}: ${req.method} ${req.url} - clientIP: ${req.ip}, errorMessage: ${err.message}, url: ${req.originalUrl}, method: ${req.method}, ip: ${req.ip}`, ); } diff --git a/apis/authQuery/Interface/middlewares/jwt.ts b/apis/authQuery/Interface/middlewares/jwt.ts index 316dc7a..ab99e77 100644 --- a/apis/authQuery/Interface/middlewares/jwt.ts +++ b/apis/authQuery/Interface/middlewares/jwt.ts @@ -1,7 +1,7 @@ import { config } from "dotenv"; import { NextFunction, Request, Response } from "express"; import jwt from "jsonwebtoken"; -import { Logger } from "../config/logger"; +import { Logger } from "../../config/logger"; config(); const logger = Logger.get(); @@ -21,7 +21,7 @@ const generateToken = (user: any) => { role: user.role, }, SECRET_KEY, - { expiresIn: "1d" } + { expiresIn: "1d" }, ); }; diff --git a/apis/authQuery/Interface/middlewares/validateRole.ts b/apis/authQuery/Interface/middlewares/validateRole.ts deleted file mode 100644 index 9e9a9cf..0000000 --- a/apis/authQuery/Interface/middlewares/validateRole.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { Request, Response, NextFunction } from "express"; -import jwt from "jsonwebtoken"; -import { MongooseService } from "../services/mongoose"; -import { Role } from "../models"; - -const SECRET_KEY: string | undefined = process.env.JWT_SECRET; - -const getUser = async (req: Request, res: Response) => { - if (!SECRET_KEY) { - res.status(500); - throw new Error("JWT_SECRET is not defined"); - } - - const authHeader = req.headers["authorization"]; - const jwtToken = authHeader && authHeader.split(" ")[1]; - - if (!jwtToken) { - res.status(401); - throw new Error("No token, authorization denied"); - } - - const decoded = jwt.verify(jwtToken, SECRET_KEY) as jwt.JwtPayload; - - const mongooseService = await MongooseService.get(); - const user = await mongooseService.userService.findById(decoded.id); - if (!user) { - res.status(401); - throw new Error("Authentication failed"); - } - return user; -}; - -export const validateRole = async ( - req: Request, - res: Response, - next: NextFunction, - role: Role[] -) => { - try { - const user = await getUser(req, res); - if (role.length === 1) { - if (user.role !== role[0]) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - if (role.length === 2) { - if (user.role !== role[0] && user.role !== role[1]) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - if (role.length === 3) { - if ( - user.role !== role[0] && - user.role !== role[1] && - user.role !== role[2] - ) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - } catch (error) { - if (!res.statusCode) { - res.status(500); - } - next(error); - } -}; - -export const validateRoleAdmin = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin]); -}; -export const validateRoleOwner = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Owner]); -}; -export const validateRoleCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Customer]); -}; -export const validateRoleAdminOwner = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Owner]); -}; -export const validateRoleAdminCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Customer]); -}; -export const validateRoleOwnerCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Owner, Role.Customer]); -}; -export const validateRoleAll = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Owner, Role.Customer]); -}; diff --git a/apis/authQuery/Interface/routes/auth.routes.ts b/apis/authQuery/Interface/routes/auth.routes.ts index 80e5cab..a704c68 100644 --- a/apis/authQuery/Interface/routes/auth.routes.ts +++ b/apis/authQuery/Interface/routes/auth.routes.ts @@ -4,6 +4,8 @@ import { SignInController } from "../controllers/auth/sign-in.controller"; const router = express.Router(); const signInController = new SignInController(); -router.post("/login", signInController.login.bind(signInController)); +router.post("/login", async (req, res, next) => { + await signInController.login(req, res); +}); export default router; diff --git a/apis/authQuery/application/dtos/auth/getall.user.dto.ts b/apis/authQuery/application/dtos/auth/getall.user.dto.ts new file mode 100644 index 0000000..645865c --- /dev/null +++ b/apis/authQuery/application/dtos/auth/getall.user.dto.ts @@ -0,0 +1,3 @@ +export interface GetAllUserDTO { + token: string; +} diff --git a/apis/authQuery/application/dtos/auth/getone.user.dto.ts b/apis/authQuery/application/dtos/auth/getone.user.dto.ts new file mode 100644 index 0000000..2b79f03 --- /dev/null +++ b/apis/authQuery/application/dtos/auth/getone.user.dto.ts @@ -0,0 +1,4 @@ +export interface GetOneUserDTO { + email: string; + token: string; +} diff --git a/apis/authQuery/application/dtos/auth/index.ts b/apis/authQuery/application/dtos/auth/index.ts index f4e811d..6ba6967 100644 --- a/apis/authQuery/application/dtos/auth/index.ts +++ b/apis/authQuery/application/dtos/auth/index.ts @@ -1,2 +1 @@ export * from "./login.user.dto"; -export * from "./register.user.dto"; \ No newline at end of file diff --git a/apis/authQuery/application/errors/bad-request-error.ts b/apis/authQuery/application/errors/bad-request-error.ts index 793c019..e7e7cab 100644 --- a/apis/authQuery/application/errors/bad-request-error.ts +++ b/apis/authQuery/application/errors/bad-request-error.ts @@ -1,7 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "./default-application-error"; export class BadRequestError extends DefaultApplicationError { - name = 'BadRequestError'; + name = "BadRequestError"; statusCode = 400; } - \ No newline at end of file diff --git a/apis/authQuery/application/errors/date-time-error.ts b/apis/authQuery/application/errors/date-time-error.ts index c771a19..df58dbe 100644 --- a/apis/authQuery/application/errors/date-time-error.ts +++ b/apis/authQuery/application/errors/date-time-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "./default-application-error"; export class DateTimeError extends DefaultApplicationError { statusCode = 500; - name = 'DateTimeError'; + name = "DateTimeError"; } diff --git a/apis/authQuery/application/errors/default-application-error.ts b/apis/authQuery/application/errors/default-application-error.ts index bf1f074..42e2dcd 100644 --- a/apis/authQuery/application/errors/default-application-error.ts +++ b/apis/authQuery/application/errors/default-application-error.ts @@ -1,25 +1,26 @@ -import { ResponseModel } from '../ports/responses/response.interface'; +import { ResponseModel } from "../ports/responses/response.interface"; export type ErrorParams = { name?: string; message?: string; statusCode?: number; messages?: string[]; - stack?: Error['stack']; + stack?: Error["stack"]; }; -export type ErrorResponseModel = Omit, 'body'>; +export type ErrorResponseModel = Omit, "body">; export class DefaultApplicationError extends Error - implements ErrorResponseModel { + implements ErrorResponseModel +{ public statusCode = 500; public messages: string[] = []; constructor(message?: string) { super(message); this.message = message || this.name; - this.name = 'DefaultApplicationError'; + this.name = "DefaultApplicationError"; this.messages.push(this.message); } } diff --git a/apis/authQuery/application/errors/email-validation-error.ts b/apis/authQuery/application/errors/email-validation-error.ts index 22ecabd..2f2fcb4 100644 --- a/apis/authQuery/application/errors/email-validation-error.ts +++ b/apis/authQuery/application/errors/email-validation-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class EmailValidationError extends DefaultApplicationError { statusCode = 400; - name = 'EmailValidationError'; + name = "EmailValidationError"; } diff --git a/apis/authQuery/application/errors/internal-server-error.ts b/apis/authQuery/application/errors/internal-server-error.ts index f92119c..86d7b4c 100644 --- a/apis/authQuery/application/errors/internal-server-error.ts +++ b/apis/authQuery/application/errors/internal-server-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class InternalServerError extends DefaultApplicationError { - name = 'InternalServerError'; + name = "InternalServerError"; statusCode = 500; } diff --git a/apis/authQuery/application/errors/not-found-error.ts b/apis/authQuery/application/errors/not-found-error.ts index 1e88132..7aea3a7 100644 --- a/apis/authQuery/application/errors/not-found-error.ts +++ b/apis/authQuery/application/errors/not-found-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class NotFoundError extends DefaultApplicationError { statusCode = 404; - name = 'NotFoundError'; + name = "NotFoundError"; } diff --git a/apis/authQuery/application/errors/password-validation-error.ts b/apis/authQuery/application/errors/password-validation-error.ts index 88736ea..dee948b 100644 --- a/apis/authQuery/application/errors/password-validation-error.ts +++ b/apis/authQuery/application/errors/password-validation-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class EmailValidationError extends DefaultApplicationError { statusCode = 400; - name = 'PasswordValidationError'; -} \ No newline at end of file + name = "PasswordValidationError"; +} diff --git a/apis/authQuery/application/errors/repository-error.ts b/apis/authQuery/application/errors/repository-error.ts index c87e1ab..1cc8b0c 100644 --- a/apis/authQuery/application/errors/repository-error.ts +++ b/apis/authQuery/application/errors/repository-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class RepositoryError extends DefaultApplicationError { - name = 'RepositoryError'; + name = "RepositoryError"; statusCode = 500; } diff --git a/apis/authQuery/application/errors/request-validation-error.ts b/apis/authQuery/application/errors/request-validation-error.ts index b34692d..8b3950c 100644 --- a/apis/authQuery/application/errors/request-validation-error.ts +++ b/apis/authQuery/application/errors/request-validation-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class RequestValidationError extends DefaultApplicationError { statusCode = 400; - name = 'RequestValidationError'; + name = "RequestValidationError"; } diff --git a/apis/authQuery/application/errors/sanitizer-error.ts b/apis/authQuery/application/errors/sanitizer-error.ts index 9fb0a7e..b0af29d 100644 --- a/apis/authQuery/application/errors/sanitizer-error.ts +++ b/apis/authQuery/application/errors/sanitizer-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class SanitizerError extends DefaultApplicationError { - name = 'SanitizerError'; + name = "SanitizerError"; statusCode = 400; } diff --git a/apis/authQuery/application/errors/unauthorized-error.ts b/apis/authQuery/application/errors/unauthorized-error.ts index 445a2fd..f748292 100644 --- a/apis/authQuery/application/errors/unauthorized-error.ts +++ b/apis/authQuery/application/errors/unauthorized-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class UnauthorizedError extends DefaultApplicationError { - name = 'UnauthorizedError'; + name = "UnauthorizedError"; statusCode = 401; } diff --git a/apis/authQuery/application/errors/user-exists-error.ts b/apis/authQuery/application/errors/user-exists-error.ts index 19e0586..878188c 100644 --- a/apis/authQuery/application/errors/user-exists-error.ts +++ b/apis/authQuery/application/errors/user-exists-error.ts @@ -1,6 +1,6 @@ -import { DefaultApplicationError } from './default-application-error'; +import { DefaultApplicationError } from "."; export class UserExistsError extends DefaultApplicationError { statusCode = 409; - name = 'UserExistsError'; + name = "UserExistsError"; } diff --git a/apis/authQuery/application/ports/index.ts b/apis/authQuery/application/ports/index.ts index ca9c79a..70fd665 100644 --- a/apis/authQuery/application/ports/index.ts +++ b/apis/authQuery/application/ports/index.ts @@ -1,11 +1,3 @@ -export * from './auth.service.interface'; -export * from './incident.repository.interface.ts'; -export * from './maintenance.repository.interface.ts'; -export * from './password.service.interface.ts'; -export * from './rental.repository.interface.ts'; -export * from './reservation.repository.interface.ts'; -export * from './scooter.repository.interface.ts'; -export * from './stock.repository.interface.ts'; -export * from './user.repository.interface'; -export * from './warranty.repository.interface.ts'; -export * from './notification.service.interface.ts'; \ No newline at end of file +export * from "./auth.service.interface"; +export * from "./password.service.interface"; +export * from "./user.repository.interface"; diff --git a/apis/authQuery/application/ports/user.repository.interface.ts b/apis/authQuery/application/ports/user.repository.interface.ts index acad1ac..230e5a0 100644 --- a/apis/authQuery/application/ports/user.repository.interface.ts +++ b/apis/authQuery/application/ports/user.repository.interface.ts @@ -1,7 +1,6 @@ -import { User } from '../../domain/entities'; +import { User } from "../../domain/entities"; export interface UserRepositoryInterface { - findByEmail(email: string): Promise; - create(user: User): Promise; + findAll(): Promise; } diff --git a/apis/authQuery/application/usecases/auth/getall.user.usecase.ts b/apis/authQuery/application/usecases/auth/getall.user.usecase.ts new file mode 100644 index 0000000..c4d8779 --- /dev/null +++ b/apis/authQuery/application/usecases/auth/getall.user.usecase.ts @@ -0,0 +1,30 @@ +import { User } from "../../../domain/entities"; +import { Role } from "../../../domain/enums"; +import { GetAllUserDTO } from "../../dtos/auth/getall.user.dto"; +import { BadRequestError, UnauthorizedError } from "../../errors"; +import { UserRepositoryInterface, AuthServiceInterface } from "../../ports"; + +export class GetAllUserUseCase { + private userRepository: UserRepositoryInterface; + private authService: AuthServiceInterface; + + constructor( + userRepository: UserRepositoryInterface, + authService: AuthServiceInterface, + ) { + this.userRepository = userRepository; + this.authService = authService; + } + + async execute(dto: GetAllUserDTO): Promise { + if (!dto || !dto.token) { + throw new BadRequestError(); + } + + const token = this.authService.verifyToken(dto.token); + if (!token || token.role !== Role.ADMIN) { + throw new UnauthorizedError(); + } + return this.userRepository.findAll(); + } +} diff --git a/apis/authQuery/application/usecases/auth/getone.user.usecase.ts b/apis/authQuery/application/usecases/auth/getone.user.usecase.ts new file mode 100644 index 0000000..180292a --- /dev/null +++ b/apis/authQuery/application/usecases/auth/getone.user.usecase.ts @@ -0,0 +1,27 @@ +import { BadRequestError, NotFoundError } from "../../errors"; +import { User } from "../../../domain/entities"; +import { UserRepositoryInterface } from "../../ports"; +import { GetOneUserDTO } from "../../dtos/auth/getone.user.dto"; + +export class GetOneUserUseCase { + private userRepository: UserRepositoryInterface; + + constructor(userRepository: UserRepositoryInterface) { + this.userRepository = userRepository; + } + + async execute(dto: GetOneUserDTO): Promise { + // Fail Fast: Vérifie si les données d’entrée sont valides + if (!dto || !dto.email) { + throw new BadRequestError(); + } + + // Récupère l’utilisateur via le repository + const user = await this.userRepository.findByEmail(dto.email); + if (!user) { + throw new NotFoundError(); + } + + return user; + } +} diff --git a/apis/authQuery/application/usecases/auth/login.usecase.ts b/apis/authQuery/application/usecases/auth/login.usecase.ts index 683fe07..9010f73 100644 --- a/apis/authQuery/application/usecases/auth/login.usecase.ts +++ b/apis/authQuery/application/usecases/auth/login.usecase.ts @@ -1,15 +1,15 @@ -import { UserRepositoryInterface } from "../../ports" -import { AuthServiceInterface } from "../../ports"; +import { UserRepositoryInterface, AuthServiceInterface } from "../../ports"; import { LoginUserDTO } from "../../dtos/auth"; -import { TokenHelper } from "../../../shared/helpers/token.helper"; import { BadRequestError, NotFoundError } from "../../errors"; export class LoginUseCase { - private userRepository: UserRepositoryInterface; private authService: AuthServiceInterface; - constructor(userRepository: UserRepositoryInterface, authService: AuthServiceInterface) { + constructor( + userRepository: UserRepositoryInterface, + authService: AuthServiceInterface, + ) { this.userRepository = userRepository; this.authService = authService; } diff --git a/apis/authQuery/infrastructure/databases/database.ts b/apis/authQuery/infrastructure/databases/database.ts index bf2bc81..7785c56 100644 --- a/apis/authQuery/infrastructure/databases/database.ts +++ b/apis/authQuery/infrastructure/databases/database.ts @@ -1,14 +1,16 @@ -import { SequelizeService } from "./sequelize"; +// import { SequelizeService } from "./sequelize"; import { MongooseService } from "./mongoose"; -const connectDB = async (DBType: string): Promise => { - if (DBType === "pgsql") { - return await SequelizeService.get(); - }; +const connectDB = async ( + DBType: string, +): Promise => { + // if (DBType === "pgsql") { + // return await SequelizeService.get(); + // }; if (DBType === "mongo") { return await MongooseService.get(); - }; + } return undefined; -} +}; export default connectDB; diff --git a/apis/authQuery/infrastructure/databases/index.ts b/apis/authQuery/infrastructure/databases/index.ts index 5b486c3..d2243ba 100644 --- a/apis/authQuery/infrastructure/databases/index.ts +++ b/apis/authQuery/infrastructure/databases/index.ts @@ -1,6 +1,5 @@ export * from "./mongoose"; -export * from "./sequelize"; -// export * from "./redis"; +// export * from "./sequelize"; // export * from "./inMemory"; export * from "./database"; export * from "./adapter"; diff --git a/apis/authQuery/infrastructure/databases/sequelize.ts b/apis/authQuery/infrastructure/databases/sequelize.ts index 1da5874..90d0431 100644 --- a/apis/authQuery/infrastructure/databases/sequelize.ts +++ b/apis/authQuery/infrastructure/databases/sequelize.ts @@ -1,44 +1,44 @@ -import { config } from "dotenv"; -import { Sequelize } from "sequelize"; -import { UserService } from "./user.service"; -import { Logger } from "../config/logger"; - -config(); -const logger = Logger.get(); - -export class SequelizeService { - private static instance?: SequelizeService; - - readonly sequelize: Sequelize; - readonly userService: UserService; - - private constructor(sequelize: Sequelize) { - this.sequelize = sequelize; - - this.userService = new UserService(this); - } - - public static async get(): Promise { - if (this.instance !== undefined) { - return this.instance; - } - const connection = await this.connect(); - this.instance = new SequelizeService(connection); - return this.instance; - } - - private static async connect(): Promise { - const sequelize = new Sequelize(process.env.POSTGRES_URI as string, { - dialect: "postgres", - logging: false, // Désactiver les logs SQL - }); - - try { - await sequelize.authenticate(); - } catch (error) { - logger.error( new Error("Impossible de se connecter à PostgreSQL :", error)); - } - - return sequelize; - } -} +// import { config } from "dotenv"; +// import { Sequelize } from "sequelize"; +// import { UserService } from "./user.service"; +// import { Logger } from "../config/logger"; + +// config(); +// const logger = Logger.get(); + +// export class SequelizeService { +// private static instance?: SequelizeService; + +// readonly sequelize: Sequelize; +// readonly userService: UserService; + +// private constructor(sequelize: Sequelize) { +// this.sequelize = sequelize; + +// this.userService = new UserService(this); +// } + +// public static async get(): Promise { +// if (this.instance !== undefined) { +// return this.instance; +// } +// const connection = await this.connect(); +// this.instance = new SequelizeService(connection); +// return this.instance; +// } + +// private static async connect(): Promise { +// const sequelize = new Sequelize(process.env.POSTGRES_URI as string, { +// dialect: "postgres", +// logging: false, // Désactiver les logs SQL +// }); + +// try { +// await sequelize.authenticate(); +// } catch (error) { +// logger.error( new Error("Impossible de se connecter à PostgreSQL :", error)); +// } + +// return sequelize; +// } +// } diff --git a/apis/authQuery/infrastructure/orms/mongoose/user.schema.ts b/apis/authQuery/infrastructure/orms/mongoose/user.schema.ts index e877cfa..b068fe0 100644 --- a/apis/authQuery/infrastructure/orms/mongoose/user.schema.ts +++ b/apis/authQuery/infrastructure/orms/mongoose/user.schema.ts @@ -48,12 +48,12 @@ export const userSchema = new Schema( role: { type: String, enum: Object.values(Role), - default: Role.Customer, + default: Role.CUSTOMER, }, }, { timestamps: true, collection: "users", versionKey: false, - } + }, ); diff --git a/apis/authQuery/infrastructure/repositories/index.ts b/apis/authQuery/infrastructure/repositories/index.ts index da83afc..2ccfbb8 100644 --- a/apis/authQuery/infrastructure/repositories/index.ts +++ b/apis/authQuery/infrastructure/repositories/index.ts @@ -1,5 +1,3 @@ -export * from "./repertory-choice"; -export * from "./sequelize/user.repository"; export * from "./mongoose/user.repository"; -export * from "./sequelize"; -export * from "./mongoose"; \ No newline at end of file +// export * from "./sequelize"; +export * from "./mongoose"; diff --git a/apis/authQuery/infrastructure/repositories/mongoose/user.repository.ts b/apis/authQuery/infrastructure/repositories/mongoose/user.repository.ts index 0b80ad0..3d3f662 100644 --- a/apis/authQuery/infrastructure/repositories/mongoose/user.repository.ts +++ b/apis/authQuery/infrastructure/repositories/mongoose/user.repository.ts @@ -1,26 +1,31 @@ import { Model } from "mongoose"; import { UserRepositoryInterface } from "../../../application/ports"; import { User } from "../../../domain/entities"; -import { userSchema } from "../../orm/mongoose"; +import { userSchema } from "../../orms/mongoose"; import { MongooseService } from "../../databases"; export class UserRepository implements UserRepositoryInterface { - readonly mongooseService: MongooseService; readonly model: Model; constructor(mongooseService: MongooseService) { this.mongooseService = mongooseService; const mongoose = this.mongooseService.mongoose; - this.model = mongoose.model("User",userSchema); - } - - create(user: User): Promise { - throw new Error("Method not implemented."); + this.model = mongoose.model("User", userSchema); } async findByEmail(email: string): Promise { const userData = await this.model.findOne({ email }); - return userData ? new User(userData.email, userData.password, userData.role, userData.id) : null; + return userData + ? new User(userData.email, userData.password, userData.role, userData.id) + : null; + } + + async findAll(): Promise { + // find all users without their password + const usersData = await this.model.find().select("-password"); + return usersData.map( + (userData) => new User(userData.email, userData.role, userData.id), + ); } } diff --git a/apis/authQuery/infrastructure/repositories/sequelize/index.ts b/apis/authQuery/infrastructure/repositories/sequelize/index.ts index e7ce7fd..e861d57 100644 --- a/apis/authQuery/infrastructure/repositories/sequelize/index.ts +++ b/apis/authQuery/infrastructure/repositories/sequelize/index.ts @@ -1 +1 @@ -export * from "./user.repository"; \ No newline at end of file +// export * from "./user.repository"; diff --git a/apis/authQuery/package.json b/apis/authQuery/package.json index 62f664d..7492aa1 100644 --- a/apis/authQuery/package.json +++ b/apis/authQuery/package.json @@ -31,7 +31,7 @@ "winston-daily-rotate-file": "^5.0.0" }, "devDependencies": { - "@types/bcryptjs": "^2.4.6", + "@types/bcrypt": "^5.0.2", "@types/cors": "^2.8.17", "@types/express": "^5.0.0", "@types/jsonwebtoken": "^9.0.8", diff --git a/apis/authQuery/shared/helpers/password.helper.ts b/apis/authQuery/shared/helpers/password.helper.ts index b20a22c..1f01f69 100644 --- a/apis/authQuery/shared/helpers/password.helper.ts +++ b/apis/authQuery/shared/helpers/password.helper.ts @@ -1,10 +1,9 @@ -import bcrypt from 'bcryptjs'; -import { Logger } from '../../config/logger'; -import { PasswordServiceInterface } from '../../application/ports/password.service.interface'; +import bcrypt from "bcrypt"; +import { Logger } from "../../config/logger"; +import { PasswordServiceInterface } from "../../application/ports/password.service.interface"; const logger = Logger.get(); export class PasswordHelper implements PasswordServiceInterface { - private saltRounds: number; constructor(saltRounds: number = 10) { @@ -29,4 +28,4 @@ export class PasswordHelper implements PasswordServiceInterface { throw new Error("Erreur lors de la comparaison des mots de passe"); } } -} \ No newline at end of file +} diff --git a/apis/authQuery/tsconfig.json b/apis/authQuery/tsconfig.json index eec3b81..8d1864b 100644 --- a/apis/authQuery/tsconfig.json +++ b/apis/authQuery/tsconfig.json @@ -9,10 +9,9 @@ "outDir": "dist", "moduleResolution": "node", "strict": true, - "declaration": true + "declaration": true, + "declarationDir": "./types" }, - "exclude": ["node_modules"], - "typeRoots": [ - "node_modules/@types" - ] -} \ No newline at end of file + "exclude": ["node_modules", "dist", "**/*.d.ts"], + "typeRoots": ["node_modules/@types"] +} diff --git a/apis/authQuery/types/application/dtos/auth/getall.user.dto.d.ts b/apis/authQuery/types/application/dtos/auth/getall.user.dto.d.ts new file mode 100644 index 0000000..bcfd406 --- /dev/null +++ b/apis/authQuery/types/application/dtos/auth/getall.user.dto.d.ts @@ -0,0 +1,3 @@ +export interface GetAllUserDTO { + token: string; +} diff --git a/apis/authQuery/types/application/dtos/auth/getone.user.dto.d.ts b/apis/authQuery/types/application/dtos/auth/getone.user.dto.d.ts new file mode 100644 index 0000000..49bb70d --- /dev/null +++ b/apis/authQuery/types/application/dtos/auth/getone.user.dto.d.ts @@ -0,0 +1,4 @@ +export interface GetOneUserDTO { + email: string; + token: string; +} diff --git a/apis/authQuery/types/application/dtos/auth/index.d.ts b/apis/authQuery/types/application/dtos/auth/index.d.ts new file mode 100644 index 0000000..6ba6967 --- /dev/null +++ b/apis/authQuery/types/application/dtos/auth/index.d.ts @@ -0,0 +1 @@ +export * from "./login.user.dto"; diff --git a/apis/authQuery/types/application/dtos/auth/login.user.dto.d.ts b/apis/authQuery/types/application/dtos/auth/login.user.dto.d.ts new file mode 100644 index 0000000..5c02594 --- /dev/null +++ b/apis/authQuery/types/application/dtos/auth/login.user.dto.d.ts @@ -0,0 +1,4 @@ +export interface LoginUserDTO { + email: string; + password: string; +} diff --git a/apis/authQuery/types/application/errors/bad-request-error.d.ts b/apis/authQuery/types/application/errors/bad-request-error.d.ts new file mode 100644 index 0000000..010153b --- /dev/null +++ b/apis/authQuery/types/application/errors/bad-request-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "./default-application-error"; +export declare class BadRequestError extends DefaultApplicationError { + name: string; + statusCode: number; +} diff --git a/apis/authQuery/types/application/errors/date-time-error.d.ts b/apis/authQuery/types/application/errors/date-time-error.d.ts new file mode 100644 index 0000000..5166451 --- /dev/null +++ b/apis/authQuery/types/application/errors/date-time-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "./default-application-error"; +export declare class DateTimeError extends DefaultApplicationError { + statusCode: number; + name: string; +} diff --git a/apis/authQuery/types/application/errors/default-application-error.d.ts b/apis/authQuery/types/application/errors/default-application-error.d.ts new file mode 100644 index 0000000..acd3957 --- /dev/null +++ b/apis/authQuery/types/application/errors/default-application-error.d.ts @@ -0,0 +1,14 @@ +import { ResponseModel } from "../ports/responses/response.interface"; +export type ErrorParams = { + name?: string; + message?: string; + statusCode?: number; + messages?: string[]; + stack?: Error["stack"]; +}; +export type ErrorResponseModel = Omit, "body">; +export declare class DefaultApplicationError extends Error implements ErrorResponseModel { + statusCode: number; + messages: string[]; + constructor(message?: string); +} diff --git a/apis/authQuery/types/application/errors/email-validation-error.d.ts b/apis/authQuery/types/application/errors/email-validation-error.d.ts new file mode 100644 index 0000000..25214d2 --- /dev/null +++ b/apis/authQuery/types/application/errors/email-validation-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class EmailValidationError extends DefaultApplicationError { + statusCode: number; + name: string; +} diff --git a/apis/authQuery/types/application/errors/index.d.ts b/apis/authQuery/types/application/errors/index.d.ts new file mode 100644 index 0000000..885142d --- /dev/null +++ b/apis/authQuery/types/application/errors/index.d.ts @@ -0,0 +1,11 @@ +export * from './bad-request-error'; +export * from './date-time-error'; +export * from './default-application-error'; +export * from './email-validation-error'; +export * from './internal-server-error'; +export * from './not-found-error'; +export * from './repository-error'; +export * from './request-validation-error'; +export * from './sanitizer-error'; +export * from './unauthorized-error'; +export * from './user-exists-error'; diff --git a/apis/authQuery/types/application/errors/internal-server-error.d.ts b/apis/authQuery/types/application/errors/internal-server-error.d.ts new file mode 100644 index 0000000..71248bf --- /dev/null +++ b/apis/authQuery/types/application/errors/internal-server-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class InternalServerError extends DefaultApplicationError { + name: string; + statusCode: number; +} diff --git a/apis/authQuery/types/application/errors/not-found-error.d.ts b/apis/authQuery/types/application/errors/not-found-error.d.ts new file mode 100644 index 0000000..309258a --- /dev/null +++ b/apis/authQuery/types/application/errors/not-found-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class NotFoundError extends DefaultApplicationError { + statusCode: number; + name: string; +} diff --git a/apis/authQuery/types/application/errors/password-validation-error.d.ts b/apis/authQuery/types/application/errors/password-validation-error.d.ts new file mode 100644 index 0000000..25214d2 --- /dev/null +++ b/apis/authQuery/types/application/errors/password-validation-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class EmailValidationError extends DefaultApplicationError { + statusCode: number; + name: string; +} diff --git a/apis/authQuery/types/application/errors/repository-error.d.ts b/apis/authQuery/types/application/errors/repository-error.d.ts new file mode 100644 index 0000000..0cb164f --- /dev/null +++ b/apis/authQuery/types/application/errors/repository-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class RepositoryError extends DefaultApplicationError { + name: string; + statusCode: number; +} diff --git a/apis/authQuery/types/application/errors/request-validation-error.d.ts b/apis/authQuery/types/application/errors/request-validation-error.d.ts new file mode 100644 index 0000000..361f4dc --- /dev/null +++ b/apis/authQuery/types/application/errors/request-validation-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class RequestValidationError extends DefaultApplicationError { + statusCode: number; + name: string; +} diff --git a/apis/authQuery/types/application/errors/sanitizer-error.d.ts b/apis/authQuery/types/application/errors/sanitizer-error.d.ts new file mode 100644 index 0000000..e6ab06d --- /dev/null +++ b/apis/authQuery/types/application/errors/sanitizer-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class SanitizerError extends DefaultApplicationError { + name: string; + statusCode: number; +} diff --git a/apis/authQuery/types/application/errors/unauthorized-error.d.ts b/apis/authQuery/types/application/errors/unauthorized-error.d.ts new file mode 100644 index 0000000..dba1ccd --- /dev/null +++ b/apis/authQuery/types/application/errors/unauthorized-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class UnauthorizedError extends DefaultApplicationError { + name: string; + statusCode: number; +} diff --git a/apis/authQuery/types/application/errors/user-exists-error.d.ts b/apis/authQuery/types/application/errors/user-exists-error.d.ts new file mode 100644 index 0000000..30fbd45 --- /dev/null +++ b/apis/authQuery/types/application/errors/user-exists-error.d.ts @@ -0,0 +1,5 @@ +import { DefaultApplicationError } from "."; +export declare class UserExistsError extends DefaultApplicationError { + statusCode: number; + name: string; +} diff --git a/apis/authQuery/types/application/ports/auth.service.interface.d.ts b/apis/authQuery/types/application/ports/auth.service.interface.d.ts new file mode 100644 index 0000000..5f6c04e --- /dev/null +++ b/apis/authQuery/types/application/ports/auth.service.interface.d.ts @@ -0,0 +1,5 @@ +import { User } from "../../domain/entities"; +export interface AuthServiceInterface { + generateToken(user: User): string; + verifyToken(token: string): User; +} diff --git a/apis/authQuery/types/application/ports/index.d.ts b/apis/authQuery/types/application/ports/index.d.ts new file mode 100644 index 0000000..70fd665 --- /dev/null +++ b/apis/authQuery/types/application/ports/index.d.ts @@ -0,0 +1,3 @@ +export * from "./auth.service.interface"; +export * from "./password.service.interface"; +export * from "./user.repository.interface"; diff --git a/apis/authQuery/types/application/ports/password.service.interface.d.ts b/apis/authQuery/types/application/ports/password.service.interface.d.ts new file mode 100644 index 0000000..9d4cc1c --- /dev/null +++ b/apis/authQuery/types/application/ports/password.service.interface.d.ts @@ -0,0 +1,4 @@ +export interface PasswordServiceInterface { + hash(password: string): Promise; + compare(password: string, hash: string): Promise; +} diff --git a/apis/authQuery/types/application/ports/responses/response.interface.d.ts b/apis/authQuery/types/application/ports/responses/response.interface.d.ts new file mode 100644 index 0000000..1b32f49 --- /dev/null +++ b/apis/authQuery/types/application/ports/responses/response.interface.d.ts @@ -0,0 +1,4 @@ +export interface ResponseModel { + body: T; + statusCode: number; +} diff --git a/apis/authQuery/types/application/ports/user.repository.interface.d.ts b/apis/authQuery/types/application/ports/user.repository.interface.d.ts new file mode 100644 index 0000000..7bff215 --- /dev/null +++ b/apis/authQuery/types/application/ports/user.repository.interface.d.ts @@ -0,0 +1,5 @@ +import { User } from "../../domain/entities"; +export interface UserRepositoryInterface { + findByEmail(email: string): Promise; + findAll(): Promise; +} diff --git a/apis/authQuery/types/application/usecases/auth/getall.user.usecase.d.ts b/apis/authQuery/types/application/usecases/auth/getall.user.usecase.d.ts new file mode 100644 index 0000000..9724189 --- /dev/null +++ b/apis/authQuery/types/application/usecases/auth/getall.user.usecase.d.ts @@ -0,0 +1,9 @@ +import { User } from "../../../domain/entities"; +import { GetAllUserDTO } from "../../dtos/auth/getall.user.dto"; +import { UserRepositoryInterface, AuthServiceInterface } from "../../ports"; +export declare class GetAllUserUseCase { + private userRepository; + private authService; + constructor(userRepository: UserRepositoryInterface, authService: AuthServiceInterface); + execute(dto: GetAllUserDTO): Promise; +} diff --git a/apis/authQuery/types/application/usecases/auth/getone.user.usecase.d.ts b/apis/authQuery/types/application/usecases/auth/getone.user.usecase.d.ts new file mode 100644 index 0000000..ba78367 --- /dev/null +++ b/apis/authQuery/types/application/usecases/auth/getone.user.usecase.d.ts @@ -0,0 +1,8 @@ +import { User } from "../../../domain/entities"; +import { UserRepositoryInterface } from "../../ports"; +import { GetOneUserDTO } from "../../dtos/auth/getone.user.dto"; +export declare class GetOneUserUseCase { + private userRepository; + constructor(userRepository: UserRepositoryInterface); + execute(dto: GetOneUserDTO): Promise; +} diff --git a/apis/authQuery/types/application/usecases/auth/login.usecase.d.ts b/apis/authQuery/types/application/usecases/auth/login.usecase.d.ts new file mode 100644 index 0000000..0519cbb --- /dev/null +++ b/apis/authQuery/types/application/usecases/auth/login.usecase.d.ts @@ -0,0 +1,8 @@ +import { UserRepositoryInterface, AuthServiceInterface } from "../../ports"; +import { LoginUserDTO } from "../../dtos/auth"; +export declare class LoginUseCase { + private userRepository; + private authService; + constructor(userRepository: UserRepositoryInterface, authService: AuthServiceInterface); + execute(dto: LoginUserDTO): Promise; +} diff --git a/apis/authQuery/types/config/cors.d.ts b/apis/authQuery/types/config/cors.d.ts new file mode 100644 index 0000000..ae1af0f --- /dev/null +++ b/apis/authQuery/types/config/cors.d.ts @@ -0,0 +1,3 @@ +import { Application } from 'express'; +declare const configureCORS: (app: Application) => void; +export default configureCORS; diff --git a/apis/authQuery/types/config/helmet.d.ts b/apis/authQuery/types/config/helmet.d.ts new file mode 100644 index 0000000..8464d96 --- /dev/null +++ b/apis/authQuery/types/config/helmet.d.ts @@ -0,0 +1,3 @@ +import { Application } from 'express'; +declare const configureHelmet: (app: Application) => void; +export default configureHelmet; diff --git a/apis/authQuery/types/config/logger.d.ts b/apis/authQuery/types/config/logger.d.ts new file mode 100644 index 0000000..446b22b --- /dev/null +++ b/apis/authQuery/types/config/logger.d.ts @@ -0,0 +1,22 @@ +import winston from "winston"; +import "winston-daily-rotate-file"; +export declare class Logger { + private static instance; + private logger; + private readonly level; + private readonly levels; + private readonly colors; + private readonly format; + private constructor(); + private createTransports; + private createExceptionHandlers; + private createDailyRotateFile; + private handleUnhandledRejections; + static get(): Logger; + error(message: Error): void; + warn(message: string): void; + info(message: string): void; + http(message: string): void; + debug(message: string): void; + getLogger(): winston.Logger; +} diff --git a/apis/authQuery/types/domain/entities/index.d.ts b/apis/authQuery/types/domain/entities/index.d.ts new file mode 100644 index 0000000..7616f9e --- /dev/null +++ b/apis/authQuery/types/domain/entities/index.d.ts @@ -0,0 +1 @@ +export * from "./user"; diff --git a/apis/authQuery/types/domain/entities/user.d.ts b/apis/authQuery/types/domain/entities/user.d.ts new file mode 100644 index 0000000..3c2d96e --- /dev/null +++ b/apis/authQuery/types/domain/entities/user.d.ts @@ -0,0 +1,13 @@ +import { Role } from '../enums'; +import { UserInterface } from '../interfaces'; +export declare class User implements UserInterface { + id: string; + email: string; + password: string; + role: Role; + firstName?: string; + lastName?: string; + phone?: string; + constructor(email: string, password: string, role?: Role, id?: string); + isValidPassword(password: string, hashedPassword: string): Promise; +} diff --git a/apis/authQuery/types/domain/enums/index.d.ts b/apis/authQuery/types/domain/enums/index.d.ts new file mode 100644 index 0000000..f739fe8 --- /dev/null +++ b/apis/authQuery/types/domain/enums/index.d.ts @@ -0,0 +1 @@ +export * from "./user.role.enum"; diff --git a/apis/authQuery/types/domain/enums/user.role.enum.d.ts b/apis/authQuery/types/domain/enums/user.role.enum.d.ts new file mode 100644 index 0000000..3ed3847 --- /dev/null +++ b/apis/authQuery/types/domain/enums/user.role.enum.d.ts @@ -0,0 +1,5 @@ +export declare enum Role { + ADMIN = "superAdmin", + OWNER = "owner", + CUSTOMER = "customer" +} diff --git a/apis/authQuery/types/domain/interfaces/incident.interface.d.ts b/apis/authQuery/types/domain/interfaces/incident.interface.d.ts new file mode 100644 index 0000000..a03eb73 --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/incident.interface.d.ts @@ -0,0 +1,13 @@ +import { IncidentStatus } from "../enums"; +export interface IncidentInterface { + id: string; + scooterId: string; + customerId: string; + ReservationId: string; + description: string; + location: string; + severity: number; + status: IncidentStatus; + reportedAt: Date; + resolvedAt: Date | null; +} diff --git a/apis/authQuery/types/domain/interfaces/index.d.ts b/apis/authQuery/types/domain/interfaces/index.d.ts new file mode 100644 index 0000000..15b951b --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/index.d.ts @@ -0,0 +1,2 @@ +export * from "./timestamp.interface"; +export * from "./user.interface"; diff --git a/apis/authQuery/types/domain/interfaces/maintenance.interface.d.ts b/apis/authQuery/types/domain/interfaces/maintenance.interface.d.ts new file mode 100644 index 0000000..21c1d40 --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/maintenance.interface.d.ts @@ -0,0 +1,10 @@ +import { MaintenanceType } from "../enums"; +export interface MaintenanceInterface { + id: string; + scooterId: string; + technicianId: string; + type: MaintenanceType; + date: Date; + details: string; + cost: number; +} diff --git a/apis/authQuery/types/domain/interfaces/rental.interface.d.ts b/apis/authQuery/types/domain/interfaces/rental.interface.d.ts new file mode 100644 index 0000000..5a96572 --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/rental.interface.d.ts @@ -0,0 +1,10 @@ +import { RentalStatus } from "../enums"; +export interface RentalInterface { + id: string; + scooterId: string; + customerId: string; + startDate: Date; + endDate?: Date | undefined; + status: RentalStatus; + totalPrice?: number; +} diff --git a/apis/authQuery/types/domain/interfaces/reservation.interface.d.ts b/apis/authQuery/types/domain/interfaces/reservation.interface.d.ts new file mode 100644 index 0000000..40dc07d --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/reservation.interface.d.ts @@ -0,0 +1,8 @@ +export interface ReservationInterface { + id: string; + customerId: string; + scooterId: string; + date: Date; + duration: number; + location: string; +} diff --git a/apis/authQuery/types/domain/interfaces/scooter.interface.d.ts b/apis/authQuery/types/domain/interfaces/scooter.interface.d.ts new file mode 100644 index 0000000..815807f --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/scooter.interface.d.ts @@ -0,0 +1,9 @@ +import { ScooterStatus } from "../enums"; +export interface ScooterInterface { + id: string; + model: string; + status: ScooterStatus; + lastMaintenanceDate: Date; + totalKilometers: number; + chargeCycles: number; +} diff --git a/apis/authQuery/types/domain/interfaces/stock.order.interface.d.ts b/apis/authQuery/types/domain/interfaces/stock.order.interface.d.ts new file mode 100644 index 0000000..739fec9 --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/stock.order.interface.d.ts @@ -0,0 +1,11 @@ +import { StockOrderStatus } from "../enums"; +export interface StockOrderInterface { + id: string; + partnerName: string; + supplier: string; + quantity: number; + unitPrice: number; + orderDate: Date; + deliveryDate?: Date; + status: StockOrderStatus; +} diff --git a/apis/authQuery/types/domain/interfaces/stock.piece.interface.d.ts b/apis/authQuery/types/domain/interfaces/stock.piece.interface.d.ts new file mode 100644 index 0000000..982a469 --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/stock.piece.interface.d.ts @@ -0,0 +1,9 @@ +export interface StockPieceInterface { + id: string; + name: string; + category: string; + quantity: number; + minThreshold: number; + supplier: string; + unitPrice: number; +} diff --git a/apis/authQuery/types/domain/interfaces/timestamp.interface.d.ts b/apis/authQuery/types/domain/interfaces/timestamp.interface.d.ts new file mode 100644 index 0000000..f59ce10 --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/timestamp.interface.d.ts @@ -0,0 +1,4 @@ +export interface Timestamps { + createdAt: Date; + updatedAt: Date; +} diff --git a/apis/authQuery/types/domain/interfaces/user.interface.d.ts b/apis/authQuery/types/domain/interfaces/user.interface.d.ts new file mode 100644 index 0000000..8bffa70 --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/user.interface.d.ts @@ -0,0 +1,9 @@ +export interface UserInterface { + id: string; + firstName?: string; + lastName?: string; + email: string; + password: string; + role: string; + phone?: string; +} diff --git a/apis/authQuery/types/domain/interfaces/warranty.interface.d.ts b/apis/authQuery/types/domain/interfaces/warranty.interface.d.ts new file mode 100644 index 0000000..3a8fad5 --- /dev/null +++ b/apis/authQuery/types/domain/interfaces/warranty.interface.d.ts @@ -0,0 +1,9 @@ +import { WarrantyStatus } from "../enums"; +export interface WarrantyInterface { + id: string; + scooterId: string; + coveredParts: string[]; + startDate: Date; + endDate: Date; + status: WarrantyStatus; +} diff --git a/apis/authQuery/types/infrastructure/databases/adapter.d.ts b/apis/authQuery/types/infrastructure/databases/adapter.d.ts new file mode 100644 index 0000000..89fdd15 --- /dev/null +++ b/apis/authQuery/types/infrastructure/databases/adapter.d.ts @@ -0,0 +1,5 @@ +export interface Adapter { + get(): Promise; + connect(): Promise; + disconnect(): Promise; +} diff --git a/apis/authQuery/types/infrastructure/databases/database.d.ts b/apis/authQuery/types/infrastructure/databases/database.d.ts new file mode 100644 index 0000000..4b4e483 --- /dev/null +++ b/apis/authQuery/types/infrastructure/databases/database.d.ts @@ -0,0 +1,3 @@ +import { MongooseService } from "./mongoose"; +declare const connectDB: (DBType: string) => Promise; +export default connectDB; diff --git a/apis/authQuery/types/infrastructure/databases/index.d.ts b/apis/authQuery/types/infrastructure/databases/index.d.ts new file mode 100644 index 0000000..a898acf --- /dev/null +++ b/apis/authQuery/types/infrastructure/databases/index.d.ts @@ -0,0 +1,3 @@ +export * from "./mongoose"; +export * from "./database"; +export * from "./adapter"; diff --git a/apis/authQuery/types/infrastructure/databases/mongoose.d.ts b/apis/authQuery/types/infrastructure/databases/mongoose.d.ts new file mode 100644 index 0000000..e3c71f4 --- /dev/null +++ b/apis/authQuery/types/infrastructure/databases/mongoose.d.ts @@ -0,0 +1,14 @@ +import { Mongoose } from "mongoose"; +import { UserRepository } from "../repositories/mongoose"; +import { Adapter } from "./adapter"; +export declare class MongooseService implements Adapter { + private static instance?; + readonly mongoose: Mongoose; + readonly userRepository: UserRepository; + private constructor(); + get(): Promise; + connect(): Promise; + static get(): Promise; + private static connect; + disconnect(): Promise; +} diff --git a/apis/authQuery/types/infrastructure/databases/sequelize.d.ts b/apis/authQuery/types/infrastructure/databases/sequelize.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/authQuery/types/infrastructure/orms/adapter.d.ts b/apis/authQuery/types/infrastructure/orms/adapter.d.ts new file mode 100644 index 0000000..89fdd15 --- /dev/null +++ b/apis/authQuery/types/infrastructure/orms/adapter.d.ts @@ -0,0 +1,5 @@ +export interface Adapter { + get(): Promise; + connect(): Promise; + disconnect(): Promise; +} diff --git a/apis/authQuery/types/infrastructure/orms/mongoose/index.d.ts b/apis/authQuery/types/infrastructure/orms/mongoose/index.d.ts new file mode 100644 index 0000000..baedd6d --- /dev/null +++ b/apis/authQuery/types/infrastructure/orms/mongoose/index.d.ts @@ -0,0 +1 @@ +export * from './user.schema'; diff --git a/apis/authQuery/types/infrastructure/orms/mongoose/user.schema.d.ts b/apis/authQuery/types/infrastructure/orms/mongoose/user.schema.d.ts new file mode 100644 index 0000000..d1f794b --- /dev/null +++ b/apis/authQuery/types/infrastructure/orms/mongoose/user.schema.d.ts @@ -0,0 +1,38 @@ +import { Schema } from "mongoose"; +import { User } from "../../../domain/entities"; +/** + * @swagger + * components: + * schemas: + * User: + * type: object + * required: + * - email + * - password + * - role + * properties: + * email: + * type: string + * description: L'email de l'utilisateur + * password: + * type: string + * description: Le mot de passe de l'utilisateur + * role: + * type: string + * enum: [ROLE_USER, ROLE_STORE_KEEPER, ROLE_ADMIN, ROLE_COMPTA] + * default: ROLE_USER + * description: Le rôle de l'utilisateur + * example: + * email: john.doe@toto.com + * password: password + * role: ROLE_USER + */ +export declare const userSchema: Schema & User & { + _id: import("mongoose").Types.ObjectId; +} & { + __v: number; +}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, User, import("mongoose").Document> & import("mongoose").FlatRecord & { + _id: import("mongoose").Types.ObjectId; +} & { + __v: number; +}>; diff --git a/apis/authQuery/types/infrastructure/repositories/index.d.ts b/apis/authQuery/types/infrastructure/repositories/index.d.ts new file mode 100644 index 0000000..36a4e7d --- /dev/null +++ b/apis/authQuery/types/infrastructure/repositories/index.d.ts @@ -0,0 +1,2 @@ +export * from "./mongoose/user.repository"; +export * from "./mongoose"; diff --git a/apis/authQuery/types/infrastructure/repositories/mongoose/index.d.ts b/apis/authQuery/types/infrastructure/repositories/mongoose/index.d.ts new file mode 100644 index 0000000..9ab129a --- /dev/null +++ b/apis/authQuery/types/infrastructure/repositories/mongoose/index.d.ts @@ -0,0 +1 @@ +export * from "./user.repository"; diff --git a/apis/authQuery/types/infrastructure/repositories/mongoose/user.repository.d.ts b/apis/authQuery/types/infrastructure/repositories/mongoose/user.repository.d.ts new file mode 100644 index 0000000..a5af802 --- /dev/null +++ b/apis/authQuery/types/infrastructure/repositories/mongoose/user.repository.d.ts @@ -0,0 +1,11 @@ +import { Model } from "mongoose"; +import { UserRepositoryInterface } from "../../../application/ports"; +import { User } from "../../../domain/entities"; +import { MongooseService } from "../../databases"; +export declare class UserRepository implements UserRepositoryInterface { + readonly mongooseService: MongooseService; + readonly model: Model; + constructor(mongooseService: MongooseService); + findByEmail(email: string): Promise; + findAll(): Promise; +} diff --git a/apis/authQuery/types/infrastructure/repositories/sequelize/index.d.ts b/apis/authQuery/types/infrastructure/repositories/sequelize/index.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/authQuery/types/infrastructure/repositories/sequelize/user.repository.d.ts b/apis/authQuery/types/infrastructure/repositories/sequelize/user.repository.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/apis/authQuery/types/interface/controllers/auth/sign-in.controller.d.ts b/apis/authQuery/types/interface/controllers/auth/sign-in.controller.d.ts new file mode 100644 index 0000000..7053dc5 --- /dev/null +++ b/apis/authQuery/types/interface/controllers/auth/sign-in.controller.d.ts @@ -0,0 +1,37 @@ +import { Request, Response } from "express"; +export declare class SignInController { + /** + * @swagger + * /api/auth/login: + * post: + * summary: Login a user + * tags: [Auth] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * required: + * - email + * - password + * properties: + * email: + * type: string + * description: Email de l'utilisateur + * password: + * type: string + * description: Mot de passe de l'utilisateur + * example: + * email: johndoe@example.com + * password: myPassword123 + * responses: + * 200: + * description: User logged in successfully and Session created + * 400: + * description: Invalid credentials + * 404: + * description: User not found + */ + login(req: Request, res: Response): Promise; +} diff --git a/apis/authQuery/types/interface/controllers/auth/sign-up.controller.d.ts b/apis/authQuery/types/interface/controllers/auth/sign-up.controller.d.ts new file mode 100644 index 0000000..9ff0907 --- /dev/null +++ b/apis/authQuery/types/interface/controllers/auth/sign-up.controller.d.ts @@ -0,0 +1,40 @@ +import { Request, Response } from "express"; +export declare class SignInController { + /** + * @swagger + * /auth/register: + * post: + * summary: Register a new user + * tags: [Auth] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * required: + * - email + * - password + * properties: + * email: + * type: string + * description: The user's email + * password: + * type: string + * description: The user's password + * responses: + * 201: + * description: The created user + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/User' + * 400: + * description: Email and password are required + * 409: + * description: Email already exists + * 500: + * description: Internal server error + */ + register(req: Request, res: Response): Promise; +} diff --git a/apis/authQuery/types/interface/docs/swagger.d.ts b/apis/authQuery/types/interface/docs/swagger.d.ts new file mode 100644 index 0000000..4aed7c9 --- /dev/null +++ b/apis/authQuery/types/interface/docs/swagger.d.ts @@ -0,0 +1,2 @@ +declare const swaggerSpec: object; +export default swaggerSpec; diff --git a/apis/authQuery/types/interface/middlewares/bcrypt.d.ts b/apis/authQuery/types/interface/middlewares/bcrypt.d.ts new file mode 100644 index 0000000..07629ed --- /dev/null +++ b/apis/authQuery/types/interface/middlewares/bcrypt.d.ts @@ -0,0 +1,6 @@ +export declare class Bcrypt { + private saltRounds; + constructor(saltRounds?: number); + hashPassword(password: string): Promise; + comparePassword(password: string, hash: string): Promise; +} diff --git a/apis/authQuery/types/interface/middlewares/errorHandler.d.ts b/apis/authQuery/types/interface/middlewares/errorHandler.d.ts new file mode 100644 index 0000000..ee7baee --- /dev/null +++ b/apis/authQuery/types/interface/middlewares/errorHandler.d.ts @@ -0,0 +1,3 @@ +import { NextFunction, Request, Response } from "express"; +declare const errorHandler: () => (err: any, req: Request, res: Response, next: NextFunction) => void; +export default errorHandler; diff --git a/apis/authQuery/types/interface/middlewares/jwt.d.ts b/apis/authQuery/types/interface/middlewares/jwt.d.ts new file mode 100644 index 0000000..ce810ab --- /dev/null +++ b/apis/authQuery/types/interface/middlewares/jwt.d.ts @@ -0,0 +1,4 @@ +import { NextFunction, Request, Response } from "express"; +declare const generateToken: (user: any) => string; +declare const authenticateToken: (req: Request, res: Response, next: NextFunction) => void; +export { authenticateToken, generateToken }; diff --git a/apis/authQuery/types/interface/middlewares/validateRole.d.ts b/apis/authQuery/types/interface/middlewares/validateRole.d.ts new file mode 100644 index 0000000..de602d5 --- /dev/null +++ b/apis/authQuery/types/interface/middlewares/validateRole.d.ts @@ -0,0 +1,10 @@ +import { Request, Response, NextFunction } from "express"; +import { Role } from "../models"; +export declare const validateRole: (req: Request, res: Response, next: NextFunction, role: Role[]) => Promise; +export declare const validateRoleAdmin: (req: Request, res: Response, next: NextFunction) => Promise; +export declare const validateRoleOwner: (req: Request, res: Response, next: NextFunction) => Promise; +export declare const validateRoleCustomer: (req: Request, res: Response, next: NextFunction) => Promise; +export declare const validateRoleAdminOwner: (req: Request, res: Response, next: NextFunction) => Promise; +export declare const validateRoleAdminCustomer: (req: Request, res: Response, next: NextFunction) => Promise; +export declare const validateRoleOwnerCustomer: (req: Request, res: Response, next: NextFunction) => Promise; +export declare const validateRoleAll: (req: Request, res: Response, next: NextFunction) => Promise; diff --git a/apis/authQuery/types/interface/routes/auth.routes.d.ts b/apis/authQuery/types/interface/routes/auth.routes.d.ts new file mode 100644 index 0000000..ae2ab41 --- /dev/null +++ b/apis/authQuery/types/interface/routes/auth.routes.d.ts @@ -0,0 +1,2 @@ +declare const router: import("express-serve-static-core").Router; +export default router; diff --git a/apis/authQuery/types/server.d.ts b/apis/authQuery/types/server.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/apis/authQuery/types/server.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/apis/authQuery/types/shared/helpers/password.helper.d.ts b/apis/authQuery/types/shared/helpers/password.helper.d.ts new file mode 100644 index 0000000..318d8a3 --- /dev/null +++ b/apis/authQuery/types/shared/helpers/password.helper.d.ts @@ -0,0 +1,7 @@ +import { PasswordServiceInterface } from "../../application/ports/password.service.interface"; +export declare class PasswordHelper implements PasswordServiceInterface { + private saltRounds; + constructor(saltRounds?: number); + hash(password: string): Promise; + compare(password: string, hash: string): Promise; +} diff --git a/apis/authQuery/types/shared/helpers/token.helper.d.ts b/apis/authQuery/types/shared/helpers/token.helper.d.ts new file mode 100644 index 0000000..4c80d53 --- /dev/null +++ b/apis/authQuery/types/shared/helpers/token.helper.d.ts @@ -0,0 +1,8 @@ +import { AuthServiceInterface } from '../../application/ports'; +import { User } from '../../domain/entities'; +export declare class TokenHelper implements AuthServiceInterface { + private secret; + constructor(); + generateToken(user: User): string; + verifyToken(token: string): any; +} diff --git a/apis/authQuery/types/shared/validators/env.d.ts b/apis/authQuery/types/shared/validators/env.d.ts new file mode 100644 index 0000000..e69de29 From bd270a4882e4574db8e3575f90c51280b10b0bdb Mon Sep 17 00:00:00 2001 From: horotopia Date: Tue, 25 Feb 2025 14:50:13 +0100 Subject: [PATCH 5/7] update authCommand --- apis/authCommand/Domain/Entities/index.ts | 10 +--- .../usecases/auth/change.password.usecase.ts | 55 +++++++++++-------- .../usecases/auth/change.role.usecase.ts | 23 ++++---- .../usecases/auth/update.usecase.ts | 15 ++--- 4 files changed, 53 insertions(+), 50 deletions(-) diff --git a/apis/authCommand/Domain/Entities/index.ts b/apis/authCommand/Domain/Entities/index.ts index 6eacc25..7616f9e 100644 --- a/apis/authCommand/Domain/Entities/index.ts +++ b/apis/authCommand/Domain/Entities/index.ts @@ -1,9 +1 @@ -// export * from "./incident" -// export * from "./maintenance" -// export * from "./rental" -// export * from "./reservation" -// export * from "./scooter" -// export * from "./stockOrder" -// export * from "./stockPiece" -export * from "./user" -// export * from "./warranty" \ No newline at end of file +export * from "./user"; diff --git a/apis/authCommand/application/usecases/auth/change.password.usecase.ts b/apis/authCommand/application/usecases/auth/change.password.usecase.ts index 5483e11..23a10ac 100644 --- a/apis/authCommand/application/usecases/auth/change.password.usecase.ts +++ b/apis/authCommand/application/usecases/auth/change.password.usecase.ts @@ -1,32 +1,39 @@ -import { NotFoundError } from "../../errors"; +import { + BadRequestError, + NotFoundError, + UnauthorizedError, +} from "../../errors"; import { AuthServiceInterface, UserRepositoryInterface } from "../../ports"; import { ChangePasswordUserDTO } from "../../dtos/auth"; import { Role } from "../../../domain/enums"; export class ChangePasswordUseCase { - private userRepository: UserRepositoryInterface; - private authService: AuthServiceInterface; + private userRepository: UserRepositoryInterface; + private authService: AuthServiceInterface; - constructor(userRepository: UserRepositoryInterface, authService: AuthServiceInterface) { - this.userRepository = userRepository; - this.authService = authService; + constructor( + userRepository: UserRepositoryInterface, + authService: AuthServiceInterface, + ) { + this.userRepository = userRepository; + this.authService = authService; + } + async execute(dto: ChangePasswordUserDTO): Promise { + if (!dto.userId || !dto.password || !dto.token) { + throw new BadRequestError(); } - async execute(dto: ChangePasswordUserDTO): Promise { - if (!dto.userId || !dto.password || !dto.token) { - throw new Error("L'identifiant de l'utilisateur et le mot de passe sont requis"); - } - const token = this.authService.verifyToken(dto.token); - if (!token) { - throw new Error("Invalid token"); - } - if (token.id !== dto.userId || token.role !== Role.ADMIN) { - throw new Error("Permission denied"); - } - const user = await this.userRepository.findById(dto.userId); - if (!user) { - throw new NotFoundError(); - } - user.password = dto.password; - await this.userRepository.updatePassword(dto.userId, dto.password); + + const token = this.authService.verifyToken(dto.token); + if (!token || token.id !== dto.userId || token.role !== Role.ADMIN) { + throw new UnauthorizedError(); + } + + const user = await this.userRepository.findById(dto.userId); + if (!user) { + throw new NotFoundError(); } -} \ No newline at end of file + + user.password = dto.password; + await this.userRepository.updatePassword(dto.userId, dto.password); + } +} diff --git a/apis/authCommand/application/usecases/auth/change.role.usecase.ts b/apis/authCommand/application/usecases/auth/change.role.usecase.ts index 3efbe80..b1c7b7a 100644 --- a/apis/authCommand/application/usecases/auth/change.role.usecase.ts +++ b/apis/authCommand/application/usecases/auth/change.role.usecase.ts @@ -1,4 +1,8 @@ -import { NotFoundError } from "../../errors"; +import { + BadRequestError, + NotFoundError, + UnauthorizedError, +} from "../../errors"; import { AuthServiceInterface, UserRepositoryInterface } from "../../ports"; import { ChangeRoleUserDTO } from "../../dtos/auth"; import { Role } from "../../../domain/enums"; @@ -7,23 +11,22 @@ export class ChangeRoleUseCase { private userRepository: UserRepositoryInterface; private authService: AuthServiceInterface; - constructor(userRepository: UserRepositoryInterface, authService: AuthServiceInterface) { + constructor( + userRepository: UserRepositoryInterface, + authService: AuthServiceInterface, + ) { this.userRepository = userRepository; this.authService = authService; } async execute(dto: ChangeRoleUserDTO): Promise { if (!dto.userId || !dto.role || !dto.token) { - throw new Error("L'identifiant de l'utilisateur et le rôle sont requis"); + throw new BadRequestError(); } const token = this.authService.verifyToken(dto.token); - if (!token) { - throw new Error("Invalid token"); - } - - if (token.role !== Role.ADMIN) { - throw new Error("Permission denied"); + if (!token || token.role !== Role.ADMIN) { + throw new UnauthorizedError(); } const user = await this.userRepository.findById(dto.userId); @@ -34,4 +37,4 @@ export class ChangeRoleUseCase { user.role = dto.role; await this.userRepository.update(user); } -} \ No newline at end of file +} diff --git a/apis/authCommand/application/usecases/auth/update.usecase.ts b/apis/authCommand/application/usecases/auth/update.usecase.ts index 05bce10..e85f804 100644 --- a/apis/authCommand/application/usecases/auth/update.usecase.ts +++ b/apis/authCommand/application/usecases/auth/update.usecase.ts @@ -1,25 +1,26 @@ import { AuthServiceInterface, UserRepositoryInterface } from "../../ports"; import { UpdateUserDTO } from "../../dtos/auth"; +import { BadRequestError } from "../../errors"; export class UpdateUseCase { private userRepository: UserRepositoryInterface; private authService: AuthServiceInterface; - constructor(userRepository: UserRepositoryInterface, authService: AuthServiceInterface) { + constructor( + userRepository: UserRepositoryInterface, + authService: AuthServiceInterface, + ) { this.userRepository = userRepository; this.authService = authService; } async execute(dto: UpdateUserDTO): Promise { if (!dto.id || !dto.token) { - throw new Error("Id is required"); + throw new BadRequestError(); } const token = this.authService.verifyToken(dto.token); - if (!token) { - throw new Error("Invalid token"); - } - if (token.id !== dto.id) { + if (!token || token.id !== dto.id) { throw new Error("Invalid token"); } @@ -46,4 +47,4 @@ export class UpdateUseCase { await this.userRepository.update(user); } -} \ No newline at end of file +} From d06d7101745720e2af82b5c7b6dcd3addf1b3b68 Mon Sep 17 00:00:00 2001 From: horotopia Date: Tue, 25 Feb 2025 19:05:18 +0100 Subject: [PATCH 6/7] add some usecase files --- .../Domain/Entities/maintenance.ts | 7 +++---- .../dtos/maintenance/create.maintenance.dto.ts | 2 +- .../dtos/maintenance/delete.maintenance.dto.ts | 2 +- .../application/dtos/maintenance/index.ts | 2 +- .../dtos/maintenance/read.maintenance.dto.ts | 2 +- .../dtos/maintenance/update.maintenance.dto.ts | 2 +- .../maintenance/Plan.maintenance.usecase.ts | 0 .../maintenance/alert.maintenance.usecase.ts | 0 .../maintenance/delete.maintenance.usecase.ts | 0 .../{usecases => usecase}/maintenance/index.ts | 0 .../maintenance/search.maintenance.usecase.ts | 0 .../searchHistory.maintenance.usecase.ts | 0 .../troubleshooting.maintenance.usecase.ts | 0 .../maintenance/update.maintenance.usecase.ts | 0 .../warranty.maintenance.usecase.ts | 11 +++++++++++ apis/maintenanceCommand/config/cors.ts | 2 ++ apis/maintenanceCommand/tsconfig.json | 18 ++++++++++++++++++ apis/maintenanceQuery/tsconfig.json | 18 ++++++++++++++++++ apis/reservationCommand/tsconfig.json | 18 ++++++++++++++++++ apis/reservationQuery/tsconfig.json | 18 ++++++++++++++++++ apis/stockCommand/tsconfig.json | 18 ++++++++++++++++++ apis/stockQuery/tsconfig.json | 18 ++++++++++++++++++ 22 files changed, 129 insertions(+), 9 deletions(-) rename apis/maintenanceCommand/application/{usecases => usecase}/maintenance/Plan.maintenance.usecase.ts (100%) rename apis/maintenanceCommand/application/{usecases => usecase}/maintenance/alert.maintenance.usecase.ts (100%) rename apis/maintenanceCommand/application/{usecases => usecase}/maintenance/delete.maintenance.usecase.ts (100%) rename apis/maintenanceCommand/application/{usecases => usecase}/maintenance/index.ts (100%) rename apis/maintenanceCommand/application/{usecases => usecase}/maintenance/search.maintenance.usecase.ts (100%) rename apis/maintenanceCommand/application/{usecases => usecase}/maintenance/searchHistory.maintenance.usecase.ts (100%) rename apis/maintenanceCommand/application/{usecases => usecase}/maintenance/troubleshooting.maintenance.usecase.ts (100%) rename apis/maintenanceCommand/application/{usecases => usecase}/maintenance/update.maintenance.usecase.ts (100%) create mode 100644 apis/maintenanceCommand/application/usecase/maintenance/warranty.maintenance.usecase.ts create mode 100644 apis/maintenanceCommand/tsconfig.json create mode 100644 apis/maintenanceQuery/tsconfig.json create mode 100644 apis/reservationCommand/tsconfig.json create mode 100644 apis/reservationQuery/tsconfig.json create mode 100644 apis/stockCommand/tsconfig.json create mode 100644 apis/stockQuery/tsconfig.json diff --git a/apis/maintenanceCommand/Domain/Entities/maintenance.ts b/apis/maintenanceCommand/Domain/Entities/maintenance.ts index a51a286..0df4877 100644 --- a/apis/maintenanceCommand/Domain/Entities/maintenance.ts +++ b/apis/maintenanceCommand/Domain/Entities/maintenance.ts @@ -1,9 +1,8 @@ -import { MaintenanceType } from '../enums'; -import { v4 as uuidv4 } from 'uuid'; -import { MaintenanceInterface } from '../interfaces'; +import { MaintenanceType } from "../enums"; +import { v4 as uuidv4 } from "uuid"; +import { MaintenanceInterface } from "../interfaces"; export class Maintenance implements MaintenanceInterface { - public id: string; public scooterId: string; public technicianId: string; diff --git a/apis/maintenanceCommand/application/dtos/maintenance/create.maintenance.dto.ts b/apis/maintenanceCommand/application/dtos/maintenance/create.maintenance.dto.ts index 966b986..ac98863 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/create.maintenance.dto.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/create.maintenance.dto.ts @@ -8,4 +8,4 @@ export interface CreateMaintenanceDTO { details: string; cost: number; token: string; -} \ No newline at end of file +} diff --git a/apis/maintenanceCommand/application/dtos/maintenance/delete.maintenance.dto.ts b/apis/maintenanceCommand/application/dtos/maintenance/delete.maintenance.dto.ts index acf1955..a367155 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/delete.maintenance.dto.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/delete.maintenance.dto.ts @@ -1,3 +1,3 @@ export interface DeleteMaintenanceDTO { id: string; -} \ No newline at end of file +} diff --git a/apis/maintenanceCommand/application/dtos/maintenance/index.ts b/apis/maintenanceCommand/application/dtos/maintenance/index.ts index f915ea3..4e66436 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/index.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/index.ts @@ -1,4 +1,4 @@ export * from "./create.maintenance.dto"; export * from "./delete.maintenance.dto"; export * from "./read.maintenance.dto"; -export * from "./update.maintenance.dto"; \ No newline at end of file +export * from "./update.maintenance.dto"; diff --git a/apis/maintenanceCommand/application/dtos/maintenance/read.maintenance.dto.ts b/apis/maintenanceCommand/application/dtos/maintenance/read.maintenance.dto.ts index 3b7b319..6550bc7 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/read.maintenance.dto.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/read.maintenance.dto.ts @@ -1,3 +1,3 @@ export interface ReadMaintenanceDTO { scooterId: string; -} \ No newline at end of file +} diff --git a/apis/maintenanceCommand/application/dtos/maintenance/update.maintenance.dto.ts b/apis/maintenanceCommand/application/dtos/maintenance/update.maintenance.dto.ts index 18ad2aa..2a8ba99 100644 --- a/apis/maintenanceCommand/application/dtos/maintenance/update.maintenance.dto.ts +++ b/apis/maintenanceCommand/application/dtos/maintenance/update.maintenance.dto.ts @@ -9,4 +9,4 @@ export interface UpdateMaintenanceDTO { date?: Date; details?: string; cost?: number; -} \ No newline at end of file +} diff --git a/apis/maintenanceCommand/application/usecases/maintenance/Plan.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecase/maintenance/Plan.maintenance.usecase.ts similarity index 100% rename from apis/maintenanceCommand/application/usecases/maintenance/Plan.maintenance.usecase.ts rename to apis/maintenanceCommand/application/usecase/maintenance/Plan.maintenance.usecase.ts diff --git a/apis/maintenanceCommand/application/usecases/maintenance/alert.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecase/maintenance/alert.maintenance.usecase.ts similarity index 100% rename from apis/maintenanceCommand/application/usecases/maintenance/alert.maintenance.usecase.ts rename to apis/maintenanceCommand/application/usecase/maintenance/alert.maintenance.usecase.ts diff --git a/apis/maintenanceCommand/application/usecases/maintenance/delete.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecase/maintenance/delete.maintenance.usecase.ts similarity index 100% rename from apis/maintenanceCommand/application/usecases/maintenance/delete.maintenance.usecase.ts rename to apis/maintenanceCommand/application/usecase/maintenance/delete.maintenance.usecase.ts diff --git a/apis/maintenanceCommand/application/usecases/maintenance/index.ts b/apis/maintenanceCommand/application/usecase/maintenance/index.ts similarity index 100% rename from apis/maintenanceCommand/application/usecases/maintenance/index.ts rename to apis/maintenanceCommand/application/usecase/maintenance/index.ts diff --git a/apis/maintenanceCommand/application/usecases/maintenance/search.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecase/maintenance/search.maintenance.usecase.ts similarity index 100% rename from apis/maintenanceCommand/application/usecases/maintenance/search.maintenance.usecase.ts rename to apis/maintenanceCommand/application/usecase/maintenance/search.maintenance.usecase.ts diff --git a/apis/maintenanceCommand/application/usecases/maintenance/searchHistory.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecase/maintenance/searchHistory.maintenance.usecase.ts similarity index 100% rename from apis/maintenanceCommand/application/usecases/maintenance/searchHistory.maintenance.usecase.ts rename to apis/maintenanceCommand/application/usecase/maintenance/searchHistory.maintenance.usecase.ts diff --git a/apis/maintenanceCommand/application/usecases/maintenance/troubleshooting.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecase/maintenance/troubleshooting.maintenance.usecase.ts similarity index 100% rename from apis/maintenanceCommand/application/usecases/maintenance/troubleshooting.maintenance.usecase.ts rename to apis/maintenanceCommand/application/usecase/maintenance/troubleshooting.maintenance.usecase.ts diff --git a/apis/maintenanceCommand/application/usecases/maintenance/update.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecase/maintenance/update.maintenance.usecase.ts similarity index 100% rename from apis/maintenanceCommand/application/usecases/maintenance/update.maintenance.usecase.ts rename to apis/maintenanceCommand/application/usecase/maintenance/update.maintenance.usecase.ts diff --git a/apis/maintenanceCommand/application/usecase/maintenance/warranty.maintenance.usecase.ts b/apis/maintenanceCommand/application/usecase/maintenance/warranty.maintenance.usecase.ts new file mode 100644 index 0000000..3af69cc --- /dev/null +++ b/apis/maintenanceCommand/application/usecase/maintenance/warranty.maintenance.usecase.ts @@ -0,0 +1,11 @@ +import { WarrantyRepository } from '../../ports'; + + +export class CheckIncidentWarranty { + constructor(private warrantyRepo: WarrantyRepository) {} + + async execute(scooterId: string): Promise { + const warranty = await this.warrantyRepo.findByScooterId(scooterId); + return warranty ? warranty.isValid() : false; + } +} diff --git a/apis/maintenanceCommand/config/cors.ts b/apis/maintenanceCommand/config/cors.ts index 67da7e1..cf8c0ef 100644 --- a/apis/maintenanceCommand/config/cors.ts +++ b/apis/maintenanceCommand/config/cors.ts @@ -1,7 +1,9 @@ import cors from 'cors'; import { Application } from 'express'; import { Logger } from './logger'; +import { config } from 'dotenv'; +config(); const logger = Logger.get(); const configureCORS = (app: Application) => { diff --git a/apis/maintenanceCommand/tsconfig.json b/apis/maintenanceCommand/tsconfig.json new file mode 100644 index 0000000..21de0fc --- /dev/null +++ b/apis/maintenanceCommand/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es2017", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file diff --git a/apis/maintenanceQuery/tsconfig.json b/apis/maintenanceQuery/tsconfig.json new file mode 100644 index 0000000..21de0fc --- /dev/null +++ b/apis/maintenanceQuery/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es2017", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file diff --git a/apis/reservationCommand/tsconfig.json b/apis/reservationCommand/tsconfig.json new file mode 100644 index 0000000..21de0fc --- /dev/null +++ b/apis/reservationCommand/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es2017", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file diff --git a/apis/reservationQuery/tsconfig.json b/apis/reservationQuery/tsconfig.json new file mode 100644 index 0000000..21de0fc --- /dev/null +++ b/apis/reservationQuery/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es2017", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file diff --git a/apis/stockCommand/tsconfig.json b/apis/stockCommand/tsconfig.json new file mode 100644 index 0000000..21de0fc --- /dev/null +++ b/apis/stockCommand/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es2017", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file diff --git a/apis/stockQuery/tsconfig.json b/apis/stockQuery/tsconfig.json new file mode 100644 index 0000000..21de0fc --- /dev/null +++ b/apis/stockQuery/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "lib": ["es2016"], + "target": "es2017", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "strict": true, + "declaration": true + }, + "exclude": ["node_modules"], + "typeRoots": [ + "node_modules/@types" + ] +} \ No newline at end of file From 9db9e34286099e86a4538a7f000a4814b1bd10e8 Mon Sep 17 00:00:00 2001 From: LeGrizzly Date: Tue, 25 Feb 2025 20:05:56 +0100 Subject: [PATCH 7/7] refactor: remove unused files and interfaces; update Dockerfile configurations --- apis/authCommand/dockerfile | 4 +- apis/authCommand/package.json | 4 +- apis/authCommand/server.ts | 6 +- apis/authQuery/dockerfile | 4 +- apis/authQuery/server.ts | 6 +- .../controllers/auth/sign-up.controller.ts | 75 ---------- apis/gateway/Interface/docs/swagger.ts | 73 ---------- apis/gateway/Interface/middlewares/bcrypt.ts | 31 ----- .../Interface/middlewares/errorHandler.ts | 29 ---- apis/gateway/Interface/middlewares/jwt.ts | 57 -------- .../Interface/middlewares/validateRole.ts | 130 ------------------ apis/gateway/Interface/routes/auth.routes.ts | 10 -- apis/gateway/application/dtos/auth/index.ts | 2 - .../dtos/auth/register.user.dto.ts | 7 - .../application/errors/bad-request-error.ts | 7 - .../application/errors/date-time-error.ts | 6 - .../errors/default-application-error.ts | 25 ---- .../errors/email-validation-error.ts | 6 - apis/gateway/application/errors/index.ts | 11 -- .../errors/internal-server-error.ts | 6 - .../application/errors/not-found-error.ts | 6 - .../errors/password-validation-error.ts | 6 - .../application/errors/repository-error.ts | 6 - .../errors/request-validation-error.ts | 6 - .../application/errors/sanitizer-error.ts | 6 - .../application/errors/unauthorized-error.ts | 6 - .../application/errors/user-exists-error.ts | 6 - .../ports/auth.service.interface.ts | 6 - apis/gateway/application/ports/index.ts | 3 - .../ports/password.service.interface.ts | 4 - .../ports/responses/response.interface.ts | 5 - .../ports/user.repository.interface.ts | 7 - .../usecases/auth/register.usecase.ts | 36 ----- apis/gateway/config/cors.ts | 39 ------ apis/gateway/config/helmet.ts | 12 -- apis/gateway/config/logger.ts | 109 --------------- apis/gateway/dockerfile | 2 +- apis/gateway/domain/entities/index.ts | 9 -- apis/gateway/domain/entities/user.ts | 32 ----- apis/gateway/domain/enums/index.ts | 1 - apis/gateway/domain/enums/user.role.enum.ts | 5 - apis/gateway/domain/interfaces/index.ts | 2 - .../domain/interfaces/timestamp.interface.ts | 4 - .../domain/interfaces/user.interface.ts | 9 -- apis/gateway/index.ts | 78 ++++------- .../infrastructure/databases/adapter.ts | 8 -- .../infrastructure/databases/database.ts | 14 -- .../gateway/infrastructure/databases/index.ts | 6 - .../infrastructure/databases/mongoose.ts | 49 ------- .../infrastructure/databases/sequelize.ts | 44 ------ apis/gateway/infrastructure/orms/adapter.ts | 5 - .../infrastructure/orms/mongoose/index.ts | 1 - .../orms/mongoose/user.schema.ts | 59 -------- .../infrastructure/repositories/index.ts | 5 - .../repositories/mongoose/index.ts | 1 - .../repositories/mongoose/user.repository.ts | 26 ---- .../repositories/sequelize/index.ts | 1 - .../repositories/sequelize/user.repository.ts | 0 apis/gateway/package.json | 25 +--- .../gateway/shared/helpers/password.helper.ts | 32 ----- apis/gateway/shared/helpers/token.helper.ts | 26 ---- apis/gateway/shared/validators/env.ts | 0 docker-compose.yml | 55 +++----- nginx/Dockerfile | 5 - nginx/nginx.conf | 28 ---- 65 files changed, 61 insertions(+), 1233 deletions(-) delete mode 100644 apis/gateway/Interface/controllers/auth/sign-up.controller.ts delete mode 100644 apis/gateway/Interface/docs/swagger.ts delete mode 100644 apis/gateway/Interface/middlewares/bcrypt.ts delete mode 100644 apis/gateway/Interface/middlewares/errorHandler.ts delete mode 100644 apis/gateway/Interface/middlewares/jwt.ts delete mode 100644 apis/gateway/Interface/middlewares/validateRole.ts delete mode 100644 apis/gateway/Interface/routes/auth.routes.ts delete mode 100644 apis/gateway/application/dtos/auth/index.ts delete mode 100644 apis/gateway/application/dtos/auth/register.user.dto.ts delete mode 100644 apis/gateway/application/errors/bad-request-error.ts delete mode 100644 apis/gateway/application/errors/date-time-error.ts delete mode 100644 apis/gateway/application/errors/default-application-error.ts delete mode 100644 apis/gateway/application/errors/email-validation-error.ts delete mode 100644 apis/gateway/application/errors/index.ts delete mode 100644 apis/gateway/application/errors/internal-server-error.ts delete mode 100644 apis/gateway/application/errors/not-found-error.ts delete mode 100644 apis/gateway/application/errors/password-validation-error.ts delete mode 100644 apis/gateway/application/errors/repository-error.ts delete mode 100644 apis/gateway/application/errors/request-validation-error.ts delete mode 100644 apis/gateway/application/errors/sanitizer-error.ts delete mode 100644 apis/gateway/application/errors/unauthorized-error.ts delete mode 100644 apis/gateway/application/errors/user-exists-error.ts delete mode 100644 apis/gateway/application/ports/auth.service.interface.ts delete mode 100644 apis/gateway/application/ports/index.ts delete mode 100644 apis/gateway/application/ports/password.service.interface.ts delete mode 100644 apis/gateway/application/ports/responses/response.interface.ts delete mode 100644 apis/gateway/application/ports/user.repository.interface.ts delete mode 100644 apis/gateway/application/usecases/auth/register.usecase.ts delete mode 100644 apis/gateway/config/cors.ts delete mode 100644 apis/gateway/config/helmet.ts delete mode 100644 apis/gateway/config/logger.ts delete mode 100644 apis/gateway/domain/entities/index.ts delete mode 100644 apis/gateway/domain/entities/user.ts delete mode 100644 apis/gateway/domain/enums/index.ts delete mode 100644 apis/gateway/domain/enums/user.role.enum.ts delete mode 100644 apis/gateway/domain/interfaces/index.ts delete mode 100644 apis/gateway/domain/interfaces/timestamp.interface.ts delete mode 100644 apis/gateway/domain/interfaces/user.interface.ts delete mode 100644 apis/gateway/infrastructure/databases/adapter.ts delete mode 100644 apis/gateway/infrastructure/databases/database.ts delete mode 100644 apis/gateway/infrastructure/databases/index.ts delete mode 100644 apis/gateway/infrastructure/databases/mongoose.ts delete mode 100644 apis/gateway/infrastructure/databases/sequelize.ts delete mode 100644 apis/gateway/infrastructure/orms/adapter.ts delete mode 100644 apis/gateway/infrastructure/orms/mongoose/index.ts delete mode 100644 apis/gateway/infrastructure/orms/mongoose/user.schema.ts delete mode 100644 apis/gateway/infrastructure/repositories/index.ts delete mode 100644 apis/gateway/infrastructure/repositories/mongoose/index.ts delete mode 100644 apis/gateway/infrastructure/repositories/mongoose/user.repository.ts delete mode 100644 apis/gateway/infrastructure/repositories/sequelize/index.ts delete mode 100644 apis/gateway/infrastructure/repositories/sequelize/user.repository.ts delete mode 100644 apis/gateway/shared/helpers/password.helper.ts delete mode 100644 apis/gateway/shared/helpers/token.helper.ts delete mode 100644 apis/gateway/shared/validators/env.ts delete mode 100644 nginx/Dockerfile delete mode 100644 nginx/nginx.conf diff --git a/apis/authCommand/dockerfile b/apis/authCommand/dockerfile index 5272196..18612da 100644 --- a/apis/authCommand/dockerfile +++ b/apis/authCommand/dockerfile @@ -21,5 +21,5 @@ COPY --from=build /app/package.json /app/yarn.lock* ./ RUN yarn install --production --frozen-lockfile COPY --from=build /app/dist ./dist -EXPOSE 3000 -CMD ["node", "dist/index.js"] +EXPOSE 5000 +CMD ["node", "dist/server.js"] diff --git a/apis/authCommand/package.json b/apis/authCommand/package.json index 7492aa1..ae16c2c 100644 --- a/apis/authCommand/package.json +++ b/apis/authCommand/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "main": "server.js", "scripts": { - "start": "tsc && node dist/server.js", + "start": "node dist/server.js", "dev": "nodemon src/server.ts", - "build": "tsc", + "build": "rm -rf ./dist && tsc", "lint": "eslint .", "lint:fix": "eslint . --fix", "prettier": "prettier --write .", diff --git a/apis/authCommand/server.ts b/apis/authCommand/server.ts index 7b942b2..c833ce5 100644 --- a/apis/authCommand/server.ts +++ b/apis/authCommand/server.ts @@ -26,13 +26,13 @@ app.use((req: Request, res: Response, next: NextFunction) => { next(); }); -app.get("/", (req, res) => { - res.send("Hello, TypeScript Node Express!"); +app.get("/", (req: Request, res: Response) => { + res.send("Hello, TypeScript Node Express! Auth Command"); }); app.use("/doc", swaggerUi.serve, swaggerUi.setup(swaggerSpec)); -app.use("/auth", authRoutes); +app.use("/", authRoutes); app.use(errorHandler()); diff --git a/apis/authQuery/dockerfile b/apis/authQuery/dockerfile index 5272196..18612da 100644 --- a/apis/authQuery/dockerfile +++ b/apis/authQuery/dockerfile @@ -21,5 +21,5 @@ COPY --from=build /app/package.json /app/yarn.lock* ./ RUN yarn install --production --frozen-lockfile COPY --from=build /app/dist ./dist -EXPOSE 3000 -CMD ["node", "dist/index.js"] +EXPOSE 5000 +CMD ["node", "dist/server.js"] diff --git a/apis/authQuery/server.ts b/apis/authQuery/server.ts index 7b942b2..3c055bf 100644 --- a/apis/authQuery/server.ts +++ b/apis/authQuery/server.ts @@ -26,13 +26,13 @@ app.use((req: Request, res: Response, next: NextFunction) => { next(); }); -app.get("/", (req, res) => { - res.send("Hello, TypeScript Node Express!"); +app.get("/", (req: Request, res: Response) => { + res.send("Hello, TypeScript Node Express! Auth Query"); }); app.use("/doc", swaggerUi.serve, swaggerUi.setup(swaggerSpec)); -app.use("/auth", authRoutes); +app.use("/", authRoutes); app.use(errorHandler()); diff --git a/apis/gateway/Interface/controllers/auth/sign-up.controller.ts b/apis/gateway/Interface/controllers/auth/sign-up.controller.ts deleted file mode 100644 index f5b1bf5..0000000 --- a/apis/gateway/Interface/controllers/auth/sign-up.controller.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Request, Response, NextFunction } from "express"; -import { RegisterUseCase } from '../../../application/usecases/auth/register.usecase'; -import { config } from "dotenv"; -import { TokenHelper } from "../../../shared/helpers/token.helper"; -import connectDB from "../../../infrastructure/databases/database"; -import { RepositoryError } from "../../../application/errors/repository-error"; -import { BadRequestError } from "../../../application/errors"; - -config(); -if (!process.env.DB_TYPE) { - throw new RepositoryError(); // DB_TYPE environment variable is not defined -} -const database = await connectDB(process.env.DB_TYPE); -const userRepo = database && 'userRepository' in database ? await database.userRepository : null; -const tokenService = new TokenHelper(); -if (!userRepo) { - throw new RepositoryError(); // User repository is not available -} -const registerUseCase = new RegisterUseCase(userRepo, tokenService); - -export class SignUpController { - /** - * @swagger - * /auth/register: - * post: - * summary: Register a new user - * tags: [Auth] - * requestBody: - * required: true - * content: - * application/json: - * schema: - * type: object - * required: - * - email - * - password - * properties: - * email: - * type: string - * description: The user's email - * password: - * type: string - * description: The user's password - * responses: - * 201: - * description: The created user - * content: - * application/json: - * schema: - * $ref: '#/components/schemas/User' - * 400: - * description: Email and password are required - * 409: - * description: Email already exists - * 500: - * description: Internal server error - */ - async register(req: Request, res: Response): Promise { - try { - if (!req.body || !req.body.email || !req.body.password) { - res.status(400); - throw new BadRequestError(); // Email and password are required - } - - const token = await registerUseCase.execute(req.body); - return res.json({token}); - - } catch (error) { - if (!res.statusCode) { - res.status(500); - } - return res; - } - } -} \ No newline at end of file diff --git a/apis/gateway/Interface/docs/swagger.ts b/apis/gateway/Interface/docs/swagger.ts deleted file mode 100644 index 7faddca..0000000 --- a/apis/gateway/Interface/docs/swagger.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { config } from "dotenv"; -import swaggerJsdoc from "swagger-jsdoc"; - -config(); -interface SwaggerOptions { - definition: { - openapi: string; - info: { - title: string; - version: string; - description: string; - }; - components: { - securitySchemes: { - bearerAuth: { - type: string; - scheme: string; - bearerFormat: string; - }; - }; - }; - security: { bearerAuth: string[] }[]; - servers: { - url: string; - description: string; - }[]; - }; - apis: string[]; -} - -const hostname: string = process.env.API_HOST || "localhost"; -const port: string | number = process.env.API_PORT || 5000; - -const swaggerOptions: SwaggerOptions = { - definition: { - openapi: "3.0.0", - info: { - title: "E-commerce API", - version: "0.1.0", - description: "E-commerce API documentation", - }, - components: { - securitySchemes: { - bearerAuth: { - type: "http", - scheme: "bearer", - bearerFormat: "JWT", - }, - }, - }, - security: [ - { - bearerAuth: [], - }, - ], - servers: [ - { - url: `http://${hostname || "localhost"}:${port || 5000}`, - description: "Development server", - }, - ], - }, - apis: ["src/controllers/*.ts", "src/services/mongoose/schema/*.ts"], -}; - -const swaggerSpec = swaggerJsdoc(swaggerOptions); -if (!swaggerSpec) { - throw new Error( - "Erreur lors de la configuration de Swagger : swaggerSpec est undefined." - ); -} - -export default swaggerSpec; diff --git a/apis/gateway/Interface/middlewares/bcrypt.ts b/apis/gateway/Interface/middlewares/bcrypt.ts deleted file mode 100644 index a607ad6..0000000 --- a/apis/gateway/Interface/middlewares/bcrypt.ts +++ /dev/null @@ -1,31 +0,0 @@ -import bcrypt from "bcryptjs"; -import { Logger } from "../../config/logger"; - -const logger = Logger.get(); - -export class Bcrypt { - private saltRounds: number; - - constructor(saltRounds: number = 10) { - this.saltRounds = saltRounds; - } - - async hashPassword(password: string): Promise { - try { - const salt = bcrypt.genSaltSync(this.saltRounds); - return bcrypt.hashSync(password, salt); - } catch (error) { - logger.error(new Error(`Error hashing password: ${error}`)); - throw new Error("Erreur lors du hachage du mot de passe"); - } - } - - async comparePassword(password: string, hash: string): Promise { - try { - return bcrypt.compareSync(password, hash); - } catch (error) { - logger.error(new Error(`Error comparing password: ${error}`)); - throw new Error("Erreur lors de la comparaison des mots de passe"); - } - } -} diff --git a/apis/gateway/Interface/middlewares/errorHandler.ts b/apis/gateway/Interface/middlewares/errorHandler.ts deleted file mode 100644 index a448552..0000000 --- a/apis/gateway/Interface/middlewares/errorHandler.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { NextFunction, Request, Response } from "express"; -import { Logger } from "../../config/logger"; - -const logger = Logger.get(); - -const errorHandler = () => { - return (err: any, req: Request, res: Response, next: NextFunction) => { - const statusCode = res.statusCode; - if (statusCode === 500) { - logger.error( - new Error( - `${statusCode}: ${req.method} ${req.url} - clientIP: ${req.ip}, errorStack: ${err.stack}, url: ${req.originalUrl}, method: ${req.method}, ip: ${req.ip}` - ) - ); - } - if ([400, 401, 403, 404, 409].includes(statusCode)) { - logger.warn( - `${statusCode}: ${req.method} ${req.url} - clientIP: ${req.ip}, errorMessage: ${err.message}, url: ${req.originalUrl}, method: ${req.method}, ip: ${req.ip}` - ); - } - - res.status(statusCode).json({ - message: err.message, - ...(process.env.MODE_ENV === "production" ? null : { stack: err.stack }), - }); - }; -}; - -export default errorHandler; diff --git a/apis/gateway/Interface/middlewares/jwt.ts b/apis/gateway/Interface/middlewares/jwt.ts deleted file mode 100644 index eebc123..0000000 --- a/apis/gateway/Interface/middlewares/jwt.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { config } from "dotenv"; -import { NextFunction, Request, Response } from "express"; -import jwt from "jsonwebtoken"; -import { Logger } from "../../config/logger"; - -config(); -const logger = Logger.get(); - -const SECRET_KEY: string | undefined = process.env.JWT_SECRET; - -// Génération d'un token JWT -const generateToken = (user: any) => { - if (!SECRET_KEY) { - logger.error(new Error("SECRET_KEY is not defined")); - return ""; - } - return jwt.sign( - { - id: user._id, - email: user.email, - role: user.role, - }, - SECRET_KEY, - { expiresIn: "1d" } - ); -}; - -// Vérification du token JWT -const authenticateToken = (req: Request, res: Response, next: NextFunction) => { - const authHeader = req.headers["authorization"]; - const jwtToken = authHeader && authHeader.split(" ")[1]; - - try { - if (!jwtToken) { - res.status(401); - throw new Error("Token manquant"); - } - if (!SECRET_KEY) { - res.status(500); - throw new Error("SECRET_KEY is not defined"); - } - jwt.verify(jwtToken, SECRET_KEY, (err: any, user: any) => { - if (err) { - res.status(403); - throw new Error("Token invalide"); - } - next(); - }); - } catch (error) { - if (!res.statusCode) { - res.status(500); - } - next(error); - } -}; - -export { authenticateToken, generateToken }; diff --git a/apis/gateway/Interface/middlewares/validateRole.ts b/apis/gateway/Interface/middlewares/validateRole.ts deleted file mode 100644 index 0913353..0000000 --- a/apis/gateway/Interface/middlewares/validateRole.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { Request, Response, NextFunction } from "express"; -import jwt from "jsonwebtoken"; -import { Role } from "../models"; -import connectDB from "../../infrastructure/databases/database"; -import { config } from "dotenv"; - -config(); -const SECRET_KEY: string | undefined = process.env.JWT_SECRET; - -const getUser = async (req: Request, res: Response) => { - if (!SECRET_KEY) { - res.status(500); - throw new Error("JWT_SECRET is not defined"); - } - - const authHeader = req.headers["authorization"]; - const jwtToken = authHeader && authHeader.split(" ")[1]; - - if (!jwtToken) { - res.status(401); - throw new Error("No token, authorization denied"); - } - - const decoded = jwt.verify(jwtToken, SECRET_KEY) as jwt.JwtPayload; - - const dbType = process.env.DB_TYPE; - if (!dbType) { - res.status(500); - throw new Error("DB_TYPE is not defined"); - } - const database = await connectDB(dbType); - const userRepo = database && 'userRepository' in database ? await database.userRepository : null; - const user = await userRepo.findById(decoded.id); - if (!user) { - res.status(401); - throw new Error("Authentication failed"); - } - return user; -}; - -export const validateRole = async ( - req: Request, - res: Response, - next: NextFunction, - role: Role[] -) => { - try { - const user = await getUser(req, res); - if (role.length === 1) { - if (user.role !== role[0]) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - if (role.length === 2) { - if (user.role !== role[0] && user.role !== role[1]) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - if (role.length === 3) { - if ( - user.role !== role[0] && - user.role !== role[1] && - user.role !== role[2] - ) { - res.status(403); - throw new Error("Unauthorized"); - } - next(); - } - } catch (error) { - if (!res.statusCode) { - res.status(500); - } - next(error); - } -}; - -export const validateRoleAdmin = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin]); -}; -export const validateRoleOwner = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Owner]); -}; -export const validateRoleCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Customer]); -}; -export const validateRoleAdminOwner = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Owner]); -}; -export const validateRoleAdminCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Customer]); -}; -export const validateRoleOwnerCustomer = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Owner, Role.Customer]); -}; -export const validateRoleAll = async ( - req: Request, - res: Response, - next: NextFunction -) => { - validateRole(req, res, next, [Role.Admin, Role.Owner, Role.Customer]); -}; diff --git a/apis/gateway/Interface/routes/auth.routes.ts b/apis/gateway/Interface/routes/auth.routes.ts deleted file mode 100644 index a88a0c0..0000000 --- a/apis/gateway/Interface/routes/auth.routes.ts +++ /dev/null @@ -1,10 +0,0 @@ -import express from "express"; -import { SignUpController } from "../controllers/auth/sign-up.controller"; - -const router = express.Router(); - -// router.post("/login", AuthController.login); -const signUpController = new SignUpController(); -router.post("/register", signUpController.register.bind(signUpController)); - -export default router; diff --git a/apis/gateway/application/dtos/auth/index.ts b/apis/gateway/application/dtos/auth/index.ts deleted file mode 100644 index f4e811d..0000000 --- a/apis/gateway/application/dtos/auth/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./login.user.dto"; -export * from "./register.user.dto"; \ No newline at end of file diff --git a/apis/gateway/application/dtos/auth/register.user.dto.ts b/apis/gateway/application/dtos/auth/register.user.dto.ts deleted file mode 100644 index f7b4274..0000000 --- a/apis/gateway/application/dtos/auth/register.user.dto.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Role } from "../../../domain/enums" - -export interface RegisterUserDTO { - email: string; - password: string; - role?: Role; -} \ No newline at end of file diff --git a/apis/gateway/application/errors/bad-request-error.ts b/apis/gateway/application/errors/bad-request-error.ts deleted file mode 100644 index 793c019..0000000 --- a/apis/gateway/application/errors/bad-request-error.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class BadRequestError extends DefaultApplicationError { - name = 'BadRequestError'; - statusCode = 400; -} - \ No newline at end of file diff --git a/apis/gateway/application/errors/date-time-error.ts b/apis/gateway/application/errors/date-time-error.ts deleted file mode 100644 index c771a19..0000000 --- a/apis/gateway/application/errors/date-time-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class DateTimeError extends DefaultApplicationError { - statusCode = 500; - name = 'DateTimeError'; -} diff --git a/apis/gateway/application/errors/default-application-error.ts b/apis/gateway/application/errors/default-application-error.ts deleted file mode 100644 index bf1f074..0000000 --- a/apis/gateway/application/errors/default-application-error.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ResponseModel } from '../ports/responses/response.interface'; - -export type ErrorParams = { - name?: string; - message?: string; - statusCode?: number; - messages?: string[]; - stack?: Error['stack']; -}; - -export type ErrorResponseModel = Omit, 'body'>; - -export class DefaultApplicationError - extends Error - implements ErrorResponseModel { - public statusCode = 500; - public messages: string[] = []; - - constructor(message?: string) { - super(message); - this.message = message || this.name; - this.name = 'DefaultApplicationError'; - this.messages.push(this.message); - } -} diff --git a/apis/gateway/application/errors/email-validation-error.ts b/apis/gateway/application/errors/email-validation-error.ts deleted file mode 100644 index 22ecabd..0000000 --- a/apis/gateway/application/errors/email-validation-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class EmailValidationError extends DefaultApplicationError { - statusCode = 400; - name = 'EmailValidationError'; -} diff --git a/apis/gateway/application/errors/index.ts b/apis/gateway/application/errors/index.ts deleted file mode 100644 index d6466af..0000000 --- a/apis/gateway/application/errors/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './bad-request-error'; -export * from './date-time-error'; -export * from './default-application-error'; -export * from './email-validation-error'; -export * from './internal-server-error'; -export * from './not-found-error'; -export * from './repository-error'; -export * from './request-validation-error'; -export * from './sanitizer-error'; -export * from './unauthorized-error'; -export * from './user-exists-error'; \ No newline at end of file diff --git a/apis/gateway/application/errors/internal-server-error.ts b/apis/gateway/application/errors/internal-server-error.ts deleted file mode 100644 index f92119c..0000000 --- a/apis/gateway/application/errors/internal-server-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class InternalServerError extends DefaultApplicationError { - name = 'InternalServerError'; - statusCode = 500; -} diff --git a/apis/gateway/application/errors/not-found-error.ts b/apis/gateway/application/errors/not-found-error.ts deleted file mode 100644 index 1e88132..0000000 --- a/apis/gateway/application/errors/not-found-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class NotFoundError extends DefaultApplicationError { - statusCode = 404; - name = 'NotFoundError'; -} diff --git a/apis/gateway/application/errors/password-validation-error.ts b/apis/gateway/application/errors/password-validation-error.ts deleted file mode 100644 index 88736ea..0000000 --- a/apis/gateway/application/errors/password-validation-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class EmailValidationError extends DefaultApplicationError { - statusCode = 400; - name = 'PasswordValidationError'; -} \ No newline at end of file diff --git a/apis/gateway/application/errors/repository-error.ts b/apis/gateway/application/errors/repository-error.ts deleted file mode 100644 index c87e1ab..0000000 --- a/apis/gateway/application/errors/repository-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class RepositoryError extends DefaultApplicationError { - name = 'RepositoryError'; - statusCode = 500; -} diff --git a/apis/gateway/application/errors/request-validation-error.ts b/apis/gateway/application/errors/request-validation-error.ts deleted file mode 100644 index b34692d..0000000 --- a/apis/gateway/application/errors/request-validation-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class RequestValidationError extends DefaultApplicationError { - statusCode = 400; - name = 'RequestValidationError'; -} diff --git a/apis/gateway/application/errors/sanitizer-error.ts b/apis/gateway/application/errors/sanitizer-error.ts deleted file mode 100644 index 9fb0a7e..0000000 --- a/apis/gateway/application/errors/sanitizer-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class SanitizerError extends DefaultApplicationError { - name = 'SanitizerError'; - statusCode = 400; -} diff --git a/apis/gateway/application/errors/unauthorized-error.ts b/apis/gateway/application/errors/unauthorized-error.ts deleted file mode 100644 index 445a2fd..0000000 --- a/apis/gateway/application/errors/unauthorized-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class UnauthorizedError extends DefaultApplicationError { - name = 'UnauthorizedError'; - statusCode = 401; -} diff --git a/apis/gateway/application/errors/user-exists-error.ts b/apis/gateway/application/errors/user-exists-error.ts deleted file mode 100644 index 19e0586..0000000 --- a/apis/gateway/application/errors/user-exists-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultApplicationError } from './default-application-error'; - -export class UserExistsError extends DefaultApplicationError { - statusCode = 409; - name = 'UserExistsError'; -} diff --git a/apis/gateway/application/ports/auth.service.interface.ts b/apis/gateway/application/ports/auth.service.interface.ts deleted file mode 100644 index 125c68e..0000000 --- a/apis/gateway/application/ports/auth.service.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { User } from "../../domain/entities/"; - -export interface AuthServiceInterface { - generateToken(user: User): string; - verifyToken(token: string): User; -} \ No newline at end of file diff --git a/apis/gateway/application/ports/index.ts b/apis/gateway/application/ports/index.ts deleted file mode 100644 index 9ef5ab1..0000000 --- a/apis/gateway/application/ports/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './auth.service.interface'; -export * from './password.service.interface'; -export * from './user.repository.interface'; diff --git a/apis/gateway/application/ports/password.service.interface.ts b/apis/gateway/application/ports/password.service.interface.ts deleted file mode 100644 index dc51bba..0000000 --- a/apis/gateway/application/ports/password.service.interface.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface PasswordServiceInterface { - hash(password: string): Promise; - compare(password: string, hash: string): Promise; -} \ No newline at end of file diff --git a/apis/gateway/application/ports/responses/response.interface.ts b/apis/gateway/application/ports/responses/response.interface.ts deleted file mode 100644 index 0c62167..0000000 --- a/apis/gateway/application/ports/responses/response.interface.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -export interface ResponseModel { - body: T; - statusCode: number; -} diff --git a/apis/gateway/application/ports/user.repository.interface.ts b/apis/gateway/application/ports/user.repository.interface.ts deleted file mode 100644 index acad1ac..0000000 --- a/apis/gateway/application/ports/user.repository.interface.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { User } from '../../domain/entities'; - -export interface UserRepositoryInterface { - - findByEmail(email: string): Promise; - create(user: User): Promise; -} diff --git a/apis/gateway/application/usecases/auth/register.usecase.ts b/apis/gateway/application/usecases/auth/register.usecase.ts deleted file mode 100644 index c1054b2..0000000 --- a/apis/gateway/application/usecases/auth/register.usecase.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { User } from "../../../domain/entities"; -import { RegisterUserDTO } from "../../dtos/auth"; -import { UserExistsError } from "../../errors/user-exists-error"; -import { AuthServiceInterface, UserRepositoryInterface } from "../../ports"; - - -export class RegisterUseCase { - - private userRepository: UserRepositoryInterface; - private authService: AuthServiceInterface; - - constructor(userRepository: UserRepositoryInterface, authService: AuthServiceInterface) { - this.userRepository = userRepository; - this.authService = authService; - } - - async execute(dto: RegisterUserDTO): Promise { - // Fail Fast: Vérifie si les données d’entrée sont valides - if (!dto.email || !dto.password) { - throw new Error("Email et mot de passe sont requis"); - } - - // Vérifie si l’utilisateur existe déjà - const user = await this.userRepository.findByEmail(dto.email); - if (user) { - throw new UserExistsError(); - } - - // Crée un nouvel utilisateur - const newUser = new User(dto.email, dto.password); - await this.userRepository.create(newUser); - - // Génère et retourne un token JWT - return this.authService.generateToken(newUser); - } -} \ No newline at end of file diff --git a/apis/gateway/config/cors.ts b/apis/gateway/config/cors.ts deleted file mode 100644 index 67da7e1..0000000 --- a/apis/gateway/config/cors.ts +++ /dev/null @@ -1,39 +0,0 @@ -import cors from 'cors'; -import { Application } from 'express'; -import { Logger } from './logger'; - -const logger = Logger.get(); - -const configureCORS = (app: Application) => { - const corsOptions = { - origin: (origin: string | undefined, callback: Function) => { - if (!origin) { - callback(null, true); - return; - } - - const allowedOrigins = process.env.ALLOWED_ORIGINS; - if (!allowedOrigins) { - callback(new Error("Request from unauthorized origin")); - return; - } - - const origins = allowedOrigins.split(" "); - if (origins.indexOf(origin) !== -1) { - callback(null, true); - } else { - callback(new Error("Request from unauthorized origin")); - } - }, - methods: ['GET', 'POST', 'PUT', 'DELETE'], - allowedHeaders: ['Content-Type', 'Authorization'], - credentials: true, - optionsSuccessStatus: 200, - }; - - app.use(cors(corsOptions)); - - logger.info('Cors has been enabled'); -}; - -export default configureCORS; diff --git a/apis/gateway/config/helmet.ts b/apis/gateway/config/helmet.ts deleted file mode 100644 index feb48ba..0000000 --- a/apis/gateway/config/helmet.ts +++ /dev/null @@ -1,12 +0,0 @@ -import helmet from 'helmet'; -import { Application } from 'express'; -import { Logger } from './logger'; - -const logger = Logger.get(); - -const configureHelmet = (app: Application) => { - app.use(helmet()); - logger.info('Helmet has been enabled'); -} - -export default configureHelmet; \ No newline at end of file diff --git a/apis/gateway/config/logger.ts b/apis/gateway/config/logger.ts deleted file mode 100644 index cfafb7b..0000000 --- a/apis/gateway/config/logger.ts +++ /dev/null @@ -1,109 +0,0 @@ -import winston from "winston"; -import "winston-daily-rotate-file"; -import { config } from "dotenv"; - -config(); -export class Logger { - private static instance: Logger; - private logger: winston.Logger; - - private readonly level: string = process.env.NODE_ENV === "development" ? "debug" : "info"; - private readonly levels = { error: 0, warn: 1, info: 2, http: 3, debug: 5 }; - private readonly colors = { - error: "red", - warn: "yellow", - info: "green", - http: "magenta", - debug: "white", - }; - private readonly format = winston.format.combine( - winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss:ms" }), - winston.format.colorize({ all: true }), - winston.format.errors({ stack: true }), - winston.format.printf((info ) => { - const stack = info.stack ? `\nStack trace: ${info.stack}` : ""; - return `${info.level}: ${info.message}, timestamp : ${info.timestamp}${stack}`; - }) - ); - - - private constructor() { - winston.addColors(this.colors); - - this.logger = winston.createLogger({ - level: this.level, - levels: this.levels, - format: this.format, - transports: this.createTransports(), - exceptionHandlers: this.createExceptionHandlers(), - }); - this.handleUnhandledRejections(); - } - - private createTransports(): winston.transport[] { - return [ - new winston.transports.Console(), - this.createDailyRotateFile("api-combined"), - this.createDailyRotateFile("api-error", "error"), - this.createDailyRotateFile("api-info", "info"), - this.createDailyRotateFile("api-http", "http"), - ]; - } - - private createExceptionHandlers(): winston.transport[] { - return [ - new winston.transports.Console(), - this.createDailyRotateFile("api-exceptions"), - ]; - } - - private createDailyRotateFile( - filename: string, - level?: string - ) { - return new winston.transports.DailyRotateFile({ - filename: `logs/${filename}-%DATE%.log`, - level, - datePattern: "YYYY-MM-DD", - zippedArchive: true, - maxFiles: "14d", - }); - } - - private handleUnhandledRejections(): void { - process.on("unhandledRejection", (reason, promise) => { - this.logger.error(`Unhandled Rejection at: ${promise} reason: ${reason}`); - }); - } - - public static get(): Logger { - if (!Logger.instance) { - Logger.instance = new Logger(); - } - return Logger.instance; - } - - public error(message: Error): void { - this.logger.error(message); - } - - public warn(message: string): void { - this.logger.warn(message); - } - - public info(message: string): void { - this.logger.info(message); - } - - public http(message: string): void { - this.logger.log("http", message); - } - - public debug(message: string): void { - this.logger.debug(message); - } - - public getLogger(): winston.Logger { - return this.logger; - } -} diff --git a/apis/gateway/dockerfile b/apis/gateway/dockerfile index 5272196..07bf48b 100644 --- a/apis/gateway/dockerfile +++ b/apis/gateway/dockerfile @@ -21,5 +21,5 @@ COPY --from=build /app/package.json /app/yarn.lock* ./ RUN yarn install --production --frozen-lockfile COPY --from=build /app/dist ./dist -EXPOSE 3000 +EXPOSE 8080 CMD ["node", "dist/index.js"] diff --git a/apis/gateway/domain/entities/index.ts b/apis/gateway/domain/entities/index.ts deleted file mode 100644 index 6e93025..0000000 --- a/apis/gateway/domain/entities/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from "./incident" -export * from "./maintenance" -export * from "./rental" -export * from "./reservation" -export * from "./scooter" -export * from "./stockOrder" -export * from "./stockPiece" -export * from "./user" -export * from "./warranty" \ No newline at end of file diff --git a/apis/gateway/domain/entities/user.ts b/apis/gateway/domain/entities/user.ts deleted file mode 100644 index e8cf21d..0000000 --- a/apis/gateway/domain/entities/user.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Role } from '../enums'; -import { UserInterface } from '../interfaces'; -import { v4 as uuidv4 } from 'uuid'; -import { PasswordHelper } from '../../shared/helpers/password.helper'; - -export class User implements UserInterface { - - public id: string; - public email: string; - public password: string; - public role: Role; - public firstName?: string; - public lastName?: string; - public phone?: string; - - constructor( - email: string, - password: string, - role: Role = Role.CUSTOMER, - id: string = uuidv4() - ) { - this.id = id; - this.email = email; - this.password = password; - this.role = role; - } - - isValidPassword(password: string, hashedPassword: string): Promise { - const passwordHelper = new PasswordHelper(); - return passwordHelper.compare(password, hashedPassword); - } -} \ No newline at end of file diff --git a/apis/gateway/domain/enums/index.ts b/apis/gateway/domain/enums/index.ts deleted file mode 100644 index f739fe8..0000000 --- a/apis/gateway/domain/enums/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./user.role.enum"; diff --git a/apis/gateway/domain/enums/user.role.enum.ts b/apis/gateway/domain/enums/user.role.enum.ts deleted file mode 100644 index 84681b9..0000000 --- a/apis/gateway/domain/enums/user.role.enum.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum Role { - ADMIN = "superAdmin", - OWNER = "owner", - CUSTOMER = "customer", -} diff --git a/apis/gateway/domain/interfaces/index.ts b/apis/gateway/domain/interfaces/index.ts deleted file mode 100644 index 15b951b..0000000 --- a/apis/gateway/domain/interfaces/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./timestamp.interface"; -export * from "./user.interface"; diff --git a/apis/gateway/domain/interfaces/timestamp.interface.ts b/apis/gateway/domain/interfaces/timestamp.interface.ts deleted file mode 100644 index 15a8e36..0000000 --- a/apis/gateway/domain/interfaces/timestamp.interface.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface Timestamps { - createdAt: Date; - updatedAt: Date; -} \ No newline at end of file diff --git a/apis/gateway/domain/interfaces/user.interface.ts b/apis/gateway/domain/interfaces/user.interface.ts deleted file mode 100644 index 72cf08c..0000000 --- a/apis/gateway/domain/interfaces/user.interface.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface UserInterface { - id: string; - firstName?: string; - lastName?: string; - email: string; - password: string; - role: string; - phone?: string; -} diff --git a/apis/gateway/index.ts b/apis/gateway/index.ts index b01a559..84c2108 100644 --- a/apis/gateway/index.ts +++ b/apis/gateway/index.ts @@ -1,64 +1,38 @@ +import express, { Express, Request, Response } from "express"; import proxy from "express-http-proxy"; -import express, { Express, Request, Response, NextFunction } from "express"; -import configureCORS from "./Infrastructure/libs/cors"; -import configureHelmet from "./Infrastructure/libs/helmet"; -import swaggerSpec from "./Infrastructure/docs/swagger"; -import swaggerUi from "swagger-ui-express"; -import { config } from "dotenv"; -import { Logger } from "./Infrastructure/libs/logger"; -import errorHandler from "./Interface/middlewares/errorHandler"; -config(); const app: Express = express(); app.use(express.json()); app.use(express.urlencoded({ extended: true })); -configureCORS(app); -configureHelmet(app); -const logger = Logger.get(); - -app.use((req: Request, res: Response, next: NextFunction) => { - if (process.env.MODE_ENV === "development") { - logger.http( - `${req.method} ${req.url} - ${req.ip} - ${req.headers["user-agent"]}` - ); - } - next(); +app.get("/", (req: Request, res: Response) => { + res.send("Hello, TypeScript Node Express! Gateway"); }); -const authCommand = proxy("http://localhost:8081"); -const authQuery = proxy("http://localhost:8082"); -// const maintenanceCommand = proxy("http://localhost:8083"); -// const maintenanceQuery = proxy("http://localhost:8084"); -// const reservationCommand = proxy("http://localhost:8085"); -// const reservationQuery = proxy("http://localhost:8086"); -// const stockCommand = proxy("http://localhost:8087"); -// const stockQuery = proxy("http://localhost:8088"); +const auth = proxy("http://authcommand:5000"); +const query = proxy("http://authquery:5000"); -app.use("/doc", swaggerUi.serve, swaggerUi.setup(swaggerSpec)); +app.use("/auth", auth); -app.use(errorHandler()); - -app.use("/api/auth", (req: Request, res: Response, next: NextFunction) => { - req.method === "GET" ? authQuery(req, res, next) : authCommand(req, res, next); +const server = app.listen(8080, () => { + console.log("Gateway is Listening to Port 8080"); }); -// app.use("/api/maintenance", (req: Request, res: Response, next: NextFunction) => { -// req.method === "GET" ? maintenanceQuery(req, res, next) : maintenanceCommand(req, res, next); -// }); - -// app.use("/api/reservation", (req: Request, res: Response, next: NextFunction) => { -// req.method === "GET" ? reservationQuery(req, res, next) : reservationCommand(req, res, next); -// }); - -// app.use("/api/stock", (req: Request, res: Response, next: NextFunction) => { -// req.method === "GET" ? stockQuery(req, res, next) : stockCommand(req, res, next); -// }); - -const host = process.env.API_HOST || "localhost"; -const port = process.env.API_PORT || 5000; - -app.listen(port, () => { - console.log(`Server is running on http://${host}:${port}`); - console.log(`Server is running on http://${host}:${port}/doc`); -}); \ No newline at end of file +const exitHandler = () => { + if (server) { + server.close(() => { + console.info("Server closed"); + process.exit(1); + }); + } else { + process.exit(1); + } +}; + +const unexpectedErrorHandler = (error: unknown) => { + console.error(error); + exitHandler(); +}; + +process.on("uncaughtException", unexpectedErrorHandler); +process.on("unhandledRejection", unexpectedErrorHandler); diff --git a/apis/gateway/infrastructure/databases/adapter.ts b/apis/gateway/infrastructure/databases/adapter.ts deleted file mode 100644 index a0f6730..0000000 --- a/apis/gateway/infrastructure/databases/adapter.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MongooseService } from "./mongoose"; -import { Sequelize } from "sequelize"; - -export interface Adapter { - get(): Promise; - connect(): Promise; - disconnect(): Promise; -} \ No newline at end of file diff --git a/apis/gateway/infrastructure/databases/database.ts b/apis/gateway/infrastructure/databases/database.ts deleted file mode 100644 index bf2bc81..0000000 --- a/apis/gateway/infrastructure/databases/database.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { SequelizeService } from "./sequelize"; -import { MongooseService } from "./mongoose"; - -const connectDB = async (DBType: string): Promise => { - if (DBType === "pgsql") { - return await SequelizeService.get(); - }; - if (DBType === "mongo") { - return await MongooseService.get(); - }; - return undefined; -} - -export default connectDB; diff --git a/apis/gateway/infrastructure/databases/index.ts b/apis/gateway/infrastructure/databases/index.ts deleted file mode 100644 index 5b486c3..0000000 --- a/apis/gateway/infrastructure/databases/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./mongoose"; -export * from "./sequelize"; -// export * from "./redis"; -// export * from "./inMemory"; -export * from "./database"; -export * from "./adapter"; diff --git a/apis/gateway/infrastructure/databases/mongoose.ts b/apis/gateway/infrastructure/databases/mongoose.ts deleted file mode 100644 index f86b437..0000000 --- a/apis/gateway/infrastructure/databases/mongoose.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { config } from "dotenv"; -import { Mongoose, connect } from "mongoose"; -import { UserRepository } from "../repositories/mongoose"; -import { Adapter } from "./adapter"; - -config(); -export class MongooseService implements Adapter { - private static instance?: MongooseService; - - readonly mongoose: Mongoose; - readonly userRepository: UserRepository; - - private constructor(mongoose: Mongoose) { - this.mongoose = mongoose; - - this.userRepository = new UserRepository(this); - } - get(): Promise { - return MongooseService.get(); - } - connect(): Promise { - throw new Error("Method not implemented."); - } - - public static async get(): Promise { - if (this.instance !== undefined) { - return this.instance; - } - const connection = await this.connect(); - this.instance = new MongooseService(connection); - return this.instance; - } - - private static async connect(): Promise { - const connection = await connect(process.env.MONGO_URI as string, { - auth: { - username: process.env.MONGO_USER, - password: process.env.MONGO_PASSWORD, - }, - authSource: "admin", - dbName: process.env.MONGO_DB, - }); - return connection; - } - - public async disconnect(): Promise { - await this.mongoose.disconnect(); - } -} diff --git a/apis/gateway/infrastructure/databases/sequelize.ts b/apis/gateway/infrastructure/databases/sequelize.ts deleted file mode 100644 index 1da5874..0000000 --- a/apis/gateway/infrastructure/databases/sequelize.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { config } from "dotenv"; -import { Sequelize } from "sequelize"; -import { UserService } from "./user.service"; -import { Logger } from "../config/logger"; - -config(); -const logger = Logger.get(); - -export class SequelizeService { - private static instance?: SequelizeService; - - readonly sequelize: Sequelize; - readonly userService: UserService; - - private constructor(sequelize: Sequelize) { - this.sequelize = sequelize; - - this.userService = new UserService(this); - } - - public static async get(): Promise { - if (this.instance !== undefined) { - return this.instance; - } - const connection = await this.connect(); - this.instance = new SequelizeService(connection); - return this.instance; - } - - private static async connect(): Promise { - const sequelize = new Sequelize(process.env.POSTGRES_URI as string, { - dialect: "postgres", - logging: false, // Désactiver les logs SQL - }); - - try { - await sequelize.authenticate(); - } catch (error) { - logger.error( new Error("Impossible de se connecter à PostgreSQL :", error)); - } - - return sequelize; - } -} diff --git a/apis/gateway/infrastructure/orms/adapter.ts b/apis/gateway/infrastructure/orms/adapter.ts deleted file mode 100644 index bf58a7e..0000000 --- a/apis/gateway/infrastructure/orms/adapter.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface Adapter { - get(): Promise; - connect(): Promise; - disconnect(): Promise; -} \ No newline at end of file diff --git a/apis/gateway/infrastructure/orms/mongoose/index.ts b/apis/gateway/infrastructure/orms/mongoose/index.ts deleted file mode 100644 index baedd6d..0000000 --- a/apis/gateway/infrastructure/orms/mongoose/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './user.schema'; diff --git a/apis/gateway/infrastructure/orms/mongoose/user.schema.ts b/apis/gateway/infrastructure/orms/mongoose/user.schema.ts deleted file mode 100644 index e877cfa..0000000 --- a/apis/gateway/infrastructure/orms/mongoose/user.schema.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Schema } from "mongoose"; -import { User } from "../../../domain/entities"; -import { Role } from "../../../domain/enums"; - -/** - * @swagger - * components: - * schemas: - * User: - * type: object - * required: - * - email - * - password - * - role - * properties: - * email: - * type: string - * description: L'email de l'utilisateur - * password: - * type: string - * description: Le mot de passe de l'utilisateur - * role: - * type: string - * enum: [ROLE_USER, ROLE_STORE_KEEPER, ROLE_ADMIN, ROLE_COMPTA] - * default: ROLE_USER - * description: Le rôle de l'utilisateur - * example: - * email: john.doe@toto.com - * password: password - * role: ROLE_USER - */ - -export const userSchema = new Schema( - { - id: { - type: String, - required: false, - }, - email: { - type: String, - unique: true, - required: true, - }, - password: { - type: String, - required: true, - }, - role: { - type: String, - enum: Object.values(Role), - default: Role.Customer, - }, - }, - { - timestamps: true, - collection: "users", - versionKey: false, - } -); diff --git a/apis/gateway/infrastructure/repositories/index.ts b/apis/gateway/infrastructure/repositories/index.ts deleted file mode 100644 index da83afc..0000000 --- a/apis/gateway/infrastructure/repositories/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./repertory-choice"; -export * from "./sequelize/user.repository"; -export * from "./mongoose/user.repository"; -export * from "./sequelize"; -export * from "./mongoose"; \ No newline at end of file diff --git a/apis/gateway/infrastructure/repositories/mongoose/index.ts b/apis/gateway/infrastructure/repositories/mongoose/index.ts deleted file mode 100644 index e7ce7fd..0000000 --- a/apis/gateway/infrastructure/repositories/mongoose/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./user.repository"; \ No newline at end of file diff --git a/apis/gateway/infrastructure/repositories/mongoose/user.repository.ts b/apis/gateway/infrastructure/repositories/mongoose/user.repository.ts deleted file mode 100644 index 0b80ad0..0000000 --- a/apis/gateway/infrastructure/repositories/mongoose/user.repository.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Model } from "mongoose"; -import { UserRepositoryInterface } from "../../../application/ports"; -import { User } from "../../../domain/entities"; -import { userSchema } from "../../orm/mongoose"; -import { MongooseService } from "../../databases"; - -export class UserRepository implements UserRepositoryInterface { - - readonly mongooseService: MongooseService; - readonly model: Model; - - constructor(mongooseService: MongooseService) { - this.mongooseService = mongooseService; - const mongoose = this.mongooseService.mongoose; - this.model = mongoose.model("User",userSchema); - } - - create(user: User): Promise { - throw new Error("Method not implemented."); - } - - async findByEmail(email: string): Promise { - const userData = await this.model.findOne({ email }); - return userData ? new User(userData.email, userData.password, userData.role, userData.id) : null; - } -} diff --git a/apis/gateway/infrastructure/repositories/sequelize/index.ts b/apis/gateway/infrastructure/repositories/sequelize/index.ts deleted file mode 100644 index e7ce7fd..0000000 --- a/apis/gateway/infrastructure/repositories/sequelize/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./user.repository"; \ No newline at end of file diff --git a/apis/gateway/infrastructure/repositories/sequelize/user.repository.ts b/apis/gateway/infrastructure/repositories/sequelize/user.repository.ts deleted file mode 100644 index e69de29..0000000 diff --git a/apis/gateway/package.json b/apis/gateway/package.json index 62f664d..491b403 100644 --- a/apis/gateway/package.json +++ b/apis/gateway/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "main": "server.js", "scripts": { - "start": "tsc && node dist/server.js", - "dev": "nodemon src/server.ts", - "build": "tsc", + "start": "node dist/index.js", + "dev": "nodemon src/index.ts", + "build": "rm -rf ./dist && tsc", "lint": "eslint .", "lint:fix": "eslint . --fix", "prettier": "prettier --write .", @@ -16,30 +16,15 @@ "license": "ISC", "description": "", "dependencies": { - "bcrypt": "^5.1.1", "cors": "^2.8.5", "dotenv": "^16.4.7", "express": "^4.21.2", - "helmet": "^8.0.0", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.9.6", - "sequelize": "^6.37.5", - "swagger-jsdoc": "^6.2.8", - "swagger-ui-express": "^5.0.1", - "uuid": "^11.0.5", - "winston": "^3.17.0", - "winston-daily-rotate-file": "^5.0.0" + "express-http-proxy": "^2.1.1" }, "devDependencies": { - "@types/bcryptjs": "^2.4.6", "@types/cors": "^2.8.17", "@types/express": "^5.0.0", - "@types/jsonwebtoken": "^9.0.8", - "@types/sequelize": "^4.28.20", - "@types/swagger-jsdoc": "^6.0.4", - "@types/swagger-ui-express": "^4.1.7", - "eslint": "^9.19.0", - "nodemon": "^3.1.9", + "@types/express-http-proxy": "^1.6.6", "prettier": "^3.4.2", "ts-node": "^10.9.2", "typescript": "^5.7.3" diff --git a/apis/gateway/shared/helpers/password.helper.ts b/apis/gateway/shared/helpers/password.helper.ts deleted file mode 100644 index b20a22c..0000000 --- a/apis/gateway/shared/helpers/password.helper.ts +++ /dev/null @@ -1,32 +0,0 @@ -import bcrypt from 'bcryptjs'; -import { Logger } from '../../config/logger'; -import { PasswordServiceInterface } from '../../application/ports/password.service.interface'; - -const logger = Logger.get(); -export class PasswordHelper implements PasswordServiceInterface { - - private saltRounds: number; - - constructor(saltRounds: number = 10) { - this.saltRounds = saltRounds; - } - - async hash(password: string): Promise { - try { - const salt = bcrypt.genSaltSync(this.saltRounds); - return bcrypt.hashSync(password, salt); - } catch (error) { - logger.error(new Error(`Error hashing password: ${error}`)); - throw new Error("Erreur lors du hachage du mot de passe"); - } - } - - async compare(password: string, hash: string): Promise { - try { - return bcrypt.compareSync(password, hash); - } catch (error) { - logger.error(new Error(`Error comparing password: ${error}`)); - throw new Error("Erreur lors de la comparaison des mots de passe"); - } - } -} \ No newline at end of file diff --git a/apis/gateway/shared/helpers/token.helper.ts b/apis/gateway/shared/helpers/token.helper.ts deleted file mode 100644 index 30d21a1..0000000 --- a/apis/gateway/shared/helpers/token.helper.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { sign, verify } from 'jsonwebtoken'; -import { config } from 'dotenv'; -import { Logger } from '../../config/logger'; -import { AuthServiceInterface } from '../../application/ports'; -import { User } from '../../domain/entities'; - -config(); -export class TokenHelper implements AuthServiceInterface { - private secret: string; - - constructor() { - this.secret = process.env.JWT_SECRET || ''; - if (this.secret === '') { - Logger.get().error(new Error('JWT_SECRET is not defined')); - throw new Error('JWT_SECRET is not defined'); - } - } - - generateToken(user: User): string { - return sign({email: user.email, role: user.role}, this.secret, { expiresIn: '1h' }); - } - - verifyToken(token: string): any { - return verify(token, this.secret); - } -} \ No newline at end of file diff --git a/apis/gateway/shared/validators/env.ts b/apis/gateway/shared/validators/env.ts deleted file mode 100644 index e69de29..0000000 diff --git a/docker-compose.yml b/docker-compose.yml index 65d6f14..10fb310 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,57 +1,36 @@ services: - nginx: - build: - context: ./nginx - dockerfile: Dockerfile - ports: - - "8080:8080" - depends_on: - - gateway - - authcommand - - authquery - gateway: build: context: ./apis/gateway - target: production env_file: .env volumes: - - ./api:/api + - ./apis:/api ports: - - "5001:3000" + - "5001:8080" depends_on: - authcommand - - authquery authcommand: - container_name: authCommand + container_name: authcommand build: context: ./apis/authCommand - target: production env_file: .env - volumes: - - ./api:/api - ports: - - 8081:3000 depends_on: - - mongodb - networks: - - voltride + - "mongodb" + environment: + - NODE_ENV=production - authquery: - container_name: authQuery - build: - context: ./apis/authQuery - target: production - env_file: .env - volumes: - - ./api:/api - ports: - - 8082:3000 - depends_on: - - mongodb - networks: - - voltride + # authquery: + # container_name: authQuery + # build: + # context: ./apis/authQuery + # env_file: .env + # volumes: + # - ./apis:/api + # ports: + # - 8082:3000 + # depends_on: + # - mongodb # MaintenanceCommand: # container_name: MaintenanceCommand diff --git a/nginx/Dockerfile b/nginx/Dockerfile deleted file mode 100644 index 744103c..0000000 --- a/nginx/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM nginx:alpine3.21 - -RUN rm /etc/nginx/nginx.conf - -COPY nginx.conf /etc/nginx/nginx.conf diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index 66b3f73..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,28 +0,0 @@ -http { - upstream authcommand { - server user:8081; - } - upstream authquery { - server chat:8082; - } - # upstream gateway { - # server notification:8083; - # } - - server { - listen 8080 - - location /user/ { - proxy_pass http://user/; - } - - location /chat/ { - proxy_pass http://chat/; - } - - location /notification/ { - proxy_pass http://notification/; - } - } -} -events {} \ No newline at end of file