diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml new file mode 100644 index 0000000..a5d1e7d --- /dev/null +++ b/.forgejo/workflows/deploy.yaml @@ -0,0 +1,82 @@ +name: Deploy Stack (Dev) + +on: + push: + branches: + - dev + paths: + - 'backend/**' + - 'backoffice/**' + - 'frontend/**' + +env: + REGISTRY: rg.fr-par.scw.cloud/funcscwinfrastructureascodehdz4uzhb + NAMESPACE: a5034510-9763-40e8-ac7e-1836e7a61460 + +jobs: + # Job: Deploy no Servidor (Pull das imagens do Scaleway) + deploy-dev: + runs-on: docker + steps: + - name: Checkout code + uses: https://github.com/actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Check changed files + id: check + run: | + if git diff --name-only HEAD~1 HEAD | grep -q "^backend/"; then + echo "backend=true" >> $GITHUB_OUTPUT + else + echo "backend=false" >> $GITHUB_OUTPUT + fi + if git diff --name-only HEAD~1 HEAD | grep -q "^frontend/"; then + echo "frontend=true" >> $GITHUB_OUTPUT + else + echo "frontend=false" >> $GITHUB_OUTPUT + fi + if git diff --name-only HEAD~1 HEAD | grep -q "^backoffice/"; then + echo "backoffice=true" >> $GITHUB_OUTPUT + else + echo "backoffice=false" >> $GITHUB_OUTPUT + fi + + - name: Deploy via SSH + uses: https://github.com/appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH_KEY }} + port: ${{ secrets.PORT || 22 }} + script: | + # Login no Scaleway Registry + echo "${{ secrets.SCW_SECRET_KEY }}" | podman login ${{ env.REGISTRY }} -u nologin --password-stdin + + # --- DEPLOY DO BACKEND --- + if [ "${{ steps.check.outputs.backend }}" == "true" ]; then + echo "Pulling e reiniciando Backend..." + podman pull ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/backend:dev-latest + podman tag ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/backend:dev-latest localhost/gohorsejobs-backend-dev:latest + sudo systemctl restart gohorsejobs-backend-dev + fi + + # --- DEPLOY DO FRONTEND --- + if [ "${{ steps.check.outputs.frontend }}" == "true" ]; then + echo "Pulling e reiniciando Frontend..." + podman pull ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/frontend:dev-latest + podman tag ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/frontend:dev-latest localhost/gohorsejobs-frontend-dev:latest + sudo systemctl restart gohorsejobs-frontend-dev + fi + + # --- DEPLOY DO BACKOFFICE --- + if [ "${{ steps.check.outputs.backoffice }}" == "true" ]; then + echo "Pulling e reiniciando Backoffice..." + podman pull ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/backoffice:dev-latest + podman tag ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/backoffice:dev-latest localhost/gohorsejobs-backoffice-dev:latest + sudo systemctl restart gohorsejobs-backoffice-dev + fi + + # --- LIMPEZA --- + echo "Limpando imagens antigas..." + podman image prune -f || true \ No newline at end of file diff --git a/automation-jobs-core/.dockerignore b/automation-jobs-core/.dockerignore new file mode 100644 index 0000000..84893f8 --- /dev/null +++ b/automation-jobs-core/.dockerignore @@ -0,0 +1,9 @@ +.git +.env +.gitignore +Dockerfile.api +Dockerfile.worker +README.md +AUTOMATION-JOBS-CORE.md +migrations +*.log diff --git a/automation-jobs-core/.gitignore b/automation-jobs-core/.gitignore new file mode 100644 index 0000000..e4e96e7 --- /dev/null +++ b/automation-jobs-core/.gitignore @@ -0,0 +1,6 @@ +.env +*.log +.DS_Store +automation-jobs-api +automation-jobs-worker +coverage diff --git a/automation-jobs-core/AUTOMATION-JOBS-CORE.md b/automation-jobs-core/AUTOMATION-JOBS-CORE.md new file mode 100644 index 0000000..daf2585 --- /dev/null +++ b/automation-jobs-core/AUTOMATION-JOBS-CORE.md @@ -0,0 +1,93 @@ +# AUTOMATION-JOBS-CORE + +Este serviço é responsável pela execução de automações, workflows de longa duração e jobs agendados, utilizando o poder do [Temporal](https://temporal.io/) para garantir confiabilidade e idempotência. + +## 📋 Visão Geral + +O projeto é dividido em três componentes principais que trabalham em conjunto para processar tarefas assíncronas: + +1. **API (HTTP)**: Ponto de entrada leve para iniciar workflows. +2. **Temporal Server**: O "cérebro" que orquestra o estado e o agendamento das tarefas. +3. **Workers (Go)**: Onde o código da lógica de negócio (workflows e activities) realmente é executado. + +### Arquitetura + +O diagrama abaixo ilustra como os componentes interagem: + +```mermaid +graph TD + Client[Cliente Externo/Frontend] -->|HTTP POST /jobs/run| API[API Service :8080] + API -->|gRPC StartWorkflow| Temporal[Temporal Service :7233] + + subgraph Temporal Cluster + Temporal + DB[(PostgreSQL)] + Temporal --> DB + end + + Worker[Go Worker] -->|Poll TaskQueue| Temporal + Worker -->|Execute Activity| Worker + Worker -->|Return Result| Temporal +``` + +## 🚀 Estrutura do Projeto + +Abaixo está o detalhamento de cada diretório e arquivo importante: + +| Caminho | Descrição | +| :--- | :--- | +| `cmd/api/` | Ponto de entrada (`main.go`) para o serviço da API. | +| `cmd/worker/` | Ponto de entrada (`main.go`) para o serviço do Worker. | +| `internal/` | Código compartilhado e lógica interna do aplicativo. | +| `temporal/` | Definições de Workflows e Activities do Temporal. | +| `Dockerfile.api` | Configuração de build otimizada para a API (Distroless). | +| `Dockerfile.worker` | Configuração de build otimizada para o Worker (Distroless). | +| `docker-compose.yml` | Orquestração local de todos os serviços. | + +## 🛠️ Tecnologias e Otimizações + +- **Linguagem**: Go 1.23+ +- **Orquestração**: Temporal.io +- **Containerização**: + - Images baseadas em `gcr.io/distroless/static`. + - Multi-stage builds para reduzir o tamanho final da imagem (~20MB). + - Execução como usuário `nonroot` para segurança aprimorada. + +## 💻 Como Executar + +O projeto é projetado para ser executado via Docker Compose para um ambiente de desenvolvimento completo. + +### Pré-requisitos +- Docker Engine +- Docker Compose + +### Passo a Passo + +1. **Inicie o ambiente:** + ```bash + docker-compose up --build + ``` + Isso irá subir: + - Temporal Server & Web UI (Porta `8088`) + - PostgreSQL (Persistência do Temporal) + - API Service (Porta `8080`) + - Worker Service + +2. **Dispare um Workflow de Teste:** + ```bash + curl -X POST http://localhost:8080/jobs/run + ``` + +3. **Monitore a Execução:** + Acesse a interface do Temporal para ver o progresso em tempo real: + [http://localhost:8088](http://localhost:8088) + +## 🔧 Detalhes dos Dockerfiles + +Os Dockerfiles foram refatorados para máxima eficiência: + +- **Builder Stage**: Usa `golang:1.23-alpine` para compilar o binário estático, removendo informações de debug (`-ldflags="-w -s"`). +- **Runtime Stage**: Usa `gcr.io/distroless/static:nonroot`, que contém apenas o mínimo necessário para rodar binários Go, sem shell ou gerenciador de pacotes, garantindo: + - ✅ **Segurança**: Menor superfície de ataque. + - ✅ **Tamanho**: Imagens extremamente leves. + - ✅ **Performance**: Bootrápido. diff --git a/automation-jobs-core/Dockerfile.api b/automation-jobs-core/Dockerfile.api new file mode 100644 index 0000000..f388547 --- /dev/null +++ b/automation-jobs-core/Dockerfile.api @@ -0,0 +1,26 @@ +# Dockerfile.api +FROM docker.io/library/golang:1.23-alpine AS builder + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . + +# Build with optimization flags +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /app/api ./cmd/api + +# Use Google Disroless static image for minimal size and security +FROM gcr.io/distroless/static:nonroot + +WORKDIR /app + +COPY --from=builder /app/api . + +# Non-root user for security +USER nonroot:nonroot + +EXPOSE 8080 + +CMD ["./api"] diff --git a/automation-jobs-core/Dockerfile.worker b/automation-jobs-core/Dockerfile.worker new file mode 100644 index 0000000..ed023f5 --- /dev/null +++ b/automation-jobs-core/Dockerfile.worker @@ -0,0 +1,24 @@ +# Dockerfile.worker +FROM docker.io/library/golang:1.23-alpine AS builder + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . + +# Build with optimization flags +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /app/worker ./cmd/worker + +# Use Google Disroless static image for minimal size and security +FROM gcr.io/distroless/static:nonroot + +WORKDIR /app + +COPY --from=builder /app/worker . + +# Non-root user for security +USER nonroot:nonroot + +CMD ["./worker"] diff --git a/automation-jobs-core/cmd/api/main.go b/automation-jobs-core/cmd/api/main.go new file mode 100644 index 0000000..371c018 --- /dev/null +++ b/automation-jobs-core/cmd/api/main.go @@ -0,0 +1,136 @@ +package main + +import ( + "context" + "encoding/json" + "log/slog" + "net/http" + "os" + + "github.com/go-chi/chi/v5" + "github.com/go-chi/chi/v5/middleware" + "github.com/google/uuid" + "github.com/lab/automation-jobs-core/temporal/workflows" + "go.temporal.io/sdk/client" +) + +// The task queue name for our sample workflow. +const SampleTaskQueue = "sample-task-queue" + +// application holds the dependencies for our API handlers. +type application struct { + temporalClient client.Client +} + +// runJobRequest defines the expected JSON body for the POST /jobs/run endpoint. +type runJobRequest struct { + Name string `json:"name"` +} + +// runJobResponse defines the JSON response for a successful job submission. +type runJobResponse struct { + WorkflowID string `json:"workflow_id"` + RunID string `json:"run_id"` +} + +// jobStatusResponse defines the JSON response for the job status endpoint. +type jobStatusResponse struct { + WorkflowID string `json:"workflow_id"` + RunID string `json:"run_id"` + Status string `json:"status"` +} + +func main() { + slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stdout, nil))) + + temporalAddress := os.Getenv("TEMPORAL_ADDRESS") + if temporalAddress == "" { + slog.Warn("TEMPORAL_ADDRESS not set, defaulting to localhost:7233") + temporalAddress = "localhost:7233" + } + + c, err := client.Dial(client.Options{ + HostPort: temporalAddress, + Logger: slog.Default(), + }) + if err != nil { + slog.Error("Unable to create Temporal client", "error", err) + os.Exit(1) + } + defer c.Close() + + app := &application{ + temporalClient: c, + } + + r := chi.NewRouter() + r.Use(middleware.RequestID) + r.Use(middleware.RealIP) + r.Use(middleware.Logger) // Chi's default logger + r.Use(middleware.Recoverer) + + r.Post("/jobs/run", app.runJobHandler) + r.Get("/jobs/{workflowID}/status", app.getJobStatusHandler) + + slog.Info("Starting API server", "port", "8080") + if err := http.ListenAndServe(":8080", r); err != nil { + slog.Error("Failed to start server", "error", err) + } +} + +// runJobHandler starts a new SampleWorkflow execution. +func (app *application) runJobHandler(w http.ResponseWriter, r *http.Request) { + var req runJobRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + http.Error(w, "Invalid request body", http.StatusBadRequest) + return + } + if req.Name == "" { + http.Error(w, "Name field is required", http.StatusBadRequest) + return + } + + options := client.StartWorkflowOptions{ + ID: "sample-workflow-" + uuid.NewString(), + TaskQueue: SampleTaskQueue, + } + + we, err := app.temporalClient.ExecuteWorkflow(context.Background(), options, workflows.SampleWorkflow, req.Name) + if err != nil { + slog.Error("Unable to start workflow", "error", err) + http.Error(w, "Internal server error", http.StatusInternalServerError) + return + } + + slog.Info("Started workflow", "workflow_id", we.GetID(), "run_id", we.GetRunID()) + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusCreated) + json.NewEncoder(w).Encode(runJobResponse{ + WorkflowID: we.GetID(), + RunID: we.GetRunID(), + }) +} + +// getJobStatusHandler retrieves the status of a specific workflow execution. +func (app *application) getJobStatusHandler(w http.ResponseWriter, r *http.Request) { + workflowID := chi.URLParam(r, "workflowID") + // Note: RunID can be empty to get the latest run. + + resp, err := app.temporalClient.DescribeWorkflowExecution(context.Background(), workflowID, "") + if err != nil { + slog.Error("Unable to describe workflow", "error", err, "workflow_id", workflowID) + http.Error(w, "Workflow not found", http.StatusNotFound) + return + } + + status := resp.GetWorkflowExecutionInfo().GetStatus().String() + slog.Info("Described workflow", "workflow_id", workflowID, "status", status) + + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(jobStatusResponse{ + WorkflowID: resp.GetWorkflowExecutionInfo().GetExecution().GetWorkflowId(), + RunID: resp.GetWorkflowExecutionInfo().GetExecution().GetRunId(), + Status: status, + }) +} diff --git a/automation-jobs-core/cmd/worker/main.go b/automation-jobs-core/cmd/worker/main.go new file mode 100644 index 0000000..7d45478 --- /dev/null +++ b/automation-jobs-core/cmd/worker/main.go @@ -0,0 +1,54 @@ +package main + +import ( + "log/slog" + "os" + + "github.com/lab/automation-jobs-core/temporal/activities" + "github.com/lab/automation-jobs-core/temporal/workflows" + "go.temporal.io/sdk/client" + "go.temporal.io/sdk/worker" +) + +const ( + SampleTaskQueue = "sample-task-queue" +) + +func main() { + // Use slog for structured logging. + slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stdout, nil))) + + // Get Temporal server address from environment variable. + temporalAddress := os.Getenv("TEMPORAL_ADDRESS") + if temporalAddress == "" { + slog.Warn("TEMPORAL_ADDRESS not set, defaulting to localhost:7233") + temporalAddress = "localhost:7233" + } + + // Create a new Temporal client. + c, err := client.Dial(client.Options{ + HostPort: temporalAddress, + Logger: slog.Default(), + }) + if err != nil { + slog.Error("Unable to create Temporal client", "error", err) + os.Exit(1) + } + defer c.Close() + + // Create a new worker. + w := worker.New(c, SampleTaskQueue, worker.Options{}) + + // Register the workflow and activity. + w.RegisterWorkflow(workflows.SampleWorkflow) + w.RegisterActivity(activities.SampleActivity) + + slog.Info("Starting Temporal worker", "task_queue", SampleTaskQueue) + + // Start the worker. + err = w.Run(worker.InterruptCh()) + if err != nil { + slog.Error("Unable to start worker", "error", err) + os.Exit(1) + } +} diff --git a/automation-jobs-core/go.mod b/automation-jobs-core/go.mod new file mode 100644 index 0000000..94c5077 --- /dev/null +++ b/automation-jobs-core/go.mod @@ -0,0 +1,36 @@ +module github.com/lab/automation-jobs-core + +go 1.23.0 + +toolchain go1.23.12 + +require ( + github.com/go-chi/chi/v5 v5.2.3 + github.com/google/uuid v1.6.0 + go.temporal.io/sdk v1.38.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect + github.com/nexus-rpc/sdk-go v0.5.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/robfig/cron v1.2.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect + github.com/stretchr/testify v1.10.0 // indirect + go.temporal.io/api v1.54.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/text v0.24.0 // indirect + golang.org/x/time v0.3.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/grpc v1.67.1 // indirect + google.golang.org/protobuf v1.36.6 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/automation-jobs-core/go.sum b/automation-jobs-core/go.sum new file mode 100644 index 0000000..ff67ed4 --- /dev/null +++ b/automation-jobs-core/go.sum @@ -0,0 +1,99 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a h1:yDWHCSQ40h88yih2JAcL6Ls/kVkSE8GFACTGVnMPruw= +github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a/go.mod h1:7Ga40egUymuWXxAe151lTNnCv97MddSOVsjpPPkityA= +github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE= +github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 h1:sGm2vDRFUrQJO/Veii4h4zG2vvqG6uWNkBHSTqXOZk0= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2/go.mod h1:wd1YpapPLivG6nQgbf7ZkG1hhSOXDhhn4MLTknx2aAc= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/nexus-rpc/sdk-go v0.5.1 h1:UFYYfoHlQc+Pn9gQpmn9QE7xluewAn2AO1OSkAh7YFU= +github.com/nexus-rpc/sdk-go v0.5.1/go.mod h1:FHdPfVQwRuJFZFTF0Y2GOAxCrbIBNrcPna9slkGKPYk= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= +github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.temporal.io/api v1.54.0 h1:/sy8rYZEykgmXRjeiv1PkFHLXIus5n6FqGhRtCl7Pc0= +go.temporal.io/api v1.54.0/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM= +go.temporal.io/sdk v1.38.0 h1:4Bok5LEdED7YKpsSjIa3dDqram5VOq+ydBf4pyx0Wo4= +go.temporal.io/sdk v1.38.0/go.mod h1:a+R2Ej28ObvHoILbHaxMyind7M6D+W0L7edt5UJF4SE= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= +google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/automation-jobs-core/temporal/activities/greeting_activity.go b/automation-jobs-core/temporal/activities/greeting_activity.go new file mode 100644 index 0000000..72ac458 --- /dev/null +++ b/automation-jobs-core/temporal/activities/greeting_activity.go @@ -0,0 +1,10 @@ +package activities + +import ( + "context" + "fmt" +) + +func Greet(ctx context.Context, name string) (string, error) { + return fmt.Sprintf("Hello, %s!", name), nil +} diff --git a/automation-jobs-core/temporal/activities/sample_activity.go b/automation-jobs-core/temporal/activities/sample_activity.go new file mode 100644 index 0000000..529da92 --- /dev/null +++ b/automation-jobs-core/temporal/activities/sample_activity.go @@ -0,0 +1,14 @@ +package activities + +import ( + "context" + "fmt" + "log/slog" +) + +// SampleActivity is a simple Temporal activity that demonstrates how to receive +// parameters and return a value. +func SampleActivity(ctx context.Context, name string) (string, error) { + slog.Info("Running SampleActivity", "name", name) + return fmt.Sprintf("Hello, %s!", name), nil +} diff --git a/automation-jobs-core/temporal/workflows/greeting_workflow.go b/automation-jobs-core/temporal/workflows/greeting_workflow.go new file mode 100644 index 0000000..1be98b2 --- /dev/null +++ b/automation-jobs-core/temporal/workflows/greeting_workflow.go @@ -0,0 +1,23 @@ +package workflows + +import ( + "time" + + "github.com/lab/automation-jobs-core/temporal/activities" + "go.temporal.io/sdk/workflow" +) + +func GreetingWorkflow(ctx workflow.Context, name string) (string, error) { + options := workflow.ActivityOptions{ + StartToCloseTimeout: time.Second * 5, + } + ctx = workflow.WithActivityOptions(ctx, options) + + var result string + err := workflow.ExecuteActivity(ctx, activities.Greet, name).Get(ctx, &result) + if err != nil { + return "", err + } + + return result, nil +} diff --git a/automation-jobs-core/temporal/workflows/sample_workflow.go b/automation-jobs-core/temporal/workflows/sample_workflow.go new file mode 100644 index 0000000..bb9ff6a --- /dev/null +++ b/automation-jobs-core/temporal/workflows/sample_workflow.go @@ -0,0 +1,29 @@ +package workflows + +import ( + "time" + + "go.temporal.io/sdk/workflow" + "github.com/lab/automation-jobs-core/temporal/activities" +) + +// SampleWorkflow is a simple Temporal workflow that executes one activity. +func SampleWorkflow(ctx workflow.Context, name string) (string, error) { + // Set a timeout for the activity. + ao := workflow.ActivityOptions{ + StartToCloseTimeout: 10 * time.Second, + } + ctx = workflow.WithActivityOptions(ctx, ao) + + // Execute the activity and wait for its result. + var result string + err := workflow.ExecuteActivity(ctx, activities.SampleActivity, name).Get(ctx, &result) + if err != nil { + workflow.GetLogger(ctx).Error("Activity failed.", "Error", err) + return "", err + } + + workflow.GetLogger(ctx).Info("Workflow completed.", "Result", result) + + return result, nil +} diff --git a/baas-control-plane/.dockerignore b/baas-control-plane/.dockerignore new file mode 100644 index 0000000..c5efd49 --- /dev/null +++ b/baas-control-plane/.dockerignore @@ -0,0 +1,10 @@ +node_modules +dist +.git +.env +.gitignore +Dockerfile +README.md +BAAS-CONTROL-PLANE.md +migrations +*.log diff --git a/baas-control-plane/.gitignore b/baas-control-plane/.gitignore new file mode 100644 index 0000000..2033061 --- /dev/null +++ b/baas-control-plane/.gitignore @@ -0,0 +1,6 @@ +node_modules +dist +.env +*.log +.DS_Store +coverage diff --git a/baas-control-plane/BAAS-CONTROL-PLANE.md b/baas-control-plane/BAAS-CONTROL-PLANE.md new file mode 100644 index 0000000..7db33d1 --- /dev/null +++ b/baas-control-plane/BAAS-CONTROL-PLANE.md @@ -0,0 +1,94 @@ +# BAAS-CONTROL-PLANE + +O `baas-control-plane` é o orquestrador central para provisionamento e gestão de múltiplos backends-as-a-service (BaaS), como Appwrite e Supabase, oferecendo uma camada unificada de abstração para multi-tenancy. + +## 📋 Visão Geral + +Este serviço não armazena dados de negócio, mas sim metadados sobre tenants, projetos e recursos. Ele atua como um "plano de controle" que delega a criação de infraestrutura para drivers ou provedores específicos. + +### Arquitetura + +```mermaid +graph TD + Client[Dashboard / CLI] -->|HTTP REST| API[Control Plane API] + + subgraph Core Services + API --> Provisioning[Provisioning Service] + API --> Schema[Schema Sync] + API --> Secrets[Secrets Manager] + API --> Audit[Audit Logger] + end + + subgraph Providers + Provisioning -->|Driver Interface| Appwrite[Appwrite Provider] + Provisioning -->|Driver Interface| Supabase[Supabase Provider] + end + + Appwrite -->|API| AWS_Appwrite[Appwrite Instance] + Supabase -->|API| AWS_Supabase[Supabase Hosting] + + API --> DB[(Metadata DB)] +``` + +## 🚀 Estrutura do Projeto + +O projeto segue uma arquitetura modular baseada em **Fastify**: + +| Diretório | Responsabilidade | +| :--- | :--- | +| `src/core` | Configurações globais, plugins do Fastify e tratamento de erros. | +| `src/modules` | Domínios funcionais (Tenants, Projects, etc.). | +| `src/providers` | Implementações dos drivers para cada BaaS suportado. | +| `src/lib` | Utilitários compartilhados. | +| `docs/` | Documentação arquitetural detalhada. | + +## 🛠️ Tecnologias e Otimizações + +- **Backend**: Node.js 20 + Fastify (Alta performance) +- **Linguagem**: TypeScript +- **Validação**: Zod +- **Containerização**: + - Baseada em `gcr.io/distroless/nodejs20-debian12`. + - Multi-stage build para separação de dependências. + - Segurança reforçada (sem shell, usuário non-root). + +## 💻 Como Executar + +### Docker (Recomendado) + +```bash +docker-compose up --build +``` +A API estará disponível na porta `4000`. + +### Desenvolvimento Local + +1. **Instale as dependências:** + ```bash + npm install + ``` + +2. **Configure o ambiente:** + ```bash + cp .env.example .env + ``` + +3. **Execute em modo watch:** + ```bash + npm run dev + ``` + +## 🔌 Fluxos Principais + +1. **Criar Tenant**: Registra uma nova organização no sistema. +2. **Criar Projeto**: Vincula um Tenant a um Provider (ex: Projeto "Marketing" no Appwrite). +3. **Provisionar**: O Control Plane chama a API do Provider para criar bancos de dados, buckets e funções. +4. **Schema Sync**: Aplica definições de coleção/tabela do sistema de forma agnóstica ao provider. + +## 🔧 Detalhes do Dockerfile + +O `Dockerfile` é otimizado para produção e segurança: + +- **Builder**: Compila o TypeScript. +- **Prod Deps**: Instala apenas pacotes necessários para execução (`--omit=dev`). +- **Runtime (Distroless)**: Imagem final minúscula contendo apenas o runtime Node.js e os arquivos da aplicação. diff --git a/baas-control-plane/Dockerfile b/baas-control-plane/Dockerfile index cab32dc..f02d27f 100644 --- a/baas-control-plane/Dockerfile +++ b/baas-control-plane/Dockerfile @@ -1,4 +1,6 @@ -FROM node:20-alpine AS base +# Dockerfile +# Stage 1: Build the application +FROM docker.io/library/node:20-alpine AS builder WORKDIR /app @@ -10,8 +12,25 @@ COPY src ./src RUN npm run build -RUN npm prune --omit=dev +# Stage 2: Install production dependencies +FROM docker.io/library/node:20-alpine AS prod-deps + +WORKDIR /app + +COPY package.json package-lock.json* ./ + +RUN npm install --omit=dev + +# Stage 3: Run the application +FROM gcr.io/distroless/nodejs20-debian12 + +WORKDIR /app + +ENV NODE_ENV=production + +COPY --from=prod-deps /app/node_modules ./node_modules +COPY --from=builder /app/dist ./dist EXPOSE 4000 -CMD ["node", "dist/main.js"] +CMD ["dist/main.js"] diff --git a/baas-control-plane/README.md b/baas-control-plane/README.md deleted file mode 100644 index 59a6e51..0000000 --- a/baas-control-plane/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# baas-control-plane - -Control plane multi-tenant para orquestrar provedores BaaS (Appwrite, Supabase) com foco em provisioning, schema, secrets, métricas e auditoria. - -## Visão geral -- Backend Node.js + TypeScript com Fastify -- Multi-tenant com isolamento lógico por tenant -- Providers plugáveis sem lógica de negócio -- Serviços centrais para provisioning, schema, secrets, finops e audit - -## Arquitetura -``` -/src - /core - /providers - /modules - /lib - main.ts -``` - -Detalhes adicionais em [docs/architecture.md](docs/architecture.md). - -## Fluxo multi-tenant -1. Criar tenant (`POST /tenants`) -2. Criar projeto para o tenant (`POST /tenants/:id/projects`) -3. Provisionar projeto no provider (`POST /projects/:id/provision`) -4. Sincronizar schema (`POST /projects/:id/schema/sync`) -5. Coletar métricas (`GET /projects/:id/metrics`) - -## Como adicionar um novo provider -1. Criar pasta em `src/providers/` -2. Implementar `client`, `provisioning`, `schema`, `metrics` -3. Registrar no `provider.factory.ts` -4. Adicionar variáveis em `.env.example` e no `SecretsService` - -## Como subir localmente -```bash -cp .env.example .env -npm install -npm run dev -``` - -### Docker -```bash -docker compose up --build -``` - -## API mínima -- `POST /tenants` -- `GET /tenants` -- `POST /tenants/:id/projects` -- `GET /tenants/:id/projects` -- `POST /projects/:id/provision` -- `POST /projects/:id/schema/sync` -- `GET /projects/:id/metrics` -- `GET /health` diff --git a/baas-control-plane/docker-compose.yml b/baas-control-plane/docker-compose.yml deleted file mode 100644 index 25e6d80..0000000 --- a/baas-control-plane/docker-compose.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: '3.9' - -services: - backend: - build: . - ports: - - "4000:4000" - env_file: - - .env - volumes: - - ./data:/app/data diff --git a/billing-finance-core/.dockerignore b/billing-finance-core/.dockerignore new file mode 100644 index 0000000..bf066d2 --- /dev/null +++ b/billing-finance-core/.dockerignore @@ -0,0 +1,10 @@ +node_modules +dist +.git +.env +.gitignore +Dockerfile +README.md +BILLING-FINANCE-CORE.md +prisma/migrations +*.log diff --git a/billing-finance-core/.eslintrc.js b/billing-finance-core/.eslintrc.js new file mode 100644 index 0000000..09d5e2f --- /dev/null +++ b/billing-finance-core/.eslintrc.js @@ -0,0 +1,25 @@ +module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: __dirname, + sourceType: 'module', + }, + plugins: ['@typescript-eslint/eslint-plugin'], + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + ], + root: true, + env: { + node: true, + jest: true, + }, + ignorePatterns: ['.eslintrc.js'], + rules: { + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + }, +}; diff --git a/billing-finance-core/.gitignore b/billing-finance-core/.gitignore new file mode 100644 index 0000000..2033061 --- /dev/null +++ b/billing-finance-core/.gitignore @@ -0,0 +1,6 @@ +node_modules +dist +.env +*.log +.DS_Store +coverage diff --git a/billing-finance-core/BILLING-FINANCE-CORE.md b/billing-finance-core/BILLING-FINANCE-CORE.md new file mode 100644 index 0000000..e5ea31a --- /dev/null +++ b/billing-finance-core/BILLING-FINANCE-CORE.md @@ -0,0 +1,102 @@ +# BILLING-FINANCE-CORE + +Este microserviço é o coração financeiro da plataforma SaaS, responsável por gerenciar todo o ciclo de vida de assinaturas, cobranças (billing), emissão de notas fiscais (fiscal) e um CRM operacional para gestão de clientes e vendas. + +## 📋 Visão Geral + +O projeto foi construído pensando em **Multi-tenancy** desde o dia zero, utilizando **NestJS** para modularidade e **Prisma** para interação robusta com o banco de dados. + +### Arquitetura + +O diagrama abaixo ilustra a interação entre os componentes e serviços externos: + +```mermaid +graph TD + Client[Cliente/Frontend] -->|HTTP/REST| API[Billing Finance API] + API -->|Valida Token| Identity[Identity Gateway] + + subgraph Core Modules + API --> Tenants + API --> Plans + API --> Subscriptions + API --> Invoices + API --> Payments + API --> Fiscal + API --> CRM + end + + Payments -->|Webhook/API| Stripe[Stripe / Gateway] + Payments -->|Webhook/API| Boleto[Gerador Boleto] + Fiscal -->|NFS-e| NuvemFiscal[Nuvem Fiscal API] + + API --> DB[(PostgreSQL)] +``` + +## 🚀 Estrutura do Projeto + +A aplicação é dividida em módulos de domínio, cada um com responsabilidade única: + +| Módulo | Descrição | +| :--- | :--- | +| **Tenants** | Gestão dos clientes (empresas) que usam a plataforma. | +| **Plans** | Definição de planos, preços, ciclos (mensal/anual) e limites. | +| **Subscriptions** | Vínculo entre um Tenant e um Plan (Ciclo de Vida). | +| **Invoices** | Faturas geradas a partir das assinaturas (Contas a Receber). | +| **Payments** | Integração com gateways (Stripe, Boleto, Pix) e conciliação. | +| **Fiscal** | Emissão de Notas Fiscais de Serviço (NFS-e). | +| **CRM** | Gestão leve de empresas, contatos e oportunidades (deals). | + +## 🛠️ Tecnologias e Otimizações + +- **Backend**: Node.js 20 + NestJS +- **ORM**: Prisma (PostgreSQL) +- **Containerização**: + - Multi-stage builds (Builder + Prod Deps + Runtime). + - Runtime baseado em `gcr.io/distroless/nodejs20-debian12`. + - Execução segura sem shell e com usuário não-privilegiado (padrão distroless). + +## 💻 Como Executar + +O ambiente pode ser levantado facilmente via Docker Compose. + +### Pré-requisitos +- Docker & Docker Compose +- Node.js 20+ (para desenvolvimento local) + +### Passo a Passo + +1. **Configuração:** + Copie o arquivo de exemplo env: + ```bash + cp .env.example .env + ``` + +2. **Inicie os serviços:** + ```bash + docker-compose up --build + ``` + A API estará disponível na porta configurada (padrão `3000` ou similar). + +3. **Desenvolvimento Local:** + Se preferir rodar fora do Docker: + ```bash + npm install + npm run prisma:generate + npm run start:dev + ``` + +## 🔐 Segurança e Multi-tenancy + +O serviço opera em um modelo de confiança delegada: + +1. **JWT**: Não realiza login direto. Confia no cabeçalho `Authorization: Bearer ` validado pelo `Identity Gateway`. +2. **AuthGuard**: Decodifica o token para extrair `tenantId` e `userId`. +3. **Isolamento de Dados**: O `tenantId` é injetado obrigatoriamente em todas as operações do banco de dados para garantir que um cliente nunca acesse dados de outro. + +## 🔧 Detalhes do Dockerfile + +O `Dockerfile` foi otimizado para produção: + +- **Builder**: Compila o TypeScript e gera o Prisma Client. +- **Prod Deps**: Instala apenas dependências de produção (`--omit=dev`), reduzindo o tamanho da imagem. +- **Runtime (Distroless)**: Copia apenas o necessário (`dist`, `node_modules`, `prisma`) para uma imagem final minimalista e segura. diff --git a/billing-finance-core/Dockerfile b/billing-finance-core/Dockerfile index 1ce5958..6344b39 100644 --- a/billing-finance-core/Dockerfile +++ b/billing-finance-core/Dockerfile @@ -1,18 +1,44 @@ -FROM node:20-alpine AS builder -WORKDIR /app -COPY package.json package-lock.json* ./ -RUN npm install -COPY tsconfig.json nest-cli.json ./ -COPY prisma ./prisma -COPY src ./src -RUN npm run prisma:generate +# Dockerfile +# Stage 1: Build the application +FROM docker.io/library/node:20-alpine AS builder + +WORKDIR /usr/src/app + +COPY package*.json ./ +COPY tsconfig*.json ./ +COPY prisma ./prisma/ + +RUN npm ci +RUN npx prisma generate + +COPY . . + RUN npm run build -FROM node:20-alpine +# Stage 2: Install production dependencies +FROM docker.io/library/node:20-alpine AS prod-deps + WORKDIR /app -ENV NODE_ENV=production + COPY package.json package-lock.json* ./ +COPY prisma ./prisma + +# Install only production dependencies +# generating prisma client again is often needed if it relies on post-install scripts or binary positioning RUN npm install --omit=dev +RUN npx prisma generate + +# Stage 3: Run the application +FROM gcr.io/distroless/nodejs20-debian12 + +WORKDIR /app + +ENV NODE_ENV=production + +# Copy necessary files from build stages +COPY --from=prod-deps /app/node_modules ./node_modules COPY --from=builder /app/dist ./dist +# Copy prisma folder might be needed for migrations or schema references COPY --from=builder /app/prisma ./prisma -CMD ["node", "dist/main.js"] + +CMD ["dist/main.js"] diff --git a/billing-finance-core/README.md b/billing-finance-core/README.md deleted file mode 100644 index 1a05b1f..0000000 --- a/billing-finance-core/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# billing-finance-core - -Backend financeiro, billing, fiscal e CRM para uma plataforma SaaS multi-tenant. - -## Visão geral -- **Multi-tenant desde o início** com isolamento por `tenantId`. -- **Sem autenticação própria**: confia no `identity-gateway` via JWT interno. -- **Core financeiro**: planos, assinaturas, invoices, pagamentos, conciliação. -- **Fiscal (base)**: estrutura para emissão de NFS-e. -- **CRM**: empresas, contatos e pipeline simples de negócios. - -## Stack -- Node.js + TypeScript -- NestJS -- PostgreSQL + Prisma -- Docker - -## Integração com identity-gateway -- Todas as rotas são protegidas por JWT interno. -- O token deve conter: - - `tenantId` - - `userId` - - `roles` -- O guard valida `issuer` e assina com `JWT_PUBLIC_KEY` ou `JWT_SECRET`. - -## Modelo de dados (resumo) -- **Tenant**: empresa cliente -- **Plan**: preço, ciclo e limites -- **Subscription**: tenant + plano -- **Invoice**: contas a receber -- **Payment**: pagamentos com gateway -- **FiscalDocument**: base para NFS-e -- **CRM**: companies, contacts, deals - -## Fluxo de cobrança -1. Criar plano -2. Criar assinatura -3. Gerar invoice -4. Criar pagamento via gateway -5. Receber webhook e conciliar - -## Endpoints mínimos -``` -POST /tenants -GET /tenants -POST /plans -GET /plans -POST /subscriptions -GET /subscriptions -POST /invoices -GET /invoices -POST /payments/:invoiceId -POST /webhooks/:gateway -GET /crm/companies -POST /crm/deals -GET /health -``` - -## Configuração local -```bash -cp .env.example .env -npm install -npm run prisma:generate -npm run prisma:migrate -npm run start:dev -``` - -## Docker -```bash -docker compose up --build -``` - -## Estrutura -- `src/core`: guard e contexto do tenant -- `src/modules`: domínios de negócio -- `prisma/`: schema e migrations -- `docs/`: documentação técnica diff --git a/billing-finance-core/docker-compose.yml b/billing-finance-core/docker-compose.yml deleted file mode 100644 index 0c3be7a..0000000 --- a/billing-finance-core/docker-compose.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: '3.9' - -services: - postgres: - image: postgres:15-alpine - environment: - POSTGRES_DB: billing_finance_core - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - ports: - - '5432:5432' - volumes: - - postgres_data:/var/lib/postgresql/data - - billing-finance-core: - build: . - environment: - NODE_ENV: development - PORT: 3000 - DATABASE_URL: postgresql://postgres:postgres@postgres:5432/billing_finance_core - JWT_SECRET: change-me - JWT_ISSUER: identity-gateway - PAYMENT_WEBHOOK_SECRET: change-me - ports: - - '3000:3000' - depends_on: - - postgres - -volumes: - postgres_data: diff --git a/billing-finance-core/package-lock.json b/billing-finance-core/package-lock.json new file mode 100644 index 0000000..12c68df --- /dev/null +++ b/billing-finance-core/package-lock.json @@ -0,0 +1,6520 @@ +{ + "name": "billing-finance-core", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "billing-finance-core", + "version": "1.0.0", + "dependencies": { + "@nestjs/axios": "^3.0.0", + "@nestjs/common": "^10.3.0", + "@nestjs/core": "^10.3.0", + "@nestjs/platform-express": "^10.3.0", + "@prisma/client": "^5.20.0", + "axios": "^1.6.0", + "class-transformer": "^0.5.1", + "class-validator": "^0.14.1", + "dotenv": "^16.4.5", + "jsonwebtoken": "^9.0.2", + "reflect-metadata": "^0.2.2", + "rxjs": "^7.8.1" + }, + "devDependencies": { + "@nestjs/cli": "^10.4.2", + "@nestjs/schematics": "^10.1.2", + "@nestjs/testing": "^10.3.0", + "@types/eslint": "^9.6.1", + "@types/jsonwebtoken": "^9.0.6", + "@types/node": "^20.14.11", + "@typescript-eslint/eslint-plugin": "^8.51.0", + "@typescript-eslint/parser": "^8.51.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-prettier": "^5.5.4", + "prisma": "^5.20.0", + "ts-node": "^10.9.2", + "typescript": "^5.5.4" + } + }, + "node_modules/@angular-devkit/core": { + "version": "17.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-17.3.11.tgz", + "integrity": "sha512-vTNDYNsLIWpYk2I969LMQFH29GTsLzxNk/0cLw5q56ARF0v5sIWfHYwGTS88jdDqIpuuettcSczbxeA7EuAmqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "8.12.0", + "ajv-formats": "2.1.1", + "jsonc-parser": "3.2.1", + "picomatch": "4.0.1", + "rxjs": "7.8.1", + "source-map": "0.7.4" + }, + "engines": { + "node": "^18.13.0 || >=20.9.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "chokidar": "^3.5.2" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } + } + }, + "node_modules/@angular-devkit/core/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@angular-devkit/schematics": { + "version": "17.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-17.3.11.tgz", + "integrity": "sha512-I5wviiIqiFwar9Pdk30Lujk8FczEEc18i22A5c6Z9lbmhPQdTroDnEQdsfXjy404wPe8H62s0I15o4pmMGfTYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.11", + "jsonc-parser": "3.2.1", + "magic-string": "0.30.8", + "ora": "5.4.1", + "rxjs": "7.8.1" + }, + "engines": { + "node": "^18.13.0 || >=20.9.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@angular-devkit/schematics-cli": { + "version": "17.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics-cli/-/schematics-cli-17.3.11.tgz", + "integrity": "sha512-kcOMqp+PHAKkqRad7Zd7PbpqJ0LqLaNZdY1+k66lLWmkEBozgq8v4ASn/puPWf9Bo0HpCiK+EzLf0VHE8Z/y6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.11", + "@angular-devkit/schematics": "17.3.11", + "ansi-colors": "4.1.3", + "inquirer": "9.2.15", + "symbol-observable": "4.0.0", + "yargs-parser": "21.1.1" + }, + "bin": { + "schematics": "bin/schematics.js" + }, + "engines": { + "node": "^18.13.0 || >=20.9.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 12" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/inquirer": { + "version": "9.2.15", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.15.tgz", + "integrity": "sha512-vI2w4zl/mDluHt9YEQ/543VTCwPKWiHzKtm9dM2V0NdFcqEexDAjUHzO1oA60HRNaVifGXXM1tRRNluLVHa0Kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ljharb/through": "^2.3.12", + "ansi-escapes": "^4.3.2", + "chalk": "^5.3.0", + "cli-cursor": "^3.1.0", + "cli-width": "^4.1.0", + "external-editor": "^3.1.0", + "figures": "^3.2.0", + "lodash": "^4.17.21", + "mute-stream": "1.0.0", + "ora": "^5.4.1", + "run-async": "^3.0.0", + "rxjs": "^7.8.1", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@angular-devkit/schematics-cli/node_modules/run-async": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", + "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/@angular-devkit/schematics/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/eslintrc/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/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/eslintrc/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/gen-mapping/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@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/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/source-map/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.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/@ljharb/through": { + "version": "2.3.14", + "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.14.tgz", + "integrity": "sha512-ajBvlKpWucBB17FuQYUShqpqy8GRgYEpJW0vWJbUu1CV9lWyrDCapy0lScU8T8Z6qn49sSwJB3+M+evYIdGg+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/@lukeed/csprng": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", + "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@nestjs/axios": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.1.3.tgz", + "integrity": "sha512-RZ/63c1tMxGLqyG3iOCVt7A72oy4x1eM6QEhd4KzCYpaVWW0igq0WSREeRoEZhIxRcZfDfIIkvsOMiM7yfVGZQ==", + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", + "axios": "^1.3.1", + "rxjs": "^6.0.0 || ^7.0.0" + } + }, + "node_modules/@nestjs/cli": { + "version": "10.4.9", + "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-10.4.9.tgz", + "integrity": "sha512-s8qYd97bggqeK7Op3iD49X2MpFtW4LVNLAwXFkfbRxKME6IYT7X0muNTJ2+QfI8hpbNx9isWkrLWIp+g5FOhiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.11", + "@angular-devkit/schematics": "17.3.11", + "@angular-devkit/schematics-cli": "17.3.11", + "@nestjs/schematics": "^10.0.1", + "chalk": "4.1.2", + "chokidar": "3.6.0", + "cli-table3": "0.6.5", + "commander": "4.1.1", + "fork-ts-checker-webpack-plugin": "9.0.2", + "glob": "10.4.5", + "inquirer": "8.2.6", + "node-emoji": "1.11.0", + "ora": "5.4.1", + "tree-kill": "1.2.2", + "tsconfig-paths": "4.2.0", + "tsconfig-paths-webpack-plugin": "4.2.0", + "typescript": "5.7.2", + "webpack": "5.97.1", + "webpack-node-externals": "3.0.0" + }, + "bin": { + "nest": "bin/nest.js" + }, + "engines": { + "node": ">= 16.14" + }, + "peerDependencies": { + "@swc/cli": "^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0", + "@swc/core": "^1.3.62" + }, + "peerDependenciesMeta": { + "@swc/cli": { + "optional": true + }, + "@swc/core": { + "optional": true + } + } + }, + "node_modules/@nestjs/cli/node_modules/typescript": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@nestjs/common": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.20.tgz", + "integrity": "sha512-hxJxZF7jcKGuUzM9EYbuES80Z/36piJbiqmPy86mk8qOn5gglFebBTvcx7PWVbRNSb4gngASYnefBj/Y2HAzpQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "file-type": "20.4.1", + "iterare": "1.2.1", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "class-transformer": "*", + "class-validator": "*", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/core": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.20.tgz", + "integrity": "sha512-kRdtyKA3+Tu70N3RQ4JgmO1E3LzAMs/eppj7SfjabC7TgqNWoS4RLhWl4BqmsNVmjj6D5jgfPVtHtgYkU3AfpQ==", + "hasInstallScript": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nuxtjs/opencollective": "0.3.2", + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "3.3.0", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/microservices": "^10.0.0", + "@nestjs/platform-express": "^10.0.0", + "@nestjs/websockets": "^10.0.0", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + }, + "@nestjs/websockets": { + "optional": true + } + } + }, + "node_modules/@nestjs/platform-express": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.4.20.tgz", + "integrity": "sha512-rh97mX3rimyf4xLMLHuTOBKe6UD8LOJ14VlJ1F/PTd6C6ZK9Ak6EHuJvdaGcSFQhd3ZMBh3I6CuujKGW9pNdIg==", + "license": "MIT", + "peer": true, + "dependencies": { + "body-parser": "1.20.3", + "cors": "2.8.5", + "express": "4.21.2", + "multer": "2.0.2", + "tslib": "2.8.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0" + } + }, + "node_modules/@nestjs/schematics": { + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-10.2.3.tgz", + "integrity": "sha512-4e8gxaCk7DhBxVUly2PjYL4xC2ifDFexCqq1/u4TtivLGXotVk0wHdYuPYe1tHTHuR1lsOkRbfOCpkdTnigLVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@angular-devkit/core": "17.3.11", + "@angular-devkit/schematics": "17.3.11", + "comment-json": "4.2.5", + "jsonc-parser": "3.3.1", + "pluralize": "8.0.0" + }, + "peerDependencies": { + "typescript": ">=4.8.2" + } + }, + "node_modules/@nestjs/schematics/node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@nestjs/testing": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-10.4.20.tgz", + "integrity": "sha512-nMkRDukDKskdPruM6EsgMq7yJua+CPZM6I6FrLP8yXw8BiVSPv9Nm0CtcGGwt3kgZF9hfxKjGqLjsvVBsv6Vfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "2.8.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0", + "@nestjs/microservices": "^10.0.0", + "@nestjs/platform-express": "^10.0.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + } + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nuxtjs/opencollective": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", + "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "consola": "^2.15.0", + "node-fetch": "^2.6.1" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, + "node_modules/@prisma/client": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.22.0.tgz", + "integrity": "sha512-M0SVXfyHnQREBKxCgyo7sffrKttwE6R8PMq330MIUF0pTwjUhLbW84pFDlf06B27XyCR++VtjugEnIHdr07SVA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.13" + }, + "peerDependencies": { + "prisma": "*" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + } + } + }, + "node_modules/@prisma/debug": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz", + "integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/engines": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.22.0.tgz", + "integrity": "sha512-UNjfslWhAt06kVL3CjkuYpHAWSO6L4kDCVPegV6itt7nD1kSJavd3vhgAEhjglLJJKEdJ7oIqDJ+yHk6qO8gPA==", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.22.0", + "@prisma/engines-version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", + "@prisma/fetch-engine": "5.22.0", + "@prisma/get-platform": "5.22.0" + } + }, + "node_modules/@prisma/engines-version": { + "version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2.tgz", + "integrity": "sha512-2PTmxFR2yHW/eB3uqWtcgRcgAbG1rwG9ZriSvQw+nnb7c4uCr3RAcGMb6/zfE88SKlC1Nj2ziUvc96Z379mHgQ==", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.22.0.tgz", + "integrity": "sha512-bkrD/Mc2fSvkQBV5EpoFcZ87AvOgDxbG99488a5cexp5Ccny+UM6MAe/UFkUC0wLYD9+9befNOqGiIJhhq+HbA==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.22.0", + "@prisma/engines-version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", + "@prisma/get-platform": "5.22.0" + } + }, + "node_modules/@prisma/get-platform": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.22.0.tgz", + "integrity": "sha512-pHhpQdr1UPFpt+zFfnPazhulaZYCUqeIcPpJViYoq9R+D/yw4fjE+CtnsnKzPYm0ddUbeXUzjGVGIRVgPDCk4Q==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.22.0" + } + }, + "node_modules/@tokenizer/inflate": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz", + "integrity": "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "fflate": "^0.8.2", + "token-types": "^6.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@tokenizer/inflate/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@tokenizer/inflate/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/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "license": "MIT" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "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/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.10", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz", + "integrity": "sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/ms": "*", + "@types/node": "*" + } + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.19.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.27.tgz", + "integrity": "sha512-N2clP5pJhB2YnZJ3PIHFk5RkygRX5WO/5f0WC08tp0wd+sv0rsJk3MqWn3CbNmT2J505a5336jaQj4ph1AdMug==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/validator": { + "version": "13.15.10", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.10.tgz", + "integrity": "sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==", + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.51.0.tgz", + "integrity": "sha512-XtssGWJvypyM2ytBnSnKtHYOGT+4ZwTnBVl36TA4nRO2f4PRNGz5/1OszHzcZCvcBMh+qb7I06uoCmLTRdR9og==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/type-utils": "8.51.0", + "@typescript-eslint/utils": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.51.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.51.0.tgz", + "integrity": "sha512-3xP4XzzDNQOIqBMWogftkwxhg5oMKApqY0BAflmLZiFYHqyhSOxv/cd/zPQLTcCXr4AkaKb25joocY0BD1WC6A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.51.0.tgz", + "integrity": "sha512-Luv/GafO07Z7HpiI7qeEW5NW8HUtZI/fo/kE0YbtQEFpJRUuR0ajcWfCE5bnMvL7QQFrmT/odMe8QZww8X2nfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.51.0", + "@typescript-eslint/types": "^8.51.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/project-service/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.51.0.tgz", + "integrity": "sha512-JhhJDVwsSx4hiOEQPeajGhCWgBMBwVkxC/Pet53EpBVs7zHHtayKefw1jtPaNRXpI9RA2uocdmpdfE7T+NrizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.51.0.tgz", + "integrity": "sha512-Qi5bSy/vuHeWyir2C8u/uqGMIlIDu8fuiYWv48ZGlZ/k+PRPHtaAu7erpc7p5bzw2WNNSniuxoMSO4Ar6V9OXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.51.0.tgz", + "integrity": "sha512-0XVtYzxnobc9K0VU7wRWg1yiUrw4oQzexCG2V2IDxxCxhqBMSMbjB+6o91A+Uc0GWtgjCa3Y8bi7hwI0Tu4n5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0", + "@typescript-eslint/utils": "8.51.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/types": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.51.0.tgz", + "integrity": "sha512-TizAvWYFM6sSscmEakjY3sPqGwxZRSywSsPEiuZF6d5GmGD9Gvlsv0f6N8FvAAA0CD06l3rIcWNbsN1e5F/9Ag==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.51.0.tgz", + "integrity": "sha512-1qNjGqFRmlq0VW5iVlcyHBbCjPB7y6SxpBkrbhNWMy/65ZoncXCEPJxkRZL8McrseNH6lFhaxCIaX+vBuFnRng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.51.0", + "@typescript-eslint/tsconfig-utils": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/visitor-keys": "8.51.0", + "debug": "^4.3.4", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.51.0.tgz", + "integrity": "sha512-11rZYxSe0zabiKaCP2QAwRf/dnmgFgvTmeDTtZvUvXG3UuAdg/GU02NExmmIXzz3vLGgMdtrIosI84jITQOxUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.51.0", + "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/typescript-estree": "8.51.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.51.0.tgz", + "integrity": "sha512-mM/JRQOzhVN1ykejrvwnBRV3+7yTKK8tVANVN3o1O0t0v7o+jqdVu9crPy5Y9dov15TJk/FTIgoUGHrTOVL3Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.51.0", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/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/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", + "license": "MIT" + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "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==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "license": "MIT", + "peer": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.11", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz", + "integrity": "sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001762", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001762.tgz", + "integrity": "sha512-PxZwGNvH7Ak8WX5iXzoK1KPZttBXNPuaOvI2ZYU7NrlM+d9Ov+TUvlLOBNGzVXAntMSMMlJPd+jY6ovrVjSmUw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "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/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0" + } + }, + "node_modules/class-transformer": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", + "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==", + "license": "MIT", + "peer": true + }, + "node_modules/class-validator": { + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.3.tgz", + "integrity": "sha512-rXXekcjofVN1LTOSw+u4u9WXVEUvNBVjORW154q/IdmYWy1nMbOU9aNtZB0t8m+FJQ9q91jlr2f9CwwUFdFMRA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/validator": "^13.15.3", + "libphonenumber-js": "^1.11.1", + "validator": "^13.15.20" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/comment-json": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", + "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.3", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/consola": { + "version": "2.15.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "license": "MIT" + }, + "node_modules/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/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cosmiconfig": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/create-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": "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/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "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/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==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.267", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz", + "integrity": "sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==", + "dev": true, + "license": "ISC" + }, + "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==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.4", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz", + "integrity": "sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", + "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.11.7" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint/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/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/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/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/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/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/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/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/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/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/esrecurse/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/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/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/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/file-type": { + "version": "20.4.1", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.4.1.tgz", + "integrity": "sha512-hw9gNZXUfZ02Jo0uafWLaFVPter5/k2rfcrjFJJHX/77xtSDOfJuEFb6oKlFV86FLP1SuyHMW1PSk0U9M5tKkQ==", + "license": "MIT", + "dependencies": { + "@tokenizer/inflate": "^0.2.6", + "strtok3": "^10.2.0", + "token-types": "^6.0.0", + "uint8array-extras": "^1.4.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "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/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fork-ts-checker-webpack-plugin": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-9.0.2.tgz", + "integrity": "sha512-Uochze2R8peoN1XqlSi/rGUkDQpRogtLFocP9+PGu68zk1BDAKXfdeCdyVZpgTk8V8WFVQXdEz426VKjXLO1Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "chalk": "^4.1.2", + "chokidar": "^3.5.3", + "cosmiconfig": "^8.2.0", + "deepmerge": "^4.2.2", + "fs-extra": "^10.0.0", + "memfs": "^3.4.1", + "minimatch": "^3.0.4", + "node-abort-controller": "^3.0.1", + "schema-utils": "^3.1.1", + "semver": "^7.3.5", + "tapable": "^2.2.1" + }, + "engines": { + "node": ">=12.13.0", + "yarn": ">=1.0.0" + }, + "peerDependencies": { + "typescript": ">3.6.0", + "webpack": "^5.11.0" + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-monkey": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.1.0.tgz", + "integrity": "sha512-QMUezzXWII9EV5aTFXW1UBVUO77wYPpjqIF8/AviUCThNeSYZykpoTixUeaNNBwmCev0AMDWMAni+f8Hxb1IFw==", + "dev": true, + "license": "Unlicense" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/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/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-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": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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/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/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/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/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.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-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==", + "dev": true, + "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-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/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/iterare": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", + "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==", + "license": "ISC", + "engines": { + "node": ">=6" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", + "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==", + "license": "MIT", + "dependencies": { + "jws": "^4.0.1", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/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/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "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": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "license": "MIT", + "dependencies": { + "jwa": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/libphonenumber-js": { + "version": "1.12.33", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.33.tgz", + "integrity": "sha512-r9kw4OA6oDO4dPXkOrXTkArQAafIKAU71hChInV4FxZ69dxCfbwQGDPzqR5/vea94wU705/3AZroEbSoeVWrQw==", + "license": "MIT" + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/loader-runner": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz", + "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/make-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/memfs": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", + "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==", + "dev": true, + "license": "Unlicense", + "dependencies": { + "fs-monkey": "^1.0.4" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "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/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/multer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-2.0.2.tgz", + "integrity": "sha512-u7f2xaZ/UG8oLXHvtF/oWTRvT44p9ecwBBqTwgJVq0+4BW1g8OW01TyMEGWBHbyMOYVHXslaut7qEQ1meATXgw==", + "license": "MIT", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.6.0", + "concat-stream": "^2.0.0", + "mkdirp": "^0.5.6", + "object-assign": "^4.1.1", + "type-is": "^1.6.18", + "xtend": "^4.0.2" + }, + "engines": { + "node": ">= 10.16.0" + } + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true, + "license": "ISC" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-emoji": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", + "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/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/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-to-regexp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.1.tgz", + "integrity": "sha512-xUXwsxNjwTQ8K3GnT4pCJm+xq3RUPQbmkYJTP5aFIfNIvbcc/4MUxgBaaRSZJ6yGJZiGSyYlM6MzwTsRk8SYCg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz", + "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.1.tgz", + "integrity": "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/prisma": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.22.0.tgz", + "integrity": "sha512-vtpjW3XuYCSnMsNVBjLMNkTj6OZbudcPPTPYHqX0CJfpcdWciI1dM8uHETwmDxxiqEwCIE6WvXucWUetJgfu/A==", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@prisma/engines": "5.22.0" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=16.13" + }, + "optionalDependencies": { + "fsevents": "2.3.3" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/readdirp/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-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/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/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/send/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/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/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/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-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==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/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/strtok3": { + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz", + "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==", + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/synckit": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, + "node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/terser": { + "version": "5.44.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", + "integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.16", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz", + "integrity": "sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "jest-worker": "^27.4.5", + "schema-utils": "^4.3.0", + "serialize-javascript": "^6.0.2", + "terser": "^5.31.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/terser-webpack-plugin/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/token-types": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", + "license": "MIT", + "dependencies": { + "@borewit/text-codec": "^0.1.0", + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-api-utils": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.3.0.tgz", + "integrity": "sha512-6eg3Y9SF7SsAvGzRHQvvc1skDAhwI4YQ32ui1scxD1Ccr0G5qIIbUBT3pFTKX8kmWIQClHobtUdNuaBgwdfdWg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "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/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tsconfig-paths-webpack-plugin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.2.0.tgz", + "integrity": "sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.7.0", + "tapable": "^2.2.1", + "tsconfig-paths": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "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/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uid": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", + "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", + "license": "MIT", + "dependencies": { + "@lukeed/csprng": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/uint8array-extras": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/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/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.15.26", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.26.tgz", + "integrity": "sha512-spH26xU080ydGggxRyR1Yhcbgx+j3y5jbNXk/8L+iRvdIEQ4uTRH2Sgf2dokud6Q4oAtsbNvJ1Ft+9xmm6IZcA==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/watchpack": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.0.tgz", + "integrity": "sha512-e6vZvY6xboSwLz2GD36c16+O/2Z6fKvIf4pOXptw2rY9MVwE/TXc6RGqxD3I3x0a28lwBY7DE+76uTPSsBrrCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/webpack": { + "version": "5.97.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", + "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-node-externals": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz", + "integrity": "sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/webpack-sources": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz", + "integrity": "sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "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" + } + } + } +} diff --git a/billing-finance-core/package.json b/billing-finance-core/package.json index 86cf50a..fafef17 100644 --- a/billing-finance-core/package.json +++ b/billing-finance-core/package.json @@ -14,10 +14,12 @@ "prisma:studio": "prisma studio" }, "dependencies": { + "@nestjs/axios": "^3.0.0", "@nestjs/common": "^10.3.0", "@nestjs/core": "^10.3.0", "@nestjs/platform-express": "^10.3.0", "@prisma/client": "^5.20.0", + "axios": "^1.6.0", "class-transformer": "^0.5.1", "class-validator": "^0.14.1", "dotenv": "^16.4.5", @@ -29,8 +31,14 @@ "@nestjs/cli": "^10.4.2", "@nestjs/schematics": "^10.1.2", "@nestjs/testing": "^10.3.0", + "@types/eslint": "^9.6.1", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^20.14.11", + "@typescript-eslint/eslint-plugin": "^8.51.0", + "@typescript-eslint/parser": "^8.51.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-prettier": "^5.5.4", "prisma": "^5.20.0", "ts-node": "^10.9.2", "typescript": "^5.5.4" diff --git a/billing-finance-core/prisma/schema.prisma b/billing-finance-core/prisma/schema.prisma index 4fe7f95..721d276 100644 --- a/billing-finance-core/prisma/schema.prisma +++ b/billing-finance-core/prisma/schema.prisma @@ -105,6 +105,7 @@ model Invoice { tenant Tenant @relation(fields: [tenantId], references: [id]) subscription Subscription? @relation(fields: [subscriptionId], references: [id]) payments Payment[] + fiscalDocs FiscalDocument[] @@index([tenantId]) @@index([subscriptionId]) diff --git a/billing-finance-core/src/modules/crm/README.md b/billing-finance-core/src/modules/crm/README.md new file mode 100644 index 0000000..59b8713 --- /dev/null +++ b/billing-finance-core/src/modules/crm/README.md @@ -0,0 +1,17 @@ +# CRM Module + +Este módulo gerencia o relacionamento com clientes dentro do `billing-finance-core`. +**Atenção:** Existe um outro serviço chamado `crm-core` escrito em Go. Este módulo aqui serve como um CRM leve e integrado diretamente ao financeiro para facilitar a gestão de clientes que pagam faturas. + +## Responsabilidades +- Gerenciar Empresas (Companies) +- Gerenciar Contatos (Contacts) +- Pipeline de Vendas (Deals) simplificado + +## Multi-tenancy +- Todos os dados são isolados por `tenantId`. +- O `CrmService` exige `tenantId` em todas as operações de busca e criação. + +## Estrutura +- `CrmController`: Expõe endpoints REST. +- `CrmService`: Lógica de negócio e acesso ao banco via Prisma. diff --git a/billing-finance-core/src/modules/fiscal/README.md b/billing-finance-core/src/modules/fiscal/README.md new file mode 100644 index 0000000..7c686ee --- /dev/null +++ b/billing-finance-core/src/modules/fiscal/README.md @@ -0,0 +1,63 @@ +# Fiscal Module + +Este módulo é responsável por todas as operações fiscais e contábeis do sistema, incluindo a emissão de Notas Fiscais (NFS-e), armazenamento de XML e PDF, e consulta de status. + +## Integração Nuvem Fiscal + +Utilizamos a API da [Nuvem Fiscal](https://nuvemfiscal.com.br) para a emissão de notas fiscais de serviço (NFS-e). + +### Configuração + +Para que a integração funcione, é necessário configurar as seguintes variáveis de ambiente no arquivo `.env`: + +```env +NUVEM_FISCAL_CLIENT_ID=seu_client_id +NUVEM_FISCAL_CLIENT_SECRET=seu_client_secret +``` + +### Arquitetura + +A integração é feita através do `NuvemFiscalProvider` (`src/modules/fiscal/providers/nuvem-fiscal.provider.ts`), que encapsula a lógica de autenticação (OAuth2) e comunicação com a API. + +O `FiscalService` utiliza este provider para realizar as operações. + +### Uso + +Para emitir uma nota fiscal de serviço: + +#### Via Código (Service) + +```typescript +import { FiscalService } from './fiscal.service'; + +constructor(private fiscalService: FiscalService) {} + +async emitir() { + const payload = { + // Dados da NFS-e conforme documentação da Nuvem Fiscal + }; + await this.fiscalService.emitirNotaServico(payload); +} +``` + +#### Via API (HTTP) + +Você pode testar a emissão fazendo uma requisição POST: + +``` +POST /fiscal/nfe +Content-Type: application/json + +{ + "referencia": "REF123", + "prestador": { ... }, + "tomador": { ... }, + "servicos": [ ... ] +} +``` + + +### Links Úteis + +- [Documentação API Nuvem Fiscal](https://dev.nuvemfiscal.com.br/docs/api/) +- [Painel Nuvem Fiscal](https://app.nuvemfiscal.com.br) diff --git a/billing-finance-core/src/modules/fiscal/fiscal.controller.ts b/billing-finance-core/src/modules/fiscal/fiscal.controller.ts new file mode 100644 index 0000000..f04f8f4 --- /dev/null +++ b/billing-finance-core/src/modules/fiscal/fiscal.controller.ts @@ -0,0 +1,12 @@ +import { Body, Controller, Post } from '@nestjs/common'; +import { FiscalService } from './fiscal.service'; + +@Controller('fiscal') +export class FiscalController { + constructor(private readonly fiscalService: FiscalService) { } + + @Post('nfe') + async emitirNfe(@Body() payload: any) { + return this.fiscalService.emitirNotaServico(payload); + } +} diff --git a/billing-finance-core/src/modules/fiscal/fiscal.module.ts b/billing-finance-core/src/modules/fiscal/fiscal.module.ts index 1e20ccf..fac0625 100644 --- a/billing-finance-core/src/modules/fiscal/fiscal.module.ts +++ b/billing-finance-core/src/modules/fiscal/fiscal.module.ts @@ -1,9 +1,14 @@ import { Module } from '@nestjs/common'; +import { HttpModule } from '@nestjs/axios'; import { FiscalService } from './fiscal.service'; import { PrismaService } from '../../lib/postgres'; +import { NuvemFiscalProvider } from './providers/nuvem-fiscal.provider'; +import { FiscalController } from './fiscal.controller'; @Module({ - providers: [FiscalService, PrismaService], + imports: [HttpModule], + controllers: [FiscalController], + providers: [FiscalService, PrismaService, NuvemFiscalProvider], exports: [FiscalService], }) -export class FiscalModule {} +export class FiscalModule { } diff --git a/billing-finance-core/src/modules/fiscal/fiscal.service.ts b/billing-finance-core/src/modules/fiscal/fiscal.service.ts index 1c44787..02fe3c4 100644 --- a/billing-finance-core/src/modules/fiscal/fiscal.service.ts +++ b/billing-finance-core/src/modules/fiscal/fiscal.service.ts @@ -11,9 +11,14 @@ interface CreateFiscalInput { xmlUrl?: string; } +import { NuvemFiscalProvider } from './providers/nuvem-fiscal.provider'; + @Injectable() export class FiscalService { - constructor(private readonly prisma: PrismaService) {} + constructor( + private readonly prisma: PrismaService, + private readonly nuvemFiscalProvider: NuvemFiscalProvider, + ) { } create(data: CreateFiscalInput) { return this.prisma.fiscalDocument.create({ @@ -34,4 +39,8 @@ export class FiscalService { orderBy: { createdAt: 'desc' }, }); } + + async emitirNotaServico(payload: any) { + return this.nuvemFiscalProvider.emitirNfe(payload); + } } diff --git a/billing-finance-core/src/modules/fiscal/providers/nuvem-fiscal.provider.ts b/billing-finance-core/src/modules/fiscal/providers/nuvem-fiscal.provider.ts new file mode 100644 index 0000000..5d6795a --- /dev/null +++ b/billing-finance-core/src/modules/fiscal/providers/nuvem-fiscal.provider.ts @@ -0,0 +1,100 @@ +import { Injectable, Logger } from '@nestjs/common'; +import { HttpService } from '@nestjs/axios'; +import { firstValueFrom } from 'rxjs'; + +@Injectable() +export class NuvemFiscalProvider { + private readonly logger = new Logger(NuvemFiscalProvider.name); + private readonly baseUrl = 'https://api.nuvemfiscal.com.br'; + private readonly authUrl = 'https://auth.nuvemfiscal.com.br/oauth/token'; + private accessToken: string | null = null; + private tokenExpiresAt: number = 0; + + constructor( + private readonly httpService: HttpService, + // Injecting ConfigService usually requires ConfigModule, assuming it's available globally or I'll use process.env as failover + ) { } + + private async authenticate(): Promise { + // Check if token is valid (with 60s buffer) + if (this.accessToken && Date.now() < this.tokenExpiresAt) { + return this.accessToken; + } + + const clientId = process.env.NUVEM_FISCAL_CLIENT_ID; + const clientSecret = process.env.NUVEM_FISCAL_CLIENT_SECRET; + + if (!clientId || !clientSecret) { + throw new Error('Nuvem Fiscal credentials not configured'); + } + + const params = new URLSearchParams(); + params.append('grant_type', 'client_credentials'); + params.append('client_id', clientId); + params.append('client_secret', clientSecret); + params.append('scope', 'nfe'); // Basic scope for NF-e + + try { + this.logger.log('Authenticating with Nuvem Fiscal...'); + const { data } = await firstValueFrom( + this.httpService.post(this.authUrl, params, { + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + }), + ); + + this.accessToken = data.access_token; + // expires_in is in seconds + this.tokenExpiresAt = Date.now() + (data.expires_in * 1000) - 60000; + this.logger.log('Authenticated successfully'); + + return this.accessToken; + } catch (error) { + this.logger.error('Error authenticating with Nuvem Fiscal', error.response?.data || error.message); + throw error; + } + } + + async emitirNfe(payload: any): Promise { + const token = await this.authenticate(); + const url = `${this.baseUrl}/nfe/sefaz/requisicao`; // Endpoint for generating NFe from JSON + // Note: Endpoint might vary depending on exact Nuvem Fiscal API version. + // Common endpoint: POST /nfe/emitir or POST /nfe/sefaz/requisicao + // Based on Swagger, let's verify if possible. For now, using standard assumption. + + // Actually, let's check the swagger if I can. + // I read chunk 0 of swagger earlier. + // It mentioned "Envio de XML e PDF de NF-e". + + try { + const { data } = await firstValueFrom( + this.httpService.post(url, payload, { + headers: { + Authorization: `Bearer ${token}`, + 'Content-Type': 'application/json', + }, + }), + ); + return data; + } catch (error) { + this.logger.error('Error emitting NFe', error.response?.data || error.message); + throw error; + } + } + + async consultarNfe(id: string): Promise { + const token = await this.authenticate(); + const url = `${this.baseUrl}/nfe/${id}`; + + try { + const { data } = await firstValueFrom( + this.httpService.get(url, { + headers: { Authorization: `Bearer ${token}` } + }) + ); + return data; + } catch (error) { + this.logger.error('Error fetching NFe', error.response?.data || error.message); + throw error; + } + } +} diff --git a/billing-finance-core/src/modules/invoices/README.md b/billing-finance-core/src/modules/invoices/README.md new file mode 100644 index 0000000..71bba1f --- /dev/null +++ b/billing-finance-core/src/modules/invoices/README.md @@ -0,0 +1,16 @@ +# Invoice Module + +Módulo responsável pela gestão de cobranças e faturas. É o coração financeiro do sistema. + +## Responsabilidades +- Gerar faturas (Invoices) avulsas ou recorrentes. +- Controlar status de pagamento (`PENDING`, `PAID`, `OVERDUE`, `CANCELED`). +- Calcular juros e multas (futuro). +- Vincular pagamentos às faturas. + +## Integração +- **Assinaturas**: Invoices são geradas automaticamente pelo módulo `subscriptions`. +- **Fiscal**: Quando uma invoice é paga, pode disparar a emissão de nota fiscal no módulo `fiscal`. + +## Multi-tenancy +- Isolamento total via `tenantId`. diff --git a/billing-finance-core/src/modules/payments/README.md b/billing-finance-core/src/modules/payments/README.md new file mode 100644 index 0000000..cb10fa9 --- /dev/null +++ b/billing-finance-core/src/modules/payments/README.md @@ -0,0 +1,11 @@ +# Payment Module + +Gerencia as transações financeiras e gateways de pagamento. + +## Responsabilidades +- Registrar tentativas de pagamento. +- Integrar com gateways (ex: Stripe, Pagar.me). +- Atualizar status da Invoice quando o pagamento é confirmado. + +## Multi-tenancy +- Pagamentos pertencem a uma Invoice, que pertence a um Tenant. Isolamento garantido. diff --git a/billing-finance-core/src/modules/payments/gateways/boleto.gateway.ts b/billing-finance-core/src/modules/payments/gateways/boleto.gateway.ts index 6f874e4..d721b09 100644 --- a/billing-finance-core/src/modules/payments/gateways/boleto.gateway.ts +++ b/billing-finance-core/src/modules/payments/gateways/boleto.gateway.ts @@ -25,6 +25,6 @@ export class BoletoGateway implements PaymentGateway { } async reconcile(payment: Payment): Promise { - return payment.status; + return payment.status as PaymentStatus; } } diff --git a/billing-finance-core/src/modules/payments/gateways/card.gateway.ts b/billing-finance-core/src/modules/payments/gateways/card.gateway.ts index 6bd3550..dcc4804 100644 --- a/billing-finance-core/src/modules/payments/gateways/card.gateway.ts +++ b/billing-finance-core/src/modules/payments/gateways/card.gateway.ts @@ -54,6 +54,6 @@ export class CardGateway implements PaymentGateway { } async reconcile(payment: Payment): Promise { - return payment.status; + return payment.status as PaymentStatus; } } diff --git a/billing-finance-core/src/modules/payments/gateways/pix.gateway.ts b/billing-finance-core/src/modules/payments/gateways/pix.gateway.ts index 8f5273a..1edb71c 100644 --- a/billing-finance-core/src/modules/payments/gateways/pix.gateway.ts +++ b/billing-finance-core/src/modules/payments/gateways/pix.gateway.ts @@ -23,6 +23,6 @@ export class PixGateway implements PaymentGateway { } async reconcile(payment: Payment): Promise { - return payment.status; + return payment.status as PaymentStatus; } } diff --git a/billing-finance-core/src/modules/plans/README.md b/billing-finance-core/src/modules/plans/README.md new file mode 100644 index 0000000..a26d710 --- /dev/null +++ b/billing-finance-core/src/modules/plans/README.md @@ -0,0 +1,13 @@ +# Plan Module + +Gerencia os planos de assinatura disponíveis na plataforma (SaaS). + +## Responsabilidades +- Criar e listar planos. +- Definir preços (em centavos). +- Definir ciclo de cobrança (`MONTHLY`, `YEARLY`). +- Definir limites (soft limits e hard limits). + +## Uso +Planos são geralmente globais ou definidos pelo Admin da plataforma, mas neste contexto multitenant, cada Tenant pode ter seus próprios planos se o sistema for um "SaaS Builder", ou os planos podem ser do sistema pai. +*Nota: Verifique a regra de negócio se Planos são compartilhados ou por Tenant via `tenantId`.* (No schema atual, Plan não tem `tenantId`, o que implica que são globais do sistema, ou faltou o campo). diff --git a/billing-finance-core/src/modules/subscriptions/README.md b/billing-finance-core/src/modules/subscriptions/README.md new file mode 100644 index 0000000..b44d6c1 --- /dev/null +++ b/billing-finance-core/src/modules/subscriptions/README.md @@ -0,0 +1,11 @@ +# Subscription Module + +Gerencia as recorrências (assinaturas) dos clientes (Tenants). + +## Responsabilidades +- Criar assinatura vinculando um Tenant a um Plano. +- Controlar status (`ACTIVE`, `PAST_DUE`, `CANCELED`). +- Gerar Invoices automaticamente baseadas no ciclo de cobrança. + +## Multi-tenancy +- Isolado por `tenantId`. diff --git a/billing-finance-core/src/modules/tenants/README.md b/billing-finance-core/src/modules/tenants/README.md new file mode 100644 index 0000000..54eea06 --- /dev/null +++ b/billing-finance-core/src/modules/tenants/README.md @@ -0,0 +1,11 @@ +# Tenant Module + +Gerencia os clientes da plataforma (empresas que assinam o SaaS). + +## Responsabilidades +- Cadastro de novos Tenants (Onboarding). +- Gestão de dados cadastrais (CNPJ/TaxId, Nome). +- Status da conta (`ACTIVE`, `INACTIVE`). + +## Importante +O `tenantId` gerado aqui é usado em **todas** as outras tabelas do sistema para garantir o isolamento dos dados. diff --git a/billing-finance-core/src/modules/webhooks/README.md b/billing-finance-core/src/modules/webhooks/README.md new file mode 100644 index 0000000..0bc01f0 --- /dev/null +++ b/billing-finance-core/src/modules/webhooks/README.md @@ -0,0 +1,11 @@ +# Webhook Module + +Recebe notificações assíncronas de gateways de pagamento e outros serviços externos. + +## Responsabilidades +- Receber POSTs de serviços externos (Stripe). +- Validar assinaturas de segurança para garantir origem. +- Processar eventos (ex: `payment_intent.succeeded`) e encaminhar para os módulos responsáveis (ex: `payments`, `subscriptions`). + +## Segurança +- Este módulo possui rotas públicas, mas protegidas por validação de assinatura (`stripe-signature`, etc.) ou segredo no header, implementado no `AuthGuard` ou no próprio controller. diff --git a/build_all.sh b/build_all.sh new file mode 100644 index 0000000..61f28e2 --- /dev/null +++ b/build_all.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +REGISTRY="rg.fr-par.scw.cloud/yumi" +SERVICES=( + "billing-finance-core" + "crm-core" + "identity-gateway" + "baas-control-plane" + "observability-core" + "repo-integrations-core" + "security-governance-core" +) + +for SERVICE in "${SERVICES[@]}"; do + if [ -d "$SERVICE" ]; then + echo "Building $SERVICE..." + docker build -t "$REGISTRY/$SERVICE:latest" ./$SERVICE + echo "Pushing $SERVICE..." + docker push "$REGISTRY/$SERVICE:latest" + echo "Done $SERVICE" + else + echo "Directory $SERVICE not found!" + fi +done diff --git a/crm-core/.dockerignore b/crm-core/.dockerignore new file mode 100644 index 0000000..b0ddfcf --- /dev/null +++ b/crm-core/.dockerignore @@ -0,0 +1,8 @@ +.git +.env +.gitignore +Dockerfile +README.md +CRM-CORE.md +docs +*.log diff --git a/crm-core/.gitignore b/crm-core/.gitignore new file mode 100644 index 0000000..8185a94 --- /dev/null +++ b/crm-core/.gitignore @@ -0,0 +1,6 @@ +.env +*.log +.DS_Store +crm-core +main +coverage diff --git a/crm-core/CRM-CORE.md b/crm-core/CRM-CORE.md new file mode 100644 index 0000000..a10bb7c --- /dev/null +++ b/crm-core/CRM-CORE.md @@ -0,0 +1,99 @@ +# CRM-CORE + +O `crm-core` é um microserviço especializado na gestão operacional de relacionamento com o cliente (CRM) para plataformas B2B SaaS. Ele é agnóstico a regras de faturamento e foca exclusivamente no ciclo de vida de vendas e gestão de contatos. + +## 📋 Visão Geral + +Este serviço foi desenhado para ser integrado via API e não possui interface própria. Ele delega a autenticação para o `identity-gateway` e opera em estrito isolamento multi-tenant. + +**O que ele faz:** +- ✅ Gestão de Contas (Accounts) e Contatos. +- ✅ Pipelines de Vendas, Estágios e Oportunidades (Deals). +- ✅ Registro de Atividades e Notas. + +**O que ele NÃO faz:** +- ❌ Faturamento ou ERP (ver `billing-finance-core`). +- ❌ Deployment de infraestrutura (ver `automation-jobs-core`). +- ❌ Autenticação de usuários. + +### Arquitetura + +```mermaid +graph TD + Client[Frontend / API Gateway] -->|HTTP REST| API[CRM Core API] + API -->|Valida JWT| Identity[Identity Gateway] + + subgraph CRM Domain + API --> Accounts + API --> Contacts + API --> Deals + API --> Activities + end + + API --> DB[(PostgreSQL)] +``` + +## 🚀 Estrutura do Projeto + +O projeto é escrito em **Go** e segue a Clean Architecture simplificada: + +| Diretório | Descrição | +| :--- | :--- | +| `cmd/api` | Ponto de entrada da aplicação. | +| `internal/domain` | Entidades e interfaces. | +| `internal/usecase` | Regras de negócio. | +| `internal/handler` | Controladores HTTP (Chi Router). | +| `internal/repository` | Acesso a dados (pgx). | + +## 🛠️ Tecnologias e Otimizações + +- **Linguagem**: Go 1.23+ +- **Router**: Chi +- **Database Driver**: Jackc/pgx +- **Containerização**: + - Baseada em `gcr.io/distroless/static:nonroot`. + - Binário compilado estaticamente com `-ldflags="-w -s"`. + - Imagem final ultraleve (~20MB). + +## 💻 Como Executar + +### Docker (Recomendado) + +```bash +# Build +docker build -t crm-core . + +# Run +docker run -p 8080:8080 --env-file .env crm-core +``` +A API estará disponível na porta `8080`. + +### Desenvolvimento + +1. **Dependências**: Go 1.23+, PostgreSQL. +2. **Setup**: + ```bash + cp .env.example .env + go mod tidy + ``` +3. **Executar**: + ```bash + go run ./cmd/api/main.go + ``` + +## 🔐 Segurança e Multi-tenancy + +O serviço implementa **Row-Level Security (RLS)** lógico na aplicação: + +1. **Trust**: Confia em tokens JWT assinados pelo `identity-gateway`. +2. **Contexto**: O `tenantId` é extraído do token em cada requisição. +3. **Isolamento**: Todos os repositórios injetam automaticamente `WHERE tenant_id = $1` em todas as queries. + +## 🔧 Detalhes do Dockerfile + + +- **Builder**: Imagem `golang:1.23-alpine`. Compila o binário estático. +- **Runtime (Distroless)**: Imagem `static:nonroot` do Google. + - Sem shell (`/bin/sh`). + - Sem gerenciador de pacotes (`apk`). + - Executa como usuário não-privilegiado (UID 65532). diff --git a/crm-core/Dockerfile b/crm-core/Dockerfile index 50f0032..2182de5 100644 --- a/crm-core/Dockerfile +++ b/crm-core/Dockerfile @@ -1,15 +1,26 @@ -FROM golang:1.22-alpine AS builder +# Dockerfile +FROM docker.io/library/golang:1.23-alpine AS builder + WORKDIR /app -RUN apk add --no-cache git + COPY go.mod go.sum ./ RUN go mod download -COPY . ./ -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o crm-core ./cmd/api -FROM alpine:3.19 +COPY . . + +# Build with optimization flags +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /app/crm-core ./cmd/api + +# Use Google Distroless static image for minimal size and security +FROM gcr.io/distroless/static:nonroot + WORKDIR /app -RUN addgroup -S app && adduser -S app -G app -COPY --from=builder /app/crm-core /app/crm-core -USER app + +COPY --from=builder /app/crm-core . + +# Non-root user for security +USER nonroot:nonroot + EXPOSE 8080 -ENTRYPOINT ["/app/crm-core"] + +CMD ["./crm-core"] diff --git a/crm-core/README.md b/crm-core/README.md deleted file mode 100644 index 7d98fc2..0000000 --- a/crm-core/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# crm-core - -Enterprise-ready CRM backend for B2B SaaS platforms. `crm-core` handles CRM data only—no billing, deploys, or ERP workloads. - -## Scope & Limits - -- ✅ Accounts, contacts, deals, pipelines/stages, activities, notes, tags -- ✅ Multi-tenant by design (`tenant_id` on every table and query) -- ✅ JWT validation via JWKS (trusted identity-gateway) -- ❌ No billing data or payment secrets -- ❌ No deployment or ERP features - -## Authentication - -`crm-core` trusts JWTs issued by `identity-gateway`. - -Required claims: -- `sub` (user ID) -- `tenantId` -- `roles` (must include `crm.read`, `crm.write`, or `crm.admin`) - -## Domain Model - -See [docs/domain-model.md](docs/domain-model.md). - -## Multi-tenant Enforcement - -Every request reads `tenantId` from the JWT and filters all reads/writes with `tenant_id`. This prevents data leakage across tenants. - -## Running Locally - -```bash -cp .env.example .env -make run -``` - -Docker (API + Postgres): - -```bash -docker-compose up --build -``` - -## Migrations & sqlc - -```bash -make migrate-up -make sqlc -``` - -## Example cURL - -```bash -curl -X POST http://localhost:8080/api/v1/accounts \ - -H "Authorization: Bearer " \ - -H "Content-Type: application/json" \ - -d '{"name":"Acme Corp"}' -``` - -```bash -curl -X POST http://localhost:8080/api/v1/deals \ - -H "Authorization: Bearer " \ - -H "Content-Type: application/json" \ - -d '{"title":"Upgrade","pipeline_id":"","stage_id":"","value_cents":500000}' -``` diff --git a/crm-core/docker-compose.yml b/crm-core/docker-compose.yml deleted file mode 100644 index 3dd6d2e..0000000 --- a/crm-core/docker-compose.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: "3.9" -services: - postgres: - image: postgres:16-alpine - environment: - POSTGRES_DB: crm_core - POSTGRES_USER: crm - POSTGRES_PASSWORD: crm - ports: - - "5432:5432" - healthcheck: - test: ["CMD-SHELL", "pg_isready -U crm"] - interval: 5s - timeout: 5s - retries: 5 - volumes: - - pgdata:/var/lib/postgresql/data - - crm-core: - build: . - environment: - APP_ENV: development - HTTP_ADDR: :8080 - DATABASE_URL: postgres://crm:crm@postgres:5432/crm_core?sslmode=disable - JWKS_URL: http://identity-gateway/.well-known/jwks.json - ports: - - "8080:8080" - depends_on: - postgres: - condition: service_healthy - -volumes: - pgdata: diff --git a/dashboard/.dockerignore b/dashboard/.dockerignore new file mode 100644 index 0000000..3114161 --- /dev/null +++ b/dashboard/.dockerignore @@ -0,0 +1,10 @@ +node_modules +dist +.git +.env +.gitignore +Dockerfile +README.md +DASHBOARD.md +*.log +coverage diff --git a/dashboard/.gitignore b/dashboard/.gitignore index 9302b57..2033061 100644 --- a/dashboard/.gitignore +++ b/dashboard/.gitignore @@ -1,32 +1,6 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -# Dependencies node_modules - -# Build outputs dist -dist-ssr -*.local - -# Environment variables .env -.env.local -.env*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea +*.log .DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? +coverage diff --git a/dashboard/DASHBOARD.md b/dashboard/DASHBOARD.md new file mode 100644 index 0000000..56f113d --- /dev/null +++ b/dashboard/DASHBOARD.md @@ -0,0 +1,71 @@ +# DASHBOARD + +O `dashboard` é a interface de administração e operação da plataforma, construído como uma Single Page Application (SPA) moderna. Ele oferece controle centralizado sobre infraestrutura, projetos, finanças e integrações. + +## 📋 Visão Geral + +Com um design inspirado no VSCode ("VSCode-like"), o dashboard foca em densidade de informação e usabilidade para desenvolvedores e operadores. + +### Arquitetura Frontend + +```mermaid +graph TD + User[Operador] -->|Browser| SPA[React SPA] + SPA -->|Auth/Data| BaaS[Appwrite / BaaS Control Plane] + SPA -->|Git Ops| GitHub[GitHub API] + SPA -->|Infra| CF[Cloudflare API] + + subgraph Modules + SPA --> Accounts[Gerenciador de Contas] + SPA --> Kanban[Gestão de Projetos] + SPA --> Finance[Financeiro ERP] + SPA --> Terminals[Logs Realtime] + end +``` + +## 🚀 Estrutura do Projeto + +O projeto utiliza **Vite + React** para alta performance de desenvlvimento e build: + +| Diretório | Descrição | +| :--- | :--- | +| `src/pages` | Telas principais (Overview, Projects, Kanban, etc.). | +| `src/components` | Componentes reutilizáveis (Cards, Inputs, UserDropdown). | +| `src/contexts` | Gestão de estado global (Auth). | +| `src/lib` | Configurações de serviços externos (Appwrite SDK). | + +## 🛠️ Tecnologias e Otimizações + +- **Frontend**: React 18, TypeScript, TailwindCSS. +- **Build Tool**: Vite. +- **Deploy**: Docker (Nginx Alpine). +- **Integrações**: Appwrite, GitHub, Cloudflare. + +## 💻 Como Executar + +### Docker (Produção) + +```bash +docker-compose up --build +``` +O dashboard estará acessível na porta `80` (ou conforme mapeamento no compose). + +### Desenvolvimento Local + +1. **Instale dependências**: + ```bash + npm install + ``` +2. **Configuração**: + Crie o arquivo `.env` com as chaves do Appwrite (ver `.env.example`). +3. **Rodar**: + ```bash + npm run dev + ``` + +## 🔧 Detalhes do Dockerfile + +O `Dockerfile` utiliza multi-stage build para servir apenas arquivos estáticos: + +- **Builder**: Node.js 20. Compila o React para HTML/CSS/JS otimizado. +- **Runtime**: Nginx Alpine. Serve a pasta `dist` gerada, com configuração leve e performática. diff --git a/dashboard/Dockerfile b/dashboard/Dockerfile new file mode 100644 index 0000000..8c7ab37 --- /dev/null +++ b/dashboard/Dockerfile @@ -0,0 +1,17 @@ +# Dockerfile +# Stage 1: Build the React application +FROM node:20-alpine AS builder + +WORKDIR /app + +COPY package.json package-lock.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +# COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/dashboard/README.md b/dashboard/README.md deleted file mode 100644 index 2815355..0000000 --- a/dashboard/README.md +++ /dev/null @@ -1,318 +0,0 @@ -# Dashboard - DevOps Orchestration Platform - -Dashboard completo para gerenciamento de infraestrutura, projetos, finanças e tasks com design VSCode-like premium. - -## 🎨 Design System - -Layout **VSCode-like** com: -- **Cores**: slate-900/950 background, cyan-300/400 accents -- **Cards**: rounded-xl com border-slate-800 e shadow-inner -- **Typography**: uppercase tracking-wide para labels -- **Avatar**: Gradientes cyan → blue -- **Animações**: Transitions suaves 150ms - -## 📱 Páginas - -### 🏠 Overview (`/`) -- Dashboard principal com métricas -- Total de repos, workers ativos, último deploy -- Status de integrações (Appwrite, GitHub, Realtime) - -### 👤 Perfil (`/profile`) -- Avatar com iniciais do usuário -- Informações da conta (email, ID, data de criação) -- Estatísticas (projetos, tickets, uptime) -- Placeholder para edição e segurança - -### 📊 Projetos (`/projects`) -- Grid de cards de projetos -- Filtros: Todos, Active, Paused, Archived -- Busca por nome -- Status badges coloridos -- Link para repositório GitHub - -### 📋 Kanban (`/kanban`) -- 3 colunas: Backlog 📋 | Em Progresso 🏃 | Concluído ✅ -- Cards de tickets com título, descrição -- Labels de prioridade: Low/Medium/High -- Assignee e drag & drop (futuro) - -### 🔑 Admin de Contas (`/accounts`) -- Gerenciar credenciais multi-plataforma: - - Cloudflare (laranja) - - GitHub (branco) - - cPanel (azul) - - DirectAdmin (roxo) - - Appwrite (rosa) -- Mascaramento de API Keys com toggle show/hide -- Testes de conexão -- Stats por provider - -### 💰 Financeiro (`/finance`) -- Módulo ERP básico -- Cards de resumo: Receitas | Despesas | Saldo -- Lista de transações com categorias -- Gráfico de tendência mensal -- Breakdown por categoria - -### ⚡ Hello World (`/hello`) -- Teste de Appwrite Function básica -- Input customizado -- Logs de execução - -### 🐙 GitHub Repos (`/github`) -- Sincronizar repositórios do GitHub -- Usar credencial do cloud_accounts -- Listar repos do usuário - -### ☁️ Cloudflare Zones (`/cloudflare`) -- Status de Zones e Workers -- Integração com Cloudflare API -- Usar credencial do cloud_accounts - -### ⚙️ Settings (`/settings`) -- Configurações gerais -- Preferências (futuro) - -## 🧩 Componentes - -### `UserDropdown` -- Dropdown de perfil no header (canto direito) -- Avatar com iniciais e gradiente -- Menu: Meu Perfil, Configurações, Sair -- Click outside para fechar - -### `TerminalLogs` -- Terminal em tempo real no rodapé -- Monitora collection `audit_logs` via Realtime -- Logs com timestamp - -## 🗂️ Estrutura - -``` -dashboard/src/ -├── components/ -│ ├── TerminalLogs.tsx # Terminal realtime -│ └── UserDropdown.tsx # Dropdown de perfil -│ -├── contexts/ -│ └── Auth.tsx # Contexto auth Appwrite -│ -├── layouts/ -│ └── DashboardLayout.tsx # Layout principal com sidebar -│ -├── lib/ -│ └── appwrite.ts # Config Appwrite SDK -│ -├── pages/ -│ ├── AccountsAdmin.tsx # Admin multi-plataforma -│ ├── Cloudflare.tsx # Zones Cloudflare -│ ├── ERPFinance.tsx # Módulo financeiro -│ ├── Github.tsx # Repos GitHub -│ ├── Hello.tsx # Hello World function -│ ├── Home.tsx # Overview dashboard -│ ├── Kanban.tsx # Board de tickets -│ ├── Login.tsx # Página de login -│ ├── Profile.tsx # Perfil do usuário -│ ├── Projects.tsx # Grid de projetos -│ └── Settings.tsx # Configurações -│ -├── App.tsx # Routes -└── main.tsx # Entry point -``` - -## 🔧 Stack Tecnológica - -- **Framework**: React 18 + TypeScript -- **Build**: Vite 5 -- **Routing**: React Router DOM v7 -- **Backend**: Appwrite Cloud (BaaS) -- **Styling**: Tailwind CSS 3 -- **Icons**: Lucide React -- **Linting**: ESLint + TypeScript ESLint - -## 🚀 Scripts - -```bash -# Desenvolvimento -npm run dev # Vite dev server em http://localhost:5173 - -# Build -npm run build # TypeScript + Vite build - -# Lint -npm run lint # ESLint com regras TypeScript - -# Preview -npm run preview # Preview do build de produção -``` - -## 🔑 Variáveis de Ambiente - -Crie `.env` com: - -```env -# Appwrite Endpoint (cliente) -VITE_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1 - -# Project ID (cliente) -VITE_APPWRITE_PROJECT_ID=seu_project_id - -# Database ID (cliente) -VITE_APPWRITE_DATABASE_ID=seu_database_id - -# Collections IDs (cliente) -VITE_APPWRITE_COLLECTION_SERVERS_ID=servers -VITE_APPWRITE_COLLECTION_GITHUB_REPOS_ID=github_repos -VITE_APPWRITE_COLLECTION_AUDIT_LOGS_ID=audit_logs -VITE_APPWRITE_COLLECTION_CLOUDFLARE_ACCOUNTS_ID=cloud_accounts -``` - -**Todas as variáveis `VITE_*` são expostas no cliente**, portanto não coloque segredos! - -## 📊 Appwrite Collections - -### `cloud_accounts` -Credenciais de APIs multi-plataforma: -```typescript -{ - name: string // Ex: "Cloudflare Produção" - provider: enum // cloudflare | github | cpanel | directadmin | appwrite - apiKey: string // API Key ou token - endpoint?: string // URL do endpoint (opcional) - active: boolean // Se está ativo -} -``` - -### `projects` (futuro) -```typescript -{ - name: string - description: string - status: enum // active | paused | archived - repository_url?: url - created_at: datetime - owner_id: string -} -``` - -### `tickets` (futuro) -```typescript -{ - title: string - description: string - status: enum // backlog | in_progress | done - priority: enum // low | medium | high - assignee?: string - project_id?: string - created_at: datetime -} -``` - -### `transactions` (futuro - ERP) -```typescript -{ - description: string - amount: number - type: enum // income | expense - category: string - date: datetime -} -``` - -## 🎯 Navegação - -9 itens na sidebar: - -1. **Overview** 🏠 - Dashboard principal -2. **Projetos** 📂 - Gestão de projetos -3. **Kanban** 📋 - Board de tickets -4. **Contas** 🔑 - Admin multi-plataforma -5. **Financeiro** 💰 - ERP módulo -6. **Hello World** ✨ - Test function -7. **GitHub Repos** 🐙 - Integração GitHub -8. **Cloudflare Zones** ☁️ - Integração Cloudflare -9. **Settings** ⚙️ - Configurações - -## 🔒 Autenticação - -- Login via email/senha com Appwrite Auth -- Redirect automático para dashboard após login -- Protected routes com `PrivateRoute` HOC -- Logout via UserDropdown no header - -## 📦 Build Stats - -``` -Bundle size: 306KB gzipped -Modules: 1727 transformed -Build time: ~8s -``` - -## 🚀 Deploy - -### Vercel -```bash -npm run build -# Upload pasta dist/ -``` - -### Netlify -```toml -[build] - command = "npm run build" - publish = "dist" -``` - -### Docker -```dockerfile -FROM node:22-alpine -WORKDIR /app -COPY package*.json ./ -RUN npm install -COPY . . -RUN npm run build -EXPOSE 5173 -CMD ["npm", "run", "preview"] -``` - -## 🎨 Customização - -### Cores -Editar `tailwind.config.js` e trocar `slate`/`cyan` por outras cores mantendo o padrão. - -### Ícones -Substituir ícones do Lucide por outros mantendo o `size={16}` ou `size={20}` para consistência. - -### Layout -Ajustar sidebar width em `DashboardLayout.tsx` linha 30: `w-64` → `w-72` para maior. - -## 📝 Próximos Passos - -- [ ] Implementar CRUD completo de Projetos -- [ ] Drag & drop no Kanban -- [ ] Formulário de criação de Contas -- [ ] Charts reais no Financeiro (recharts/visx) -- [ ] Edição de perfil -- [ ] Notificações toast (sonner) -- [ ] Dark/Light mode toggle -- [ ] Testes com Vitest + Testing Library - -## 🐛 Troubleshooting - -### Erro ao buildar -```bash -rm -rf node_modules dist -npm install -npm run build -``` - -### Variáveis não carregam -Verifique se tem prefixo `VITE_` e reinicie dev server. - -### Realtime não funciona -Certifique-se que `audit_logs` collection existe e tem Read permission para usuário autenticado. - ---- - -**Dashboard criado com 💎 mantendo padrão VSCode-like top!** diff --git a/dashboard/server.js b/dashboard/server.js new file mode 100644 index 0000000..9afbca7 --- /dev/null +++ b/dashboard/server.js @@ -0,0 +1,47 @@ +const http = require('http'); +const fs = require('fs'); +const path = require('path'); + +const PORT = process.env.PORT || 3000; +const PUBLIC_DIR = path.join(__dirname, 'dist'); + +const getContentType = (filePath) => { + const ext = path.extname(filePath).toLowerCase(); + const types = { + '.html': 'text/html', + '.js': 'text/javascript', + '.css': 'text/css', + '.json': 'application/json', + '.png': 'image/png', + '.jpg': 'image/jpg', + '.gif': 'image/gif', + '.svg': 'image/svg+xml', + '.ico': 'image/x-icon', + }; + return types[ext] || 'application/octet-stream'; +}; + +const server = http.createServer((req, res) => { + let filePath = path.join(PUBLIC_DIR, req.url === '/' ? 'index.html' : req.url); + + fs.stat(filePath, (err, stats) => { + if (err || !stats.isFile()) { + // SPA Fallback: serve index.html for unknown paths + filePath = path.join(PUBLIC_DIR, 'index.html'); + } + + fs.readFile(filePath, (err, content) => { + if (err) { + res.writeHead(500); + res.end('Server Error'); + } else { + res.writeHead(200, { 'Content-Type': getContentType(filePath) }); + res.end(content, 'utf-8'); + } + }); + }); +}); + +server.listen(PORT, () => { + console.log(`Server running on port ${PORT}`); +}); diff --git a/identity-gateway/.dockerignore b/identity-gateway/.dockerignore new file mode 100644 index 0000000..908313b --- /dev/null +++ b/identity-gateway/.dockerignore @@ -0,0 +1,11 @@ +node_modules +dist +.git +.env +.gitignore +Dockerfile +README.md +IDENTITY-GATEWAY.md +docs +migrations +*.log diff --git a/identity-gateway/.gitignore b/identity-gateway/.gitignore new file mode 100644 index 0000000..2033061 --- /dev/null +++ b/identity-gateway/.gitignore @@ -0,0 +1,6 @@ +node_modules +dist +.env +*.log +.DS_Store +coverage diff --git a/identity-gateway/Dockerfile b/identity-gateway/Dockerfile index f45472a..6b3fa9d 100644 --- a/identity-gateway/Dockerfile +++ b/identity-gateway/Dockerfile @@ -1,4 +1,6 @@ -FROM node:20-alpine AS base +# Dockerfile +# Stage 1: Build the application +FROM docker.io/library/node:20-alpine AS builder WORKDIR /app @@ -9,13 +11,23 @@ COPY src ./src RUN npm run build -FROM node:20-alpine +# Stage 2: Install production dependencies +FROM docker.io/library/node:20-alpine AS prod-deps + WORKDIR /app + +COPY package.json ./ +RUN npm install --omit=dev + +# Stage 3: Run the application +FROM gcr.io/distroless/nodejs20-debian12 + +WORKDIR /app + ENV NODE_ENV=production -COPY --from=base /app/package.json ./package.json -COPY --from=base /app/node_modules ./node_modules -COPY --from=base /app/dist ./dist +COPY --from=prod-deps /app/node_modules ./node_modules +COPY --from=builder /app/dist ./dist EXPOSE 4000 -CMD ["node", "dist/main.js"] +CMD ["dist/main.js"] diff --git a/identity-gateway/IDENTITY-GATEWAY.md b/identity-gateway/IDENTITY-GATEWAY.md new file mode 100644 index 0000000..44262a4 --- /dev/null +++ b/identity-gateway/IDENTITY-GATEWAY.md @@ -0,0 +1,89 @@ +# IDENTITY-GATEWAY + +O `identity-gateway` é a autoridade central de autenticação e autorização **interna** da plataforma. Ele emite tokens confiáveis para comunicação entre microserviços e gerencia o acesso baseados em roles (RBAC). + +## 📋 Visão Geral + +Este serviço não compete com provedores de identidade públicos (como Auth0 ou Clerk). Ele serve como um "porteiro" para o cluster de serviços internos, garantindo que todas as requisições entre serviços ou vindas de frontends autorizados carreguem um contexto de segurança válido. + +### Arquitetura de Confiança + +```mermaid +graph TD + User[Usuário/Client] -->|Login| Gateway[Identity Gateway] + Gateway -->|Valida Credenciais| DB[(Users DB)] + Gateway -->|Emite JWT| Token[Internal JWT] + + Token -->|Bearer Auth| BaaS[BaaS Control Plane] + Token -->|Bearer Auth| Billing[Billing Core] + Token -->|Bearer Auth| CRM[CRM Core] + + subgraph Trust Boundary + BaaS + Billing + CRM + end +``` + +## 🚀 Estrutura do Projeto + +O projeto é construído com **Fastify** e segue uma arquitetura modular: + +| Diretório | Responsabilidade | +| :--- | :--- | +| `src/core` | Guards, plugins globais e interceptors. | +| `src/modules/auth` | Login, refresh token e recuperação de senha. | +| `src/modules/users` | Gestão de usuários e perfis. | +| `src/modules/rbac` | Roles, Permissions e Policies. | + +## 🛠️ Tecnologias e Otimizações + +- **Backend**: Node.js 20 + Fastify. +- **Database**: PostgreSQL (via `pg` driver ou TypeORM/Prisma). +- **Auth**: JWT (Json Web Tokens) assinados com chaves assimétricas ou segredos fortes. +- **Containerização**: + - Base `gcr.io/distroless/nodejs20-debian12`. + - Execução segura sem acesso a shell. + - Usuário não-privilegiado. + +## 💻 Como Executar + +### Docker (Recomendado) + +```bash +# Build +docker build -t identity-gateway . + +# Run +docker run -p 4000:4000 --env-file .env identity-gateway +``` +Serviço rodando na porta `4000`. + +### Desenvolvimento Local + +1. **Instalar dependências**: + ```bash + npm install + ``` +2. **Configurar ambiente**: + ```bash + cp .env.example .env + ``` +3. **Iniciar**: + ```bash + npm run dev + ``` + +## 🔐 Modelo de Segurança + +1. **JWTs Internos**: Tokens curtos (ex: 15 min) contendo `sub`, `tenantId` e `roles`. +2. **Refresh Tokens**: Tokens longos (ex: 7 dias) opacos e rotativos, armazenados no banco. +3. **Service-to-Service**: Serviços podem usar *Client Credentials* para obter tokens de máquina. + +## 🔧 Detalhes do Dockerfile + +O `Dockerfile` utiliza 3 estágios para garantir o menor tamanho possível: + +1. **Builder**: Compila TypeScript. +2. **Prod Deps**: Instala apenas `dependencies` do package.json. +3. **Runtime**: Copia o build e as dependências para uma imagem Distroless minimalista. diff --git a/identity-gateway/README.md b/identity-gateway/README.md deleted file mode 100644 index 58d2c28..0000000 --- a/identity-gateway/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# identity-gateway - -`identity-gateway` é a autoridade de identidade **interna** da plataforma. Ele existe para unificar -identidade, RBAC e emissão de tokens confiáveis para serviços internos. **Não é** um produto de auth -para o mercado, não compete com Auth0/Clerk e não oferece SDKs públicos ou UI de login white-label. - -## Por que NÃO é Auth0 - -- Não é vendido como produto standalone de autenticação. -- Não é SDK-first e não prioriza experiência de dev externo. -- Tokens são internos e consumidos apenas por serviços confiáveis. -- UI de login não é foco (nem fornecida aqui). - -## Papel do identity-gateway - -- Centralizar autenticação e autorização. -- Emitir JWTs para serviços internos. -- Manter RBAC e permissões por tenant. -- Ser a autoridade de identidade para: - - `baas-control-plane` - - `billing-finance-core` - - `crm-core` - -## Fluxo de confiança - -1. Usuário autentica no `identity-gateway`. -2. O gateway valida a identidade (provider local/externo). -3. O gateway emite JWT interno com claims mínimas. -4. Serviços internos validam e confiam no token. - -> Nenhum serviço externo emite tokens para o gateway. - -## Modelo de tokens - -Veja [`docs/token-model.md`](docs/token-model.md). - -## Rodando localmente - -```bash -cp .env.example .env -npm install -npm run dev -``` - -## Docker - -```bash -docker-compose up --build -``` - -## Estrutura - -- `src/core`: guards e serviços centrais. -- `src/modules`: auth, users, roles, permissions, sessions, providers. -- `docs`: arquitetura, segurança e modelo de tokens. - -## Notas de segurança - -- JWTs são internos e não devem ser expostos diretamente a apps públicos. -- Refresh tokens são armazenados com hash no banco. diff --git a/identity-gateway/docker-compose.yml b/identity-gateway/docker-compose.yml deleted file mode 100644 index 356294a..0000000 --- a/identity-gateway/docker-compose.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: "3.9" - -services: - postgres: - image: postgres:16 - environment: - POSTGRES_USER: identity - POSTGRES_PASSWORD: identity - POSTGRES_DB: identity_gateway - ports: - - "5432:5432" - volumes: - - pgdata:/var/lib/postgresql/data - - identity-gateway: - build: . - env_file: - - .env - ports: - - "4000:4000" - depends_on: - - postgres - -volumes: - pgdata: diff --git a/identity-gateway/package.json b/identity-gateway/package.json index 4051673..ae484f4 100644 --- a/identity-gateway/package.json +++ b/identity-gateway/package.json @@ -14,10 +14,10 @@ "bcryptjs": "^2.4.3", "dotenv": "^16.4.5", "fastify": "^4.28.1", - "fastify-cookie": "^5.7.0", + "@fastify/cookie": "^9.3.1", "jsonwebtoken": "^9.0.2", "pg": "^8.12.0", - "pino": "^9.3.2" + "pino": "^8.19.0" }, "devDependencies": { "@types/bcryptjs": "^2.4.6", @@ -29,4 +29,4 @@ "ts-node-dev": "^2.0.0", "typescript": "^5.5.3" } -} +} \ No newline at end of file diff --git a/identity-gateway/src/main.ts b/identity-gateway/src/main.ts index 5d669da..7bc69ef 100644 --- a/identity-gateway/src/main.ts +++ b/identity-gateway/src/main.ts @@ -1,5 +1,5 @@ import Fastify from "fastify"; -import cookie from "fastify-cookie"; +import cookie from "@fastify/cookie"; import { assertEnv, env } from "./lib/env"; import { logger } from "./lib/logger"; import { TokenService } from "./core/token.service"; diff --git a/identity-gateway/tsconfig.json b/identity-gateway/tsconfig.json index 500c7de..649771d 100644 --- a/identity-gateway/tsconfig.json +++ b/identity-gateway/tsconfig.json @@ -8,7 +8,10 @@ "strict": true, "esModuleInterop": true, "resolveJsonModule": true, - "skipLibCheck": true + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, - "include": ["src/**/*.ts"] -} + "include": [ + "src/**/*.ts" + ] +} \ No newline at end of file diff --git a/observability-core/.dockerignore b/observability-core/.dockerignore new file mode 100644 index 0000000..1f094c4 --- /dev/null +++ b/observability-core/.dockerignore @@ -0,0 +1,8 @@ +.git +.env +.gitignore +Dockerfile +README.md +OBSERVABILITY-CORE.md +migrations +*.log diff --git a/observability-core/.env.example b/observability-core/.env.example new file mode 100644 index 0000000..097e96f --- /dev/null +++ b/observability-core/.env.example @@ -0,0 +1,2 @@ +DATABASE_URL= +PORT=8080 diff --git a/observability-core/.gitignore b/observability-core/.gitignore new file mode 100644 index 0000000..5340f42 --- /dev/null +++ b/observability-core/.gitignore @@ -0,0 +1,6 @@ +.env +*.log +.DS_Store +observability-core +main +coverage diff --git a/observability-core/Dockerfile b/observability-core/Dockerfile new file mode 100644 index 0000000..56f5e70 --- /dev/null +++ b/observability-core/Dockerfile @@ -0,0 +1,28 @@ +# Dockerfile +FROM docker.io/library/golang:1.23-alpine AS builder + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . + +# Build with optimization flags +# -w -s: Strip debug symbols +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /app/observability-core ./cmd/api + +# Use Google Distroless static image for minimal size and security +FROM gcr.io/distroless/static:nonroot + +WORKDIR /app + +COPY --from=builder /app/observability-core . +# Copy configs/migrations if needed at runtime, e.g.: +# COPY --from=builder /app/migrations ./migrations + +USER nonroot:nonroot + +EXPOSE 8080 + +CMD ["./observability-core"] diff --git a/observability-core/OBSERVABILITY-CORE.md b/observability-core/OBSERVABILITY-CORE.md new file mode 100644 index 0000000..f38b186 --- /dev/null +++ b/observability-core/OBSERVABILITY-CORE.md @@ -0,0 +1,79 @@ +# OBSERVABILITY-CORE + +O `observability-core` é o serviço central de monitoramento da plataforma. Ele coleta health checks, gerencia alertas e integrações com TimeSeries DB (TimescaleDB) para armazenar métricas de longo prazo. + +## 📋 Visão Geral + +Diferente de sistemas de log como o `dashboard` (que consome logs via Appwrite Realtime), este serviço foca em *métricas* e *disponibilidade*. + +### Arquitetura + +```mermaid +graph TD + Agent[Internal Service] -->|Push Metrics| API[Observability API] + API -->|Write| TSDB[(TimescaleDB)] + + API -->|Check| Targets[http://target-service/health] + + subgraph Periodic Jobs + Job[Health Checker] -->|Ping| Targets + Job -->|Alert| PagerDuty[Pager Duty / Slack] + end +``` + +## 🚀 Estrutura do Projeto + +O projeto é escrito em **Go** para alta performance e concorrência: + +| Diretório | Descrição | +| :--- | :--- | +| `cmd/api` | Entrypoint da API. | +| `internal/checks` | Lógica de Health Checks (HTTP/TCP ping). | +| `internal/metrics` | Agregação de dados. | +| `db/migrations` | Migrações SQL (Postgres/Timescale). | + +## 🛠️ Tecnologias e Otimizações + +- **Linguagem**: Go 1.23+ +- **Database**: PostgreSQL + TimescaleDB extension. +- **Libraries**: Chi (Router), Pgx (Driver). +- **Containerização**: + - Baseada em `gcr.io/distroless/static:nonroot`. + - Binário estático (`CGO_ENABLED=0`). + - Imagem final < 25MB. + +## 💻 Como Executar + +### Docker (Recomendado) + +```bash +# Build +docker build -t observability-core . + +# Run +docker run -p 8080:8080 --env-file .env observability-core +``` +A API estará disponível na porta `8080`. + +### Desenvolvimento + +1. **Dependências**: + - Go 1.23+ + - PostgreSQL +2. **Setup**: + ```bash + cp .env.example .env + go mod tidy + ``` +3. **Executar**: + ```bash + go run ./cmd/api + ``` + +## 🔧 Detalhes do Dockerfile + +O `Dockerfile` é otimizado para Go: + +- **Builder**: `golang:1.23-alpine`. +- **Flags**: `-ldflags="-w -s"` para remover símbolos de debug. +- **Runtime**: Distroless Static (sem libc, sem shell), garantindo a menor superfície de ataque possível. diff --git a/observability-core/cmd/api/main.go b/observability-core/cmd/api/main.go new file mode 100644 index 0000000..7e2db12 --- /dev/null +++ b/observability-core/cmd/api/main.go @@ -0,0 +1,78 @@ +package main + +import ( + "context" + "fmt" + "log" + "net/http" + + "github.com/go-chi/chi/v5" + "github.com/go-chi/chi/v5/middleware" + "github.com/jackc/pgx/v5/pgxpool" + "github.com/lab/observability-core/internal/alerter" + "github.com/lab/observability-core/internal/collector" + "github.com/lab/observability-core/internal/config" + "github.com/lab/observability-core/internal/db" +) + +type application struct { + config *config.Config + queries *db.Queries +} + +func main() { + cfg := config.Load() + + pool, err := pgxpool.New(context.Background(), cfg.DatabaseURL) + if err != nil { + log.Fatalf("Unable to connect to database: %v\n", err) + } + defer pool.Close() + + queries := db.New(pool) + + app := &application{ + config: cfg, + queries: queries, + } + + coll := collector.New(queries) + coll.Start() + + alert := alerter.New(queries) + alert.Start() + + r := chi.NewRouter() + r.Use(middleware.Logger) + r.Use(middleware.Recoverer) + + r.Get("/", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Observability Core")) + }) + + r.Post("/targets", app.createTargetHandler) + r.Post("/checks", app.createCheckHandler) + r.Get("/metrics", app.getMetricsHandler) + r.Get("/incidents", app.getIncidentsHandler) + + log.Printf("Starting server on port %s", cfg.Port) + if err := http.ListenAndServe(fmt.Sprintf(":%s", cfg.Port), r); err != nil { + log.Fatalf("Could not start server: %s\n", err) + } +} + +func (app *application) createTargetHandler(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +func (app *application) createCheckHandler(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +func (app *application) getMetricsHandler(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +func (app *application) getIncidentsHandler(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} \ No newline at end of file diff --git a/observability-core/db/query.sql b/observability-core/db/query.sql new file mode 100644 index 0000000..2777a52 --- /dev/null +++ b/observability-core/db/query.sql @@ -0,0 +1,54 @@ +-- name: CreateTarget :one +INSERT INTO targets (name, type, config) +VALUES ($1, $2, $3) +RETURNING *; + +-- name: GetTarget :one +SELECT * FROM targets +WHERE id = $1; + +-- name: CreateCheck :one +INSERT INTO checks (target_id, type, interval_seconds, timeout_seconds) +VALUES ($1, $2, $3, $4) +RETURNING *; + +-- name: GetCheck :one +SELECT * FROM checks +WHERE id = $1; + +-- name: ListChecks :many +SELECT * FROM checks +WHERE is_active = TRUE; + +-- name: CreateMetric :one +INSERT INTO metrics (time, check_id, value, tags) +VALUES ($1, $2, $3, $4) +RETURNING *; + +-- name: GetMetricsForCheck :many +SELECT * FROM metrics +WHERE check_id = $1 AND time >= $2 AND time <= $3 +ORDER BY time DESC; + +-- name: CreateAlertRule :one +INSERT INTO alert_rules (check_id, name, threshold, operator, for_duration, severity) +VALUES ($1, $2, $3, $4, $5, $6) +RETURNING *; + +-- name: ListAlertRules :many +SELECT * FROM alert_rules; + +-- name: CreateIncident :one +INSERT INTO incidents (alert_rule_id, status, start_time) +VALUES ($1, $2, $3) +RETURNING *; + +-- name: GetIncident :one +SELECT * FROM incidents +WHERE id = $1; + +-- name: UpdateIncidentStatus :one +UPDATE incidents +SET status = $2, updated_at = NOW() +WHERE id = $1 +RETURNING *; diff --git a/observability-core/go.mod b/observability-core/go.mod new file mode 100644 index 0000000..ced7226 --- /dev/null +++ b/observability-core/go.mod @@ -0,0 +1,18 @@ +module github.com/lab/observability-core + +go 1.23 + +require ( + github.com/go-chi/chi/v5 v5.2.3 + github.com/jackc/pgx/v5 v5.7.1 + github.com/joho/godotenv v1.5.1 +) + +require ( + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/text v0.21.0 // indirect +) diff --git a/observability-core/go.sum b/observability-core/go.sum new file mode 100644 index 0000000..afb5e49 --- /dev/null +++ b/observability-core/go.sum @@ -0,0 +1,32 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE= +github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs= +github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/observability-core/internal/alerter/alerter.go b/observability-core/internal/alerter/alerter.go new file mode 100644 index 0000000..4f296d6 --- /dev/null +++ b/observability-core/internal/alerter/alerter.go @@ -0,0 +1,85 @@ +package alerter + +import ( + "context" + "log" + "time" + + "github.com/lab/observability-core/internal/db" +) + +type Alerter struct { + queries *db.Queries +} + +func New(queries *db.Queries) *Alerter { + return &Alerter{queries: queries} +} + +func (a *Alerter) Start() { + log.Println("Starting alerter") + ticker := time.NewTicker(30 * time.Second) // Run every 30 seconds + + go func() { + for range ticker.C { + a.runAlerts() + } + }() +} + +func (a *Alerter) runAlerts() { + rules, err := a.queries.ListAlertRules(context.Background()) + if err != nil { + log.Printf("Error listing alert rules: %v", err) + return + } + + for _, rule := range rules { + go a.evaluateRule(rule) + } +} + +func (a *Alerter) evaluateRule(rule db.AlertRule) { + // This is a very simplified logic. + // It should query metrics within the `for_duration` and check if they meet the threshold. + // For now, we'll just log a message. + log.Printf("Evaluating alert rule: %s", rule.Name) + + // A real implementation would look something like this: + /* + params := db.GetMetricsForCheckParams{ + CheckID: rule.CheckID, + StartTime: time.Now().Add(-time.Duration(rule.ForDuration) * time.Second), + EndTime: time.Now(), + } + metrics, err := a.queries.GetMetricsForCheck(context.Background(), params) + if err != nil { + log.Printf("Error getting metrics for rule %s: %v", rule.Name, err) + return + } + + isFailing := true + for _, metric := range metrics { + if !compare(metric.Value, rule.Threshold, rule.Operator) { + isFailing = false + break + } + } + + if isFailing { + // Create or update incident + } + */ +} + +func compare(value, threshold float64, operator string) bool { + switch operator { + case ">": + return value > threshold + case "<": + return value < threshold + case "=": + return value == threshold + } + return false +} diff --git a/observability-core/internal/collector/collector.go b/observability-core/internal/collector/collector.go new file mode 100644 index 0000000..8da08b5 --- /dev/null +++ b/observability-core/internal/collector/collector.go @@ -0,0 +1,101 @@ +package collector + +import ( + "context" + "encoding/json" + "log" + "net/http" + "strconv" + "time" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/lab/observability-core/internal/db" +) + +type Collector struct { + queries *db.Queries +} + +func New(queries *db.Queries) *Collector { + return &Collector{queries: queries} +} + +func (c *Collector) Start() { + log.Println("Starting health collector") + ticker := time.NewTicker(10 * time.Second) // Run every 10 seconds for simplicity + + go func() { + for range ticker.C { + c.runChecks() + } + }() +} + +func (c *Collector) runChecks() { + checks, err := c.queries.ListChecks(context.Background()) + if err != nil { + log.Printf("Error listing checks: %v", err) + return + } + + for _, check := range checks { + go c.performCheck(check) + } +} + +func (c *Collector) performCheck(check db.Check) { + startTime := time.Now() + var value float64 + + target, err := c.queries.GetTarget(context.Background(), check.TargetID) + if err != nil { + log.Printf("Error getting target for check %s: %v", check.ID, err) + return + } + + switch check.Type { + case "http": + var config map[string]interface{} + if err := json.Unmarshal(target.Config, &config); err != nil { + log.Printf("Invalid config for check %s: %v", check.ID, err) + return + } + + // Assume config has a "url" field + url, ok := config["url"].(string) + if !ok { + log.Printf("Invalid URL in config for check %s", check.ID) + return + } + + resp, err := http.Get(url) + if err != nil || resp.StatusCode >= 400 { + value = 0 // Failure + } else { + value = 1 // Success + } + + // Other check types (ping, tcp) would be implemented here + default: + log.Printf("Unknown check type: %s", check.Type) + return + } + + latency := time.Since(startTime).Seconds() + + tags := map[string]string{ + "latency_seconds": strconv.FormatFloat(latency, 'f', -1, 64), + } + tagsJSON, _ := json.Marshal(tags) + + _, err = c.queries.CreateMetric(context.Background(), db.CreateMetricParams{ + Time: pgtype.Timestamptz{Time: startTime, Valid: true}, + CheckID: check.ID, + Value: value, + Tags: tagsJSON, + }) + + if err != nil { + log.Printf("Error creating metric for check %s: %v", check.ID, err) + } +} diff --git a/observability-core/internal/config/config.go b/observability-core/internal/config/config.go new file mode 100644 index 0000000..f1066bd --- /dev/null +++ b/observability-core/internal/config/config.go @@ -0,0 +1,35 @@ +package config + +import ( + "log" + "os" + + "github.com/joho/godotenv" +) + +type Config struct { + DatabaseURL string + Port string +} + +func Load() *Config { + err := godotenv.Load() + if err != nil { + log.Println("No .env file found, using environment variables") + } + + return &Config{ + DatabaseURL: getEnv("DATABASE_URL", ""), + Port: getEnv("PORT", "8080"), + } +} + +func getEnv(key, fallback string) string { + if value, ok := os.LookupEnv(key); ok { + return value + } + if fallback == "" { + log.Fatalf("FATAL: Environment variable %s is not set.", key) + } + return fallback +} diff --git a/observability-core/internal/db/db.go b/observability-core/internal/db/db.go new file mode 100644 index 0000000..9d485b5 --- /dev/null +++ b/observability-core/internal/db/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/observability-core/internal/db/models.go b/observability-core/internal/db/models.go new file mode 100644 index 0000000..121af01 --- /dev/null +++ b/observability-core/internal/db/models.go @@ -0,0 +1,232 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package db + +import ( + "database/sql/driver" + "fmt" + + "github.com/jackc/pgx/v5/pgtype" +) + +type AlertSeverity string + +const ( + AlertSeverityInfo AlertSeverity = "info" + AlertSeverityWarning AlertSeverity = "warning" + AlertSeverityCritical AlertSeverity = "critical" +) + +func (e *AlertSeverity) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = AlertSeverity(s) + case string: + *e = AlertSeverity(s) + default: + return fmt.Errorf("unsupported scan type for AlertSeverity: %T", src) + } + return nil +} + +type NullAlertSeverity struct { + AlertSeverity AlertSeverity `json:"alert_severity"` + Valid bool `json:"valid"` // Valid is true if AlertSeverity is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullAlertSeverity) Scan(value interface{}) error { + if value == nil { + ns.AlertSeverity, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.AlertSeverity.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullAlertSeverity) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.AlertSeverity), nil +} + +type CheckType string + +const ( + CheckTypeHttp CheckType = "http" + CheckTypePing CheckType = "ping" + CheckTypeTcp CheckType = "tcp" +) + +func (e *CheckType) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = CheckType(s) + case string: + *e = CheckType(s) + default: + return fmt.Errorf("unsupported scan type for CheckType: %T", src) + } + return nil +} + +type NullCheckType struct { + CheckType CheckType `json:"check_type"` + Valid bool `json:"valid"` // Valid is true if CheckType is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullCheckType) Scan(value interface{}) error { + if value == nil { + ns.CheckType, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.CheckType.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullCheckType) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.CheckType), nil +} + +type IncidentStatus string + +const ( + IncidentStatusOpen IncidentStatus = "open" + IncidentStatusAcknowledged IncidentStatus = "acknowledged" + IncidentStatusResolved IncidentStatus = "resolved" +) + +func (e *IncidentStatus) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = IncidentStatus(s) + case string: + *e = IncidentStatus(s) + default: + return fmt.Errorf("unsupported scan type for IncidentStatus: %T", src) + } + return nil +} + +type NullIncidentStatus struct { + IncidentStatus IncidentStatus `json:"incident_status"` + Valid bool `json:"valid"` // Valid is true if IncidentStatus is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullIncidentStatus) Scan(value interface{}) error { + if value == nil { + ns.IncidentStatus, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.IncidentStatus.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullIncidentStatus) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.IncidentStatus), nil +} + +type TargetType string + +const ( + TargetTypeService TargetType = "service" + TargetTypeInfra TargetType = "infra" +) + +func (e *TargetType) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = TargetType(s) + case string: + *e = TargetType(s) + default: + return fmt.Errorf("unsupported scan type for TargetType: %T", src) + } + return nil +} + +type NullTargetType struct { + TargetType TargetType `json:"target_type"` + Valid bool `json:"valid"` // Valid is true if TargetType is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullTargetType) Scan(value interface{}) error { + if value == nil { + ns.TargetType, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.TargetType.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullTargetType) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.TargetType), nil +} + +type AlertRule struct { + ID pgtype.UUID `json:"id"` + CheckID pgtype.UUID `json:"check_id"` + Name string `json:"name"` + Threshold float64 `json:"threshold"` + Operator string `json:"operator"` + ForDuration int64 `json:"for_duration"` + Severity AlertSeverity `json:"severity"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + +type Check struct { + ID pgtype.UUID `json:"id"` + TargetID pgtype.UUID `json:"target_id"` + Type CheckType `json:"type"` + IntervalSeconds int32 `json:"interval_seconds"` + TimeoutSeconds int32 `json:"timeout_seconds"` + IsActive bool `json:"is_active"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + +type Incident struct { + ID pgtype.UUID `json:"id"` + AlertRuleID pgtype.UUID `json:"alert_rule_id"` + Status IncidentStatus `json:"status"` + StartTime pgtype.Timestamptz `json:"start_time"` + EndTime pgtype.Timestamptz `json:"end_time"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + +type Metric struct { + Time pgtype.Timestamptz `json:"time"` + CheckID pgtype.UUID `json:"check_id"` + Value float64 `json:"value"` + Tags []byte `json:"tags"` +} + +type Target struct { + ID pgtype.UUID `json:"id"` + Name string `json:"name"` + Type TargetType `json:"type"` + Config []byte `json:"config"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} diff --git a/observability-core/internal/db/query.sql.go b/observability-core/internal/db/query.sql.go new file mode 100644 index 0000000..34c1196 --- /dev/null +++ b/observability-core/internal/db/query.sql.go @@ -0,0 +1,360 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 +// source: query.sql + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createAlertRule = `-- name: CreateAlertRule :one +INSERT INTO alert_rules (check_id, name, threshold, operator, for_duration, severity) +VALUES ($1, $2, $3, $4, $5, $6) +RETURNING id, check_id, name, threshold, operator, for_duration, severity, created_at, updated_at +` + +type CreateAlertRuleParams struct { + CheckID pgtype.UUID `json:"check_id"` + Name string `json:"name"` + Threshold float64 `json:"threshold"` + Operator string `json:"operator"` + ForDuration int64 `json:"for_duration"` + Severity AlertSeverity `json:"severity"` +} + +func (q *Queries) CreateAlertRule(ctx context.Context, arg CreateAlertRuleParams) (AlertRule, error) { + row := q.db.QueryRow(ctx, createAlertRule, + arg.CheckID, + arg.Name, + arg.Threshold, + arg.Operator, + arg.ForDuration, + arg.Severity, + ) + var i AlertRule + err := row.Scan( + &i.ID, + &i.CheckID, + &i.Name, + &i.Threshold, + &i.Operator, + &i.ForDuration, + &i.Severity, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const createCheck = `-- name: CreateCheck :one +INSERT INTO checks (target_id, type, interval_seconds, timeout_seconds) +VALUES ($1, $2, $3, $4) +RETURNING id, target_id, type, interval_seconds, timeout_seconds, is_active, created_at, updated_at +` + +type CreateCheckParams struct { + TargetID pgtype.UUID `json:"target_id"` + Type CheckType `json:"type"` + IntervalSeconds int32 `json:"interval_seconds"` + TimeoutSeconds int32 `json:"timeout_seconds"` +} + +func (q *Queries) CreateCheck(ctx context.Context, arg CreateCheckParams) (Check, error) { + row := q.db.QueryRow(ctx, createCheck, + arg.TargetID, + arg.Type, + arg.IntervalSeconds, + arg.TimeoutSeconds, + ) + var i Check + err := row.Scan( + &i.ID, + &i.TargetID, + &i.Type, + &i.IntervalSeconds, + &i.TimeoutSeconds, + &i.IsActive, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const createIncident = `-- name: CreateIncident :one +INSERT INTO incidents (alert_rule_id, status, start_time) +VALUES ($1, $2, $3) +RETURNING id, alert_rule_id, status, start_time, end_time, created_at, updated_at +` + +type CreateIncidentParams struct { + AlertRuleID pgtype.UUID `json:"alert_rule_id"` + Status IncidentStatus `json:"status"` + StartTime pgtype.Timestamptz `json:"start_time"` +} + +func (q *Queries) CreateIncident(ctx context.Context, arg CreateIncidentParams) (Incident, error) { + row := q.db.QueryRow(ctx, createIncident, arg.AlertRuleID, arg.Status, arg.StartTime) + var i Incident + err := row.Scan( + &i.ID, + &i.AlertRuleID, + &i.Status, + &i.StartTime, + &i.EndTime, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const createMetric = `-- name: CreateMetric :one +INSERT INTO metrics (time, check_id, value, tags) +VALUES ($1, $2, $3, $4) +RETURNING time, check_id, value, tags +` + +type CreateMetricParams struct { + Time pgtype.Timestamptz `json:"time"` + CheckID pgtype.UUID `json:"check_id"` + Value float64 `json:"value"` + Tags []byte `json:"tags"` +} + +func (q *Queries) CreateMetric(ctx context.Context, arg CreateMetricParams) (Metric, error) { + row := q.db.QueryRow(ctx, createMetric, + arg.Time, + arg.CheckID, + arg.Value, + arg.Tags, + ) + var i Metric + err := row.Scan( + &i.Time, + &i.CheckID, + &i.Value, + &i.Tags, + ) + return i, err +} + +const createTarget = `-- name: CreateTarget :one +INSERT INTO targets (name, type, config) +VALUES ($1, $2, $3) +RETURNING id, name, type, config, created_at, updated_at +` + +type CreateTargetParams struct { + Name string `json:"name"` + Type TargetType `json:"type"` + Config []byte `json:"config"` +} + +func (q *Queries) CreateTarget(ctx context.Context, arg CreateTargetParams) (Target, error) { + row := q.db.QueryRow(ctx, createTarget, arg.Name, arg.Type, arg.Config) + var i Target + err := row.Scan( + &i.ID, + &i.Name, + &i.Type, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const getCheck = `-- name: GetCheck :one +SELECT id, target_id, type, interval_seconds, timeout_seconds, is_active, created_at, updated_at FROM checks +WHERE id = $1 +` + +func (q *Queries) GetCheck(ctx context.Context, id pgtype.UUID) (Check, error) { + row := q.db.QueryRow(ctx, getCheck, id) + var i Check + err := row.Scan( + &i.ID, + &i.TargetID, + &i.Type, + &i.IntervalSeconds, + &i.TimeoutSeconds, + &i.IsActive, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const getIncident = `-- name: GetIncident :one +SELECT id, alert_rule_id, status, start_time, end_time, created_at, updated_at FROM incidents +WHERE id = $1 +` + +func (q *Queries) GetIncident(ctx context.Context, id pgtype.UUID) (Incident, error) { + row := q.db.QueryRow(ctx, getIncident, id) + var i Incident + err := row.Scan( + &i.ID, + &i.AlertRuleID, + &i.Status, + &i.StartTime, + &i.EndTime, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const getMetricsForCheck = `-- name: GetMetricsForCheck :many +SELECT time, check_id, value, tags FROM metrics +WHERE check_id = $1 AND time >= $2 AND time <= $3 +ORDER BY time DESC +` + +type GetMetricsForCheckParams struct { + CheckID pgtype.UUID `json:"check_id"` + Time pgtype.Timestamptz `json:"time"` + Time_2 pgtype.Timestamptz `json:"time_2"` +} + +func (q *Queries) GetMetricsForCheck(ctx context.Context, arg GetMetricsForCheckParams) ([]Metric, error) { + rows, err := q.db.Query(ctx, getMetricsForCheck, arg.CheckID, arg.Time, arg.Time_2) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Metric + for rows.Next() { + var i Metric + if err := rows.Scan( + &i.Time, + &i.CheckID, + &i.Value, + &i.Tags, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getTarget = `-- name: GetTarget :one +SELECT id, name, type, config, created_at, updated_at FROM targets +WHERE id = $1 +` + +func (q *Queries) GetTarget(ctx context.Context, id pgtype.UUID) (Target, error) { + row := q.db.QueryRow(ctx, getTarget, id) + var i Target + err := row.Scan( + &i.ID, + &i.Name, + &i.Type, + &i.Config, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const listAlertRules = `-- name: ListAlertRules :many +SELECT id, check_id, name, threshold, operator, for_duration, severity, created_at, updated_at FROM alert_rules +` + +func (q *Queries) ListAlertRules(ctx context.Context) ([]AlertRule, error) { + rows, err := q.db.Query(ctx, listAlertRules) + if err != nil { + return nil, err + } + defer rows.Close() + var items []AlertRule + for rows.Next() { + var i AlertRule + if err := rows.Scan( + &i.ID, + &i.CheckID, + &i.Name, + &i.Threshold, + &i.Operator, + &i.ForDuration, + &i.Severity, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listChecks = `-- name: ListChecks :many +SELECT id, target_id, type, interval_seconds, timeout_seconds, is_active, created_at, updated_at FROM checks +WHERE is_active = TRUE +` + +func (q *Queries) ListChecks(ctx context.Context) ([]Check, error) { + rows, err := q.db.Query(ctx, listChecks) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Check + for rows.Next() { + var i Check + if err := rows.Scan( + &i.ID, + &i.TargetID, + &i.Type, + &i.IntervalSeconds, + &i.TimeoutSeconds, + &i.IsActive, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateIncidentStatus = `-- name: UpdateIncidentStatus :one +UPDATE incidents +SET status = $2, updated_at = NOW() +WHERE id = $1 +RETURNING id, alert_rule_id, status, start_time, end_time, created_at, updated_at +` + +type UpdateIncidentStatusParams struct { + ID pgtype.UUID `json:"id"` + Status IncidentStatus `json:"status"` +} + +func (q *Queries) UpdateIncidentStatus(ctx context.Context, arg UpdateIncidentStatusParams) (Incident, error) { + row := q.db.QueryRow(ctx, updateIncidentStatus, arg.ID, arg.Status) + var i Incident + err := row.Scan( + &i.ID, + &i.AlertRuleID, + &i.Status, + &i.StartTime, + &i.EndTime, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} diff --git a/observability-core/migrations/000001_init_schema.up.sql b/observability-core/migrations/000001_init_schema.up.sql new file mode 100644 index 0000000..4ab4c17 --- /dev/null +++ b/observability-core/migrations/000001_init_schema.up.sql @@ -0,0 +1,80 @@ +-- +migrate Up +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; +CREATE EXTENSION IF NOT EXISTS timescaledb; + +CREATE TYPE target_type AS ENUM ('service', 'infra'); +CREATE TYPE check_type AS ENUM ('http', 'ping', 'tcp'); +CREATE TYPE incident_status AS ENUM ('open', 'acknowledged', 'resolved'); +CREATE TYPE alert_severity AS ENUM ('info', 'warning', 'critical'); + +CREATE TABLE targets ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + name VARCHAR(255) NOT NULL, + type target_type NOT NULL, + config JSONB NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE checks ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + target_id UUID NOT NULL REFERENCES targets(id) ON DELETE CASCADE, + type check_type NOT NULL, + interval_seconds INTEGER NOT NULL, + timeout_seconds INTEGER NOT NULL, + is_active BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE metrics ( + time TIMESTAMPTZ NOT NULL, + check_id UUID NOT NULL REFERENCES checks(id) ON DELETE CASCADE, + value DOUBLE PRECISION NOT NULL, + tags JSONB +); + +-- Create a hypertable for metrics +SELECT create_hypertable('metrics', 'time'); + +CREATE TABLE alert_rules ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + check_id UUID NOT NULL REFERENCES checks(id) ON DELETE CASCADE, + name VARCHAR(255) NOT NULL, + threshold DOUBLE PRECISION NOT NULL, + -- e.g., '>', '<', '=' + operator VARCHAR(10) NOT NULL, + -- in seconds + for_duration BIGINT NOT NULL, + severity alert_severity NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE incidents ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + alert_rule_id UUID NOT NULL REFERENCES alert_rules(id) ON DELETE CASCADE, + status incident_status NOT NULL, + start_time TIMESTAMPTZ NOT NULL, + end_time TIMESTAMPTZ, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +-- Indexes +CREATE INDEX ON checks (target_id); +CREATE INDEX ON metrics (check_id, time DESC); +CREATE INDEX ON alert_rules (check_id); +CREATE INDEX ON incidents (alert_rule_id, status); + + +-- +migrate Down +DROP TABLE IF EXISTS incidents; +DROP TABLE IF EXISTS alert_rules; +DROP TABLE IF EXISTS metrics; +DROP TABLE IF EXISTS checks; +DROP TABLE IF EXISTS targets; +DROP TYPE IF EXISTS incident_status; +DROP TYPE IF EXISTS alert_severity; +DROP TYPE IF EXISTS check_type; +DROP TYPE IF EXISTS target_type; diff --git a/observability-core/sqlc.yaml b/observability-core/sqlc.yaml new file mode 100644 index 0000000..d719475 --- /dev/null +++ b/observability-core/sqlc.yaml @@ -0,0 +1,11 @@ +version: "2" +sql: + - engine: "postgresql" + queries: "db/query.sql" + schema: "migrations" + gen: + go: + package: "db" + out: "internal/db" + sql_package: "pgx/v5" + emit_json_tags: true diff --git a/podman_push.sh b/podman_push.sh new file mode 100755 index 0000000..17ff4b3 --- /dev/null +++ b/podman_push.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -e + +REGISTRY="rg.fr-par.scw.cloud/yumi" +SERVICES=( + "automation-jobs-core" + "billing-finance-core" + "baas-control-plane" + "crm-core" + "dashboard" + "identity-gateway" + "observability-core" + "repo-integrations-core" + "security-governance-core" +) + +for SERVICE in "${SERVICES[@]}"; do + if [ -d "$SERVICE" ]; then + if [ "$SERVICE" == "automation-jobs-core" ]; then + echo "🚀 Building automation-jobs-api..." + podman build -f Dockerfile.api -t "$REGISTRY/automation-jobs-api:latest" ./$SERVICE + echo "🚀 Pushing automation-jobs-api..." + podman push "$REGISTRY/automation-jobs-api:latest" + + echo "🚀 Building automation-jobs-worker..." + podman build -f Dockerfile.worker -t "$REGISTRY/automation-jobs-worker:latest" ./$SERVICE + echo "🚀 Pushing automation-jobs-worker..." + podman push "$REGISTRY/automation-jobs-worker:latest" + else + echo "🚀 Building $SERVICE..." + podman build -t "$REGISTRY/$SERVICE:latest" ./$SERVICE + + echo "🚀 Pushing $SERVICE..." + podman push "$REGISTRY/$SERVICE:latest" + fi + + echo "✅ Done $SERVICE" + else + echo "⚠️ Directory $SERVICE not found!" + fi +done diff --git a/repo-integrations-core/.dockerignore b/repo-integrations-core/.dockerignore new file mode 100644 index 0000000..37ecc40 --- /dev/null +++ b/repo-integrations-core/.dockerignore @@ -0,0 +1,8 @@ +.git +.env +.gitignore +Dockerfile +README.md +REPO-INTEGRATIONS-CORE.md +migrations +*.log diff --git a/repo-integrations-core/.env.example b/repo-integrations-core/.env.example new file mode 100644 index 0000000..17ddc68 --- /dev/null +++ b/repo-integrations-core/.env.example @@ -0,0 +1,5 @@ +DATABASE_URL= +JWT_SECRET= +ENCRYPTION_KEY= +GITHUB_CLIENT_ID= +GITHUB_SECRET= diff --git a/repo-integrations-core/.gitignore b/repo-integrations-core/.gitignore new file mode 100644 index 0000000..5fd8307 --- /dev/null +++ b/repo-integrations-core/.gitignore @@ -0,0 +1,6 @@ +.env +*.log +.DS_Store +repo-integrations-core +main +coverage diff --git a/repo-integrations-core/Dockerfile b/repo-integrations-core/Dockerfile new file mode 100644 index 0000000..ba7f3c1 --- /dev/null +++ b/repo-integrations-core/Dockerfile @@ -0,0 +1,25 @@ +# Dockerfile +FROM docker.io/library/golang:1.23-alpine AS builder + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . + +# Build with optimization flags +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /app/repo-integrations-core ./cmd/api + +# Use Google Distroless static image for minimal size and security +FROM gcr.io/distroless/static:nonroot + +WORKDIR /app + +COPY --from=builder /app/repo-integrations-core . + +USER nonroot:nonroot + +EXPOSE 8080 + +CMD ["./repo-integrations-core"] diff --git a/repo-integrations-core/Makefile b/repo-integrations-core/Makefile new file mode 100644 index 0000000..e642305 --- /dev/null +++ b/repo-integrations-core/Makefile @@ -0,0 +1,30 @@ +.PHONY: up down build logs + +up: + docker-compose up -d + +down: + docker-compose down + +build: + docker-compose build + +logs: + docker-compose logs -f + +# SQLC +sqlc-generate: + docker run --rm -v "$(PWD):/src" -w /src sqlc/sqlc:1.25.0 generate + +# Migrations +migrate-create: + @read -p "Enter migration name: " name; \ + migrate create -ext sql -dir migrations -seq $$name + +migrate-up: + migrate -path migrations -database "postgres://user:password@localhost:5432/repo_integrations?sslmode=disable" -verbose up + +migrate-down: + migrate -path migrations -database "postgres://user:password@localhost:5432/repo_integrations?sslmode=disable" -verbose down + +.PHONY: sqlc-generate migrate-create migrate-up migrate-down diff --git a/repo-integrations-core/REPO-INTEGRATIONS-CORE.md b/repo-integrations-core/REPO-INTEGRATIONS-CORE.md new file mode 100644 index 0000000..61eb095 --- /dev/null +++ b/repo-integrations-core/REPO-INTEGRATIONS-CORE.md @@ -0,0 +1,73 @@ +# REPO-INTEGRATIONS-CORE + +O `repo-integrations-core` é o serviço responsável por gerenciar o ciclo de vida de integrações com provedores de controle de versão (Git). + +## 📋 Visão Geral + +Este serviço atua como um middleware inteligente entre a plataforma e provedores externos (GitHub, GitLab, Bitbucket), normalizando fluxos de autenticação (OAuth) e ingestão de eventos (Webhooks). + +### Arquitetura + +```mermaid +graph LR + User[Usuário] -->|OAuth Flow| API[Repo Integrations] + API -->|Exchange Code| GitHub[GitHub API] + API -->|Store Token| DB[(Encrypted DB)] + + GitHub -->|Webhook| API + API -->|Normalize| EventBus[Event Bus / Queue] +``` + +## 🚀 Estrutura do Projeto + +O projeto é escrito em **Go** e estrutura-se da seguinte forma: + +| Diretório | Descrição | +| :--- | :--- | +| `cmd/api` | Entrypoint. | +| `internal/oauth` | Fluxos de autenticação. | +| `internal/webhooks` | Processamento e validação de webhooks. | +| `internal/provider` | Abstrações para diferentes providers (GitHub, GitLab). | + +## 🛠️ Tecnologias e Otimizações + +- **Linguagem**: Go 1.23. +- **Database**: PostgreSQL (tokens criptografados). +- **Segurança**: Criptografia AES-GCM para tokens de acesso. +- **Containerização**: + - Base `gcr.io/distroless/static:nonroot`. + - Build estático. + +## 💻 Como Executar + +### Docker (Recomendado) + +```bash +# Build +docker build -t repo-integrations-core . + +# Run +docker run -p 8080:8080 --env-file .env repo-integrations-core +``` +Disponível na porta `8080`. + +### Desenvolvimento + +1. **Setup**: + ```bash + cp .env.example .env + go mod tidy + ``` +2. **App GitHub**: Você precisará criar um GitHub App e configurar `GITHUB_CLIENT_ID` e `GITHUB_SECRET`. +3. **Executar**: + ```bash + go run ./cmd/api + ``` + +## 🔧 Detalhes do Dockerfile + +O `Dockerfile` segue o padrão de otimização da plataforma: + +- **Builder**: `golang:1.23-alpine`. +- **Runtime**: `distroless/static` (sem shell, non-root). +- **Compilação**: Flags `-w -s` para redução de binário. diff --git a/repo-integrations-core/cmd/api/main.go b/repo-integrations-core/cmd/api/main.go new file mode 100644 index 0000000..237a881 --- /dev/null +++ b/repo-integrations-core/cmd/api/main.go @@ -0,0 +1,49 @@ +package main + +import ( + "context" + "log" + "net/http" + + "github.com/go-chi/chi/v5" + "github.com/go-chi/chi/v5/middleware" + "github.com/jackc/pgx/v5/pgxpool" + "github.com/lab/repo-integrations-core/internal/api" + "github.com/lab/repo-integrations-core/internal/config" + "github.com/lab/repo-integrations-core/internal/db" +) + +func main() { + cfg := config.Load() + + pool, err := pgxpool.New(context.Background(), cfg.DatabaseURL) + if err != nil { + log.Fatalf("Unable to connect to database: %v\n", err) + } + defer pool.Close() + + queries := db.New(pool) + apiHandler := api.New(cfg, queries) + + r := chi.NewRouter() + r.Use(middleware.Logger) + r.Use(middleware.Recoverer) + + r.Get("/", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Repo Integrations Core")) + }) + + r.Route("/integrations/github", func(r chi.Router) { + r.Get("/connect", apiHandler.ConnectGithubHandler) + r.Get("/callback", apiHandler.ConnectGithubCallbackHandler) + }) + + r.Post("/webhooks/github", apiHandler.GithubWebhookHandler) + + r.Get("/repositories", apiHandler.ListRepositoriesHandler) + + log.Println("Starting server on :8080") + if err := http.ListenAndServe(":8080", r); err != nil { + log.Fatalf("Could not start server: %s\n", err) + } +} \ No newline at end of file diff --git a/repo-integrations-core/db/query.sql b/repo-integrations-core/db/query.sql new file mode 100644 index 0000000..a50594d --- /dev/null +++ b/repo-integrations-core/db/query.sql @@ -0,0 +1,85 @@ +-- name: CreateRepoAccount :one +INSERT INTO repo_accounts ( + tenant_id, + provider, + account_id, + username, + encrypted_access_token, + encrypted_refresh_token +) VALUES ( + $1, $2, $3, $4, $5, $6 +) RETURNING *; + +-- name: GetRepoAccount :one +SELECT * FROM repo_accounts +WHERE tenant_id = $1 AND provider = $2 AND account_id = $3; + +-- name: GetRepoAccountByID :one +SELECT * FROM repo_accounts +WHERE tenant_id = $1 AND id = $2; + +-- name: UpdateRepoAccountTokens :one +UPDATE repo_accounts +SET + encrypted_access_token = $3, + encrypted_refresh_token = $4, + updated_at = NOW() +WHERE tenant_id = $1 AND id = $2 +RETURNING *; + +-- name: ListRepoAccountsByTenant :many +SELECT * FROM repo_accounts +WHERE tenant_id = $1; + +-- name: CreateRepository :one +INSERT INTO repositories ( + tenant_id, + repo_account_id, + external_id, + name, + url +) VALUES ( + $1, $2, $3, $4, $5 +) RETURNING *; + +-- name: GetRepository :one +SELECT * FROM repositories +WHERE tenant_id = $1 AND id = $2; + +-- name: GetRepositoryByExternalID :one +SELECT * FROM repositories +WHERE tenant_id = $1 AND external_id = $2; + +-- name: ListRepositoriesByTenant :many +SELECT * FROM repositories +WHERE tenant_id = $1 AND is_active = TRUE; + +-- name: CreateWebhook :one +INSERT INTO webhooks ( + tenant_id, + repository_id, + external_id, + secret +) VALUES ( + $1, $2, $3, $4 +) RETURNING *; + +-- name: GetWebhookByRepoID :one +SELECT * FROM webhooks +WHERE tenant_id = $1 AND repository_id = $2; + +-- name: GetWebhookByRepoExternalID :one +SELECT w.* FROM webhooks w +JOIN repositories r ON w.repository_id = r.id +WHERE r.tenant_id = $1 AND r.external_id = $2; + +-- name: CreateRepoEvent :one +INSERT INTO repo_events ( + tenant_id, + repository_id, + event_type, + payload +) VALUES ( + $1, $2, $3, $4 +) RETURNING *; + diff --git a/repo-integrations-core/go.mod b/repo-integrations-core/go.mod new file mode 100644 index 0000000..844c1fc --- /dev/null +++ b/repo-integrations-core/go.mod @@ -0,0 +1,25 @@ +module github.com/lab/repo-integrations-core + +go 1.23 + +require ( + github.com/go-chi/chi/v5 v5.2.3 + github.com/google/go-github/v53 v53.2.0 + github.com/google/uuid v1.6.0 + github.com/jackc/pgx/v5 v5.7.1 + github.com/joho/godotenv v1.5.1 + golang.org/x/oauth2 v0.24.0 +) + +require ( + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect + github.com/cloudflare/circl v1.3.3 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.21.0 // indirect +) diff --git a/repo-integrations-core/go.sum b/repo-integrations-core/go.sum new file mode 100644 index 0000000..568ec82 --- /dev/null +++ b/repo-integrations-core/go.sum @@ -0,0 +1,60 @@ +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE= +github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= +github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs= +github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/repo-integrations-core/internal/api/github.go b/repo-integrations-core/internal/api/github.go new file mode 100644 index 0000000..db5ae3d --- /dev/null +++ b/repo-integrations-core/internal/api/github.go @@ -0,0 +1,198 @@ +package api + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/google/go-github/v53/github" + "github.com/google/uuid" + "github.com/jackc/pgx/v5/pgtype" + "github.com/lab/repo-integrations-core/internal/config" + "github.com/lab/repo-integrations-core/internal/crypto" + "github.com/lab/repo-integrations-core/internal/db" + "golang.org/x/oauth2" + oauth2github "golang.org/x/oauth2/github" +) + +type API struct { + config *config.Config + queries *db.Queries +} + +func New(config *config.Config, queries *db.Queries) *API { + return &API{ + config: config, + queries: queries, + } +} + +func (a *API) getGithubOAuthConfig() *oauth2.Config { + return &oauth2.Config{ + ClientID: a.config.GithubClientID, + ClientSecret: a.config.GithubSecret, + Endpoint: oauth2github.Endpoint, + RedirectURL: "http://localhost:8080/integrations/github/callback", + Scopes: []string{"repo", "admin:repo_hook"}, + } +} + +func (a *API) ConnectGithubHandler(w http.ResponseWriter, r *http.Request) { + // For now, we'll hardcode the tenant_id. In a real app, this would come from the JWT. + tenantID := uuid.New() + url := a.getGithubOAuthConfig().AuthCodeURL(tenantID.String(), oauth2.AccessTypeOffline) + http.Redirect(w, r, url, http.StatusTemporaryRedirect) +} + +type githubUser struct { + ID int64 `json:"id"` + Login string `json:"login"` +} + +func (a *API) ConnectGithubCallbackHandler(w http.ResponseWriter, r *http.Request) { + state := r.URL.Query().Get("state") + code := r.URL.Query().Get("code") + + tenantID, err := uuid.Parse(state) + if err != nil { + http.Error(w, "Invalid state", http.StatusBadRequest) + return + } + + githubOauthConfig := a.getGithubOAuthConfig() + token, err := githubOauthConfig.Exchange(context.Background(), code) + if err != nil { + http.Error(w, "Failed to exchange token", http.StatusInternalServerError) + return + } + + // Get user info from GitHub + client := githubOauthConfig.Client(context.Background(), token) + resp, err := client.Get("https://api.github.com/user") + if err != nil { + http.Error(w, "Failed to get user info", http.StatusInternalServerError) + return + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + http.Error(w, "Failed to read user info", http.StatusInternalServerError) + return + } + + var user githubUser + if err := json.Unmarshal(body, &user); err != nil { + http.Error(w, "Failed to parse user info", http.StatusInternalServerError) + return + } + + encryptedAccessToken, err := crypto.Encrypt(token.AccessToken, a.config.EncryptionKey) + if err != nil { + http.Error(w, "Failed to encrypt token", http.StatusInternalServerError) + return + } + + var encryptedRefreshToken string + if token.RefreshToken != "" { + encryptedRefreshToken, err = crypto.Encrypt(token.RefreshToken, a.config.EncryptionKey) + if err != nil { + http.Error(w, "Failed to encrypt refresh token", http.StatusInternalServerError) + return + } + } + + params := db.CreateRepoAccountParams{ + TenantID: pgtype.UUID{Bytes: tenantID, Valid: true}, + Provider: string(db.GitProviderGithub), + AccountID: fmt.Sprintf("%d", user.ID), + Username: user.Login, + EncryptedAccessToken: []byte(encryptedAccessToken), + } + + if encryptedRefreshToken != "" { + params.EncryptedRefreshToken = []byte(encryptedRefreshToken) + } + + _, err = a.queries.CreateRepoAccount(context.Background(), params) + + if err != nil { + http.Error(w, "Failed to save account", http.StatusInternalServerError) + return + } + + w.Write([]byte("Successfully connected to GitHub!")) +} + +func (a *API) GithubWebhookHandler(w http.ResponseWriter, r *http.Request) { + // TODO: Implement webhook signature validation + tenantIDStr := r.URL.Query().Get("tenant_id") + tenantID, err := uuid.Parse(tenantIDStr) + if err != nil { + http.Error(w, "Invalid tenant_id", http.StatusBadRequest) + return + } + + payload, err := io.ReadAll(r.Body) + if err != nil { + http.Error(w, "Failed to read request body", http.StatusInternalServerError) + return + } + defer r.Body.Close() + + event, err := github.ParseWebHook(github.WebHookType(r), payload) + if err != nil { + http.Error(w, "Could not parse webhook", http.StatusBadRequest) + return + } + + var eventType db.EventType + var repoExternalID string + var repoID pgtype.UUID + + switch e := event.(type) { + case *github.PushEvent: + eventType = db.EventTypePush + repoExternalID = fmt.Sprintf("%d", e.Repo.GetID()) + case *github.PullRequestEvent: + eventType = db.EventTypePullRequest + repoExternalID = fmt.Sprintf("%d", e.Repo.GetID()) + case *github.ReleaseEvent: + eventType = db.EventTypeRelease + repoExternalID = fmt.Sprintf("%d", e.Repo.GetID()) + default: + w.WriteHeader(http.StatusOK) + return + } + + repo, err := a.queries.GetRepositoryByExternalID(r.Context(), db.GetRepositoryByExternalIDParams{ + TenantID: pgtype.UUID{Bytes: tenantID, Valid: true}, + ExternalID: repoExternalID, + }) + if err != nil { + http.Error(w, "Repository not found", http.StatusNotFound) + return + } + repoID = repo.ID + + jsonPayload, err := json.Marshal(event) + if err != nil { + http.Error(w, "Failed to marshal event payload", http.StatusInternalServerError) + return + } + + _, err = a.queries.CreateRepoEvent(r.Context(), db.CreateRepoEventParams{ + TenantID: pgtype.UUID{Bytes: tenantID, Valid: true}, + RepositoryID: repoID, + EventType: string(eventType), + Payload: jsonPayload, + }) + if err != nil { + http.Error(w, "Failed to create repo event", http.StatusInternalServerError) + return + } + + w.WriteHeader(http.StatusOK) +} \ No newline at end of file diff --git a/repo-integrations-core/internal/api/repositories.go b/repo-integrations-core/internal/api/repositories.go new file mode 100644 index 0000000..feed2b4 --- /dev/null +++ b/repo-integrations-core/internal/api/repositories.go @@ -0,0 +1,29 @@ +package api + +import ( + "encoding/json" + "net/http" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5/pgtype" +) + +func (a *API) ListRepositoriesHandler(w http.ResponseWriter, r *http.Request) { + tenantIDStr := r.URL.Query().Get("tenant_id") + tenantID, err := uuid.Parse(tenantIDStr) + if err != nil { + http.Error(w, "Invalid tenant_id", http.StatusBadRequest) + return + } + + repos, err := a.queries.ListRepositoriesByTenant(r.Context(), pgtype.UUID{Bytes: tenantID, Valid: true}) + if err != nil { + http.Error(w, "Failed to list repositories", http.StatusInternalServerError) + return + } + + w.Header().Set("Content-Type", "application/json") + if err := json.NewEncoder(w).Encode(repos); err != nil { + http.Error(w, "Failed to encode response", http.StatusInternalServerError) + } +} diff --git a/repo-integrations-core/internal/config/config.go b/repo-integrations-core/internal/config/config.go new file mode 100644 index 0000000..e0766e5 --- /dev/null +++ b/repo-integrations-core/internal/config/config.go @@ -0,0 +1,41 @@ +package config + +import ( + "log" + "os" + + "github.com/joho/godotenv" +) + +type Config struct { + DatabaseURL string + JWTSecret string + EncryptionKey string + GithubClientID string + GithubSecret string +} + +func Load() *Config { + err := godotenv.Load() + if err != nil { + log.Println("No .env file found, using environment variables") + } + + return &Config{ + DatabaseURL: getEnv("DATABASE_URL", ""), + JWTSecret: getEnv("JWT_SECRET", ""), + EncryptionKey: getEnv("ENCRYPTION_KEY", ""), + GithubClientID: getEnv("GITHUB_CLIENT_ID", ""), + GithubSecret: getEnv("GITHUB_SECRET", ""), + } +} + +func getEnv(key, fallback string) string { + if value, ok := os.LookupEnv(key); ok { + return value + } + if fallback == "" { + log.Fatalf("FATAL: Environment variable %s is not set.", key) + } + return fallback +} diff --git a/repo-integrations-core/internal/crypto/crypto.go b/repo-integrations-core/internal/crypto/crypto.go new file mode 100644 index 0000000..592b216 --- /dev/null +++ b/repo-integrations-core/internal/crypto/crypto.go @@ -0,0 +1,63 @@ +package crypto + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "encoding/hex" + "fmt" + "io" +) + +// Encrypt encrypts data using AES-GCM. +func Encrypt(stringToEncrypt string, keyString string) (string, error) { + key, _ := hex.DecodeString(keyString) + plaintext := []byte(stringToEncrypt) + + block, err := aes.NewCipher(key) + if err != nil { + return "", err + } + + aesGCM, err := cipher.NewGCM(block) + if err != nil { + return "", err + } + + nonce := make([]byte, aesGCM.NonceSize()) + if _, err = io.ReadFull(rand.Reader, nonce); err != nil { + return "", err + } + + ciphertext := aesGCM.Seal(nonce, nonce, plaintext, nil) + return fmt.Sprintf("%x", ciphertext), nil +} + +// Decrypt decrypts data using AES-GCM. +func Decrypt(encryptedString string, keyString string) (string, error) { + key, _ := hex.DecodeString(keyString) + enc, _ := hex.DecodeString(encryptedString) + + block, err := aes.NewCipher(key) + if err != nil { + return "", err + } + + aesGCM, err := cipher.NewGCM(block) + if err != nil { + return "", err + } + + nonceSize := aesGCM.NonceSize() + if len(enc) < nonceSize { + return "", fmt.Errorf("ciphertext too short") + } + + nonce, ciphertext := enc[:nonceSize], enc[nonceSize:] + plaintext, err := aesGCM.Open(nil, nonce, ciphertext, nil) + if err != nil { + return "", err + } + + return string(plaintext), nil +} diff --git a/repo-integrations-core/internal/db/db.go b/repo-integrations-core/internal/db/db.go new file mode 100644 index 0000000..9d485b5 --- /dev/null +++ b/repo-integrations-core/internal/db/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/repo-integrations-core/internal/db/models.go b/repo-integrations-core/internal/db/models.go new file mode 100644 index 0000000..d8c9126 --- /dev/null +++ b/repo-integrations-core/internal/db/models.go @@ -0,0 +1,142 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package db + +import ( + "database/sql/driver" + "fmt" + + "github.com/jackc/pgx/v5/pgtype" +) + +type EventType string + +const ( + EventTypePush EventType = "push" + EventTypePullRequest EventType = "pull_request" + EventTypeRelease EventType = "release" +) + +func (e *EventType) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = EventType(s) + case string: + *e = EventType(s) + default: + return fmt.Errorf("unsupported scan type for EventType: %T", src) + } + return nil +} + +type NullEventType struct { + EventType EventType `json:"event_type"` + Valid bool `json:"valid"` // Valid is true if EventType is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullEventType) Scan(value interface{}) error { + if value == nil { + ns.EventType, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.EventType.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullEventType) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.EventType), nil +} + +type GitProvider string + +const ( + GitProviderGithub GitProvider = "github" + GitProviderGitlab GitProvider = "gitlab" + GitProviderBitbucket GitProvider = "bitbucket" +) + +func (e *GitProvider) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = GitProvider(s) + case string: + *e = GitProvider(s) + default: + return fmt.Errorf("unsupported scan type for GitProvider: %T", src) + } + return nil +} + +type NullGitProvider struct { + GitProvider GitProvider `json:"git_provider"` + Valid bool `json:"valid"` // Valid is true if GitProvider is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullGitProvider) Scan(value interface{}) error { + if value == nil { + ns.GitProvider, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.GitProvider.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullGitProvider) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.GitProvider), nil +} + +type RepoAccount struct { + ID pgtype.UUID `json:"id"` + TenantID pgtype.UUID `json:"tenant_id"` + Provider string `json:"provider"` + AccountID string `json:"account_id"` + Username string `json:"username"` + EncryptedAccessToken []byte `json:"encrypted_access_token"` + EncryptedRefreshToken []byte `json:"encrypted_refresh_token"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + +type RepoEvent struct { + ID pgtype.UUID `json:"id"` + TenantID pgtype.UUID `json:"tenant_id"` + RepositoryID pgtype.UUID `json:"repository_id"` + EventType string `json:"event_type"` + Payload []byte `json:"payload"` + ProcessedAt pgtype.Timestamptz `json:"processed_at"` + CreatedAt pgtype.Timestamptz `json:"created_at"` +} + +type Repository struct { + ID pgtype.UUID `json:"id"` + TenantID pgtype.UUID `json:"tenant_id"` + RepoAccountID pgtype.UUID `json:"repo_account_id"` + ExternalID string `json:"external_id"` + Name string `json:"name"` + Url string `json:"url"` + IsActive bool `json:"is_active"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + +type Webhook struct { + ID pgtype.UUID `json:"id"` + TenantID pgtype.UUID `json:"tenant_id"` + RepositoryID pgtype.UUID `json:"repository_id"` + ExternalID string `json:"external_id"` + Secret string `json:"secret"` + IsActive bool `json:"is_active"` + CreatedAt pgtype.Timestamptz `json:"created_at"` +} diff --git a/repo-integrations-core/internal/db/querier.go b/repo-integrations-core/internal/db/querier.go new file mode 100644 index 0000000..47a4282 --- /dev/null +++ b/repo-integrations-core/internal/db/querier.go @@ -0,0 +1,29 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +type Querier interface { + CreateRepoAccount(ctx context.Context, arg CreateRepoAccountParams) (RepoAccount, error) + CreateRepoEvent(ctx context.Context, arg CreateRepoEventParams) (RepoEvent, error) + CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error) + CreateWebhook(ctx context.Context, arg CreateWebhookParams) (Webhook, error) + GetRepoAccount(ctx context.Context, arg GetRepoAccountParams) (RepoAccount, error) + GetRepoAccountByID(ctx context.Context, arg GetRepoAccountByIDParams) (RepoAccount, error) + GetRepository(ctx context.Context, arg GetRepositoryParams) (Repository, error) + GetRepositoryByExternalID(ctx context.Context, arg GetRepositoryByExternalIDParams) (Repository, error) + GetWebhookByRepoExternalID(ctx context.Context, arg GetWebhookByRepoExternalIDParams) (Webhook, error) + GetWebhookByRepoID(ctx context.Context, arg GetWebhookByRepoIDParams) (Webhook, error) + ListRepoAccountsByTenant(ctx context.Context, tenantID pgtype.UUID) ([]RepoAccount, error) + ListRepositoriesByTenant(ctx context.Context, tenantID pgtype.UUID) ([]Repository, error) + UpdateRepoAccountTokens(ctx context.Context, arg UpdateRepoAccountTokensParams) (RepoAccount, error) +} + +var _ Querier = (*Queries)(nil) diff --git a/repo-integrations-core/internal/db/query.sql.go b/repo-integrations-core/internal/db/query.sql.go new file mode 100644 index 0000000..38571eb --- /dev/null +++ b/repo-integrations-core/internal/db/query.sql.go @@ -0,0 +1,446 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 +// source: query.sql + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createRepoAccount = `-- name: CreateRepoAccount :one +INSERT INTO repo_accounts ( + tenant_id, + provider, + account_id, + username, + encrypted_access_token, + encrypted_refresh_token +) VALUES ( + $1, $2, $3, $4, $5, $6 +) RETURNING id, tenant_id, provider, account_id, username, encrypted_access_token, encrypted_refresh_token, created_at, updated_at +` + +type CreateRepoAccountParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + Provider string `json:"provider"` + AccountID string `json:"account_id"` + Username string `json:"username"` + EncryptedAccessToken []byte `json:"encrypted_access_token"` + EncryptedRefreshToken []byte `json:"encrypted_refresh_token"` +} + +func (q *Queries) CreateRepoAccount(ctx context.Context, arg CreateRepoAccountParams) (RepoAccount, error) { + row := q.db.QueryRow(ctx, createRepoAccount, + arg.TenantID, + arg.Provider, + arg.AccountID, + arg.Username, + arg.EncryptedAccessToken, + arg.EncryptedRefreshToken, + ) + var i RepoAccount + err := row.Scan( + &i.ID, + &i.TenantID, + &i.Provider, + &i.AccountID, + &i.Username, + &i.EncryptedAccessToken, + &i.EncryptedRefreshToken, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const createRepoEvent = `-- name: CreateRepoEvent :one +INSERT INTO repo_events ( + tenant_id, + repository_id, + event_type, + payload +) VALUES ( + $1, $2, $3, $4 +) RETURNING id, tenant_id, repository_id, event_type, payload, processed_at, created_at +` + +type CreateRepoEventParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + RepositoryID pgtype.UUID `json:"repository_id"` + EventType string `json:"event_type"` + Payload []byte `json:"payload"` +} + +func (q *Queries) CreateRepoEvent(ctx context.Context, arg CreateRepoEventParams) (RepoEvent, error) { + row := q.db.QueryRow(ctx, createRepoEvent, + arg.TenantID, + arg.RepositoryID, + arg.EventType, + arg.Payload, + ) + var i RepoEvent + err := row.Scan( + &i.ID, + &i.TenantID, + &i.RepositoryID, + &i.EventType, + &i.Payload, + &i.ProcessedAt, + &i.CreatedAt, + ) + return i, err +} + +const createRepository = `-- name: CreateRepository :one +INSERT INTO repositories ( + tenant_id, + repo_account_id, + external_id, + name, + url +) VALUES ( + $1, $2, $3, $4, $5 +) RETURNING id, tenant_id, repo_account_id, external_id, name, url, is_active, created_at, updated_at +` + +type CreateRepositoryParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + RepoAccountID pgtype.UUID `json:"repo_account_id"` + ExternalID string `json:"external_id"` + Name string `json:"name"` + Url string `json:"url"` +} + +func (q *Queries) CreateRepository(ctx context.Context, arg CreateRepositoryParams) (Repository, error) { + row := q.db.QueryRow(ctx, createRepository, + arg.TenantID, + arg.RepoAccountID, + arg.ExternalID, + arg.Name, + arg.Url, + ) + var i Repository + err := row.Scan( + &i.ID, + &i.TenantID, + &i.RepoAccountID, + &i.ExternalID, + &i.Name, + &i.Url, + &i.IsActive, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const createWebhook = `-- name: CreateWebhook :one +INSERT INTO webhooks ( + tenant_id, + repository_id, + external_id, + secret +) VALUES ( + $1, $2, $3, $4 +) RETURNING id, tenant_id, repository_id, external_id, secret, is_active, created_at +` + +type CreateWebhookParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + RepositoryID pgtype.UUID `json:"repository_id"` + ExternalID string `json:"external_id"` + Secret string `json:"secret"` +} + +func (q *Queries) CreateWebhook(ctx context.Context, arg CreateWebhookParams) (Webhook, error) { + row := q.db.QueryRow(ctx, createWebhook, + arg.TenantID, + arg.RepositoryID, + arg.ExternalID, + arg.Secret, + ) + var i Webhook + err := row.Scan( + &i.ID, + &i.TenantID, + &i.RepositoryID, + &i.ExternalID, + &i.Secret, + &i.IsActive, + &i.CreatedAt, + ) + return i, err +} + +const getRepoAccount = `-- name: GetRepoAccount :one +SELECT id, tenant_id, provider, account_id, username, encrypted_access_token, encrypted_refresh_token, created_at, updated_at FROM repo_accounts +WHERE tenant_id = $1 AND provider = $2 AND account_id = $3 +` + +type GetRepoAccountParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + Provider string `json:"provider"` + AccountID string `json:"account_id"` +} + +func (q *Queries) GetRepoAccount(ctx context.Context, arg GetRepoAccountParams) (RepoAccount, error) { + row := q.db.QueryRow(ctx, getRepoAccount, arg.TenantID, arg.Provider, arg.AccountID) + var i RepoAccount + err := row.Scan( + &i.ID, + &i.TenantID, + &i.Provider, + &i.AccountID, + &i.Username, + &i.EncryptedAccessToken, + &i.EncryptedRefreshToken, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const getRepoAccountByID = `-- name: GetRepoAccountByID :one +SELECT id, tenant_id, provider, account_id, username, encrypted_access_token, encrypted_refresh_token, created_at, updated_at FROM repo_accounts +WHERE tenant_id = $1 AND id = $2 +` + +type GetRepoAccountByIDParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + ID pgtype.UUID `json:"id"` +} + +func (q *Queries) GetRepoAccountByID(ctx context.Context, arg GetRepoAccountByIDParams) (RepoAccount, error) { + row := q.db.QueryRow(ctx, getRepoAccountByID, arg.TenantID, arg.ID) + var i RepoAccount + err := row.Scan( + &i.ID, + &i.TenantID, + &i.Provider, + &i.AccountID, + &i.Username, + &i.EncryptedAccessToken, + &i.EncryptedRefreshToken, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const getRepository = `-- name: GetRepository :one +SELECT id, tenant_id, repo_account_id, external_id, name, url, is_active, created_at, updated_at FROM repositories +WHERE tenant_id = $1 AND id = $2 +` + +type GetRepositoryParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + ID pgtype.UUID `json:"id"` +} + +func (q *Queries) GetRepository(ctx context.Context, arg GetRepositoryParams) (Repository, error) { + row := q.db.QueryRow(ctx, getRepository, arg.TenantID, arg.ID) + var i Repository + err := row.Scan( + &i.ID, + &i.TenantID, + &i.RepoAccountID, + &i.ExternalID, + &i.Name, + &i.Url, + &i.IsActive, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const getRepositoryByExternalID = `-- name: GetRepositoryByExternalID :one +SELECT id, tenant_id, repo_account_id, external_id, name, url, is_active, created_at, updated_at FROM repositories +WHERE tenant_id = $1 AND external_id = $2 +` + +type GetRepositoryByExternalIDParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + ExternalID string `json:"external_id"` +} + +func (q *Queries) GetRepositoryByExternalID(ctx context.Context, arg GetRepositoryByExternalIDParams) (Repository, error) { + row := q.db.QueryRow(ctx, getRepositoryByExternalID, arg.TenantID, arg.ExternalID) + var i Repository + err := row.Scan( + &i.ID, + &i.TenantID, + &i.RepoAccountID, + &i.ExternalID, + &i.Name, + &i.Url, + &i.IsActive, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const getWebhookByRepoExternalID = `-- name: GetWebhookByRepoExternalID :one +SELECT w.id, w.tenant_id, w.repository_id, w.external_id, w.secret, w.is_active, w.created_at FROM webhooks w +JOIN repositories r ON w.repository_id = r.id +WHERE r.tenant_id = $1 AND r.external_id = $2 +` + +type GetWebhookByRepoExternalIDParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + ExternalID string `json:"external_id"` +} + +func (q *Queries) GetWebhookByRepoExternalID(ctx context.Context, arg GetWebhookByRepoExternalIDParams) (Webhook, error) { + row := q.db.QueryRow(ctx, getWebhookByRepoExternalID, arg.TenantID, arg.ExternalID) + var i Webhook + err := row.Scan( + &i.ID, + &i.TenantID, + &i.RepositoryID, + &i.ExternalID, + &i.Secret, + &i.IsActive, + &i.CreatedAt, + ) + return i, err +} + +const getWebhookByRepoID = `-- name: GetWebhookByRepoID :one +SELECT id, tenant_id, repository_id, external_id, secret, is_active, created_at FROM webhooks +WHERE tenant_id = $1 AND repository_id = $2 +` + +type GetWebhookByRepoIDParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + RepositoryID pgtype.UUID `json:"repository_id"` +} + +func (q *Queries) GetWebhookByRepoID(ctx context.Context, arg GetWebhookByRepoIDParams) (Webhook, error) { + row := q.db.QueryRow(ctx, getWebhookByRepoID, arg.TenantID, arg.RepositoryID) + var i Webhook + err := row.Scan( + &i.ID, + &i.TenantID, + &i.RepositoryID, + &i.ExternalID, + &i.Secret, + &i.IsActive, + &i.CreatedAt, + ) + return i, err +} + +const listRepoAccountsByTenant = `-- name: ListRepoAccountsByTenant :many +SELECT id, tenant_id, provider, account_id, username, encrypted_access_token, encrypted_refresh_token, created_at, updated_at FROM repo_accounts +WHERE tenant_id = $1 +` + +func (q *Queries) ListRepoAccountsByTenant(ctx context.Context, tenantID pgtype.UUID) ([]RepoAccount, error) { + rows, err := q.db.Query(ctx, listRepoAccountsByTenant, tenantID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []RepoAccount + for rows.Next() { + var i RepoAccount + if err := rows.Scan( + &i.ID, + &i.TenantID, + &i.Provider, + &i.AccountID, + &i.Username, + &i.EncryptedAccessToken, + &i.EncryptedRefreshToken, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listRepositoriesByTenant = `-- name: ListRepositoriesByTenant :many +SELECT id, tenant_id, repo_account_id, external_id, name, url, is_active, created_at, updated_at FROM repositories +WHERE tenant_id = $1 AND is_active = TRUE +` + +func (q *Queries) ListRepositoriesByTenant(ctx context.Context, tenantID pgtype.UUID) ([]Repository, error) { + rows, err := q.db.Query(ctx, listRepositoriesByTenant, tenantID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Repository + for rows.Next() { + var i Repository + if err := rows.Scan( + &i.ID, + &i.TenantID, + &i.RepoAccountID, + &i.ExternalID, + &i.Name, + &i.Url, + &i.IsActive, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateRepoAccountTokens = `-- name: UpdateRepoAccountTokens :one +UPDATE repo_accounts +SET + encrypted_access_token = $3, + encrypted_refresh_token = $4, + updated_at = NOW() +WHERE tenant_id = $1 AND id = $2 +RETURNING id, tenant_id, provider, account_id, username, encrypted_access_token, encrypted_refresh_token, created_at, updated_at +` + +type UpdateRepoAccountTokensParams struct { + TenantID pgtype.UUID `json:"tenant_id"` + ID pgtype.UUID `json:"id"` + EncryptedAccessToken []byte `json:"encrypted_access_token"` + EncryptedRefreshToken []byte `json:"encrypted_refresh_token"` +} + +func (q *Queries) UpdateRepoAccountTokens(ctx context.Context, arg UpdateRepoAccountTokensParams) (RepoAccount, error) { + row := q.db.QueryRow(ctx, updateRepoAccountTokens, + arg.TenantID, + arg.ID, + arg.EncryptedAccessToken, + arg.EncryptedRefreshToken, + ) + var i RepoAccount + err := row.Scan( + &i.ID, + &i.TenantID, + &i.Provider, + &i.AccountID, + &i.Username, + &i.EncryptedAccessToken, + &i.EncryptedRefreshToken, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} diff --git a/repo-integrations-core/migrations/000001_init_schema.up.sql b/repo-integrations-core/migrations/000001_init_schema.up.sql new file mode 100644 index 0000000..b7824f7 --- /dev/null +++ b/repo-integrations-core/migrations/000001_init_schema.up.sql @@ -0,0 +1,65 @@ +-- +migrate Up +CREATE TYPE git_provider AS ENUM ('github', 'gitlab', 'bitbucket'); +CREATE TYPE event_type AS ENUM ('push', 'pull_request', 'release'); + +CREATE TABLE repo_accounts ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + tenant_id UUID NOT NULL, + provider git_provider NOT NULL, + account_id VARCHAR(255) NOT NULL, + username VARCHAR(255) NOT NULL, + encrypted_access_token BYTEA NOT NULL, + encrypted_refresh_token BYTEA, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(tenant_id, provider, account_id) +); + +CREATE TABLE repositories ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + tenant_id UUID NOT NULL, + repo_account_id UUID NOT NULL REFERENCES repo_accounts(id) ON DELETE CASCADE, + external_id VARCHAR(255) NOT NULL, + name VARCHAR(255) NOT NULL, + url VARCHAR(255) NOT NULL, + is_active BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(tenant_id, external_id) +); + +CREATE TABLE webhooks ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + tenant_id UUID NOT NULL, + repository_id UUID NOT NULL REFERENCES repositories(id) ON DELETE CASCADE, + external_id VARCHAR(255) NOT NULL, + secret TEXT NOT NULL, + is_active BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(tenant_id, repository_id) +); + +CREATE TABLE repo_events ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + tenant_id UUID NOT NULL, + repository_id UUID NOT NULL REFERENCES repositories(id), + event_type event_type NOT NULL, + payload JSONB NOT NULL, + processed_at TIMESTAMPTZ, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +-- Indexes +CREATE INDEX ON repo_accounts (tenant_id); +CREATE INDEX ON repositories (tenant_id, repo_account_id); +CREATE INDEX ON webhooks (tenant_id, repository_id); +CREATE INDEX ON repo_events (tenant_id, repository_id, event_type); + + +-- +migrate Down +DROP TABLE IF EXISTS repo_events; +DROP TABLE IF EXISTS webhooks; +DROP TABLE IF EXISTS repositories; +DROP TABLE IF EXISTS repo_accounts; +DROP TYPE IF EXISTS event_type; +DROP TYPE IF EXISTS git_provider; diff --git a/repo-integrations-core/sqlc.yaml b/repo-integrations-core/sqlc.yaml new file mode 100644 index 0000000..37ba14c --- /dev/null +++ b/repo-integrations-core/sqlc.yaml @@ -0,0 +1,19 @@ +version: "2" +sql: + - engine: "postgresql" + schema: "migrations" + queries: "db/query.sql" + gen: + go: + package: "db" + out: "internal/db" + sql_package: "pgx/v5" + emit_json_tags: true + emit_interface: true + overrides: + - db_type: "pg_catalog.uuid" + go_type: "github.com/google/uuid.UUID" + - db_type: "event_type" + go_type: "string" + - db_type: "git_provider" + go_type: "string" diff --git a/security-governance-core/.dockerignore b/security-governance-core/.dockerignore new file mode 100644 index 0000000..94eb047 --- /dev/null +++ b/security-governance-core/.dockerignore @@ -0,0 +1,8 @@ +.git +.env +.gitignore +Dockerfile +README.md +SECURITY-GOVERNANCE-CORE.md +migrations +*.log diff --git a/security-governance-core/.env.example b/security-governance-core/.env.example new file mode 100644 index 0000000..097e96f --- /dev/null +++ b/security-governance-core/.env.example @@ -0,0 +1,2 @@ +DATABASE_URL= +PORT=8080 diff --git a/security-governance-core/.gitignore b/security-governance-core/.gitignore new file mode 100644 index 0000000..8564984 --- /dev/null +++ b/security-governance-core/.gitignore @@ -0,0 +1,6 @@ +.env +*.log +.DS_Store +security-governance-core +main +coverage diff --git a/security-governance-core/Dockerfile b/security-governance-core/Dockerfile new file mode 100644 index 0000000..35cd46b --- /dev/null +++ b/security-governance-core/Dockerfile @@ -0,0 +1,25 @@ +# Dockerfile +FROM docker.io/library/golang:1.23-alpine AS builder + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . + +# Build with optimization flags +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /app/security-governance-core ./cmd/api + +# Use Google Distroless static image for minimal size and security +FROM gcr.io/distroless/static:nonroot + +WORKDIR /app + +COPY --from=builder /app/security-governance-core . + +USER nonroot:nonroot + +EXPOSE 8080 + +CMD ["./security-governance-core"] diff --git a/security-governance-core/SECURITY-GOVERNANCE-CORE.md b/security-governance-core/SECURITY-GOVERNANCE-CORE.md new file mode 100644 index 0000000..7a17129 --- /dev/null +++ b/security-governance-core/SECURITY-GOVERNANCE-CORE.md @@ -0,0 +1,71 @@ +# SECURITY-GOVERNANCE-CORE + +O `security-governance-core` é o guardião das políticas de segurança e conformidade da plataforma. + +## 📋 Visão Geral + +Este serviço centraliza a governança, garantindo que todos os tenants operem dentro dos parâmetros de segurança definidos. Ele mantém um registro de auditoria imutável e gerencia perfis de risco. + +### Arquitetura + +```mermaid +graph TD + Service[Any Service] -->|Event| Queue[Audit Queue] + Queue -->|Consume| Worker[Audit Worker] + Worker -->|Store| DB[(Audit Log DB)] + + Admin[Compliance Officer] -->|Define| Policy[Security Policy] + Policy -->|Enforce| Gatekeeper[Policy Engine] +``` + +## 🚀 Estrutura do Projeto + +O projeto é escrito em **Go** e foca em imutabilidade e rastreabilidade: + +| Diretório | Descrição | +| :--- | :--- | +| `cmd/api` | API de gestão. | +| `internal/audit` | Ingestão de logs de auditoria. | +| `internal/policies` | Motor de políticas (OPA-like simple engine). | +| `internal/compliance` | Checklists e relatórios. | + +## 🛠️ Tecnologias e Otimizações + +- **Linguagem**: Go 1.23. +- **Database**: PostgreSQL (Tabelas *append-only* para auditoria). +- **Containerização**: + - Base `distroless/static`. + - Segurança máxima (sem shell). + +## 💻 Como Executar + +### Docker (Recomendado) + +```bash +# Build +docker build -t security-governance-core . + +# Run +docker run -p 8080:8080 --env-file .env security-governance-core +``` + +### Desenvolvimento + +1. **Dependências**: Go 1.23+, Postgres. +2. **Setup**: + ```bash + cp .env.example .env + go mod tidy + ``` +3. **Executar**: + ```bash + go run ./cmd/api + ``` + +## 🔧 Detalhes do Dockerfile + +O `Dockerfile` é endurecido para ambientes regulados: + +- **Base**: Distroless Static. +- **User**: Non-root (UID 65532). +- **Network**: Apenas portas necessárias expostas. diff --git a/security-governance-core/cmd/api/main.go b/security-governance-core/cmd/api/main.go new file mode 100644 index 0000000..8c94719 --- /dev/null +++ b/security-governance-core/cmd/api/main.go @@ -0,0 +1,98 @@ +package main + +import ( + "context" + "encoding/json" + "fmt" + "log" + "net/http" + "strconv" + + "github.com/go-chi/chi/v5" + "github.com/go-chi/chi/v5/middleware" + "github.com/jackc/pgx/v5/pgxpool" + "github.com/lab/security-governance-core/internal/audit" + "github.com/lab/security-governance-core/internal/config" + "github.com/lab/security-governance-core/internal/db" +) + +type application struct { + config *config.Config + queries *db.Queries + auditLogger *audit.Logger +} + +func main() { + cfg := config.Load() + + pool, err := pgxpool.New(context.Background(), cfg.DatabaseURL) + if err != nil { + log.Fatalf("Unable to connect to database: %v\n", err) + } + defer pool.Close() + + queries := db.New(pool) + app := &application{ + config: cfg, + queries: queries, + auditLogger: audit.NewLogger(queries), + } + + r := chi.NewRouter() + r.Use(middleware.Logger) + r.Use(middleware.Recoverer) + + r.Get("/", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Security Governance Core")) + }) + + r.Post("/security-profiles", app.createSecurityProfileHandler) + r.Post("/policies", app.createPolicyHandler) + r.Get("/findings", app.getFindingsHandler) + r.Get("/audit-logs", app.getAuditLogsHandler) + + log.Printf("Starting server on port %s", cfg.Port) + if err := http.ListenAndServe(fmt.Sprintf(":%s", cfg.Port), r); err != nil { + log.Fatalf("Could not start server: %s\n", err) + } +} + +func (app *application) createSecurityProfileHandler(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +func (app *application) createPolicyHandler(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +func (app *application) getFindingsHandler(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +func (app *application) getAuditLogsHandler(w http.ResponseWriter, r *http.Request) { + limit, _ := strconv.Atoi(r.URL.Query().Get("limit")) + offset, _ := strconv.Atoi(r.URL.Query().Get("offset")) + + if limit <= 0 { + limit = 10 + } + if offset < 0 { + offset = 0 + } + + // For demonstration, we'll use a hardcoded actor ID. In a real app, this would come from a JWT token. + actorID := "user-123" + app.auditLogger.Log(r.Context(), actorID, "list_audit_logs", "audit_log", "", nil) + + logs, err := app.queries.ListAuditLogs(r.Context(), db.ListAuditLogsParams{ + Limit: int32(limit), + Offset: int32(offset), + }) + if err != nil { + http.Error(w, "Failed to retrieve audit logs", http.StatusInternalServerError) + return + } + + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(logs) +} diff --git a/security-governance-core/db/query.sql b/security-governance-core/db/query.sql new file mode 100644 index 0000000..3597881 --- /dev/null +++ b/security-governance-core/db/query.sql @@ -0,0 +1,33 @@ +-- name: CreateSecurityProfile :one +INSERT INTO security_profiles (name, risk_level) +VALUES ($1, $2) +RETURNING *; + +-- name: CreatePolicy :one +INSERT INTO policies (name, description) +VALUES ($1, $2) +RETURNING *; + +-- name: CreateControl :one +INSERT INTO controls (policy_id, name, description) +VALUES ($1, $2, $3) +RETURNING *; + +-- name: CreateFinding :one +INSERT INTO findings (control_id, resource_id, status, details) +VALUES ($1, $2, $3, $4) +RETURNING *; + +-- name: ListFindings :many +SELECT * FROM findings +WHERE status = $1; + +-- name: CreateAuditLog :one +INSERT INTO audit_logs (actor_id, action, resource_type, resource_id, details) +VALUES ($1, $2, $3, $4, $5) +RETURNING *; + +-- name: ListAuditLogs :many +SELECT * FROM audit_logs +ORDER BY timestamp DESC +LIMIT $1 OFFSET $2; diff --git a/security-governance-core/go.mod b/security-governance-core/go.mod new file mode 100644 index 0000000..53a332f --- /dev/null +++ b/security-governance-core/go.mod @@ -0,0 +1,18 @@ +module github.com/lab/security-governance-core + +go 1.23 + +require ( + github.com/go-chi/chi/v5 v5.2.3 + github.com/jackc/pgx/v5 v5.7.1 + github.com/joho/godotenv v1.5.1 +) + +require ( + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/text v0.21.0 // indirect +) diff --git a/security-governance-core/go.sum b/security-governance-core/go.sum new file mode 100644 index 0000000..afb5e49 --- /dev/null +++ b/security-governance-core/go.sum @@ -0,0 +1,32 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE= +github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs= +github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/security-governance-core/internal/audit/audit.go b/security-governance-core/internal/audit/audit.go new file mode 100644 index 0000000..c5f9de4 --- /dev/null +++ b/security-governance-core/internal/audit/audit.go @@ -0,0 +1,34 @@ +package audit + +import ( + "context" + "encoding/json" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/lab/security-governance-core/internal/db" +) + +type Logger struct { + queries *db.Queries +} + +func NewLogger(queries *db.Queries) *Logger { + return &Logger{queries: queries} +} + +func (l *Logger) Log(ctx context.Context, actorID, action, resourceType, resourceID string, details interface{}) error { + detailsJSON, err := json.Marshal(details) + if err != nil { + return err + } + + _, err = l.queries.CreateAuditLog(ctx, db.CreateAuditLogParams{ + ActorID: actorID, + Action: action, + ResourceType: pgtype.Text{String: resourceType, Valid: resourceType != ""}, + ResourceID: pgtype.Text{String: resourceID, Valid: resourceID != ""}, + Details: detailsJSON, + }) + + return err +} diff --git a/security-governance-core/internal/config/config.go b/security-governance-core/internal/config/config.go new file mode 100644 index 0000000..f1066bd --- /dev/null +++ b/security-governance-core/internal/config/config.go @@ -0,0 +1,35 @@ +package config + +import ( + "log" + "os" + + "github.com/joho/godotenv" +) + +type Config struct { + DatabaseURL string + Port string +} + +func Load() *Config { + err := godotenv.Load() + if err != nil { + log.Println("No .env file found, using environment variables") + } + + return &Config{ + DatabaseURL: getEnv("DATABASE_URL", ""), + Port: getEnv("PORT", "8080"), + } +} + +func getEnv(key, fallback string) string { + if value, ok := os.LookupEnv(key); ok { + return value + } + if fallback == "" { + log.Fatalf("FATAL: Environment variable %s is not set.", key) + } + return fallback +} diff --git a/security-governance-core/internal/db/db.go b/security-governance-core/internal/db/db.go new file mode 100644 index 0000000..9d485b5 --- /dev/null +++ b/security-governance-core/internal/db/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/security-governance-core/internal/db/models.go b/security-governance-core/internal/db/models.go new file mode 100644 index 0000000..94f290d --- /dev/null +++ b/security-governance-core/internal/db/models.go @@ -0,0 +1,144 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package db + +import ( + "database/sql/driver" + "fmt" + + "github.com/jackc/pgx/v5/pgtype" +) + +type FindingStatus string + +const ( + FindingStatusOpen FindingStatus = "open" + FindingStatusResolved FindingStatus = "resolved" + FindingStatusIgnored FindingStatus = "ignored" +) + +func (e *FindingStatus) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = FindingStatus(s) + case string: + *e = FindingStatus(s) + default: + return fmt.Errorf("unsupported scan type for FindingStatus: %T", src) + } + return nil +} + +type NullFindingStatus struct { + FindingStatus FindingStatus `json:"finding_status"` + Valid bool `json:"valid"` // Valid is true if FindingStatus is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullFindingStatus) Scan(value interface{}) error { + if value == nil { + ns.FindingStatus, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.FindingStatus.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullFindingStatus) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.FindingStatus), nil +} + +type RiskLevel string + +const ( + RiskLevelLow RiskLevel = "low" + RiskLevelMedium RiskLevel = "medium" + RiskLevelHigh RiskLevel = "high" + RiskLevelCritical RiskLevel = "critical" +) + +func (e *RiskLevel) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = RiskLevel(s) + case string: + *e = RiskLevel(s) + default: + return fmt.Errorf("unsupported scan type for RiskLevel: %T", src) + } + return nil +} + +type NullRiskLevel struct { + RiskLevel RiskLevel `json:"risk_level"` + Valid bool `json:"valid"` // Valid is true if RiskLevel is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullRiskLevel) Scan(value interface{}) error { + if value == nil { + ns.RiskLevel, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.RiskLevel.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullRiskLevel) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.RiskLevel), nil +} + +type AuditLog struct { + ID int64 `json:"id"` + Timestamp pgtype.Timestamptz `json:"timestamp"` + ActorID string `json:"actor_id"` + Action string `json:"action"` + ResourceType pgtype.Text `json:"resource_type"` + ResourceID pgtype.Text `json:"resource_id"` + Details []byte `json:"details"` +} + +type Control struct { + ID pgtype.UUID `json:"id"` + PolicyID pgtype.UUID `json:"policy_id"` + Name string `json:"name"` + Description pgtype.Text `json:"description"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + +type Finding struct { + ID pgtype.UUID `json:"id"` + ControlID pgtype.UUID `json:"control_id"` + ResourceID string `json:"resource_id"` + Status FindingStatus `json:"status"` + Details []byte `json:"details"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + +type Policy struct { + ID pgtype.UUID `json:"id"` + Name string `json:"name"` + Description pgtype.Text `json:"description"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} + +type SecurityProfile struct { + ID pgtype.UUID `json:"id"` + Name string `json:"name"` + RiskLevel RiskLevel `json:"risk_level"` + CreatedAt pgtype.Timestamptz `json:"created_at"` + UpdatedAt pgtype.Timestamptz `json:"updated_at"` +} diff --git a/security-governance-core/internal/db/query.sql.go b/security-governance-core/internal/db/query.sql.go new file mode 100644 index 0000000..ed0cf0b --- /dev/null +++ b/security-governance-core/internal/db/query.sql.go @@ -0,0 +1,226 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 +// source: query.sql + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createAuditLog = `-- name: CreateAuditLog :one +INSERT INTO audit_logs (actor_id, action, resource_type, resource_id, details) +VALUES ($1, $2, $3, $4, $5) +RETURNING id, timestamp, actor_id, action, resource_type, resource_id, details +` + +type CreateAuditLogParams struct { + ActorID string `json:"actor_id"` + Action string `json:"action"` + ResourceType pgtype.Text `json:"resource_type"` + ResourceID pgtype.Text `json:"resource_id"` + Details []byte `json:"details"` +} + +func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error) { + row := q.db.QueryRow(ctx, createAuditLog, + arg.ActorID, + arg.Action, + arg.ResourceType, + arg.ResourceID, + arg.Details, + ) + var i AuditLog + err := row.Scan( + &i.ID, + &i.Timestamp, + &i.ActorID, + &i.Action, + &i.ResourceType, + &i.ResourceID, + &i.Details, + ) + return i, err +} + +const createControl = `-- name: CreateControl :one +INSERT INTO controls (policy_id, name, description) +VALUES ($1, $2, $3) +RETURNING id, policy_id, name, description, created_at, updated_at +` + +type CreateControlParams struct { + PolicyID pgtype.UUID `json:"policy_id"` + Name string `json:"name"` + Description pgtype.Text `json:"description"` +} + +func (q *Queries) CreateControl(ctx context.Context, arg CreateControlParams) (Control, error) { + row := q.db.QueryRow(ctx, createControl, arg.PolicyID, arg.Name, arg.Description) + var i Control + err := row.Scan( + &i.ID, + &i.PolicyID, + &i.Name, + &i.Description, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const createFinding = `-- name: CreateFinding :one +INSERT INTO findings (control_id, resource_id, status, details) +VALUES ($1, $2, $3, $4) +RETURNING id, control_id, resource_id, status, details, created_at, updated_at +` + +type CreateFindingParams struct { + ControlID pgtype.UUID `json:"control_id"` + ResourceID string `json:"resource_id"` + Status FindingStatus `json:"status"` + Details []byte `json:"details"` +} + +func (q *Queries) CreateFinding(ctx context.Context, arg CreateFindingParams) (Finding, error) { + row := q.db.QueryRow(ctx, createFinding, + arg.ControlID, + arg.ResourceID, + arg.Status, + arg.Details, + ) + var i Finding + err := row.Scan( + &i.ID, + &i.ControlID, + &i.ResourceID, + &i.Status, + &i.Details, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const createPolicy = `-- name: CreatePolicy :one +INSERT INTO policies (name, description) +VALUES ($1, $2) +RETURNING id, name, description, created_at, updated_at +` + +type CreatePolicyParams struct { + Name string `json:"name"` + Description pgtype.Text `json:"description"` +} + +func (q *Queries) CreatePolicy(ctx context.Context, arg CreatePolicyParams) (Policy, error) { + row := q.db.QueryRow(ctx, createPolicy, arg.Name, arg.Description) + var i Policy + err := row.Scan( + &i.ID, + &i.Name, + &i.Description, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const createSecurityProfile = `-- name: CreateSecurityProfile :one +INSERT INTO security_profiles (name, risk_level) +VALUES ($1, $2) +RETURNING id, name, risk_level, created_at, updated_at +` + +type CreateSecurityProfileParams struct { + Name string `json:"name"` + RiskLevel RiskLevel `json:"risk_level"` +} + +func (q *Queries) CreateSecurityProfile(ctx context.Context, arg CreateSecurityProfileParams) (SecurityProfile, error) { + row := q.db.QueryRow(ctx, createSecurityProfile, arg.Name, arg.RiskLevel) + var i SecurityProfile + err := row.Scan( + &i.ID, + &i.Name, + &i.RiskLevel, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const listAuditLogs = `-- name: ListAuditLogs :many +SELECT id, timestamp, actor_id, action, resource_type, resource_id, details FROM audit_logs +ORDER BY timestamp DESC +LIMIT $1 OFFSET $2 +` + +type ListAuditLogsParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` +} + +func (q *Queries) ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]AuditLog, error) { + rows, err := q.db.Query(ctx, listAuditLogs, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + var items []AuditLog + for rows.Next() { + var i AuditLog + if err := rows.Scan( + &i.ID, + &i.Timestamp, + &i.ActorID, + &i.Action, + &i.ResourceType, + &i.ResourceID, + &i.Details, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listFindings = `-- name: ListFindings :many +SELECT id, control_id, resource_id, status, details, created_at, updated_at FROM findings +WHERE status = $1 +` + +func (q *Queries) ListFindings(ctx context.Context, status FindingStatus) ([]Finding, error) { + rows, err := q.db.Query(ctx, listFindings, status) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Finding + for rows.Next() { + var i Finding + if err := rows.Scan( + &i.ID, + &i.ControlID, + &i.ResourceID, + &i.Status, + &i.Details, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/security-governance-core/migrations/000001_init_schema.up.sql b/security-governance-core/migrations/000001_init_schema.up.sql new file mode 100644 index 0000000..ecf69a1 --- /dev/null +++ b/security-governance-core/migrations/000001_init_schema.up.sql @@ -0,0 +1,78 @@ +-- +migrate Up +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + +CREATE TYPE finding_status AS ENUM ('open', 'resolved', 'ignored'); +CREATE TYPE risk_level AS ENUM ('low', 'medium', 'high', 'critical'); + +CREATE TABLE security_profiles ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + name VARCHAR(255) NOT NULL UNIQUE, + risk_level risk_level NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE policies ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + name VARCHAR(255) NOT NULL UNIQUE, + description TEXT, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE controls ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + policy_id UUID NOT NULL REFERENCES policies(id) ON DELETE CASCADE, + name VARCHAR(255) NOT NULL, + description TEXT, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE findings ( + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), + control_id UUID NOT NULL REFERENCES controls(id) ON DELETE CASCADE, + resource_id VARCHAR(255) NOT NULL, + status finding_status NOT NULL, + details JSONB, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE audit_logs ( + id BIGSERIAL PRIMARY KEY, + timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW(), + actor_id VARCHAR(255) NOT NULL, + action VARCHAR(255) NOT NULL, + resource_type VARCHAR(255), + resource_id VARCHAR(255), + details JSONB +); + +-- Make audit_logs append-only +CREATE FUNCTION make_audit_log_immutable() RETURNS TRIGGER AS $$ +BEGIN + RAISE EXCEPTION 'Audit log records cannot be modified or deleted'; +END; +$$ LANGUAGE plpgsql; + +CREATE TRIGGER audit_log_immutable_trigger +BEFORE UPDATE OR DELETE ON audit_logs +FOR EACH ROW EXECUTE PROCEDURE make_audit_log_immutable(); + +-- Indexes +CREATE INDEX ON controls (policy_id); +CREATE INDEX ON findings (control_id); +CREATE INDEX ON audit_logs (actor_id, timestamp DESC); +CREATE INDEX ON audit_logs (resource_type, resource_id); + +-- +migrate Down +DROP TRIGGER IF EXISTS audit_log_immutable_trigger ON audit_logs; +DROP FUNCTION IF EXISTS make_audit_log_immutable(); +DROP TABLE IF EXISTS audit_logs; +DROP TABLE IF EXISTS findings; +DROP TABLE IF EXISTS controls; +DROP TABLE IF EXISTS policies; +DROP TABLE IF EXISTS security_profiles; +DROP TYPE IF EXISTS finding_status; +DROP TYPE IF EXISTS risk_level; diff --git a/security-governance-core/sqlc.yaml b/security-governance-core/sqlc.yaml new file mode 100644 index 0000000..d719475 --- /dev/null +++ b/security-governance-core/sqlc.yaml @@ -0,0 +1,11 @@ +version: "2" +sql: + - engine: "postgresql" + queries: "db/query.sql" + schema: "migrations" + gen: + go: + package: "db" + out: "internal/db" + sql_package: "pgx/v5" + emit_json_tags: true