From 3438c8b6bf2a1e44f4f59a8012b09634d25de8a6 Mon Sep 17 00:00:00 2001 From: ezekielelvis Date: Sat, 1 Aug 2026 20:33:45 +0000 Subject: [PATCH 1/2] Add backend, infrastructure, CI, and docs for Event Registration & Ticketing System MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Serverless event registration/ticketing REST API on AWS, built as a pnpm monorepo: - backend/: Lambda handlers (TS) for auth, events, admin review, and registrations, layered as handlers -> services -> repositories, with Zod validation, typed errors, Cognito JWT auth-context helpers, and Powertools logging/metrics/tracing. 38 unit tests covering business rules (capacity enforcement, ownership checks, review workflow, HTML escaping in outbound email). - infrastructure/: AWS CDK (TS) app with six stacks — Database (DynamoDB), Auth (Cognito), Notifications (SNS -> Lambda -> SES), Api (HTTP API + JWT authorizer + throttling), Monitoring (CloudWatch alarms/dashboard incl. >5% error-rate alarm), Budget (AWS Budgets Free Tier guardrail). - .github/workflows/ci.yml: lint, typecheck, unit tests, cdk synth on every push/PR, per GitHub Flow (docs/branching-strategy.md). - docs/: architecture, data model, API reference, security patterns, and ADRs for the major design decisions. - frontend/: placeholder only, design pending further instructions. Co-Authored-By: Claude Sonnet 5 --- .eslintrc.json | 25 + .github/workflows/ci.yml | 52 + .gitignore | 19 + .prettierrc.json | 7 + README.md | 153 +- backend/README.md | 53 + backend/jest.config.js | 10 + backend/package.json | 37 + backend/src/handlers/admin/list-events.ts | 22 + backend/src/handlers/admin/list-users.ts | 22 + backend/src/handlers/admin/review-event.ts | 21 + .../src/handlers/admin/update-user-role.ts | 21 + backend/src/handlers/auth/confirm-signup.ts | 10 + backend/src/handlers/auth/forgot-password.ts | 10 + backend/src/handlers/auth/login.ts | 10 + .../auth/post-confirmation-trigger.ts | 58 + backend/src/handlers/auth/refresh.ts | 10 + backend/src/handlers/auth/reset-password.ts | 10 + backend/src/handlers/auth/signup.ts | 16 + backend/src/handlers/events/cancel-event.ts | 19 + backend/src/handlers/events/create-event.ts | 15 + backend/src/handlers/events/get-event.ts | 13 + backend/src/handlers/events/list-events.ts | 10 + backend/src/handlers/events/list-my-events.ts | 22 + backend/src/handlers/events/update-event.ts | 21 + .../notifications/dispatch-notification.ts | 46 + .../registrations/cancel-registration.ts | 19 + .../registrations/list-event-registrations.ts | 27 + .../registrations/list-my-registrations.ts | 21 + .../src/handlers/registrations/register.ts | 19 + backend/src/lib/auth-context.ts | 44 + backend/src/lib/cognito.ts | 3 + backend/src/lib/dynamo.ts | 10 + backend/src/lib/env.ts | 31 + backend/src/lib/errors.ts | 40 + backend/src/lib/html.ts | 18 + backend/src/lib/http.ts | 82 + backend/src/lib/ids.ts | 4 + backend/src/lib/logger.ts | 11 + backend/src/lib/notifier.ts | 27 + backend/src/lib/pagination.ts | 15 + backend/src/lib/validation.ts | 100 + backend/src/models/enums.ts | 28 + backend/src/models/types.ts | 72 + backend/src/repositories/events-repository.ts | 172 + .../repositories/registrations-repository.ts | 96 + backend/src/repositories/users-repository.ts | 57 + backend/src/services/admin-service.ts | 50 + backend/src/services/auth-service.ts | 133 + backend/src/services/dto.ts | 26 + backend/src/services/email-templates.ts | 50 + backend/src/services/event-service.ts | 102 + backend/src/services/registration-service.ts | 94 + backend/tests/unit/lib/auth-context.test.ts | 53 + backend/tests/unit/lib/validation.test.ts | 51 + .../repositories/events-repository.test.ts | 43 + .../tests/unit/services/admin-service.test.ts | 76 + .../unit/services/email-templates.test.ts | 33 + .../tests/unit/services/event-service.test.ts | 118 + .../services/registration-service.test.ts | 109 + backend/tsconfig.json | 10 + docs/api.md | 76 + docs/architecture.md | 132 + docs/branching-strategy.md | 48 + docs/data-model.md | 121 + docs/decisions.md | 93 + docs/security.md | 117 + frontend/README.md | 9 + infrastructure/README.md | 59 + infrastructure/bin/app.ts | 58 + infrastructure/cdk.json | 37 + infrastructure/lib/config/environment.ts | 28 + infrastructure/lib/constructs/api-lambda.ts | 53 + infrastructure/lib/stacks/api-stack.ts | 183 + infrastructure/lib/stacks/auth-stack.ts | 102 + infrastructure/lib/stacks/budget-stack.ts | 61 + infrastructure/lib/stacks/database-stack.ts | 76 + infrastructure/lib/stacks/monitoring-stack.ts | 225 + .../lib/stacks/notifications-stack.ts | 61 + infrastructure/package.json | 36 + infrastructure/tsconfig.json | 10 + package.json | 43 + pnpm-lock.yaml | 4510 +++++++++++++++++ pnpm-workspace.yaml | 3 + scripts/seed-admin.ts | 100 + tsconfig.base.json | 23 + tsconfig.json | 10 + 87 files changed, 8829 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.json create mode 100644 .github/workflows/ci.yml create mode 100644 .prettierrc.json create mode 100644 backend/README.md create mode 100644 backend/jest.config.js create mode 100644 backend/package.json create mode 100644 backend/src/handlers/admin/list-events.ts create mode 100644 backend/src/handlers/admin/list-users.ts create mode 100644 backend/src/handlers/admin/review-event.ts create mode 100644 backend/src/handlers/admin/update-user-role.ts create mode 100644 backend/src/handlers/auth/confirm-signup.ts create mode 100644 backend/src/handlers/auth/forgot-password.ts create mode 100644 backend/src/handlers/auth/login.ts create mode 100644 backend/src/handlers/auth/post-confirmation-trigger.ts create mode 100644 backend/src/handlers/auth/refresh.ts create mode 100644 backend/src/handlers/auth/reset-password.ts create mode 100644 backend/src/handlers/auth/signup.ts create mode 100644 backend/src/handlers/events/cancel-event.ts create mode 100644 backend/src/handlers/events/create-event.ts create mode 100644 backend/src/handlers/events/get-event.ts create mode 100644 backend/src/handlers/events/list-events.ts create mode 100644 backend/src/handlers/events/list-my-events.ts create mode 100644 backend/src/handlers/events/update-event.ts create mode 100644 backend/src/handlers/notifications/dispatch-notification.ts create mode 100644 backend/src/handlers/registrations/cancel-registration.ts create mode 100644 backend/src/handlers/registrations/list-event-registrations.ts create mode 100644 backend/src/handlers/registrations/list-my-registrations.ts create mode 100644 backend/src/handlers/registrations/register.ts create mode 100644 backend/src/lib/auth-context.ts create mode 100644 backend/src/lib/cognito.ts create mode 100644 backend/src/lib/dynamo.ts create mode 100644 backend/src/lib/env.ts create mode 100644 backend/src/lib/errors.ts create mode 100644 backend/src/lib/html.ts create mode 100644 backend/src/lib/http.ts create mode 100644 backend/src/lib/ids.ts create mode 100644 backend/src/lib/logger.ts create mode 100644 backend/src/lib/notifier.ts create mode 100644 backend/src/lib/pagination.ts create mode 100644 backend/src/lib/validation.ts create mode 100644 backend/src/models/enums.ts create mode 100644 backend/src/models/types.ts create mode 100644 backend/src/repositories/events-repository.ts create mode 100644 backend/src/repositories/registrations-repository.ts create mode 100644 backend/src/repositories/users-repository.ts create mode 100644 backend/src/services/admin-service.ts create mode 100644 backend/src/services/auth-service.ts create mode 100644 backend/src/services/dto.ts create mode 100644 backend/src/services/email-templates.ts create mode 100644 backend/src/services/event-service.ts create mode 100644 backend/src/services/registration-service.ts create mode 100644 backend/tests/unit/lib/auth-context.test.ts create mode 100644 backend/tests/unit/lib/validation.test.ts create mode 100644 backend/tests/unit/repositories/events-repository.test.ts create mode 100644 backend/tests/unit/services/admin-service.test.ts create mode 100644 backend/tests/unit/services/email-templates.test.ts create mode 100644 backend/tests/unit/services/event-service.test.ts create mode 100644 backend/tests/unit/services/registration-service.test.ts create mode 100644 backend/tsconfig.json create mode 100644 docs/api.md create mode 100644 docs/architecture.md create mode 100644 docs/branching-strategy.md create mode 100644 docs/data-model.md create mode 100644 docs/decisions.md create mode 100644 docs/security.md create mode 100644 frontend/README.md create mode 100644 infrastructure/README.md create mode 100644 infrastructure/bin/app.ts create mode 100644 infrastructure/cdk.json create mode 100644 infrastructure/lib/config/environment.ts create mode 100644 infrastructure/lib/constructs/api-lambda.ts create mode 100644 infrastructure/lib/stacks/api-stack.ts create mode 100644 infrastructure/lib/stacks/auth-stack.ts create mode 100644 infrastructure/lib/stacks/budget-stack.ts create mode 100644 infrastructure/lib/stacks/database-stack.ts create mode 100644 infrastructure/lib/stacks/monitoring-stack.ts create mode 100644 infrastructure/lib/stacks/notifications-stack.ts create mode 100644 infrastructure/package.json create mode 100644 infrastructure/tsconfig.json create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 scripts/seed-admin.ts create mode 100644 tsconfig.base.json create mode 100644 tsconfig.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..7ab0b92 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2022, + "sourceType": "module" + }, + "plugins": ["@typescript-eslint"], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "env": { + "node": true, + "es2022": true, + "jest": true + }, + "rules": { + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-explicit-any": "warn" + }, + "ignorePatterns": ["dist", "cdk.out", "node_modules", "*.js"] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a0429c1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: ["**"] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + validate: + name: validate + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.7.1 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Lint + run: pnpm run lint + + - name: Typecheck (backend + infrastructure) + run: pnpm run typecheck + + - name: Unit tests (Lambda handlers, services, repositories) + run: pnpm run test:coverage + + - name: Upload coverage report + if: always() + uses: actions/upload-artifact@v4 + with: + name: backend-coverage + path: backend/coverage + retention-days: 14 + + - name: cdk synth (validates every stack builds without deploying) + run: pnpm run synth diff --git a/.gitignore b/.gitignore index 872d5f6..eaaa4ee 100644 --- a/.gitignore +++ b/.gitignore @@ -141,3 +141,22 @@ dist vite.config.js.timestamp-* vite.config.ts.timestamp-* .vite/ + +# AWS CDK +cdk.out/ +infrastructure/cdk.out/ +infrastructure/cdk.context.json +*.d.ts +!frontend/**/*.d.ts + +# Build output (workspaces) +backend/dist/ +infrastructure/dist/ + +# Local env / secrets +.env.local +.env.*.local + +# OS files +.DS_Store + diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..4cbc711 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "semi": true, + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100, + "tabWidth": 2 +} diff --git a/README.md b/README.md index 7466583..c6ab485 100644 --- a/README.md +++ b/README.md @@ -1 +1,152 @@ -# Azubi_Final_Capstone \ No newline at end of file +# Event Registration & Ticketing System + +[![CI](https://github.com/ForkYeahMan/Azubi_Final_Capstone/actions/workflows/ci.yml/badge.svg)](https://github.com/ForkYeahMan/Azubi_Final_Capstone/actions/workflows/ci.yml) + +A serverless Event Registration & Ticketing System on AWS — replaces +Microsoft Forms + Excel with a scalable REST API. Admins, Event Organizers, +and Users each get a role-scoped API; events go through an approval +workflow before they're public; registration issues an organizer-provided +ticket link by email. + +See [docs/architecture.md](docs/architecture.md) for the system design, +[docs/data-model.md](docs/data-model.md) for the DynamoDB schema, +[docs/api.md](docs/api.md) for the full endpoint reference, +[docs/security.md](docs/security.md) for the API security controls applied, +[docs/branching-strategy.md](docs/branching-strategy.md) for how changes +flow into `main`, and [docs/decisions.md](docs/decisions.md) for why each +major choice was made. + +## Monorepo layout + +```text +. +├── backend/ Lambda source (TypeScript) — handlers, services, repositories +├── infrastructure/ AWS CDK app (TypeScript) — one stack per concern +├── frontend/ placeholder — design/build pending further instructions +├── docs/ architecture, data model, API reference, ADRs +├── scripts/ seed-admin.ts — creates the first Admin account +└── .github/workflows/ CI — lint, typecheck, unit tests, cdk synth on every push/PR +``` + +Backend and infrastructure are pnpm workspaces sharing one `pnpm install` +and one TypeScript toolchain. + +## Prerequisites + +- Node.js 20+ and [pnpm](https://pnpm.io) 9+ (`corepack enable` or + `npm install -g pnpm`) +- An AWS account with credentials configured (`aws configure` or SSO) +- `cdk bootstrap` run once per account/region (see below) + +## Setup + +```bash +pnpm install +``` + +This installs both workspaces (`backend`, `infrastructure`) and the root +tooling (ESLint, Prettier, ts-node for `scripts/`). + +## Backend — build & test + +```bash +pnpm --filter backend build # tsc typecheck + emit +pnpm test # Jest unit tests (services, repositories, lib) +pnpm run test:coverage +``` + +The backend has no local server — Lambdas are only meaningfully runnable +once deployed (or via `sam local` / manual invocation with a crafted event, +not included here). Unit tests mock the AWS SDK (`aws-sdk-client-mock`) and +the repository layer, so business logic in `services/` is fully covered +without touching real AWS resources. + +## Continuous integration + +Every push and every PR into `main` runs +[`.github/workflows/ci.yml`](.github/workflows/ci.yml): lint → typecheck +(backend + infrastructure) → unit tests with coverage → `cdk synth` +(validates all six stacks build without needing AWS credentials). See +[docs/branching-strategy.md](docs/branching-strategy.md) for how this gates +merges to `main`. Check the +[Actions tab](https://github.com/ForkYeahMan/Azubi_Final_Capstone/actions) +for build history and logs. + +## Infrastructure — deploy + +```bash +# One-time per AWS account/region: +cd infrastructure +pnpm run bootstrap + +# See what would change: +pnpm run diff + +# Deploy everything (Database → Auth → Notifications → Api → Monitoring → Budget): +pnpm run deploy +``` + +By default the app deploys to stage `dev` and sends Budget/CloudWatch/SES +alerts to a placeholder email baked into +[infrastructure/lib/config/environment.ts](infrastructure/lib/config/environment.ts). +Override both via CDK context flags: + +```bash +cd infrastructure +npx cdk deploy --all \ + -c stage=dev \ + -c alertEmail=you@example.com \ + -c monthlyBudgetUsd=10 +``` + +**After deploying**, two manual one-time steps are required because SES +starts in sandbox mode: + +1. AWS emails a verification link to `alertEmail` (the SES sender + identity) — click it before any notification email will send. +2. While in the SES sandbox, **recipient** addresses must also be verified + (Admins reviewing test signups, organizers/users registering with test + accounts) — verify them in the SES console, or request SES production + access once you're ready for real end users. + +### Creating the first Admin + +Admins are never self-service (see +[docs/decisions.md](docs/decisions.md#auth-amazon-cognito-over-hand-rolled-jwt)). +After the `Auth` and `Database` stacks deploy, grab their outputs and run: + +```bash +USER_POOL_ID= \ +USERS_TABLE_NAME= \ +AWS_REGION= \ +pnpm run seed:admin -- --email admin@example.com --name "Site Admin" --password 'Str0ngP@ssw0rd' +``` + +### Tearing down + +```bash +cd infrastructure +pnpm run destroy +``` + +`dev`-stage DynamoDB tables and the Cognito User Pool are destroyed with +the stack; `prod`-stage versions of both are retained on stack deletion +(see `RemovalPolicy` in `database-stack.ts` / `auth-stack.ts`) as a +safety net against accidental data loss. + +## Frontend + +Not started yet — design and implementation are pending further +instructions. `frontend/` currently holds a placeholder only. + +## Cost & monitoring + +Every resource is pay-per-use (Lambda, API Gateway HTTP API, DynamoDB +on-demand) with no idle compute, so a dev/demo deployment should stay well +inside AWS Free Tier. The `Budget` stack alerts by email at 80% actual / +100% forecasted spend against a configurable monthly threshold +(`monthlyBudgetUsd`, default $10) as a guardrail. The `Monitoring` stack +tracks API request/error counts, Lambda duration, DynamoDB throttles, and +alarms if the API error rate exceeds 5% over a 5-minute window — see +[docs/architecture.md](docs/architecture.md) and +[docs/security.md](docs/security.md) for details. diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000..7ce2a67 --- /dev/null +++ b/backend/README.md @@ -0,0 +1,53 @@ +# Backend + +Lambda handlers, business logic, and DynamoDB access for the Event +Registration & Ticketing System. + +## Layout + +```text +src/ +├── handlers/ one file per Lambda, exports `handler` +│ ├── auth/ signup, confirm, login, refresh, password reset, Cognito post-confirmation trigger +│ ├── events/ create/list/get/update/cancel, organizer's own listing +│ ├── admin/ review queue, approve/reject, user listing, role updates +│ ├── registrations/ register/cancel, "my registrations", event roster +│ └── notifications/ SNS subscriber that sends email via SES +├── services/ business rules; the only layer handlers call into +├── repositories/ the only layer that talks to DynamoDB +├── models/ shared TypeScript types and enums +└── lib/ cross-cutting: http helpers, errors, auth-context, validation (Zod), logging (Powertools), SNS publish helper +``` + +Handlers are intentionally thin: parse/validate the request, call a +service, map the result to an HTTP response. This keeps business rules +(who can do what, when an event moves between statuses, capacity +enforcement) testable without mocking API Gateway event shapes in every +test — see `tests/unit/services/`. + +## Commands + +```bash +pnpm run build # tsc typecheck + emit (used by CDK's NodejsFunction bundler at synth time too) +pnpm run typecheck # tsc --noEmit +pnpm test # Jest +pnpm run test:coverage +pnpm run lint +``` + +## Conventions + +- **Errors**: throw one of the typed errors in `lib/errors.ts` + (`BadRequestError`, `ForbiddenError`, `NotFoundError`, `ConflictError`, + ...). `withErrorHandling` in `lib/http.ts` catches these and maps them to + the correct status code and `{ error: { code, message } }` body + automatically — handlers never need their own try/catch. +- **Auth**: `getAuthContext(event)` in `lib/auth-context.ts` extracts + `{ userId, email, groups }` from the claims API Gateway's Cognito JWT + authorizer attaches to the request; `requireRole(ctx, ...roles)` throws + `ForbiddenError` if the caller lacks all of them. Ownership checks + (e.g. "only the organizer who created this event") happen in the + service layer, not the handler. +- **Validation**: every request body/query goes through a Zod schema in + `lib/validation.ts` via `parse(schema, data)`, which throws + `BadRequestError` with a readable message on failure. diff --git a/backend/jest.config.js b/backend/jest.config.js new file mode 100644 index 0000000..949b994 --- /dev/null +++ b/backend/jest.config.js @@ -0,0 +1,10 @@ +/** @type {import('jest').Config} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + rootDir: '.', + testMatch: ['/tests/**/*.test.ts'], + collectCoverageFrom: ['src/**/*.ts', '!src/handlers/**/index.ts'], + coverageDirectory: 'coverage', + clearMocks: true, +}; diff --git a/backend/package.json b/backend/package.json new file mode 100644 index 0000000..13b4d8e --- /dev/null +++ b/backend/package.json @@ -0,0 +1,37 @@ +{ + "name": "@azubi-ticketing/backend", + "version": "1.0.0", + "private": true, + "description": "Lambda handlers, services, and repositories for the Event Registration & Ticketing System", + "main": "index.js", + "scripts": { + "build": "tsc -p tsconfig.json", + "lint": "eslint src --ext .ts", + "test": "jest", + "test:watch": "jest --watch", + "test:coverage": "jest --coverage", + "typecheck": "tsc --noEmit -p tsconfig.json" + }, + "dependencies": { + "@aws-lambda-powertools/logger": "^2.11.0", + "@aws-lambda-powertools/metrics": "^2.11.0", + "@aws-lambda-powertools/tracer": "^2.11.0", + "@aws-sdk/client-cognito-identity-provider": "^3.658.1", + "@aws-sdk/client-sesv2": "^3.658.1", + "@aws-sdk/client-sns": "^3.658.1", + "@aws-sdk/client-dynamodb": "^3.658.1", + "@aws-sdk/lib-dynamodb": "^3.658.1", + "@aws-sdk/util-dynamodb": "^3.658.1", + "ulid": "^2.3.0", + "zod": "^3.23.8" + }, + "devDependencies": { + "@types/aws-lambda": "^8.10.145", + "@types/jest": "^29.5.13", + "@types/node": "^20.16.5", + "aws-sdk-client-mock": "^4.0.2", + "jest": "^29.7.0", + "ts-jest": "^29.2.5", + "typescript": "^5.5.4" + } +} diff --git a/backend/src/handlers/admin/list-events.ts b/backend/src/handlers/admin/list-events.ts new file mode 100644 index 0000000..a5f737e --- /dev/null +++ b/backend/src/handlers/admin/list-events.ts @@ -0,0 +1,22 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { z } from 'zod'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { ok, withErrorHandling } from '../../lib/http'; +import { parse } from '../../lib/validation'; +import { EventStatus, Role } from '../../models/enums'; +import { AdminService } from '../../services/admin-service'; + +const querySchema = z.object({ + status: z.nativeEnum(EventStatus).default(EventStatus.PENDING_REVIEW), + limit: z.coerce.number().int().min(1).max(100).default(20), + cursor: z.string().optional(), +}); + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ADMIN); + + const query = parse(querySchema, event.queryStringParameters ?? {}); + const page = await AdminService.listEvents(query.status, query.limit, query.cursor); + return ok(page); +}); diff --git a/backend/src/handlers/admin/list-users.ts b/backend/src/handlers/admin/list-users.ts new file mode 100644 index 0000000..d60a124 --- /dev/null +++ b/backend/src/handlers/admin/list-users.ts @@ -0,0 +1,22 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { z } from 'zod'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { ok, withErrorHandling } from '../../lib/http'; +import { parse } from '../../lib/validation'; +import { Role } from '../../models/enums'; +import { AdminService } from '../../services/admin-service'; + +const querySchema = z.object({ + role: z.nativeEnum(Role).default(Role.USER), + limit: z.coerce.number().int().min(1).max(100).default(20), + cursor: z.string().optional(), +}); + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ADMIN); + + const query = parse(querySchema, event.queryStringParameters ?? {}); + const page = await AdminService.listUsers(query.role, query.limit, query.cursor); + return ok(page); +}); diff --git a/backend/src/handlers/admin/review-event.ts b/backend/src/handlers/admin/review-event.ts new file mode 100644 index 0000000..4f6f0c7 --- /dev/null +++ b/backend/src/handlers/admin/review-event.ts @@ -0,0 +1,21 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { BadRequestError } from '../../lib/errors'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { parse, reviewEventSchema } from '../../lib/validation'; +import { Role } from '../../models/enums'; +import { AdminService } from '../../services/admin-service'; + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ADMIN); + + const eventId = event.pathParameters?.eventId; + if (!eventId) { + throw new BadRequestError('eventId path parameter is required.'); + } + + const input = parse(reviewEventSchema, parseJsonBody(event)); + const reviewed = await AdminService.reviewEvent(eventId, input); + return ok(reviewed); +}); diff --git a/backend/src/handlers/admin/update-user-role.ts b/backend/src/handlers/admin/update-user-role.ts new file mode 100644 index 0000000..e0dd297 --- /dev/null +++ b/backend/src/handlers/admin/update-user-role.ts @@ -0,0 +1,21 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { BadRequestError } from '../../lib/errors'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { parse, updateUserRoleSchema } from '../../lib/validation'; +import { Role } from '../../models/enums'; +import { AdminService } from '../../services/admin-service'; + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ADMIN); + + const userId = event.pathParameters?.userId; + if (!userId) { + throw new BadRequestError('userId path parameter is required.'); + } + + const input = parse(updateUserRoleSchema, parseJsonBody(event)); + await AdminService.updateUserRole(userId, input.role); + return ok({ message: `User ${userId} is now ${input.role}.` }); +}); diff --git a/backend/src/handlers/auth/confirm-signup.ts b/backend/src/handlers/auth/confirm-signup.ts new file mode 100644 index 0000000..813042d --- /dev/null +++ b/backend/src/handlers/auth/confirm-signup.ts @@ -0,0 +1,10 @@ +import type { APIGatewayProxyEventV2 } from 'aws-lambda'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { confirmSignupSchema, parse } from '../../lib/validation'; +import { AuthService } from '../../services/auth-service'; + +export const handler = withErrorHandling(async (event: APIGatewayProxyEventV2) => { + const input = parse(confirmSignupSchema, parseJsonBody(event)); + await AuthService.confirmSignup(input); + return ok({ message: 'Account confirmed. You can now log in.' }); +}); diff --git a/backend/src/handlers/auth/forgot-password.ts b/backend/src/handlers/auth/forgot-password.ts new file mode 100644 index 0000000..3d77450 --- /dev/null +++ b/backend/src/handlers/auth/forgot-password.ts @@ -0,0 +1,10 @@ +import type { APIGatewayProxyEventV2 } from 'aws-lambda'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { forgotPasswordSchema, parse } from '../../lib/validation'; +import { AuthService } from '../../services/auth-service'; + +export const handler = withErrorHandling(async (event: APIGatewayProxyEventV2) => { + const input = parse(forgotPasswordSchema, parseJsonBody(event)); + await AuthService.forgotPassword(input); + return ok({ message: 'If an account exists for this email, a reset code has been sent.' }); +}); diff --git a/backend/src/handlers/auth/login.ts b/backend/src/handlers/auth/login.ts new file mode 100644 index 0000000..02d5cf6 --- /dev/null +++ b/backend/src/handlers/auth/login.ts @@ -0,0 +1,10 @@ +import type { APIGatewayProxyEventV2 } from 'aws-lambda'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { loginSchema, parse } from '../../lib/validation'; +import { AuthService } from '../../services/auth-service'; + +export const handler = withErrorHandling(async (event: APIGatewayProxyEventV2) => { + const input = parse(loginSchema, parseJsonBody(event)); + const tokens = await AuthService.login(input); + return ok(tokens); +}); diff --git a/backend/src/handlers/auth/post-confirmation-trigger.ts b/backend/src/handlers/auth/post-confirmation-trigger.ts new file mode 100644 index 0000000..170b02e --- /dev/null +++ b/backend/src/handlers/auth/post-confirmation-trigger.ts @@ -0,0 +1,58 @@ +import type { PostConfirmationTriggerEvent } from 'aws-lambda'; +import { AdminAddUserToGroupCommand } from '@aws-sdk/client-cognito-identity-provider'; +import { cognito } from '../../lib/cognito'; +import { logger } from '../../lib/logger'; +import { Role } from '../../models/enums'; +import { UsersRepository } from '../../repositories/users-repository'; + +const SELF_SERVICE_ROLES = new Set([Role.USER, Role.ORGANIZER]); + +/** + * Cognito Post-Confirmation trigger: fires once a new user verifies their + * email. Adds them to the Cognito group matching their chosen role (so API + * Gateway's JWT authorizer sees `cognito:groups` on their very first login) + * and mirrors a profile row into the Users table for Admin listings. + * + * Cognito group names are the `Role` enum values themselves (`ADMIN`, + * `ORGANIZER`, `USER`) — this must stay in sync with how the CDK + * AuthStack names its three groups, since `getAuthContext` filters the + * `cognito:groups` JWT claim against these exact strings. + * + * The pool id comes from `triggerEvent.userPoolId`, not an environment + * variable: this Lambda is itself registered as a trigger on the User + * Pool, so an env var built from `userPool.userPoolId` would create a + * circular CloudFormation dependency (the pool's LambdaConfig references + * this function's ARN while the function's env would reference the + * pool's ID). Reading it off the event sidesteps that entirely. + */ +export const handler = async ( + triggerEvent: PostConfirmationTriggerEvent, +): Promise => { + if (triggerEvent.triggerSource !== 'PostConfirmation_ConfirmSignUp') { + return triggerEvent; + } + + const { sub, email, name } = triggerEvent.request.userAttributes; + const requestedRole = triggerEvent.request.userAttributes['custom:role']; + const role = SELF_SERVICE_ROLES.has(requestedRole) ? (requestedRole as Role) : Role.USER; + + await cognito.send( + new AdminAddUserToGroupCommand({ + UserPoolId: triggerEvent.userPoolId, + Username: triggerEvent.userName, + GroupName: role, + }), + ); + + await UsersRepository.create({ + userId: sub, + email, + name: name ?? email, + role, + createdAt: new Date().toISOString(), + }); + + logger.info('Provisioned new user', { userId: sub, role }); + + return triggerEvent; +}; diff --git a/backend/src/handlers/auth/refresh.ts b/backend/src/handlers/auth/refresh.ts new file mode 100644 index 0000000..938cfe2 --- /dev/null +++ b/backend/src/handlers/auth/refresh.ts @@ -0,0 +1,10 @@ +import type { APIGatewayProxyEventV2 } from 'aws-lambda'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { parse, refreshSchema } from '../../lib/validation'; +import { AuthService } from '../../services/auth-service'; + +export const handler = withErrorHandling(async (event: APIGatewayProxyEventV2) => { + const input = parse(refreshSchema, parseJsonBody(event)); + const tokens = await AuthService.refresh(input); + return ok(tokens); +}); diff --git a/backend/src/handlers/auth/reset-password.ts b/backend/src/handlers/auth/reset-password.ts new file mode 100644 index 0000000..eabda47 --- /dev/null +++ b/backend/src/handlers/auth/reset-password.ts @@ -0,0 +1,10 @@ +import type { APIGatewayProxyEventV2 } from 'aws-lambda'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { parse, resetPasswordSchema } from '../../lib/validation'; +import { AuthService } from '../../services/auth-service'; + +export const handler = withErrorHandling(async (event: APIGatewayProxyEventV2) => { + const input = parse(resetPasswordSchema, parseJsonBody(event)); + await AuthService.resetPassword(input); + return ok({ message: 'Password reset. You can now log in with your new password.' }); +}); diff --git a/backend/src/handlers/auth/signup.ts b/backend/src/handlers/auth/signup.ts new file mode 100644 index 0000000..30ea154 --- /dev/null +++ b/backend/src/handlers/auth/signup.ts @@ -0,0 +1,16 @@ +import type { APIGatewayProxyEventV2 } from 'aws-lambda'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { parse, signupSchema } from '../../lib/validation'; +import { AuthService } from '../../services/auth-service'; + +export const handler = withErrorHandling(async (event: APIGatewayProxyEventV2) => { + const input = parse(signupSchema, parseJsonBody(event)); + const result = await AuthService.signup(input); + return ok( + { + message: 'Account created. Check your email for a verification code.', + userId: result.userSub, + }, + 201, + ); +}); diff --git a/backend/src/handlers/events/cancel-event.ts b/backend/src/handlers/events/cancel-event.ts new file mode 100644 index 0000000..abca95d --- /dev/null +++ b/backend/src/handlers/events/cancel-event.ts @@ -0,0 +1,19 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { BadRequestError } from '../../lib/errors'; +import { noContent, withErrorHandling } from '../../lib/http'; +import { Role } from '../../models/enums'; +import { EventService } from '../../services/event-service'; + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ORGANIZER, Role.ADMIN); + + const eventId = event.pathParameters?.eventId; + if (!eventId) { + throw new BadRequestError('eventId path parameter is required.'); + } + + await EventService.cancelEvent(ctx, eventId); + return noContent(); +}); diff --git a/backend/src/handlers/events/create-event.ts b/backend/src/handlers/events/create-event.ts new file mode 100644 index 0000000..93f5452 --- /dev/null +++ b/backend/src/handlers/events/create-event.ts @@ -0,0 +1,15 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { createEventSchema, parse } from '../../lib/validation'; +import { Role } from '../../models/enums'; +import { EventService } from '../../services/event-service'; + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ORGANIZER); + + const input = parse(createEventSchema, parseJsonBody(event)); + const created = await EventService.createEvent(ctx, input); + return ok(created, 201); +}); diff --git a/backend/src/handlers/events/get-event.ts b/backend/src/handlers/events/get-event.ts new file mode 100644 index 0000000..0c960ac --- /dev/null +++ b/backend/src/handlers/events/get-event.ts @@ -0,0 +1,13 @@ +import type { APIGatewayProxyEventV2 } from 'aws-lambda'; +import { BadRequestError } from '../../lib/errors'; +import { ok, withErrorHandling } from '../../lib/http'; +import { EventService } from '../../services/event-service'; + +export const handler = withErrorHandling(async (event: APIGatewayProxyEventV2) => { + const eventId = event.pathParameters?.eventId; + if (!eventId) { + throw new BadRequestError('eventId path parameter is required.'); + } + const found = await EventService.getPublicEvent(eventId); + return ok(found); +}); diff --git a/backend/src/handlers/events/list-events.ts b/backend/src/handlers/events/list-events.ts new file mode 100644 index 0000000..4e765c8 --- /dev/null +++ b/backend/src/handlers/events/list-events.ts @@ -0,0 +1,10 @@ +import type { APIGatewayProxyEventV2 } from 'aws-lambda'; +import { ok, withErrorHandling } from '../../lib/http'; +import { listEventsQuerySchema, parse } from '../../lib/validation'; +import { EventService } from '../../services/event-service'; + +export const handler = withErrorHandling(async (event: APIGatewayProxyEventV2) => { + const query = parse(listEventsQuerySchema, event.queryStringParameters ?? {}); + const page = await EventService.listApprovedEvents(query); + return ok(page); +}); diff --git a/backend/src/handlers/events/list-my-events.ts b/backend/src/handlers/events/list-my-events.ts new file mode 100644 index 0000000..ee25fa4 --- /dev/null +++ b/backend/src/handlers/events/list-my-events.ts @@ -0,0 +1,22 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { z } from 'zod'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { ok, withErrorHandling } from '../../lib/http'; +import { parse } from '../../lib/validation'; +import { EventStatus, Role } from '../../models/enums'; +import { EventService } from '../../services/event-service'; + +const querySchema = z.object({ + status: z.nativeEnum(EventStatus).optional(), + limit: z.coerce.number().int().min(1).max(100).default(20), + cursor: z.string().optional(), +}); + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ORGANIZER); + + const query = parse(querySchema, event.queryStringParameters ?? {}); + const page = await EventService.listMyEvents(ctx, query.status, query.limit, query.cursor); + return ok(page); +}); diff --git a/backend/src/handlers/events/update-event.ts b/backend/src/handlers/events/update-event.ts new file mode 100644 index 0000000..e49e838 --- /dev/null +++ b/backend/src/handlers/events/update-event.ts @@ -0,0 +1,21 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { BadRequestError } from '../../lib/errors'; +import { ok, parseJsonBody, withErrorHandling } from '../../lib/http'; +import { parse, updateEventSchema } from '../../lib/validation'; +import { Role } from '../../models/enums'; +import { EventService } from '../../services/event-service'; + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ORGANIZER); + + const eventId = event.pathParameters?.eventId; + if (!eventId) { + throw new BadRequestError('eventId path parameter is required.'); + } + + const input = parse(updateEventSchema, parseJsonBody(event)); + const updated = await EventService.updateEvent(ctx, eventId, input); + return ok(updated); +}); diff --git a/backend/src/handlers/notifications/dispatch-notification.ts b/backend/src/handlers/notifications/dispatch-notification.ts new file mode 100644 index 0000000..243317d --- /dev/null +++ b/backend/src/handlers/notifications/dispatch-notification.ts @@ -0,0 +1,46 @@ +import type { SNSEvent } from 'aws-lambda'; +import { SendEmailCommand, SESv2Client } from '@aws-sdk/client-sesv2'; +import { env } from '../../lib/env'; +import { logger } from '../../lib/logger'; +import { NotificationMessage } from '../../models/types'; +import { renderEmail } from '../../services/email-templates'; + +const ses = new SESv2Client({}); + +/** + * Subscribed to the shared SNS notifications topic. This is the only piece + * of the system that talks to SES — publishers (event review, registration) + * just fire-and-forget a message to SNS and don't know or care how + * delivery happens. + */ +export const handler = async (event: SNSEvent): Promise => { + for (const record of event.Records) { + let message: NotificationMessage; + try { + message = JSON.parse(record.Sns.Message) as NotificationMessage; + } catch { + logger.error('Skipping malformed SNS message', { messageId: record.Sns.MessageId }); + continue; + } + + const email = renderEmail(message); + + await ses.send( + new SendEmailCommand({ + FromEmailAddress: env.senderEmail, + Destination: { ToAddresses: [email.to] }, + Content: { + Simple: { + Subject: { Data: email.subject }, + Body: { + Html: { Data: email.html }, + Text: { Data: email.text }, + }, + }, + }, + }), + ); + + logger.info('Sent notification email', { type: message.type, to: email.to }); + } +}; diff --git a/backend/src/handlers/registrations/cancel-registration.ts b/backend/src/handlers/registrations/cancel-registration.ts new file mode 100644 index 0000000..87c8bfa --- /dev/null +++ b/backend/src/handlers/registrations/cancel-registration.ts @@ -0,0 +1,19 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { BadRequestError } from '../../lib/errors'; +import { noContent, withErrorHandling } from '../../lib/http'; +import { Role } from '../../models/enums'; +import { RegistrationService } from '../../services/registration-service'; + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.USER); + + const eventId = event.pathParameters?.eventId; + if (!eventId) { + throw new BadRequestError('eventId path parameter is required.'); + } + + await RegistrationService.cancel(ctx, eventId); + return noContent(); +}); diff --git a/backend/src/handlers/registrations/list-event-registrations.ts b/backend/src/handlers/registrations/list-event-registrations.ts new file mode 100644 index 0000000..350e9c4 --- /dev/null +++ b/backend/src/handlers/registrations/list-event-registrations.ts @@ -0,0 +1,27 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { z } from 'zod'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { BadRequestError } from '../../lib/errors'; +import { ok, withErrorHandling } from '../../lib/http'; +import { parse } from '../../lib/validation'; +import { Role } from '../../models/enums'; +import { RegistrationService } from '../../services/registration-service'; + +const querySchema = z.object({ + limit: z.coerce.number().int().min(1).max(100).default(20), + cursor: z.string().optional(), +}); + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.ORGANIZER, Role.ADMIN); + + const eventId = event.pathParameters?.eventId; + if (!eventId) { + throw new BadRequestError('eventId path parameter is required.'); + } + + const query = parse(querySchema, event.queryStringParameters ?? {}); + const page = await RegistrationService.listForEvent(ctx, eventId, query.limit, query.cursor); + return ok(page); +}); diff --git a/backend/src/handlers/registrations/list-my-registrations.ts b/backend/src/handlers/registrations/list-my-registrations.ts new file mode 100644 index 0000000..db203e4 --- /dev/null +++ b/backend/src/handlers/registrations/list-my-registrations.ts @@ -0,0 +1,21 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { z } from 'zod'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { ok, withErrorHandling } from '../../lib/http'; +import { parse } from '../../lib/validation'; +import { Role } from '../../models/enums'; +import { RegistrationService } from '../../services/registration-service'; + +const querySchema = z.object({ + limit: z.coerce.number().int().min(1).max(100).default(20), + cursor: z.string().optional(), +}); + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.USER); + + const query = parse(querySchema, event.queryStringParameters ?? {}); + const page = await RegistrationService.listMine(ctx, query.limit, query.cursor); + return ok(page); +}); diff --git a/backend/src/handlers/registrations/register.ts b/backend/src/handlers/registrations/register.ts new file mode 100644 index 0000000..845cb11 --- /dev/null +++ b/backend/src/handlers/registrations/register.ts @@ -0,0 +1,19 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { getAuthContext, requireRole } from '../../lib/auth-context'; +import { BadRequestError } from '../../lib/errors'; +import { ok, withErrorHandling } from '../../lib/http'; +import { Role } from '../../models/enums'; +import { RegistrationService } from '../../services/registration-service'; + +export const handler = withErrorHandling(async (event) => { + const ctx = getAuthContext(event); + requireRole(ctx, Role.USER); + + const eventId = event.pathParameters?.eventId; + if (!eventId) { + throw new BadRequestError('eventId path parameter is required.'); + } + + const registration = await RegistrationService.register(ctx, eventId); + return ok(registration, 201); +}); diff --git a/backend/src/lib/auth-context.ts b/backend/src/lib/auth-context.ts new file mode 100644 index 0000000..6497c4d --- /dev/null +++ b/backend/src/lib/auth-context.ts @@ -0,0 +1,44 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { Role } from '../models/enums'; +import { AuthContext } from '../models/types'; +import { ForbiddenError, UnauthorizedError } from './errors'; + +/** + * Extracts the caller's identity and roles from the claims API Gateway's + * Cognito JWT authorizer attaches to the request. Throws if the event was + * somehow invoked without an authorizer context (should never happen once + * the route is wired to the authorizer, but fail loudly rather than + * silently treating the caller as anonymous). + */ +export function getAuthContext(event: APIGatewayProxyEventV2WithJWTAuthorizer): AuthContext { + const claims = event.requestContext?.authorizer?.jwt?.claims; + if (!claims?.sub) { + throw new UnauthorizedError(); + } + + const groupsClaim = claims['cognito:groups'] as string | string[] | undefined; + const groups = parseGroups(groupsClaim); + + return { + userId: String(claims.sub), + email: String(claims.email ?? ''), + groups, + }; +} + +function parseGroups(claim: string | string[] | undefined): Role[] { + if (!claim) return []; + const raw = Array.isArray(claim) ? claim : claim.replace(/[[\]]/g, '').split(','); + return raw + .map((g) => g.trim()) + .filter((g): g is Role => (Object.values(Role) as string[]).includes(g)); +} + +export function requireRole(ctx: AuthContext, ...allowed: Role[]): void { + const hasRole = ctx.groups.some((g) => allowed.includes(g)); + if (!hasRole) { + throw new ForbiddenError( + `This action requires one of the following roles: ${allowed.join(', ')}.`, + ); + } +} diff --git a/backend/src/lib/cognito.ts b/backend/src/lib/cognito.ts new file mode 100644 index 0000000..8c513d4 --- /dev/null +++ b/backend/src/lib/cognito.ts @@ -0,0 +1,3 @@ +import { CognitoIdentityProviderClient } from '@aws-sdk/client-cognito-identity-provider'; + +export const cognito = new CognitoIdentityProviderClient({}); diff --git a/backend/src/lib/dynamo.ts b/backend/src/lib/dynamo.ts new file mode 100644 index 0000000..2fbc8c0 --- /dev/null +++ b/backend/src/lib/dynamo.ts @@ -0,0 +1,10 @@ +import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; +import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb'; + +const client = new DynamoDBClient({}); + +export const ddb = DynamoDBDocumentClient.from(client, { + marshallOptions: { + removeUndefinedValues: true, + }, +}); diff --git a/backend/src/lib/env.ts b/backend/src/lib/env.ts new file mode 100644 index 0000000..703e60d --- /dev/null +++ b/backend/src/lib/env.ts @@ -0,0 +1,31 @@ +export function requireEnv(name: string): string { + const value = process.env[name]; + if (!value) { + throw new Error(`Missing required environment variable: ${name}`); + } + return value; +} + +export const env = { + get eventsTable() { + return requireEnv('EVENTS_TABLE_NAME'); + }, + get registrationsTable() { + return requireEnv('REGISTRATIONS_TABLE_NAME'); + }, + get usersTable() { + return requireEnv('USERS_TABLE_NAME'); + }, + get userPoolId() { + return requireEnv('USER_POOL_ID'); + }, + get userPoolClientId() { + return requireEnv('USER_POOL_CLIENT_ID'); + }, + get notificationsTopicArn() { + return requireEnv('NOTIFICATIONS_TOPIC_ARN'); + }, + get senderEmail() { + return requireEnv('SENDER_EMAIL'); + }, +}; diff --git a/backend/src/lib/errors.ts b/backend/src/lib/errors.ts new file mode 100644 index 0000000..6af2911 --- /dev/null +++ b/backend/src/lib/errors.ts @@ -0,0 +1,40 @@ +export class ApiError extends Error { + constructor( + public readonly statusCode: number, + public readonly code: string, + message: string, + ) { + super(message); + this.name = 'ApiError'; + } +} + +export class BadRequestError extends ApiError { + constructor(message: string, code = 'BAD_REQUEST') { + super(400, code, message); + } +} + +export class UnauthorizedError extends ApiError { + constructor(message = 'Authentication is required.', code = 'UNAUTHORIZED') { + super(401, code, message); + } +} + +export class ForbiddenError extends ApiError { + constructor(message = 'You do not have permission to perform this action.', code = 'FORBIDDEN') { + super(403, code, message); + } +} + +export class NotFoundError extends ApiError { + constructor(message = 'Resource not found.', code = 'NOT_FOUND') { + super(404, code, message); + } +} + +export class ConflictError extends ApiError { + constructor(message: string, code = 'CONFLICT') { + super(409, code, message); + } +} diff --git a/backend/src/lib/html.ts b/backend/src/lib/html.ts new file mode 100644 index 0000000..40ed114 --- /dev/null +++ b/backend/src/lib/html.ts @@ -0,0 +1,18 @@ +const HTML_ESCAPES: Record = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', +}; + +/** + * Escapes user-supplied text before it's interpolated into an HTML email + * body. Event titles, rejection reasons, and ticket links all originate + * from organizer/admin input (validated for shape by Zod, but not for + * HTML-safety) — without this, a title like `` + * would be embedded verbatim in emails sent to Users and Organizers. + */ +export function escapeHtml(value: string): string { + return value.replace(/[&<>"']/g, (char) => HTML_ESCAPES[char]); +} diff --git a/backend/src/lib/http.ts b/backend/src/lib/http.ts new file mode 100644 index 0000000..d59668e --- /dev/null +++ b/backend/src/lib/http.ts @@ -0,0 +1,82 @@ +import type { APIGatewayProxyEventV2, APIGatewayProxyResultV2 } from 'aws-lambda'; +import { ApiError, BadRequestError } from './errors'; +import { logger, metrics, MetricUnit } from './logger'; + +const CORS_HEADERS = { + 'Content-Type': 'application/json', + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Headers': 'Content-Type,Authorization', + 'Access-Control-Allow-Methods': 'GET,POST,PUT,PATCH,DELETE,OPTIONS', +}; + +export function ok(body: unknown, statusCode = 200): APIGatewayProxyResultV2 { + return { + statusCode, + headers: CORS_HEADERS, + body: JSON.stringify(body), + }; +} + +export function noContent(): APIGatewayProxyResultV2 { + return { statusCode: 204, headers: CORS_HEADERS, body: '' }; +} + +function errorResponse(statusCode: number, code: string, message: string): APIGatewayProxyResultV2 { + return { + statusCode, + headers: CORS_HEADERS, + body: JSON.stringify({ error: { code, message } }), + }; +} + +export type Handler = (event: E) => Promise; + +/** + * Wraps a handler so every route gets the same error-mapping, logging, and + * metrics behavior without repeating try/catch in every file. Generic over + * the event type so authenticated handlers can accept + * APIGatewayProxyEventV2WithJWTAuthorizer directly instead of casting. + * + * Emits the `ApiRequests`/`ApiErrors` EMF metrics that back the API error + * rate alarm in MonitoringStack, and flushes any metrics the handler itself + * recorded (e.g. RegistrationService's FailedRegistrations counter) — + * Powertools buffers `addMetric` calls in memory until + * `publishStoredMetrics()` runs, so this `finally` block is what actually + * gets them into CloudWatch. + */ +export function withErrorHandling(handler: Handler): Handler { + return async (event: E): Promise => { + metrics.addMetric('ApiRequests', MetricUnit.Count, 1); + try { + return await handler(event); + } catch (err) { + if (err instanceof ApiError) { + if (err.statusCode >= 500) { + metrics.addMetric('ApiErrors', MetricUnit.Count, 1); + logger.error('Request failed', { err }); + } else { + logger.warn('Request rejected', { code: err.code, message: err.message }); + } + return errorResponse(err.statusCode, err.code, err.message); + } + + metrics.addMetric('ApiErrors', MetricUnit.Count, 1); + logger.error('Unhandled error', { err }); + return errorResponse(500, 'INTERNAL_ERROR', 'An unexpected error occurred.'); + } finally { + metrics.publishStoredMetrics(); + } + }; +} + +export function parseJsonBody(event: APIGatewayProxyEventV2): T { + if (!event.body) { + throw new BadRequestError('Request body is required.'); + } + try { + const raw = event.isBase64Encoded ? Buffer.from(event.body, 'base64').toString('utf-8') : event.body; + return JSON.parse(raw) as T; + } catch { + throw new BadRequestError('Request body must be valid JSON.'); + } +} diff --git a/backend/src/lib/ids.ts b/backend/src/lib/ids.ts new file mode 100644 index 0000000..645903a --- /dev/null +++ b/backend/src/lib/ids.ts @@ -0,0 +1,4 @@ +import { ulid } from 'ulid'; + +export const newEventId = (): string => `evt_${ulid()}`; +export const newRegistrationId = (): string => `reg_${ulid()}`; diff --git a/backend/src/lib/logger.ts b/backend/src/lib/logger.ts new file mode 100644 index 0000000..f68f347 --- /dev/null +++ b/backend/src/lib/logger.ts @@ -0,0 +1,11 @@ +import { Logger } from '@aws-lambda-powertools/logger'; +import { Metrics, MetricUnit } from '@aws-lambda-powertools/metrics'; +import { Tracer } from '@aws-lambda-powertools/tracer'; + +const SERVICE_NAME = process.env.POWERTOOLS_SERVICE_NAME ?? 'event-ticketing'; + +export const logger = new Logger({ serviceName: SERVICE_NAME }); +export const metrics = new Metrics({ namespace: 'EventTicketing', serviceName: SERVICE_NAME }); +export const tracer = new Tracer({ serviceName: SERVICE_NAME }); + +export { MetricUnit }; diff --git a/backend/src/lib/notifier.ts b/backend/src/lib/notifier.ts new file mode 100644 index 0000000..d910741 --- /dev/null +++ b/backend/src/lib/notifier.ts @@ -0,0 +1,27 @@ +import { PublishCommand, SNSClient } from '@aws-sdk/client-sns'; +import { env } from './env'; +import { logger } from './logger'; +import { NotificationMessage } from '../models/types'; + +const sns = new SNSClient({}); + +/** + * Publishes a notification event to the shared SNS topic. Business Lambdas + * call this instead of sending email themselves — the notificationDispatcher + * Lambda (subscribed to this topic) is the only code that talks to SES. + */ +export async function publishNotification(message: NotificationMessage): Promise { + await sns.send( + new PublishCommand({ + TopicArn: env.notificationsTopicArn, + Message: JSON.stringify(message), + MessageAttributes: { + notificationType: { + DataType: 'String', + StringValue: message.type, + }, + }, + }), + ); + logger.info('Published notification', { type: message.type }); +} diff --git a/backend/src/lib/pagination.ts b/backend/src/lib/pagination.ts new file mode 100644 index 0000000..8448009 --- /dev/null +++ b/backend/src/lib/pagination.ts @@ -0,0 +1,15 @@ +type Key = Record | undefined; + +export function encodeCursor(lastEvaluatedKey: Key): string | undefined { + if (!lastEvaluatedKey) return undefined; + return Buffer.from(JSON.stringify(lastEvaluatedKey), 'utf-8').toString('base64url'); +} + +export function decodeCursor(cursor: string | undefined): Key { + if (!cursor) return undefined; + try { + return JSON.parse(Buffer.from(cursor, 'base64url').toString('utf-8')); + } catch { + return undefined; + } +} diff --git a/backend/src/lib/validation.ts b/backend/src/lib/validation.ts new file mode 100644 index 0000000..f955c02 --- /dev/null +++ b/backend/src/lib/validation.ts @@ -0,0 +1,100 @@ +import { z, ZodType } from 'zod'; +import { BadRequestError } from './errors'; +import { Role } from '../models/enums'; + +/** + * Takes `ZodType` rather than `ZodSchema` (which pins both + * Input and Output to T) — schemas using `.default()` have an Input type + * that differs from Output (the field is optional going in, always present + * coming out), and pinning both to T breaks inference for exactly those + * schemas, silently widening `T` to include `undefined` on defaulted + * fields. + */ +export function parse(schema: ZodType, data: unknown): T { + const result = schema.safeParse(data); + if (!result.success) { + const message = result.error.issues + .map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`) + .join('; '); + throw new BadRequestError(message); + } + return result.data; +} + +export const emailSchema = z.string().trim().toLowerCase().email(); +export const isoDateSchema = z.string().refine((v) => !Number.isNaN(Date.parse(v)), { + message: 'Must be a valid ISO-8601 date string.', +}); +export const urlSchema = z.string().url(); + +export const signupSchema = z.object({ + email: emailSchema, + password: z.string().min(8, 'Password must be at least 8 characters.'), + name: z.string().trim().min(1).max(100), + role: z.enum(['USER', 'ORGANIZER']), +}); + +export const confirmSignupSchema = z.object({ + email: emailSchema, + code: z.string().trim().min(1), +}); + +export const loginSchema = z.object({ + email: emailSchema, + password: z.string().min(1), +}); + +export const refreshSchema = z.object({ + email: emailSchema, + refreshToken: z.string().min(1), +}); + +export const forgotPasswordSchema = z.object({ + email: emailSchema, +}); + +export const resetPasswordSchema = z.object({ + email: emailSchema, + code: z.string().trim().min(1), + newPassword: z.string().min(8, 'Password must be at least 8 characters.'), +}); + +export const createEventSchema = z + .object({ + title: z.string().trim().min(1).max(200), + description: z.string().trim().min(1).max(5000), + category: z.string().trim().min(1).max(50), + location: z.string().trim().min(1).max(200), + startDate: isoDateSchema, + endDate: isoDateSchema, + capacity: z.number().int().min(0).max(1_000_000), + ticketLink: urlSchema, + }) + .refine((data) => Date.parse(data.endDate) >= Date.parse(data.startDate), { + message: 'endDate must be on or after startDate.', + path: ['endDate'], + }); + +export const updateEventSchema = createEventSchema; + +export const reviewEventSchema = z + .object({ + decision: z.enum(['APPROVED', 'REJECTED']), + reason: z.string().trim().min(1).max(1000).optional(), + }) + .refine((data) => data.decision !== 'REJECTED' || !!data.reason, { + message: 'reason is required when rejecting an event.', + path: ['reason'], + }); + +export const updateUserRoleSchema = z.object({ + role: z.union([z.literal(Role.ORGANIZER), z.literal(Role.USER)]), +}); + +export const listEventsQuerySchema = z.object({ + category: z.string().trim().optional(), + from: isoDateSchema.optional(), + to: isoDateSchema.optional(), + limit: z.coerce.number().int().min(1).max(100).default(20), + cursor: z.string().optional(), +}); diff --git a/backend/src/models/enums.ts b/backend/src/models/enums.ts new file mode 100644 index 0000000..8dd815a --- /dev/null +++ b/backend/src/models/enums.ts @@ -0,0 +1,28 @@ +export enum Role { + ADMIN = 'ADMIN', + ORGANIZER = 'ORGANIZER', + USER = 'USER', +} + +export enum EventStatus { + PENDING_REVIEW = 'PENDING_REVIEW', + APPROVED = 'APPROVED', + REJECTED = 'REJECTED', + CANCELLED = 'CANCELLED', +} + +export enum RegistrationStatus { + REGISTERED = 'REGISTERED', + CANCELLED = 'CANCELLED', +} + +export enum ReviewDecision { + APPROVED = 'APPROVED', + REJECTED = 'REJECTED', +} + +export enum NotificationType { + EVENT_REVIEWED = 'EVENT_REVIEWED', + REGISTRATION_CONFIRMED = 'REGISTRATION_CONFIRMED', + REGISTRATION_CANCELLED = 'REGISTRATION_CANCELLED', +} diff --git a/backend/src/models/types.ts b/backend/src/models/types.ts new file mode 100644 index 0000000..b93a25b --- /dev/null +++ b/backend/src/models/types.ts @@ -0,0 +1,72 @@ +import { EventStatus, NotificationType, RegistrationStatus, Role } from './enums'; + +export interface UserRecord { + userId: string; + email: string; + name: string; + role: Role; + createdAt: string; +} + +export interface EventRecord { + eventId: string; + organizerId: string; + organizerEmail: string; + title: string; + description: string; + category: string; + location: string; + startDate: string; + endDate: string; + capacity: number; + registeredCount: number; + ticketLink: string; + status: EventStatus; + rejectionReason?: string; + createdAt: string; + updatedAt: string; +} + +export interface RegistrationRecord { + eventId: string; + userId: string; + registrationId: string; + userEmail: string; + status: RegistrationStatus; + ticketLink: string; + registeredAt: string; + cancelledAt?: string; +} + +export interface AuthContext { + userId: string; + email: string; + groups: Role[]; +} + +export interface EventReviewedMessage { + type: NotificationType.EVENT_REVIEWED; + organizerEmail: string; + eventTitle: string; + decision: 'APPROVED' | 'REJECTED'; + reason?: string; +} + +export interface RegistrationConfirmedMessage { + type: NotificationType.REGISTRATION_CONFIRMED; + userEmail: string; + eventTitle: string; + eventStartDate: string; + ticketLink: string; +} + +export interface RegistrationCancelledMessage { + type: NotificationType.REGISTRATION_CANCELLED; + userEmail: string; + eventTitle: string; +} + +export type NotificationMessage = + | EventReviewedMessage + | RegistrationConfirmedMessage + | RegistrationCancelledMessage; diff --git a/backend/src/repositories/events-repository.ts b/backend/src/repositories/events-repository.ts new file mode 100644 index 0000000..098a218 --- /dev/null +++ b/backend/src/repositories/events-repository.ts @@ -0,0 +1,172 @@ +import { ConditionalCheckFailedException } from '@aws-sdk/client-dynamodb'; +import { GetCommand, PutCommand, QueryCommand, UpdateCommand } from '@aws-sdk/lib-dynamodb'; +import { ddb } from '../lib/dynamo'; +import { env } from '../lib/env'; +import { ConflictError, NotFoundError } from '../lib/errors'; +import { decodeCursor, encodeCursor } from '../lib/pagination'; +import { EventStatus } from '../models/enums'; +import { EventRecord } from '../models/types'; + +export interface Page { + items: T[]; + cursor?: string; +} + +export interface ListApprovedOptions { + from?: string; + to?: string; + category?: string; + limit: number; + cursor?: string; +} + +export interface ListByOrganizerOptions { + status?: EventStatus; + limit: number; + cursor?: string; +} + +const TABLE = () => env.eventsTable; + +export const EventsRepository = { + async create(event: EventRecord): Promise { + await ddb.send( + new PutCommand({ + TableName: TABLE(), + Item: event, + ConditionExpression: 'attribute_not_exists(eventId)', + }), + ); + }, + + async getById(eventId: string): Promise { + const result = await ddb.send(new GetCommand({ TableName: TABLE(), Key: { eventId } })); + return result.Item as EventRecord | undefined; + }, + + async getByIdOrThrow(eventId: string): Promise { + const event = await this.getById(eventId); + if (!event) { + throw new NotFoundError(`Event ${eventId} was not found.`); + } + return event; + }, + + async replace(event: EventRecord): Promise { + await ddb.send( + new PutCommand({ + TableName: TABLE(), + Item: event, + ConditionExpression: 'attribute_exists(eventId)', + }), + ); + }, + + async setStatus( + eventId: string, + status: EventStatus, + rejectionReason: string | undefined, + updatedAt: string, + ): Promise { + await ddb.send( + new UpdateCommand({ + TableName: TABLE(), + Key: { eventId }, + UpdateExpression: rejectionReason + ? 'SET #status = :status, rejectionReason = :reason, updatedAt = :updatedAt' + : 'SET #status = :status, updatedAt = :updatedAt REMOVE rejectionReason', + ExpressionAttributeNames: { '#status': 'status' }, + ExpressionAttributeValues: rejectionReason + ? { ':status': status, ':reason': rejectionReason, ':updatedAt': updatedAt } + : { ':status': status, ':updatedAt': updatedAt }, + ConditionExpression: 'attribute_exists(eventId)', + }), + ); + }, + + /** + * Atomically increments (delta=+1) or decrements (delta=-1) + * registeredCount, refusing to let it exceed capacity. This is the + * concurrency guard that prevents overselling when many users register + * for the last remaining spot at the same time. DynamoDB condition + * expressions can't do arithmetic against an attribute (e.g. + * `registeredCount + :delta <= capacity`), so the bounds check is + * expressed as a plain attribute comparison instead — which only holds + * for single-seat deltas, the only case this domain needs. + */ + async adjustRegisteredCount(eventId: string, delta: 1 | -1): Promise { + const conditionExpression = + delta > 0 ? '(capacity = :zero) OR (registeredCount < capacity)' : 'registeredCount > :zero'; + + try { + await ddb.send( + new UpdateCommand({ + TableName: TABLE(), + Key: { eventId }, + UpdateExpression: 'SET registeredCount = registeredCount + :delta', + ConditionExpression: conditionExpression, + ExpressionAttributeValues: { ':delta': delta, ':zero': 0 }, + }), + ); + } catch (err) { + if (err instanceof ConditionalCheckFailedException) { + throw new ConflictError('This event has no remaining capacity.', 'EVENT_FULL'); + } + throw err; + } + }, + + async listByStatus(status: EventStatus, options: ListApprovedOptions): Promise> { + const result = await ddb.send( + new QueryCommand({ + TableName: TABLE(), + IndexName: 'StatusStartDateIndex', + KeyConditionExpression: options.from + ? '#status = :status AND startDate BETWEEN :from AND :to' + : '#status = :status', + FilterExpression: options.category ? 'category = :category' : undefined, + ExpressionAttributeNames: { '#status': 'status' }, + ExpressionAttributeValues: { + ':status': status, + ...(options.from ? { ':from': options.from, ':to': options.to ?? '9999-12-31' } : {}), + ...(options.category ? { ':category': options.category } : {}), + }, + Limit: options.limit, + ExclusiveStartKey: decodeCursor(options.cursor), + }), + ); + + return { + items: (result.Items ?? []) as EventRecord[], + cursor: encodeCursor(result.LastEvaluatedKey), + }; + }, + + async listApproved(options: ListApprovedOptions): Promise> { + return this.listByStatus(EventStatus.APPROVED, options); + }, + + async listByOrganizer(organizerId: string, options: ListByOrganizerOptions): Promise> { + const result = await ddb.send( + new QueryCommand({ + TableName: TABLE(), + IndexName: 'OrganizerIndex', + KeyConditionExpression: 'organizerId = :organizerId', + FilterExpression: options.status ? '#status = :status' : undefined, + ExpressionAttributeNames: options.status ? { '#status': 'status' } : undefined, + ExpressionAttributeValues: { + ':organizerId': organizerId, + ...(options.status ? { ':status': options.status } : {}), + }, + Limit: options.limit, + ExclusiveStartKey: decodeCursor(options.cursor), + ScanIndexForward: false, + }), + ); + + return { + items: (result.Items ?? []) as EventRecord[], + cursor: encodeCursor(result.LastEvaluatedKey), + }; + }, +}; diff --git a/backend/src/repositories/registrations-repository.ts b/backend/src/repositories/registrations-repository.ts new file mode 100644 index 0000000..2b6d14d --- /dev/null +++ b/backend/src/repositories/registrations-repository.ts @@ -0,0 +1,96 @@ +import { GetCommand, PutCommand, QueryCommand, UpdateCommand } from '@aws-sdk/lib-dynamodb'; +import { ConditionalCheckFailedException } from '@aws-sdk/client-dynamodb'; +import { ddb } from '../lib/dynamo'; +import { env } from '../lib/env'; +import { ConflictError } from '../lib/errors'; +import { decodeCursor, encodeCursor } from '../lib/pagination'; +import { RegistrationStatus } from '../models/enums'; +import { RegistrationRecord } from '../models/types'; +import { Page } from './events-repository'; + +const TABLE = () => env.registrationsTable; + +export const RegistrationsRepository = { + async create(registration: RegistrationRecord): Promise { + try { + await ddb.send( + new PutCommand({ + TableName: TABLE(), + Item: registration, + ConditionExpression: + 'attribute_not_exists(eventId) OR #status = :cancelled', + ExpressionAttributeNames: { '#status': 'status' }, + ExpressionAttributeValues: { ':cancelled': RegistrationStatus.CANCELLED }, + }), + ); + } catch (err) { + if (err instanceof ConditionalCheckFailedException) { + throw new ConflictError('You are already registered for this event.', 'ALREADY_REGISTERED'); + } + throw err; + } + }, + + async getByEventAndUser(eventId: string, userId: string): Promise { + const result = await ddb.send(new GetCommand({ TableName: TABLE(), Key: { eventId, userId } })); + return result.Item as RegistrationRecord | undefined; + }, + + async cancel(eventId: string, userId: string, cancelledAt: string): Promise { + try { + await ddb.send( + new UpdateCommand({ + TableName: TABLE(), + Key: { eventId, userId }, + UpdateExpression: 'SET #status = :cancelled, cancelledAt = :cancelledAt', + ConditionExpression: 'attribute_exists(eventId) AND #status = :registered', + ExpressionAttributeNames: { '#status': 'status' }, + ExpressionAttributeValues: { + ':cancelled': RegistrationStatus.CANCELLED, + ':registered': RegistrationStatus.REGISTERED, + ':cancelledAt': cancelledAt, + }, + }), + ); + } catch (err) { + if (err instanceof ConditionalCheckFailedException) { + throw new ConflictError('You do not have an active registration for this event.', 'NOT_REGISTERED'); + } + throw err; + } + }, + + async listByEvent(eventId: string, limit: number, cursor?: string): Promise> { + const result = await ddb.send( + new QueryCommand({ + TableName: TABLE(), + KeyConditionExpression: 'eventId = :eventId', + ExpressionAttributeValues: { ':eventId': eventId }, + Limit: limit, + ExclusiveStartKey: decodeCursor(cursor), + }), + ); + return { + items: (result.Items ?? []) as RegistrationRecord[], + cursor: encodeCursor(result.LastEvaluatedKey), + }; + }, + + async listByUser(userId: string, limit: number, cursor?: string): Promise> { + const result = await ddb.send( + new QueryCommand({ + TableName: TABLE(), + IndexName: 'UserIndex', + KeyConditionExpression: 'userId = :userId', + ExpressionAttributeValues: { ':userId': userId }, + Limit: limit, + ExclusiveStartKey: decodeCursor(cursor), + ScanIndexForward: false, + }), + ); + return { + items: (result.Items ?? []) as RegistrationRecord[], + cursor: encodeCursor(result.LastEvaluatedKey), + }; + }, +}; diff --git a/backend/src/repositories/users-repository.ts b/backend/src/repositories/users-repository.ts new file mode 100644 index 0000000..807bfa4 --- /dev/null +++ b/backend/src/repositories/users-repository.ts @@ -0,0 +1,57 @@ +import { GetCommand, PutCommand, QueryCommand, UpdateCommand } from '@aws-sdk/lib-dynamodb'; +import { ddb } from '../lib/dynamo'; +import { env } from '../lib/env'; +import { decodeCursor, encodeCursor } from '../lib/pagination'; +import { Role } from '../models/enums'; +import { UserRecord } from '../models/types'; +import { Page } from './events-repository'; + +const TABLE = () => env.usersTable; + +export const UsersRepository = { + async create(user: UserRecord): Promise { + await ddb.send( + new PutCommand({ + TableName: TABLE(), + Item: user, + ConditionExpression: 'attribute_not_exists(userId)', + }), + ); + }, + + async getById(userId: string): Promise { + const result = await ddb.send(new GetCommand({ TableName: TABLE(), Key: { userId } })); + return result.Item as UserRecord | undefined; + }, + + async updateRole(userId: string, role: Role): Promise { + await ddb.send( + new UpdateCommand({ + TableName: TABLE(), + Key: { userId }, + UpdateExpression: 'SET #role = :role', + ConditionExpression: 'attribute_exists(userId)', + ExpressionAttributeNames: { '#role': 'role' }, + ExpressionAttributeValues: { ':role': role }, + }), + ); + }, + + async listByRole(role: Role, limit: number, cursor?: string): Promise> { + const result = await ddb.send( + new QueryCommand({ + TableName: TABLE(), + IndexName: 'RoleIndex', + KeyConditionExpression: '#role = :role', + ExpressionAttributeNames: { '#role': 'role' }, + ExpressionAttributeValues: { ':role': role }, + Limit: limit, + ExclusiveStartKey: decodeCursor(cursor), + }), + ); + return { + items: (result.Items ?? []) as UserRecord[], + cursor: encodeCursor(result.LastEvaluatedKey), + }; + }, +}; diff --git a/backend/src/services/admin-service.ts b/backend/src/services/admin-service.ts new file mode 100644 index 0000000..9d680d6 --- /dev/null +++ b/backend/src/services/admin-service.ts @@ -0,0 +1,50 @@ +import { BadRequestError } from '../lib/errors'; +import { metrics, MetricUnit } from '../lib/logger'; +import { publishNotification } from '../lib/notifier'; +import { EventStatus, NotificationType, ReviewDecision, Role } from '../models/enums'; +import { EventRecord, UserRecord } from '../models/types'; +import { EventsRepository, Page } from '../repositories/events-repository'; +import { UsersRepository } from '../repositories/users-repository'; +import { ReviewEventInput } from './dto'; + +export const AdminService = { + async listEvents(status: EventStatus, limit: number, cursor?: string): Promise> { + return EventsRepository.listByStatus(status, { limit, cursor }); + }, + + async reviewEvent(eventId: string, input: ReviewEventInput): Promise { + const event = await EventsRepository.getByIdOrThrow(eventId); + if (event.status !== EventStatus.PENDING_REVIEW) { + throw new BadRequestError('Only events pending review can be approved or rejected.', 'EVENT_ALREADY_REVIEWED'); + } + + const nextStatus = + input.decision === ReviewDecision.APPROVED ? EventStatus.APPROVED : EventStatus.REJECTED; + const updatedAt = new Date().toISOString(); + + await EventsRepository.setStatus(eventId, nextStatus, input.reason, updatedAt); + metrics.addMetric( + nextStatus === EventStatus.APPROVED ? 'EventsApproved' : 'EventsRejected', + MetricUnit.Count, + 1, + ); + + await publishNotification({ + type: NotificationType.EVENT_REVIEWED, + organizerEmail: event.organizerEmail, + eventTitle: event.title, + decision: input.decision, + reason: input.reason, + }); + + return { ...event, status: nextStatus, rejectionReason: input.reason, updatedAt }; + }, + + async listUsers(role: Role, limit: number, cursor?: string): Promise> { + return UsersRepository.listByRole(role, limit, cursor); + }, + + async updateUserRole(userId: string, role: Role.ORGANIZER | Role.USER): Promise { + await UsersRepository.updateRole(userId, role); + }, +}; diff --git a/backend/src/services/auth-service.ts b/backend/src/services/auth-service.ts new file mode 100644 index 0000000..756911d --- /dev/null +++ b/backend/src/services/auth-service.ts @@ -0,0 +1,133 @@ +import { + AuthFlowType, + ConfirmForgotPasswordCommand, + ConfirmSignUpCommand, + ForgotPasswordCommand, + InitiateAuthCommand, + NotAuthorizedException, + SignUpCommand, + UsernameExistsException, +} from '@aws-sdk/client-cognito-identity-provider'; +import { cognito } from '../lib/cognito'; +import { env } from '../lib/env'; +import { ConflictError, UnauthorizedError } from '../lib/errors'; +import { + ConfirmSignupInput, + ForgotPasswordInput, + LoginInput, + RefreshInput, + ResetPasswordInput, + SignupInput, +} from './dto'; + +export interface TokenSet { + idToken: string; + accessToken: string; + refreshToken?: string; + expiresIn: number; +} + +export const AuthService = { + async signup(input: SignupInput): Promise<{ userSub: string }> { + try { + const result = await cognito.send( + new SignUpCommand({ + ClientId: env.userPoolClientId, + Username: input.email, + Password: input.password, + UserAttributes: [ + { Name: 'email', Value: input.email }, + { Name: 'name', Value: input.name }, + { Name: 'custom:role', Value: input.role }, + ], + }), + ); + return { userSub: result.UserSub as string }; + } catch (err) { + if (err instanceof UsernameExistsException) { + throw new ConflictError('An account with this email already exists.', 'EMAIL_TAKEN'); + } + throw err; + } + }, + + async confirmSignup(input: ConfirmSignupInput): Promise { + await cognito.send( + new ConfirmSignUpCommand({ + ClientId: env.userPoolClientId, + Username: input.email, + ConfirmationCode: input.code, + }), + ); + }, + + async login(input: LoginInput): Promise { + try { + const result = await cognito.send( + new InitiateAuthCommand({ + ClientId: env.userPoolClientId, + AuthFlow: AuthFlowType.USER_PASSWORD_AUTH, + AuthParameters: { USERNAME: input.email, PASSWORD: input.password }, + }), + ); + const authResult = result.AuthenticationResult; + if (!authResult?.IdToken || !authResult.AccessToken) { + throw new UnauthorizedError('Invalid email or password.'); + } + return { + idToken: authResult.IdToken, + accessToken: authResult.AccessToken, + refreshToken: authResult.RefreshToken, + expiresIn: authResult.ExpiresIn ?? 3600, + }; + } catch (err) { + if (err instanceof NotAuthorizedException) { + throw new UnauthorizedError('Invalid email or password.'); + } + throw err; + } + }, + + async refresh(input: RefreshInput): Promise { + try { + const result = await cognito.send( + new InitiateAuthCommand({ + ClientId: env.userPoolClientId, + AuthFlow: AuthFlowType.REFRESH_TOKEN_AUTH, + AuthParameters: { REFRESH_TOKEN: input.refreshToken }, + }), + ); + const authResult = result.AuthenticationResult; + if (!authResult?.IdToken || !authResult.AccessToken) { + throw new UnauthorizedError('Unable to refresh session.'); + } + return { + idToken: authResult.IdToken, + accessToken: authResult.AccessToken, + expiresIn: authResult.ExpiresIn ?? 3600, + }; + } catch (err) { + if (err instanceof NotAuthorizedException) { + throw new UnauthorizedError('Unable to refresh session.'); + } + throw err; + } + }, + + async forgotPassword(input: ForgotPasswordInput): Promise { + await cognito.send( + new ForgotPasswordCommand({ ClientId: env.userPoolClientId, Username: input.email }), + ); + }, + + async resetPassword(input: ResetPasswordInput): Promise { + await cognito.send( + new ConfirmForgotPasswordCommand({ + ClientId: env.userPoolClientId, + Username: input.email, + ConfirmationCode: input.code, + Password: input.newPassword, + }), + ); + }, +}; diff --git a/backend/src/services/dto.ts b/backend/src/services/dto.ts new file mode 100644 index 0000000..1570698 --- /dev/null +++ b/backend/src/services/dto.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; +import { + confirmSignupSchema, + createEventSchema, + forgotPasswordSchema, + listEventsQuerySchema, + loginSchema, + refreshSchema, + resetPasswordSchema, + reviewEventSchema, + signupSchema, + updateEventSchema, + updateUserRoleSchema, +} from '../lib/validation'; + +export type SignupInput = z.infer; +export type ConfirmSignupInput = z.infer; +export type LoginInput = z.infer; +export type RefreshInput = z.infer; +export type ForgotPasswordInput = z.infer; +export type ResetPasswordInput = z.infer; +export type CreateEventInput = z.infer; +export type UpdateEventInput = z.infer; +export type ReviewEventInput = z.infer; +export type UpdateUserRoleInput = z.infer; +export type ListEventsQuery = z.infer; diff --git a/backend/src/services/email-templates.ts b/backend/src/services/email-templates.ts new file mode 100644 index 0000000..d587cf7 --- /dev/null +++ b/backend/src/services/email-templates.ts @@ -0,0 +1,50 @@ +import { escapeHtml } from '../lib/html'; +import { NotificationType } from '../models/enums'; +import { NotificationMessage } from '../models/types'; + +export interface EmailContent { + to: string; + subject: string; + html: string; + text: string; +} + +export function renderEmail(message: NotificationMessage): EmailContent { + switch (message.type) { + case NotificationType.EVENT_REVIEWED: { + const approved = message.decision === 'APPROVED'; + const title = escapeHtml(message.eventTitle); + const subject = approved + ? `Your event "${message.eventTitle}" was approved` + : `Your event "${message.eventTitle}" was not approved`; + const reasonLine = + !approved && message.reason ? `

Reason: ${escapeHtml(message.reason)}

` : ''; + const reasonText = !approved && message.reason ? `Reason: ${message.reason}\n` : ''; + return { + to: message.organizerEmail, + subject, + html: `

Hello,

Your event ${title} has been ${message.decision} by an administrator.

${reasonLine}

— Event Registration & Ticketing System

`, + text: `Hello,\n\nYour event "${message.eventTitle}" has been ${message.decision} by an administrator.\n${reasonText}\n— Event Registration & Ticketing System`, + }; + } + case NotificationType.REGISTRATION_CONFIRMED: { + const title = escapeHtml(message.eventTitle); + const link = escapeHtml(message.ticketLink); + return { + to: message.userEmail, + subject: `You're registered for ${message.eventTitle}`, + html: `

Hello,

You are confirmed for ${title} on ${escapeHtml(message.eventStartDate)}.

Your ticket: ${link}

— Event Registration & Ticketing System

`, + text: `Hello,\n\nYou are confirmed for "${message.eventTitle}" on ${message.eventStartDate}.\nYour ticket: ${message.ticketLink}\n\n— Event Registration & Ticketing System`, + }; + } + case NotificationType.REGISTRATION_CANCELLED: { + const title = escapeHtml(message.eventTitle); + return { + to: message.userEmail, + subject: `Your registration for ${message.eventTitle} was cancelled`, + html: `

Hello,

Your registration for ${title} has been cancelled.

— Event Registration & Ticketing System

`, + text: `Hello,\n\nYour registration for "${message.eventTitle}" has been cancelled.\n\n— Event Registration & Ticketing System`, + }; + } + } +} diff --git a/backend/src/services/event-service.ts b/backend/src/services/event-service.ts new file mode 100644 index 0000000..cb54341 --- /dev/null +++ b/backend/src/services/event-service.ts @@ -0,0 +1,102 @@ +import { newEventId } from '../lib/ids'; +import { ForbiddenError, NotFoundError } from '../lib/errors'; +import { EventStatus, Role } from '../models/enums'; +import { AuthContext, EventRecord } from '../models/types'; +import { EventsRepository, Page } from '../repositories/events-repository'; +import { CreateEventInput, ListEventsQuery, UpdateEventInput } from './dto'; + +function isOwnerOrAdmin(ctx: AuthContext, event: EventRecord): boolean { + return event.organizerId === ctx.userId || ctx.groups.includes(Role.ADMIN); +} + +export const EventService = { + async createEvent(ctx: AuthContext, input: CreateEventInput): Promise { + const now = new Date().toISOString(); + const event: EventRecord = { + eventId: newEventId(), + organizerId: ctx.userId, + organizerEmail: ctx.email, + title: input.title, + description: input.description, + category: input.category, + location: input.location, + startDate: input.startDate, + endDate: input.endDate, + capacity: input.capacity, + registeredCount: 0, + ticketLink: input.ticketLink, + status: EventStatus.PENDING_REVIEW, + createdAt: now, + updatedAt: now, + }; + await EventsRepository.create(event); + return event; + }, + + async listApprovedEvents(query: ListEventsQuery): Promise> { + return EventsRepository.listApproved({ + from: query.from, + to: query.to, + category: query.category, + limit: query.limit, + cursor: query.cursor, + }); + }, + + /** + * GET /events/{eventId} is a public, unauthenticated route (HTTP API JWT + * authorizers have no "optional" mode, so it never sees a caller + * identity). Only APPROVED events are visible here; organizers see their + * own pending/rejected/cancelled events via GET /organizers/me/events, + * and Admins via GET /admin/events. + */ + async getPublicEvent(eventId: string): Promise { + const event = await EventsRepository.getByIdOrThrow(eventId); + if (event.status !== EventStatus.APPROVED) { + throw new NotFoundError(`Event ${eventId} was not found.`); + } + return event; + }, + + async updateEvent(ctx: AuthContext, eventId: string, input: UpdateEventInput): Promise { + const event = await EventsRepository.getByIdOrThrow(eventId); + if (event.organizerId !== ctx.userId) { + throw new ForbiddenError('Only the organizer who created this event can update it.'); + } + if (event.status === EventStatus.CANCELLED) { + throw new ForbiddenError('A cancelled event cannot be updated.'); + } + + const now = new Date().toISOString(); + // Editing an already-reviewed event puts it back in the review queue so + // an organizer can't sneak changes past an Admin's approval. + const updated: EventRecord = { + ...event, + title: input.title, + description: input.description, + category: input.category, + location: input.location, + startDate: input.startDate, + endDate: input.endDate, + capacity: input.capacity, + ticketLink: input.ticketLink, + status: EventStatus.PENDING_REVIEW, + rejectionReason: undefined, + updatedAt: now, + }; + await EventsRepository.replace(updated); + return updated; + }, + + async cancelEvent(ctx: AuthContext, eventId: string): Promise { + const event = await EventsRepository.getByIdOrThrow(eventId); + if (!isOwnerOrAdmin(ctx, event)) { + throw new ForbiddenError('Only the organizer or an Admin can cancel this event.'); + } + await EventsRepository.setStatus(eventId, EventStatus.CANCELLED, undefined, new Date().toISOString()); + }, + + async listMyEvents(ctx: AuthContext, status: EventStatus | undefined, limit: number, cursor?: string): Promise> { + return EventsRepository.listByOrganizer(ctx.userId, { status, limit, cursor }); + }, +}; diff --git a/backend/src/services/registration-service.ts b/backend/src/services/registration-service.ts new file mode 100644 index 0000000..4c4701a --- /dev/null +++ b/backend/src/services/registration-service.ts @@ -0,0 +1,94 @@ +import { newRegistrationId } from '../lib/ids'; +import { BadRequestError, ForbiddenError } from '../lib/errors'; +import { metrics, MetricUnit } from '../lib/logger'; +import { publishNotification } from '../lib/notifier'; +import { EventStatus, NotificationType, RegistrationStatus, Role } from '../models/enums'; +import { AuthContext, RegistrationRecord } from '../models/types'; +import { EventsRepository, Page } from '../repositories/events-repository'; +import { RegistrationsRepository } from '../repositories/registrations-repository'; + +export const RegistrationService = { + async register(ctx: AuthContext, eventId: string): Promise { + try { + const registration = await RegistrationService.attemptRegistration(ctx, eventId); + metrics.addMetric('RegistrationsCreated', MetricUnit.Count, 1); + return registration; + } catch (err) { + // A named counter, distinct from the generic ApiErrors metric — + // backs the "track failed registrations" monitoring requirement + // regardless of which specific rule (capacity, timing, approval + // status, duplicate) caused the failure. + metrics.addMetric('FailedRegistrations', MetricUnit.Count, 1); + throw err; + } + }, + + async attemptRegistration(ctx: AuthContext, eventId: string): Promise { + const event = await EventsRepository.getByIdOrThrow(eventId); + + if (event.status !== EventStatus.APPROVED) { + throw new BadRequestError('You can only register for approved events.', 'EVENT_NOT_APPROVED'); + } + if (new Date(event.startDate).getTime() <= Date.now()) { + throw new BadRequestError('This event has already started or ended.', 'EVENT_NOT_UPCOMING'); + } + + // Reserve the seat first — if capacity is exhausted this throws + // ConflictError before we ever write a registration record. + await EventsRepository.adjustRegisteredCount(eventId, 1); + + const registration: RegistrationRecord = { + eventId, + userId: ctx.userId, + registrationId: newRegistrationId(), + userEmail: ctx.email, + status: RegistrationStatus.REGISTERED, + ticketLink: event.ticketLink, + registeredAt: new Date().toISOString(), + }; + + try { + await RegistrationsRepository.create(registration); + } catch (err) { + // Roll back the seat reservation if the registration write failed + // (e.g. duplicate registration detected). + await EventsRepository.adjustRegisteredCount(eventId, -1); + throw err; + } + + await publishNotification({ + type: NotificationType.REGISTRATION_CONFIRMED, + userEmail: ctx.email, + eventTitle: event.title, + eventStartDate: event.startDate, + ticketLink: event.ticketLink, + }); + + return registration; + }, + + async cancel(ctx: AuthContext, eventId: string): Promise { + const event = await EventsRepository.getByIdOrThrow(eventId); + await RegistrationsRepository.cancel(eventId, ctx.userId, new Date().toISOString()); + await EventsRepository.adjustRegisteredCount(eventId, -1); + + await publishNotification({ + type: NotificationType.REGISTRATION_CANCELLED, + userEmail: ctx.email, + eventTitle: event.title, + }); + }, + + async listMine(ctx: AuthContext, limit: number, cursor?: string): Promise> { + return RegistrationsRepository.listByUser(ctx.userId, limit, cursor); + }, + + async listForEvent(ctx: AuthContext, eventId: string, limit: number, cursor?: string): Promise> { + const event = await EventsRepository.getByIdOrThrow(eventId); + const allowed = event.organizerId === ctx.userId || ctx.groups.includes(Role.ADMIN); + if (!allowed) { + throw new ForbiddenError('Only the organizer or an Admin can view this event’s registrations.'); + } + return RegistrationsRepository.listByEvent(eventId, limit, cursor); + }, +}; diff --git a/backend/tests/unit/lib/auth-context.test.ts b/backend/tests/unit/lib/auth-context.test.ts new file mode 100644 index 0000000..c372853 --- /dev/null +++ b/backend/tests/unit/lib/auth-context.test.ts @@ -0,0 +1,53 @@ +import type { APIGatewayProxyEventV2WithJWTAuthorizer } from 'aws-lambda'; +import { getAuthContext, requireRole } from '../../../src/lib/auth-context'; +import { ForbiddenError, UnauthorizedError } from '../../../src/lib/errors'; +import { Role } from '../../../src/models/enums'; + +function eventWithClaims(claims: Record | undefined): APIGatewayProxyEventV2WithJWTAuthorizer { + return { + requestContext: { + authorizer: claims ? { jwt: { claims, scopes: [] } } : undefined, + }, + } as unknown as APIGatewayProxyEventV2WithJWTAuthorizer; +} + +describe('getAuthContext', () => { + it('extracts userId, email, and groups from an array-form groups claim', () => { + const ctx = getAuthContext( + eventWithClaims({ sub: 'user-1', email: 'a@example.com', 'cognito:groups': ['ORGANIZER', 'USER'] }), + ); + expect(ctx).toEqual({ userId: 'user-1', email: 'a@example.com', groups: [Role.ORGANIZER, Role.USER] }); + }); + + it('parses a comma-separated string groups claim matching Role values', () => { + const ctx = getAuthContext( + eventWithClaims({ sub: 'user-2', email: 'b@example.com', 'cognito:groups': 'ORGANIZER,USER' }), + ); + expect(ctx.groups.sort()).toEqual([Role.ORGANIZER, Role.USER].sort()); + }); + + it('returns an empty groups array when no groups claim is present', () => { + const ctx = getAuthContext(eventWithClaims({ sub: 'user-3', email: 'c@example.com' })); + expect(ctx.groups).toEqual([]); + }); + + it('throws UnauthorizedError when there is no authorizer context', () => { + expect(() => getAuthContext(eventWithClaims(undefined))).toThrow(UnauthorizedError); + }); + + it('throws UnauthorizedError when claims have no sub', () => { + expect(() => getAuthContext(eventWithClaims({ email: 'x@example.com' }))).toThrow(UnauthorizedError); + }); +}); + +describe('requireRole', () => { + const ctx = { userId: 'u1', email: 'u1@example.com', groups: [Role.ORGANIZER] }; + + it('passes when the caller has one of the allowed roles', () => { + expect(() => requireRole(ctx, Role.ORGANIZER, Role.ADMIN)).not.toThrow(); + }); + + it('throws ForbiddenError when the caller lacks all allowed roles', () => { + expect(() => requireRole(ctx, Role.ADMIN)).toThrow(ForbiddenError); + }); +}); diff --git a/backend/tests/unit/lib/validation.test.ts b/backend/tests/unit/lib/validation.test.ts new file mode 100644 index 0000000..b158883 --- /dev/null +++ b/backend/tests/unit/lib/validation.test.ts @@ -0,0 +1,51 @@ +import { BadRequestError } from '../../../src/lib/errors'; +import { createEventSchema, parse, reviewEventSchema } from '../../../src/lib/validation'; + +describe('createEventSchema', () => { + const validPayload = { + title: 'AWS Community Day', + description: 'A day of AWS talks.', + category: 'CONFERENCE', + location: 'Accra, Ghana', + startDate: '2026-09-01T09:00:00.000Z', + endDate: '2026-09-01T17:00:00.000Z', + capacity: 100, + ticketLink: 'https://example.com/tickets', + }; + + it('accepts a valid payload', () => { + expect(() => parse(createEventSchema, validPayload)).not.toThrow(); + }); + + it('rejects when endDate is before startDate', () => { + expect(() => + parse(createEventSchema, { ...validPayload, endDate: '2026-08-31T00:00:00.000Z' }), + ).toThrow(BadRequestError); + }); + + it('rejects a non-URL ticketLink', () => { + expect(() => parse(createEventSchema, { ...validPayload, ticketLink: 'not-a-url' })).toThrow( + BadRequestError, + ); + }); + + it('rejects negative capacity', () => { + expect(() => parse(createEventSchema, { ...validPayload, capacity: -1 })).toThrow(BadRequestError); + }); +}); + +describe('reviewEventSchema', () => { + it('accepts APPROVED without a reason', () => { + expect(() => parse(reviewEventSchema, { decision: 'APPROVED' })).not.toThrow(); + }); + + it('rejects REJECTED without a reason', () => { + expect(() => parse(reviewEventSchema, { decision: 'REJECTED' })).toThrow(BadRequestError); + }); + + it('accepts REJECTED with a reason', () => { + expect(() => + parse(reviewEventSchema, { decision: 'REJECTED', reason: 'Duplicate event listing.' }), + ).not.toThrow(); + }); +}); diff --git a/backend/tests/unit/repositories/events-repository.test.ts b/backend/tests/unit/repositories/events-repository.test.ts new file mode 100644 index 0000000..fc06b88 --- /dev/null +++ b/backend/tests/unit/repositories/events-repository.test.ts @@ -0,0 +1,43 @@ +import { mockClient } from 'aws-sdk-client-mock'; +import { ConditionalCheckFailedException } from '@aws-sdk/client-dynamodb'; +import { DynamoDBDocumentClient, UpdateCommand } from '@aws-sdk/lib-dynamodb'; +import { ddb } from '../../../src/lib/dynamo'; +import { ConflictError } from '../../../src/lib/errors'; +import { EventsRepository } from '../../../src/repositories/events-repository'; + +process.env.EVENTS_TABLE_NAME = 'test-events-table'; + +const ddbMock = mockClient(ddb as unknown as DynamoDBDocumentClient); + +beforeEach(() => { + ddbMock.reset(); +}); + +describe('EventsRepository.adjustRegisteredCount', () => { + it('uses a capacity-aware condition when reserving a seat (delta = +1)', async () => { + ddbMock.on(UpdateCommand).resolves({}); + + await EventsRepository.adjustRegisteredCount('evt_1', 1); + + const call = ddbMock.commandCalls(UpdateCommand)[0]; + expect(call.args[0].input.ConditionExpression).toBe('(capacity = :zero) OR (registeredCount < capacity)'); + expect(call.args[0].input.ExpressionAttributeValues).toEqual({ ':delta': 1, ':zero': 0 }); + }); + + it('uses a floor-at-zero condition when releasing a seat (delta = -1)', async () => { + ddbMock.on(UpdateCommand).resolves({}); + + await EventsRepository.adjustRegisteredCount('evt_1', -1); + + const call = ddbMock.commandCalls(UpdateCommand)[0]; + expect(call.args[0].input.ConditionExpression).toBe('registeredCount > :zero'); + }); + + it('translates a failed condition check into ConflictError (event full)', async () => { + ddbMock.on(UpdateCommand).rejects( + new ConditionalCheckFailedException({ message: 'failed', $metadata: {} }), + ); + + await expect(EventsRepository.adjustRegisteredCount('evt_1', 1)).rejects.toThrow(ConflictError); + }); +}); diff --git a/backend/tests/unit/services/admin-service.test.ts b/backend/tests/unit/services/admin-service.test.ts new file mode 100644 index 0000000..ba356d2 --- /dev/null +++ b/backend/tests/unit/services/admin-service.test.ts @@ -0,0 +1,76 @@ +import { EventsRepository } from '../../../src/repositories/events-repository'; +import { publishNotification } from '../../../src/lib/notifier'; +import { AdminService } from '../../../src/services/admin-service'; +import { EventStatus, NotificationType, ReviewDecision } from '../../../src/models/enums'; +import { EventRecord } from '../../../src/models/types'; +import { BadRequestError } from '../../../src/lib/errors'; + +jest.mock('../../../src/repositories/events-repository'); +jest.mock('../../../src/lib/notifier'); + +const mockedEvents = EventsRepository as jest.Mocked; +const mockedPublish = publishNotification as jest.MockedFunction; + +function buildEvent(overrides: Partial = {}): EventRecord { + return { + eventId: 'evt_1', + organizerId: 'organizer-1', + organizerEmail: 'organizer@example.com', + title: 'Test Event', + description: 'Description', + category: 'WORKSHOP', + location: 'Virtual', + startDate: '2030-01-01T00:00:00.000Z', + endDate: '2030-01-01T02:00:00.000Z', + capacity: 10, + registeredCount: 0, + ticketLink: 'https://example.com/ticket', + status: EventStatus.PENDING_REVIEW, + createdAt: '2029-12-01T00:00:00.000Z', + updatedAt: '2029-12-01T00:00:00.000Z', + ...overrides, + }; +} + +describe('AdminService.reviewEvent', () => { + it('approves a pending event and notifies the organizer', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent()); + + const result = await AdminService.reviewEvent('evt_1', { decision: ReviewDecision.APPROVED }); + + expect(mockedEvents.setStatus).toHaveBeenCalledWith('evt_1', EventStatus.APPROVED, undefined, expect.any(String)); + expect(result.status).toBe(EventStatus.APPROVED); + expect(mockedPublish).toHaveBeenCalledWith( + expect.objectContaining({ type: NotificationType.EVENT_REVIEWED, decision: 'APPROVED' }), + ); + }); + + it('rejects a pending event with a reason and notifies the organizer', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent()); + + const result = await AdminService.reviewEvent('evt_1', { + decision: ReviewDecision.REJECTED, + reason: 'Missing venue details.', + }); + + expect(mockedEvents.setStatus).toHaveBeenCalledWith( + 'evt_1', + EventStatus.REJECTED, + 'Missing venue details.', + expect.any(String), + ); + expect(result.rejectionReason).toBe('Missing venue details.'); + expect(mockedPublish).toHaveBeenCalledWith( + expect.objectContaining({ type: NotificationType.EVENT_REVIEWED, decision: 'REJECTED', reason: 'Missing venue details.' }), + ); + }); + + it('refuses to review an event that is not PENDING_REVIEW', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent({ status: EventStatus.APPROVED })); + + await expect( + AdminService.reviewEvent('evt_1', { decision: ReviewDecision.APPROVED }), + ).rejects.toThrow(BadRequestError); + expect(mockedEvents.setStatus).not.toHaveBeenCalled(); + }); +}); diff --git a/backend/tests/unit/services/email-templates.test.ts b/backend/tests/unit/services/email-templates.test.ts new file mode 100644 index 0000000..498976f --- /dev/null +++ b/backend/tests/unit/services/email-templates.test.ts @@ -0,0 +1,33 @@ +import { renderEmail } from '../../../src/services/email-templates'; +import { NotificationType } from '../../../src/models/enums'; + +describe('renderEmail', () => { + it('HTML-escapes organizer/user-supplied text to prevent HTML injection in emails', () => { + const email = renderEmail({ + type: NotificationType.EVENT_REVIEWED, + organizerEmail: 'organizer@example.com', + eventTitle: '', + decision: 'REJECTED', + reason: '', + }); + + expect(email.html).not.toContain(''); + expect(email.html).not.toContain(''); + expect(email.html).toContain('<img src=x onerror=alert(1)>'); + expect(email.html).toContain('<script>steal()</script>'); + }); + + it('renders a registration confirmation with the ticket link', () => { + const email = renderEmail({ + type: NotificationType.REGISTRATION_CONFIRMED, + userEmail: 'user@example.com', + eventTitle: 'AWS Community Day', + eventStartDate: '2030-01-01T00:00:00.000Z', + ticketLink: 'https://example.com/ticket', + }); + + expect(email.to).toBe('user@example.com'); + expect(email.html).toContain('https://example.com/ticket'); + expect(email.text).toContain('https://example.com/ticket'); + }); +}); diff --git a/backend/tests/unit/services/event-service.test.ts b/backend/tests/unit/services/event-service.test.ts new file mode 100644 index 0000000..7b73b4b --- /dev/null +++ b/backend/tests/unit/services/event-service.test.ts @@ -0,0 +1,118 @@ +import { EventsRepository } from '../../../src/repositories/events-repository'; +import { EventService } from '../../../src/services/event-service'; +import { EventStatus, Role } from '../../../src/models/enums'; +import { AuthContext, EventRecord } from '../../../src/models/types'; +import { ForbiddenError, NotFoundError } from '../../../src/lib/errors'; + +jest.mock('../../../src/repositories/events-repository'); + +const mockedRepo = EventsRepository as jest.Mocked; + +function buildEvent(overrides: Partial = {}): EventRecord { + return { + eventId: 'evt_1', + organizerId: 'organizer-1', + organizerEmail: 'organizer@example.com', + title: 'Test Event', + description: 'Description', + category: 'WORKSHOP', + location: 'Virtual', + startDate: '2030-01-01T00:00:00.000Z', + endDate: '2030-01-01T02:00:00.000Z', + capacity: 10, + registeredCount: 0, + ticketLink: 'https://example.com/ticket', + status: EventStatus.PENDING_REVIEW, + createdAt: '2029-12-01T00:00:00.000Z', + updatedAt: '2029-12-01T00:00:00.000Z', + ...overrides, + }; +} + +const organizerCtx: AuthContext = { userId: 'organizer-1', email: 'organizer@example.com', groups: [Role.ORGANIZER] }; +const otherOrganizerCtx: AuthContext = { userId: 'organizer-2', email: 'other@example.com', groups: [Role.ORGANIZER] }; +const adminCtx: AuthContext = { userId: 'admin-1', email: 'admin@example.com', groups: [Role.ADMIN] }; + +const createInput = { + title: 'New Event', + description: 'Desc', + category: 'WORKSHOP', + location: 'Virtual', + startDate: '2030-01-01T00:00:00.000Z', + endDate: '2030-01-01T02:00:00.000Z', + capacity: 50, + ticketLink: 'https://example.com/ticket', +}; + +describe('EventService.createEvent', () => { + it('creates the event with PENDING_REVIEW status, owned by the caller', async () => { + const created = await EventService.createEvent(organizerCtx, createInput); + + expect(created.status).toBe(EventStatus.PENDING_REVIEW); + expect(created.organizerId).toBe(organizerCtx.userId); + expect(created.registeredCount).toBe(0); + expect(mockedRepo.create).toHaveBeenCalledWith(expect.objectContaining({ eventId: created.eventId })); + }); +}); + +describe('EventService.getPublicEvent', () => { + it('returns the event when APPROVED', async () => { + const event = buildEvent({ status: EventStatus.APPROVED }); + mockedRepo.getByIdOrThrow.mockResolvedValue(event); + + await expect(EventService.getPublicEvent('evt_1')).resolves.toEqual(event); + }); + + it('throws NotFoundError when the event is not APPROVED', async () => { + mockedRepo.getByIdOrThrow.mockResolvedValue(buildEvent({ status: EventStatus.PENDING_REVIEW })); + + await expect(EventService.getPublicEvent('evt_1')).rejects.toThrow(NotFoundError); + }); +}); + +describe('EventService.updateEvent', () => { + it('resets an APPROVED event back to PENDING_REVIEW on edit', async () => { + mockedRepo.getByIdOrThrow.mockResolvedValue(buildEvent({ status: EventStatus.APPROVED })); + + const updated = await EventService.updateEvent(organizerCtx, 'evt_1', createInput); + + expect(updated.status).toBe(EventStatus.PENDING_REVIEW); + expect(mockedRepo.replace).toHaveBeenCalledWith(expect.objectContaining({ status: EventStatus.PENDING_REVIEW })); + }); + + it('rejects updates from a non-owner organizer', async () => { + mockedRepo.getByIdOrThrow.mockResolvedValue(buildEvent()); + + await expect(EventService.updateEvent(otherOrganizerCtx, 'evt_1', createInput)).rejects.toThrow( + ForbiddenError, + ); + }); + + it('rejects updates to a cancelled event', async () => { + mockedRepo.getByIdOrThrow.mockResolvedValue(buildEvent({ status: EventStatus.CANCELLED })); + + await expect(EventService.updateEvent(organizerCtx, 'evt_1', createInput)).rejects.toThrow(ForbiddenError); + }); +}); + +describe('EventService.cancelEvent', () => { + it('allows the owning organizer to cancel', async () => { + mockedRepo.getByIdOrThrow.mockResolvedValue(buildEvent()); + + await EventService.cancelEvent(organizerCtx, 'evt_1'); + + expect(mockedRepo.setStatus).toHaveBeenCalledWith('evt_1', EventStatus.CANCELLED, undefined, expect.any(String)); + }); + + it('allows an Admin to cancel any event', async () => { + mockedRepo.getByIdOrThrow.mockResolvedValue(buildEvent()); + + await expect(EventService.cancelEvent(adminCtx, 'evt_1')).resolves.toBeUndefined(); + }); + + it('rejects a non-owner, non-admin caller', async () => { + mockedRepo.getByIdOrThrow.mockResolvedValue(buildEvent()); + + await expect(EventService.cancelEvent(otherOrganizerCtx, 'evt_1')).rejects.toThrow(ForbiddenError); + }); +}); diff --git a/backend/tests/unit/services/registration-service.test.ts b/backend/tests/unit/services/registration-service.test.ts new file mode 100644 index 0000000..327774e --- /dev/null +++ b/backend/tests/unit/services/registration-service.test.ts @@ -0,0 +1,109 @@ +import { EventsRepository } from '../../../src/repositories/events-repository'; +import { RegistrationsRepository } from '../../../src/repositories/registrations-repository'; +import { publishNotification } from '../../../src/lib/notifier'; +import { RegistrationService } from '../../../src/services/registration-service'; +import { EventStatus, NotificationType, Role } from '../../../src/models/enums'; +import { AuthContext, EventRecord } from '../../../src/models/types'; +import { BadRequestError, ForbiddenError } from '../../../src/lib/errors'; + +jest.mock('../../../src/repositories/events-repository'); +jest.mock('../../../src/repositories/registrations-repository'); +jest.mock('../../../src/lib/notifier'); + +const mockedEvents = EventsRepository as jest.Mocked; +const mockedRegistrations = RegistrationsRepository as jest.Mocked; +const mockedPublish = publishNotification as jest.MockedFunction; + +function buildEvent(overrides: Partial = {}): EventRecord { + return { + eventId: 'evt_1', + organizerId: 'organizer-1', + organizerEmail: 'organizer@example.com', + title: 'Test Event', + description: 'Description', + category: 'WORKSHOP', + location: 'Virtual', + startDate: '2999-01-01T00:00:00.000Z', + endDate: '2999-01-01T02:00:00.000Z', + capacity: 10, + registeredCount: 0, + ticketLink: 'https://example.com/ticket', + status: EventStatus.APPROVED, + createdAt: '2029-12-01T00:00:00.000Z', + updatedAt: '2029-12-01T00:00:00.000Z', + ...overrides, + }; +} + +const userCtx: AuthContext = { userId: 'user-1', email: 'user@example.com', groups: [Role.USER] }; + +describe('RegistrationService.register', () => { + it('reserves a seat, creates the registration, and publishes a confirmation', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent()); + + const registration = await RegistrationService.register(userCtx, 'evt_1'); + + expect(mockedEvents.adjustRegisteredCount).toHaveBeenCalledWith('evt_1', 1); + expect(mockedRegistrations.create).toHaveBeenCalledWith( + expect.objectContaining({ eventId: 'evt_1', userId: 'user-1' }), + ); + expect(registration.ticketLink).toBe('https://example.com/ticket'); + expect(mockedPublish).toHaveBeenCalledWith( + expect.objectContaining({ type: NotificationType.REGISTRATION_CONFIRMED }), + ); + }); + + it('rejects registration for a non-APPROVED event', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent({ status: EventStatus.PENDING_REVIEW })); + + await expect(RegistrationService.register(userCtx, 'evt_1')).rejects.toThrow(BadRequestError); + expect(mockedEvents.adjustRegisteredCount).not.toHaveBeenCalled(); + }); + + it('rejects registration for an event that has already started', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent({ startDate: '2000-01-01T00:00:00.000Z' })); + + await expect(RegistrationService.register(userCtx, 'evt_1')).rejects.toThrow(BadRequestError); + }); + + it('rolls back the seat reservation if the registration write fails', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent()); + mockedRegistrations.create.mockRejectedValue(new Error('duplicate')); + + await expect(RegistrationService.register(userCtx, 'evt_1')).rejects.toThrow('duplicate'); + + expect(mockedEvents.adjustRegisteredCount).toHaveBeenNthCalledWith(1, 'evt_1', 1); + expect(mockedEvents.adjustRegisteredCount).toHaveBeenNthCalledWith(2, 'evt_1', -1); + expect(mockedPublish).not.toHaveBeenCalled(); + }); +}); + +describe('RegistrationService.cancel', () => { + it('cancels the registration, frees the seat, and notifies the user', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent()); + + await RegistrationService.cancel(userCtx, 'evt_1'); + + expect(mockedRegistrations.cancel).toHaveBeenCalledWith('evt_1', 'user-1', expect.any(String)); + expect(mockedEvents.adjustRegisteredCount).toHaveBeenCalledWith('evt_1', -1); + expect(mockedPublish).toHaveBeenCalledWith( + expect.objectContaining({ type: NotificationType.REGISTRATION_CANCELLED }), + ); + }); +}); + +describe('RegistrationService.listForEvent', () => { + it('allows the owning organizer', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent()); + mockedRegistrations.listByEvent.mockResolvedValue({ items: [], cursor: undefined }); + const organizerCtx: AuthContext = { userId: 'organizer-1', email: 'o@example.com', groups: [Role.ORGANIZER] }; + + await expect(RegistrationService.listForEvent(organizerCtx, 'evt_1', 20)).resolves.toBeDefined(); + }); + + it('rejects a caller who is neither the organizer nor an Admin', async () => { + mockedEvents.getByIdOrThrow.mockResolvedValue(buildEvent()); + + await expect(RegistrationService.listForEvent(userCtx, 'evt_1', 20)).rejects.toThrow(ForbiddenError); + }); +}); diff --git a/backend/tsconfig.json b/backend/tsconfig.json new file mode 100644 index 0000000..c5d8266 --- /dev/null +++ b/backend/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "outDir": "dist", + "baseUrl": "src", + "types": ["node", "jest"] + }, + "include": ["src/**/*.ts", "tests/**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..7f04c46 --- /dev/null +++ b/docs/api.md @@ -0,0 +1,76 @@ +# API Reference + +Base URL: `https://{api-id}.execute-api.{region}.amazonaws.com` (stage is +part of the domain for HTTP API default stage `$default`). + +All authenticated routes require `Authorization: Bearer `. +Roles are enforced two ways: API Gateway's JWT authorizer confirms the +token is valid and attaches claims (including `cognito:groups`); each +Lambda additionally checks the specific group/ownership rule noted below +(defense in depth — a misconfigured route scope shouldn't be the only +thing standing between a User and an Admin action). + +## Auth — `/auth/*` (public) + +Thin wrappers around Cognito so the client only ever talks to one API. + +| Method | Path | Body | Notes | +|---|---|---|---| +| POST | `/auth/signup` | `{ email, password, name, role }` | `role` ∈ `USER`, `ORGANIZER`. Admins are seeded out-of-band (see `scripts/seed-admin.ts`), never self-service. | +| POST | `/auth/confirm-signup` | `{ email, code }` | Confirms the emailed verification code. | +| POST | `/auth/login` | `{ email, password }` | Returns `idToken`, `accessToken`, `refreshToken`. | +| POST | `/auth/refresh` | `{ refreshToken, email }` | Returns a new `idToken`/`accessToken` pair. | +| POST | `/auth/forgot-password` | `{ email }` | Triggers Cognito's reset-code email. | +| POST | `/auth/reset-password` | `{ email, code, newPassword }` | | + +## Events — `/events/*` + +| Method | Path | Auth | Notes | +|---|---|---|---| +| POST | `/events` | Organizer | Creates event, `status = PENDING_REVIEW`. | +| GET | `/events` | Public | Lists `APPROVED` upcoming events. Query: `category`, `from`, `to`, `limit`, `cursor`. | +| GET | `/events/{eventId}` | Public | Event detail. `PENDING_REVIEW`/`REJECTED` events are hidden from non-owners. | +| PUT | `/events/{eventId}` | Organizer (owner) | Editing a non-`PENDING_REVIEW` event resets it to `PENDING_REVIEW` for re-approval (prevents bait-and-switch after approval). | +| DELETE | `/events/{eventId}` | Organizer (owner) or Admin | Soft delete — sets `status = CANCELLED`, does not remove history. | +| GET | `/organizers/me/events` | Organizer | Own events, any status. Query: `status`. | + +## Registrations & Ticketing — `/events/{eventId}/register`, `/users/me/registrations` + +| Method | Path | Auth | Notes | +|---|---|---|---| +| POST | `/events/{eventId}/register` | User | Fails with `409` if already registered, event full, or event not `APPROVED`/in the future. Publishes `REGISTRATION_CONFIRMED` → confirmation email with ticket link. | +| DELETE | `/events/{eventId}/register` | User (self) | Cancels own registration, decrements `registeredCount`. | +| GET | `/users/me/registrations` | User | Own registration history. | +| GET | `/events/{eventId}/registrations` | Organizer (owner) or Admin | Roster for an event. | + +## Admin — `/admin/*` + +| Method | Path | Auth | Notes | +|---|---|---|---| +| GET | `/admin/events` | Admin | Query `status` (defaults to `PENDING_REVIEW`). | +| POST | `/admin/events/{eventId}/review` | Admin | `{ decision: "APPROVED" \| "REJECTED", reason? }`. `reason` required when rejecting. Publishes `EVENT_REVIEWED` → organizer email. | +| GET | `/admin/users` | Admin | Query `role`. | +| PATCH | `/admin/users/{userId}/role` | Admin | `{ role: "ORGANIZER" \| "USER" }` — promote/demote (not usable to grant `ADMIN`). | + +## Error shape + +All errors return a consistent JSON body so the frontend can render them +uniformly: + +```json +{ + "error": { + "code": "EVENT_NOT_APPROVED", + "message": "Cannot register for an event that has not been approved." + } +} +``` + +| HTTP | When | +|---|---| +| 400 | Validation failure (Zod schema) | +| 401 | Missing/invalid JWT | +| 403 | Valid JWT, wrong role or not the resource owner | +| 404 | Resource not found | +| 409 | Conflict (duplicate registration, event full, capacity race lost) | +| 500 | Unhandled — logged with a correlation id via CloudWatch/X-Ray | diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 0000000..08c4e66 --- /dev/null +++ b/docs/architecture.md @@ -0,0 +1,132 @@ +# Architecture + +## Overview + +A serverless Event Registration & Ticketing System that replaces manual +Microsoft Forms + Excel workflows with a REST API backed entirely by +managed AWS services. No servers, containers, or clusters to patch — the +system scales to zero between events and scales out automatically during +signup spikes (e.g. a popular event opening registration). + +```mermaid +flowchart TB + subgraph Client["Clients (web / mobile — TBD)"] + FE[Frontend App] + end + + subgraph Edge["API Layer"] + APIGW["Amazon API Gateway (HTTP API)"] + AUTHZ["Cognito JWT Authorizer"] + end + + subgraph Compute["Compute — AWS Lambda (Node.js 20 / TypeScript)"] + L_AUTH[Auth Handlers] + L_EVT[Event Handlers] + L_ADM[Admin Handlers] + L_REG[Registration Handlers] + L_NOTIF[Notification Dispatcher] + end + + subgraph Data["Data Layer"] + DDB_EVT[("DynamoDB: Events")] + DDB_REG[("DynamoDB: Registrations")] + DDB_USR[("DynamoDB: Users")] + end + + subgraph IdP["Identity"] + COG["Amazon Cognito User Pool
Groups: Admins / Organizers / Users"] + end + + subgraph Notify["Notifications"] + SNS["SNS Topic: event-notifications"] + SES["Amazon SES"] + end + + subgraph Ops["Observability & Cost"] + CW["CloudWatch Logs, Metrics, Alarms, Dashboard"] + XRAY["AWS X-Ray Tracing"] + BUDGET["AWS Budgets (Free Tier guardrail)"] + end + + FE -->|HTTPS + JWT| APIGW + APIGW --> AUTHZ + AUTHZ --> COG + APIGW --> L_AUTH & L_EVT & L_ADM & L_REG + + L_AUTH <--> COG + L_AUTH --> DDB_USR + L_EVT --> DDB_EVT + L_ADM --> DDB_EVT + L_ADM --> DDB_USR + L_REG --> DDB_REG + L_REG --> DDB_EVT + + L_ADM -->|publish| SNS + L_REG -->|publish| SNS + SNS -->|subscribe| L_NOTIF + L_NOTIF --> SES + + L_AUTH & L_EVT & L_ADM & L_REG & L_NOTIF -.logs/traces.-> CW + L_AUTH & L_EVT & L_ADM & L_REG & L_NOTIF -.traces.-> XRAY + BUDGET -.monitors spend.-> Data + BUDGET -.monitors spend.-> Compute +``` + +## Why these choices + +See [decisions.md](./decisions.md) for the full rationale behind each pick +below (ADR-style). Summary: + +| Concern | Choice | Why (short) | +|---|---|---| +| IaC | AWS CDK (TypeScript) | Same language as Lambdas; type-safe constructs; one `pnpm install` for the whole repo | +| API | API Gateway **HTTP API** (v2) | ~70% cheaper than REST API, native JWT authorizer, sufficient feature set — helps stay in Free Tier / low budget | +| Auth | Amazon Cognito User Pool | Managed signup/login/password reset, groups map directly to Admin/Organizer/User roles, issues JWTs API Gateway validates natively | +| Compute | AWS Lambda (Node 22, TS, esbuild bundling) | Pay-per-invocation, zero idle cost, scales automatically | +| Data | DynamoDB (on-demand capacity) | Serverless, no capacity planning, free tier covers dev/test load | +| Notifications | SNS topic → Lambda subscriber → SES | SNS decouples "something happened" from "how we tell someone" (satisfies the SNS requirement); SES does the actual transactional email delivery, which SNS's raw email-subscription model doesn't support well for per-user dynamic addresses | +| Observability | CloudWatch Logs/Metrics/Alarms + X-Ray | Built into every Lambda/API Gateway/DynamoDB resource for free; alarms catch failures before users report them | +| Cost control | AWS Budgets | Email alert at 80%/100% of a small monthly threshold so the whole stack stays inside Free Tier during development | + +## Request flow examples + +### 1. Organizer creates an event +1. Organizer calls `POST /events` with a JWT (Cognito `Organizer` group). +2. `createEvent` Lambda validates the payload, writes an `Events` item with + `status = PENDING_REVIEW`. +3. Event is invisible to public listings until approved. + +### 2. Admin approves/rejects an event +1. Admin calls `POST /admin/events/{eventId}/review` with `{ decision, reason? }`. +2. `reviewEvent` Lambda updates `status` to `APPROVED` or `REJECTED` + (reason required + stored when rejecting). +3. Lambda publishes an `EVENT_REVIEWED` message to the SNS topic. +4. `notificationDispatcher` Lambda (SNS subscriber) sends the organizer an + email via SES with the decision and reason. + +### 3. User registers for an event +1. User calls `POST /events/{eventId}/register`. +2. `registerForEvent` Lambda checks the event is `APPROVED`, in the future, + and has capacity; conditionally increments `registeredCount` on the + `Events` table (optimistic concurrency, no overselling) and writes a + `Registrations` item. +3. Lambda publishes a `REGISTRATION_CONFIRMED` message to SNS, which the + dispatcher turns into a confirmation email containing the organizer-supplied + ticket link. + +## Monorepo layout + +```text +. +├── backend/ Lambda source (TypeScript), one handler per file +├── infrastructure/ AWS CDK app (TypeScript), one stack per concern +├── frontend/ placeholder — design pending, built later +├── docs/ architecture, data model, API reference, ADRs +└── scripts/ one-off ops scripts (e.g. seed the first Admin) +``` + +Each Lambda handler is a thin adapter: parse/validate input → call a +`service` → map the result/error to an HTTP response. Services hold business +rules and call `repositories`, which are the only code that talks to +DynamoDB. This keeps handlers testable without mocking AWS SDK calls in +every test. diff --git a/docs/branching-strategy.md b/docs/branching-strategy.md new file mode 100644 index 0000000..f6d2aa9 --- /dev/null +++ b/docs/branching-strategy.md @@ -0,0 +1,48 @@ +# Branching Strategy — GitHub Flow + +This repository uses **GitHub Flow**: `main` is always deployable, and all +work happens on short-lived branches merged back via pull request. + +## Rules + +1. **`main` is protected.** No direct pushes — every change lands via a + pull request. See [Branch protection](#branch-protection-on-main) + below for the exact rules applied. +2. **Branch per unit of work**, cut from `main`: + - `feature/` — new functionality (e.g. + `feature/event-search-filters`) + - `fix/` — bug fixes + - `chore/` — tooling, docs, dependency bumps + - `infra/` — changes scoped to `infrastructure/` +3. **Open a PR early**, even as a draft — CI (`.github/workflows/ci.yml`) + runs lint, typecheck, unit tests, and `cdk synth` on every push to the + branch and on the PR itself, so failures surface before review. +4. **Squash-merge to `main`** once CI is green and the PR is approved. + Delete the branch after merging (GitHub does this automatically for + squash merges when the default repo setting is enabled). +5. **`main` is what gets deployed.** There's no long-lived `develop` or + `release` branch — see [decisions.md](./decisions.md) for why: this + project deploys manually (`pnpm run deploy`) rather than auto-deploying + on merge, so `main` being "deployable" means "CI-green and ready to + deploy," not "auto-deployed." + +## Why GitHub Flow over Git Flow + +Git Flow's `develop`/`release`/`hotfix` branches exist to manage scheduled, +versioned releases with parallel in-flight work streams — overhead this +project doesn't need at capstone scale (one deployable target per stage, +no versioned release trains). GitHub Flow's single long-lived branch plus +short-lived feature branches matches how the CDK stacks are actually +deployed: `pnpm run diff` / `pnpm run deploy` against whatever `main` looks +like, whenever a maintainer chooses to run it. + +## Branch protection on `main` + +Applied via `gh api repos/ForkYeahMan/Azubi_Final_Capstone/branches/main/protection`: + +- Require the `CI / validate` status check to pass before merging +- Require a pull request before merging (no direct pushes) +- Require branches to be up to date with `main` before merging + +These can be adjusted in the repo's Settings → Branches once more +contributors are involved (e.g. requiring N approving reviews). diff --git a/docs/data-model.md b/docs/data-model.md new file mode 100644 index 0000000..077fb60 --- /dev/null +++ b/docs/data-model.md @@ -0,0 +1,121 @@ +# Data Model + +Three DynamoDB tables, all on-demand (pay-per-request) billing. Single-table +design was considered and rejected for this project size — see +[decisions.md](./decisions.md#single-table-vs-multi-table-dynamodb). + +## `Events` table + +| Attribute | Type | Notes | +|---|---|---| +| `eventId` (PK) | S | `evt_` | +| `organizerId` | S | Cognito `sub` of the creating organizer | +| `organizerEmail` | S | denormalized for notification emails without a lookup | +| `title` | S | | +| `description` | S | | +| `category` | S | e.g. `WORKSHOP`, `CONFERENCE`, `SOCIAL` | +| `location` | S | free text or "Virtual" | +| `startDate` | S | ISO-8601 | +| `endDate` | S | ISO-8601 | +| `capacity` | N | max registrations, 0 = unlimited | +| `registeredCount` | N | maintained via atomic counter on registration/cancellation | +| `ticketLink` | S | organizer-provided URL (Eventbrite, Zoom, download, etc.) | +| `status` | S | `PENDING_REVIEW` \| `APPROVED` \| `REJECTED` \| `CANCELLED` | +| `rejectionReason` | S | present only when `status = REJECTED` | +| `createdAt` / `updatedAt` | S | ISO-8601 | + +**GSI1** `StatusStartDateIndex` — PK `status`, SK `startDate` +Powers the public "browse approved upcoming events" listing without a scan. + +**GSI2** `OrganizerIndex` — PK `organizerId`, SK `createdAt` +Powers "an organizer's own events across all statuses". + +## `Registrations` table + +| Attribute | Type | Notes | +|---|---|---| +| `eventId` (PK) | S | | +| `userId` (SK) | S | Cognito `sub` of the registrant — composite key also enforces "one registration per user per event" | +| `registrationId` | S | `reg_`, used as an external-facing id | +| `userEmail` | S | denormalized for confirmation email | +| `status` | S | `REGISTERED` \| `CANCELLED` | +| `ticketLink` | S | snapshot of the event's ticket link at registration time | +| `registeredAt` | S | ISO-8601 | +| `cancelledAt` | S | present only when cancelled | + +**GSI1** `UserIndex` — PK `userId`, SK `registeredAt` +Powers "a user's own registrations" (their ticket history). + +## `Users` table + +Cognito is the source of truth for credentials; this table stores profile +data outside of what's convenient to keep in Cognito attributes, and gives +Admins a fast, queryable list of accounts without paging through +`ListUsers` on the User Pool. + +| Attribute | Type | Notes | +|---|---|---| +| `userId` (PK) | S | Cognito `sub` | +| `email` | S | | +| `name` | S | | +| `role` | S | `ADMIN` \| `ORGANIZER` \| `USER` — mirrors Cognito group membership | +| `createdAt` | S | ISO-8601 | + +**GSI1** `RoleIndex` — PK `role`, SK `createdAt` +Powers Admin's "list all organizers" / "list all users" screens. + +Populated by the Cognito **Post-Confirmation Lambda trigger** at sign-up +time, so it always exists before the user makes their first API call. + +## Entity relationship + +```mermaid +erDiagram + USERS ||--o{ EVENTS : organizes + USERS ||--o{ REGISTRATIONS : registers + EVENTS ||--o{ REGISTRATIONS : "has" + + USERS { + string userId PK + string email + string name + string role + } + EVENTS { + string eventId PK + string organizerId + string title + string status + number capacity + number registeredCount + string ticketLink + } + REGISTRATIONS { + string eventId PK + string userId SK + string status + string ticketLink + string registeredAt + } +``` + +## Status lifecycles + +```mermaid +stateDiagram-v2 + [*] --> PENDING_REVIEW: Organizer creates event + PENDING_REVIEW --> APPROVED: Admin approves + PENDING_REVIEW --> REJECTED: Admin rejects (reason required) + APPROVED --> CANCELLED: Organizer or Admin cancels + REJECTED --> [*] + CANCELLED --> [*] + APPROVED --> [*] +``` + +```mermaid +stateDiagram-v2 + [*] --> REGISTERED: User registers (capacity permitting) + REGISTERED --> CANCELLED: User cancels + CANCELLED --> [*] + REGISTERED --> [*] +``` diff --git a/docs/decisions.md b/docs/decisions.md new file mode 100644 index 0000000..a32f03d --- /dev/null +++ b/docs/decisions.md @@ -0,0 +1,93 @@ +# Architecture Decision Records + +Short-form ADRs for the choices that shape the rest of the codebase. + +## IaC: AWS CDK (TypeScript) over Terraform / SAM + +Terraform is already on the machine and is a perfectly valid choice, but +CDK was picked because: (1) it's the same language as the Lambda code, so +Lambda handler types can be imported directly into stack definitions for +things like environment variable typing; (2) `pnpm install` at the repo +root sets up both app and infra tooling — no second language runtime; +(3) L2 constructs (`RestApi`/`HttpApi`, `Table`, `UserPool`, `Topic`, +`CfnBudget`) generate least-privilege IAM policies automatically via +`grantReadWriteData()`-style helpers, which is less IAM to hand-write and +get wrong than raw Terraform `aws_iam_policy` documents. + +## API Gateway: HTTP API (v2) over REST API (v1) + +The product is "a REST API" from the client's point of view — that doesn't +require API Gateway's **REST API** resource type specifically. HTTP API +gives: ~70% lower cost per request, a built-in Cognito JWT authorizer +(same job as REST API's Cognito authorizer, less config), and lower +latency. REST API's extra features (usage plans/API keys, request +validation models, WAF integration) aren't needed here. Given one of the +explicit non-functional requirements is Free-Tier cost tracking, the +cheaper option wins when both satisfy the functional need. + +## Auth: Amazon Cognito over hand-rolled JWT + +A hand-rolled Users table + bcrypt + self-signed JWT + custom authorizer +is more code to secure correctly (password storage, token signing key +rotation, refresh token revocation) for no functional gain here. Cognito +User Pool Groups map 1:1 onto the three entities in the brief +(Admin/Organizer/User), API Gateway validates its JWTs natively, and it's +inside AWS Free Tier for this project's scale (50,000 MAU). + +Admins are **not** self-service signup — only `USER` and `ORGANIZER` are +selectable at `/auth/signup`. The first Admin is created by +`scripts/seed-admin.ts`, and further Admins can only be promoted by an +existing Admin directly in Cognito/DynamoDB (no API route grants `ADMIN` — +`PATCH /admin/users/{userId}/role` explicitly rejects it). This avoids a +privilege-escalation hole where a user just signs up as `role: "ADMIN"`. + +## Notifications: SNS → Lambda → SES, not direct SNS email subscriptions + +The non-functional requirement names SNS for confirmation emails. SNS's +built-in email delivery works via **topic subscriptions**, which are +designed for a fixed, small set of subscribers who each confirm +subscription once — not for "email this specific new user who just +registered," where the recipient changes on every request and a manual +per-user confirmation click is unacceptable UX. + +The standard AWS pattern that keeps SNS in the design while still sending +real transactional email is: business Lambdas publish an event +(`EVENT_REVIEWED`, `REGISTRATION_CONFIRMED`) to an SNS topic; a single +`notificationDispatcher` Lambda subscribes to that topic and calls SES +`SendEmail` with the recipient pulled from the message payload. This keeps +publishers decoupled from delivery mechanics (swapping SES for something +else later touches one Lambda, not four), satisfies the SNS requirement, +and produces email a real recipient actually gets. + +Note: SES starts in **sandbox mode** (both sender and recipient addresses +must be verified) until AWS grants production access — expected and +acceptable for a Free-Tier / capstone deployment; documented in the infra +README's post-deploy steps. + +## DynamoDB: three tables, not single-table design + +Single-table design earns its complexity when access patterns are numerous +and cross-entity joins in one query matter for latency at scale. Here +there are two core entities (`Events`, `Registrations`) plus a support +table (`Users`) with a small, well-known set of access patterns already +covered by two GSIs each. Three plain tables keep the CDK stack, the +repository code, and any future engineer's mental model simpler, at the +cost of a couple of extra round trips for the rare cross-entity read — a +fine trade at this scale, and easy to fold into one table later if access +patterns grow. + +## Compute packaging: `NodejsFunction` (esbuild) over pre-bundled zips + +CDK's `aws-lambda-nodejs.NodejsFunction` bundles each handler with esbuild +at synth time — tree-shaken, minified, no manual `npm run build && zip` +step to forget before `cdk deploy`. Source maps are kept for readable +CloudWatch stack traces. + +## Observability: Powertools for AWS Lambda (TypeScript) + +Added on top of the stated requirement (CloudWatch Logs & Alarms) because +it's a small dependency that turns ad-hoc `console.log` into structured +JSON logs (queryable in CloudWatch Logs Insights), adds one-line X-Ray +subsegments, and emits custom EMF metrics (e.g. `RegistrationsCreated`, +`EventsApproved`) that back the CloudWatch alarms without hand-writing +`PutMetricData` calls in every handler. diff --git a/docs/security.md b/docs/security.md new file mode 100644 index 0000000..762056a --- /dev/null +++ b/docs/security.md @@ -0,0 +1,117 @@ +# API Security + +Research notes and the concrete controls applied to this system's public +REST API, organized by pattern. + +## Threat model, briefly + +The API is public (any client can reach `GET /events`, and `/auth/*` must +accept unauthenticated traffic by definition). The realistic risks for a +system like this are: credential stuffing / signup spam against `/auth/*`, +casual scraping/volumetric abuse of public read endpoints, privilege +escalation (a User calling an Admin/Organizer-only action), injected +content surfacing in emails or client UIs, and an over-permissioned Lambda +turning one bug into a wider blast radius. Each is addressed below. + +## Authentication & authorization + +- **Amazon Cognito JWT authorizer** on every non-public route + (`api-stack.ts`) — API Gateway validates the token's signature, + expiry, and audience before the Lambda ever runs; a request with no + token or a tampered one never reaches application code. +- **Defense in depth on top of the authorizer**: each handler still calls + `requireRole(ctx, ...)` (`lib/auth-context.ts`) and, where relevant, the + service layer checks resource ownership (`event.organizerId === ctx.userId`). + A route wired to the wrong authorizer scope isn't the only thing + standing between a User and an Admin action. +- **No self-service path to ADMIN.** `/auth/signup` only accepts `USER` or + `ORGANIZER`; `PATCH /admin/users/{userId}/role` explicitly rejects + `ADMIN` as a target value. See + [decisions.md](./decisions.md#auth-amazon-cognito-over-hand-rolled-jwt). + +## Input validation & sanitization + +- **Every request body and query string is parsed through a Zod schema** + (`lib/validation.ts`) before touching business logic — unknown/malformed + input never reaches a service or repository. DynamoDB calls always use + `ExpressionAttributeValues` (parameterized), never string-concatenated + user input, so injection into a Dynamo expression isn't possible. +- **HTML-escaping in outbound email** (`lib/html.ts`, used by + `services/email-templates.ts`): event titles and rejection reasons are + organizer/admin-supplied free text that ends up embedded in HTML emails + sent to other users. Without escaping, a title like + `` would be injected verbatim into a Registration + or Rejection email. Covered by + `tests/unit/services/email-templates.test.ts`. + +## Rate limiting / throttling + +HTTP API's built-in throttling is configured per stage and per route in +`api-stack.ts`: + +- A **baseline of 50 req/s (burst 100)** applies to the whole API — + enough for normal use, low enough to blunt casual scraping of the + public `GET /events` / `GET /events/{eventId}` endpoints. +- **`/auth/*` routes are throttled to 5 req/s (burst 10)** specifically — + tighter, because these are the highest-value target for credential + stuffing, automated signup spam, and password-reset-code enumeration. + +This is a cheap, no-extra-infrastructure mitigation. **AWS WAF** (rate-based +rules, managed rule groups for known bad actors) was considered and is the +natural next step for a production deployment, but was left out here to +stay inside Free Tier — WAF Web ACLs and rules carry an hourly charge that +API Gateway throttling doesn't. + +## Least-privilege IAM + +Every Lambda gets exactly the permissions its route needs, computed per +route in `api-stack.ts`'s `applyGrants()` — nothing is attached at a +shared/stack level: + +- **DynamoDB**: `grantReadData` / `grantWriteData` / `grantReadWriteData` + scoped to the specific table(s) a handler touches, driven by the + `tables` field on each `RouteDefinition`. `GET /events` never gets + write access to the Events table; `POST /events/{eventId}/register` + gets read+write on Events (to adjust `registeredCount`) but only write + on Registrations (it never needs to read one back). +- **SNS**: `notificationsTopic.grantPublish(fn)` only for the three routes + that actually publish (`register`, `cancel-registration`, + `admin/review-event`). +- **Cognito**: each `/auth/*` Lambda gets exactly one `cognito-idp:*` + action (e.g. `login.ts` gets only `InitiateAuth`, not `SignUp` or + `AdminCreateUser`), scoped to this specific User Pool's ARN — not `*`. +- **SES**: the notification dispatcher's `ses:SendEmail` is scoped to + `arn:aws:ses:::identity/*`, not all resources. +- **Cross-stack**: the post-confirmation trigger's + `cognito-idp:AdminAddUserToGroup` grant is scoped to + `userPool.userPoolArn`, not every pool in the account. + +CDK's L2 `grant*()` helpers generate the underlying least-privilege IAM +policy automatically (resource ARN + minimal action list) — see +[decisions.md](./decisions.md#iac-aws-cdk-typescript-over-terraform--sam) +for why that was a factor in choosing CDK over hand-written Terraform IAM +documents. + +## Transport & response hygiene + +- API Gateway (HTTP API) is **HTTPS-only** by default — there is no HTTP + listener to disable. +- CORS is currently `allowOrigins: ['*']` (`api-stack.ts`) since no + frontend origin exists yet — **tighten this to the actual frontend + origin(s) once the frontend is built**, tracked as a follow-up. +- Error responses are a fixed `{ error: { code, message } }` shape + (`lib/http.ts`) built from typed `ApiError` subclasses — internal + details (stack traces, AWS SDK error internals) are logged to + CloudWatch via Powertools but never returned to the client. Unhandled + exceptions always map to a generic `500 INTERNAL_ERROR`. + +## What's monitored (see also [architecture.md](./architecture.md)) + +- CloudWatch alarm on **API error rate ≥ 5%** over a 5-minute window + (`monitoring-stack.ts`, `MathExpression` over custom `ApiErrors`/ + `ApiRequests` EMF metrics) — catches slow-burn failures a raw error + count threshold misses. +- Per-Lambda error-count alarms, DynamoDB throttle alarms, and a + `FailedRegistrations` custom metric (capacity conflicts, duplicate + registration, registering for a non-approved/past event) all feed the + same ops SNS topic. diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..fa997b6 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,9 @@ +# Frontend + +Not started — design and framework choice are pending further instructions +from the project owner. + +Once work starts, it will consume the REST API documented in +[../docs/api.md](../docs/api.md) — a Cognito-authenticated client is +enough to build against (User Pool ID / App Client ID are CDK outputs from +`EventTicketing--Auth` after deploying `infrastructure/`). diff --git a/infrastructure/README.md b/infrastructure/README.md new file mode 100644 index 0000000..b0af650 --- /dev/null +++ b/infrastructure/README.md @@ -0,0 +1,59 @@ +# Infrastructure + +AWS CDK (TypeScript) app that provisions the entire system. Six stacks, +deployed together, each owning one concern: + +| Stack | Provisions | +|---|---| +| `Database` | 3 DynamoDB tables (Events, Registrations, Users) with GSIs, on-demand billing, PITR | +| `Auth` | Cognito User Pool, app client, ADMIN/ORGANIZER/USER groups, post-confirmation trigger | +| `Notifications` | SNS topic, SES sender identity, the SNS→SES dispatcher Lambda | +| `Api` | HTTP API (v2), Cognito JWT authorizer, one Lambda per route (18 handlers) | +| `Monitoring` | CloudWatch alarms (Lambda errors, API 5xx, DynamoDB throttles) + dashboard, ops SNS topic with email subscription | +| `Budget` | AWS Budgets monthly cost alert (80% actual / 100% forecasted) | + +Stack dependency order: `Database` → `Auth` → `Notifications` → `Api` → +`Monitoring`; `Budget` is independent. `bin/app.ts` wires these together +and is the only place that constructs them. + +## Commands + +```bash +pnpm run synth # cdk synth — validate + emit CloudFormation +pnpm run diff # cdk diff against the deployed stacks +pnpm run deploy # cdk deploy --all +pnpm run destroy # cdk destroy --all +pnpm run bootstrap # cdk bootstrap (once per account/region) +``` + +All context (`stage`, `alertEmail`, `monthlyBudgetUsd`) is read in +`lib/config/environment.ts` via `-c key=value` flags — see the root +README for the full deploy walkthrough. + +## Design notes worth knowing before editing a stack + +- **Lambda packaging**: every handler is built through + `buildNodejsFunction()` in `lib/constructs/api-lambda.ts` — one place + controls runtime (Node 22, arm64), bundling (esbuild via + `NodejsFunction`), tracing (X-Ray `ACTIVE`), and log retention. Add a new + route by adding one entry to the `routes` array in `lib/stacks/api-stack.ts`, + not by hand-rolling a new `NodejsFunction`. +- **HTTP API L2 constructs** (`HttpApi`, `HttpJwtAuthorizer`, + `HttpLambdaIntegration`) live in `aws-cdk-lib/aws-apigatewayv2`, + `aws-apigatewayv2-authorizers`, and `aws-apigatewayv2-integrations` — + these graduated out of the old `@aws-cdk/aws-apigatewayv2-alpha` family + (discontinued after `2.114.1-alpha.0`) into stable `aws-cdk-lib`, so no + separate alpha package is needed. +- **Cognito group names must equal the backend's `Role` enum values** + (`ADMIN`, `ORGANIZER`, `USER`) — `AuthStack` names its three groups + exactly that, because `getAuthContext()`/`requireRole()` in the backend + filter the `cognito:groups` JWT claim against those exact strings. +- **The post-confirmation trigger avoids a circular CFN dependency** by + reading `userPoolId` off the trigger event instead of an environment + variable built from `userPool.userPoolId` — see the comment in + `backend/src/handlers/auth/post-confirmation-trigger.ts` for why the + obvious approach doesn't deploy. +- **SES sandbox**: `NotificationsStack` provisions the sender identity via + `EmailIdentity`, but AWS still requires clicking a verification email and + (while in sandbox) verifying recipient addresses too — see the root + README's post-deploy steps. diff --git a/infrastructure/bin/app.ts b/infrastructure/bin/app.ts new file mode 100644 index 0000000..0cdec56 --- /dev/null +++ b/infrastructure/bin/app.ts @@ -0,0 +1,58 @@ +#!/usr/bin/env node +import 'source-map-support/register'; +import { App, Tags } from 'aws-cdk-lib'; +import { getStageConfig } from '../lib/config/environment'; +import { DatabaseStack } from '../lib/stacks/database-stack'; +import { AuthStack } from '../lib/stacks/auth-stack'; +import { NotificationsStack } from '../lib/stacks/notifications-stack'; +import { ApiStack } from '../lib/stacks/api-stack'; +import { MonitoringStack } from '../lib/stacks/monitoring-stack'; +import { BudgetStack } from '../lib/stacks/budget-stack'; + +const app = new App(); +const config = getStageConfig(app); + +const env = { + account: process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_DEFAULT_REGION ?? 'us-east-1', +}; + +const prefix = `EventTicketing-${config.stageName}`; + +const database = new DatabaseStack(app, `${prefix}-Database`, { env, config }); + +const auth = new AuthStack(app, `${prefix}-Auth`, { + env, + config, + usersTable: database.usersTable, +}); + +const notifications = new NotificationsStack(app, `${prefix}-Notifications`, { env, config }); + +const api = new ApiStack(app, `${prefix}-Api`, { + env, + config, + eventsTable: database.eventsTable, + registrationsTable: database.registrationsTable, + usersTable: database.usersTable, + userPool: auth.userPool, + userPoolClient: auth.userPoolClient, + notificationsTopic: notifications.topic, +}); + +new MonitoringStack(app, `${prefix}-Monitoring`, { + env, + config, + httpApi: api.httpApi, + functions: api.functions, + eventsTable: database.eventsTable, + registrationsTable: database.registrationsTable, + usersTable: database.usersTable, +}); + +new BudgetStack(app, `${prefix}-Budget`, { env, config }); + +// Cost-allocation tag every stack shares — BudgetStack's cost filter +// matches on this so the monthly budget only tracks this project's spend. +Tags.of(app).add('Project', 'event-ticketing'); +Tags.of(app).add('Stage', config.stageName); diff --git a/infrastructure/cdk.json b/infrastructure/cdk.json new file mode 100644 index 0000000..05ff21d --- /dev/null +++ b/infrastructure/cdk.json @@ -0,0 +1,37 @@ +{ + "app": "npx ts-node --prefer-ts-exts bin/app.ts", + "watch": { + "include": ["**"], + "exclude": [ + "README.md", + "cdk*.json", + "**/*.d.ts", + "**/*.js", + "tsconfig.json", + "package*.json", + "node_modules", + "test" + ] + }, + "context": { + "@aws-cdk/aws-lambda:recognizeLayerVersion": true, + "@aws-cdk/core:checkSecretUsage": true, + "@aws-cdk/core:target-partitions": ["aws", "aws-cn"], + "@aws-cdk/aws-iam:minimizePolicies": true, + "@aws-cdk/aws-apigateway:disableCloudWatchRole": false, + "@aws-cdk/core:enablePartitionLiterals": true, + "@aws-cdk/aws-lambda:recognizeVersionProps": true, + "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true, + "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true, + "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true, + "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true, + "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true, + "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true, + "@aws-cdk/aws-dynamodb:resourcePolicyPerReplica": true, + "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true, + "@aws-cdk/aws-iam:standardizedServicePrincipals": true, + "@aws-cdk/aws-lambda:automaticAsyncRetryConfiguration": true, + "@aws-cdk/aws-redshift:columnId": true, + "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true + } +} diff --git a/infrastructure/lib/config/environment.ts b/infrastructure/lib/config/environment.ts new file mode 100644 index 0000000..64e8df0 --- /dev/null +++ b/infrastructure/lib/config/environment.ts @@ -0,0 +1,28 @@ +export interface StageConfig { + /** Short name used to prefix/tag every resource, e.g. "dev", "prod". */ + stageName: string; + /** Email address that receives Budget alerts, CloudWatch alarm notifications, and is the SES sender identity. */ + alertEmail: string; + /** Monthly AWS spend threshold (USD) that triggers Budget alerts. Kept small to stay inside Free Tier during development. */ + monthlyBudgetUsd: number; + /** Whether to enable X-Ray tracing and Powertools verbose logging. */ + verboseObservability: boolean; +} + +/** + * Reads stage configuration from CDK context (`-c stage=prod -c alertEmail=...`) + * with sensible defaults for local/dev use so `cdk synth` works out of the + * box without extra flags. + */ +export function getStageConfig(app: { node: { tryGetContext(key: string): unknown } }): StageConfig { + const stageName = (app.node.tryGetContext('stage') as string) ?? 'dev'; + const alertEmail = (app.node.tryGetContext('alertEmail') as string) ?? 'ezeamartey777@gmail.com'; + const monthlyBudgetUsd = Number(app.node.tryGetContext('monthlyBudgetUsd') ?? 10); + + return { + stageName, + alertEmail, + monthlyBudgetUsd, + verboseObservability: stageName !== 'prod', + }; +} diff --git a/infrastructure/lib/constructs/api-lambda.ts b/infrastructure/lib/constructs/api-lambda.ts new file mode 100644 index 0000000..4ff3493 --- /dev/null +++ b/infrastructure/lib/constructs/api-lambda.ts @@ -0,0 +1,53 @@ +import * as path from 'path'; +import { Duration } from 'aws-cdk-lib'; +import { Architecture, Runtime, Tracing } from 'aws-cdk-lib/aws-lambda'; +import { NodejsFunction, OutputFormat } from 'aws-cdk-lib/aws-lambda-nodejs'; +import { RetentionDays } from 'aws-cdk-lib/aws-logs'; +import { Construct } from 'constructs'; + +const HANDLERS_ROOT = path.resolve(__dirname, '../../../backend/src/handlers'); + +export interface BuildNodejsFunctionOptions { + /** Path to the handler file, relative to backend/src/handlers, e.g. "events/create-event.ts". */ + entry: string; + environment?: Record; + timeout?: Duration; + memorySize?: number; + description?: string; +} + +/** + * Every Lambda in this system is built the same way: Node 22 on arm64 + * (cheapest price/performance point covered by Free Tier — Node 20 was + * deprecated 2026-04-30, so this targets the current LTS runtime), + * esbuild bundling via NodejsFunction, X-Ray tracing on, and a 2-week log + * retention so CloudWatch Logs doesn't accumulate indefinitely. + */ +export function buildNodejsFunction( + scope: Construct, + id: string, + options: BuildNodejsFunctionOptions, +): NodejsFunction { + return new NodejsFunction(scope, id, { + entry: path.join(HANDLERS_ROOT, options.entry), + handler: 'handler', + runtime: Runtime.NODEJS_22_X, + architecture: Architecture.ARM_64, + memorySize: options.memorySize ?? 256, + timeout: options.timeout ?? Duration.seconds(10), + tracing: Tracing.ACTIVE, + logRetention: RetentionDays.TWO_WEEKS, + description: options.description, + bundling: { + minify: true, + sourceMap: true, + target: 'node22', + format: OutputFormat.CJS, + }, + environment: { + POWERTOOLS_SERVICE_NAME: 'event-ticketing', + NODE_OPTIONS: '--enable-source-maps', + ...options.environment, + }, + }); +} diff --git a/infrastructure/lib/stacks/api-stack.ts b/infrastructure/lib/stacks/api-stack.ts new file mode 100644 index 0000000..5f8e7e1 --- /dev/null +++ b/infrastructure/lib/stacks/api-stack.ts @@ -0,0 +1,183 @@ +import { CfnOutput, Duration, Stack, StackProps } from 'aws-cdk-lib'; +import { Table } from 'aws-cdk-lib/aws-dynamodb'; +import { UserPool, UserPoolClient } from 'aws-cdk-lib/aws-cognito'; +import { PolicyStatement } from 'aws-cdk-lib/aws-iam'; +import { CfnStage, CorsHttpMethod, HttpApi, HttpMethod, HttpStage } from 'aws-cdk-lib/aws-apigatewayv2'; +import { HttpJwtAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2-authorizers'; +import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations'; +import { Topic } from 'aws-cdk-lib/aws-sns'; +import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs'; +import { Construct } from 'constructs'; +import { StageConfig } from '../config/environment'; +import { buildNodejsFunction } from '../constructs/api-lambda'; + +export interface ApiStackProps extends StackProps { + config: StageConfig; + eventsTable: Table; + registrationsTable: Table; + usersTable: Table; + userPool: UserPool; + userPoolClient: UserPoolClient; + notificationsTopic: Topic; +} + +type TableAccess = 'read' | 'write' | 'readwrite'; + +interface RouteDefinition { + method: HttpMethod; + path: string; + entry: string; + id: string; + authenticated: boolean; + tables?: Partial>; + publishesNotifications?: boolean; + cognitoActions?: string[]; +} + +export class ApiStack extends Stack { + public readonly httpApi: HttpApi; + public readonly functions: Record = {}; + + constructor(scope: Construct, id: string, props: ApiStackProps) { + super(scope, id, props); + + this.httpApi = new HttpApi(this, 'HttpApi', { + apiName: `event-ticketing-${props.config.stageName}`, + description: 'Event Registration & Ticketing System REST API', + // Default stage is created explicitly below (not via + // createDefaultStage) so it can carry throttle settings — an + // unauthenticated-endpoint abuse control (see HttpStage below). + createDefaultStage: false, + corsPreflight: { + allowHeaders: ['Content-Type', 'Authorization'], + allowMethods: [ + CorsHttpMethod.GET, + CorsHttpMethod.POST, + CorsHttpMethod.PUT, + CorsHttpMethod.PATCH, + CorsHttpMethod.DELETE, + CorsHttpMethod.OPTIONS, + ], + allowOrigins: ['*'], + maxAge: Duration.days(1), + }, + }); + + // Baseline throttle protects every public/unauthenticated route from + // simple volumetric abuse; the six /auth/* routes get a much tighter + // limit since they're the highest-value target for credential + // stuffing, signup spam, and password-reset enumeration. + const defaultStage = new HttpStage(this, 'DefaultStage', { + httpApi: this.httpApi, + stageName: '$default', + autoDeploy: true, + throttle: { rateLimit: 50, burstLimit: 100 }, + }); + + // Per-route throttle overrides aren't exposed on the HttpStage L2 + // (only the stage-wide `throttle` default is), so this drops to the + // L1 `RouteSettings` CFN property directly. Keep these keys in sync + // with the `/auth/*` entries in the `routes` array below. + const AUTH_ROUTE_THROTTLE = { ThrottlingRateLimit: 5, ThrottlingBurstLimit: 10 }; + (defaultStage.node.defaultChild as CfnStage).addPropertyOverride('RouteSettings', { + 'POST /auth/signup': AUTH_ROUTE_THROTTLE, + 'POST /auth/confirm-signup': AUTH_ROUTE_THROTTLE, + 'POST /auth/login': AUTH_ROUTE_THROTTLE, + 'POST /auth/refresh': AUTH_ROUTE_THROTTLE, + 'POST /auth/forgot-password': AUTH_ROUTE_THROTTLE, + 'POST /auth/reset-password': AUTH_ROUTE_THROTTLE, + }); + + const authorizer = new HttpJwtAuthorizer('CognitoAuthorizer', props.userPool.userPoolProviderUrl, { + jwtAudience: [props.userPoolClient.userPoolClientId], + identitySource: ['$request.header.Authorization'], + }); + + const commonEnv = { + EVENTS_TABLE_NAME: props.eventsTable.tableName, + REGISTRATIONS_TABLE_NAME: props.registrationsTable.tableName, + USERS_TABLE_NAME: props.usersTable.tableName, + USER_POOL_ID: props.userPool.userPoolId, + USER_POOL_CLIENT_ID: props.userPoolClient.userPoolClientId, + NOTIFICATIONS_TOPIC_ARN: props.notificationsTopic.topicArn, + }; + + const routes: RouteDefinition[] = [ + // --- Auth (public) --- + { id: 'Signup', method: HttpMethod.POST, path: '/auth/signup', entry: 'auth/signup.ts', authenticated: false, cognitoActions: ['cognito-idp:SignUp'] }, + { id: 'ConfirmSignup', method: HttpMethod.POST, path: '/auth/confirm-signup', entry: 'auth/confirm-signup.ts', authenticated: false, cognitoActions: ['cognito-idp:ConfirmSignUp'] }, + { id: 'Login', method: HttpMethod.POST, path: '/auth/login', entry: 'auth/login.ts', authenticated: false, cognitoActions: ['cognito-idp:InitiateAuth'] }, + { id: 'Refresh', method: HttpMethod.POST, path: '/auth/refresh', entry: 'auth/refresh.ts', authenticated: false, cognitoActions: ['cognito-idp:InitiateAuth'] }, + { id: 'ForgotPassword', method: HttpMethod.POST, path: '/auth/forgot-password', entry: 'auth/forgot-password.ts', authenticated: false, cognitoActions: ['cognito-idp:ForgotPassword'] }, + { id: 'ResetPassword', method: HttpMethod.POST, path: '/auth/reset-password', entry: 'auth/reset-password.ts', authenticated: false, cognitoActions: ['cognito-idp:ConfirmForgotPassword'] }, + + // --- Events (public reads) --- + { id: 'ListEvents', method: HttpMethod.GET, path: '/events', entry: 'events/list-events.ts', authenticated: false, tables: { events: 'read' } }, + { id: 'GetEvent', method: HttpMethod.GET, path: '/events/{eventId}', entry: 'events/get-event.ts', authenticated: false, tables: { events: 'read' } }, + + // --- Events (authenticated) --- + { id: 'CreateEvent', method: HttpMethod.POST, path: '/events', entry: 'events/create-event.ts', authenticated: true, tables: { events: 'write' } }, + { id: 'UpdateEvent', method: HttpMethod.PUT, path: '/events/{eventId}', entry: 'events/update-event.ts', authenticated: true, tables: { events: 'readwrite' } }, + { id: 'CancelEvent', method: HttpMethod.DELETE, path: '/events/{eventId}', entry: 'events/cancel-event.ts', authenticated: true, tables: { events: 'readwrite' } }, + { id: 'ListMyEvents', method: HttpMethod.GET, path: '/organizers/me/events', entry: 'events/list-my-events.ts', authenticated: true, tables: { events: 'read' } }, + + // --- Registrations & ticketing --- + { id: 'RegisterForEvent', method: HttpMethod.POST, path: '/events/{eventId}/register', entry: 'registrations/register.ts', authenticated: true, tables: { events: 'readwrite', registrations: 'write' }, publishesNotifications: true }, + { id: 'CancelRegistration', method: HttpMethod.DELETE, path: '/events/{eventId}/register', entry: 'registrations/cancel-registration.ts', authenticated: true, tables: { events: 'readwrite', registrations: 'write' }, publishesNotifications: true }, + { id: 'ListMyRegistrations', method: HttpMethod.GET, path: '/users/me/registrations', entry: 'registrations/list-my-registrations.ts', authenticated: true, tables: { registrations: 'read' } }, + { id: 'ListEventRegistrations', method: HttpMethod.GET, path: '/events/{eventId}/registrations', entry: 'registrations/list-event-registrations.ts', authenticated: true, tables: { events: 'read', registrations: 'read' } }, + + // --- Admin --- + { id: 'AdminListEvents', method: HttpMethod.GET, path: '/admin/events', entry: 'admin/list-events.ts', authenticated: true, tables: { events: 'read' } }, + { id: 'AdminReviewEvent', method: HttpMethod.POST, path: '/admin/events/{eventId}/review', entry: 'admin/review-event.ts', authenticated: true, tables: { events: 'readwrite' }, publishesNotifications: true }, + { id: 'AdminListUsers', method: HttpMethod.GET, path: '/admin/users', entry: 'admin/list-users.ts', authenticated: true, tables: { users: 'read' } }, + { id: 'AdminUpdateUserRole', method: HttpMethod.PATCH, path: '/admin/users/{userId}/role', entry: 'admin/update-user-role.ts', authenticated: true, tables: { users: 'write' } }, + ]; + + for (const route of routes) { + const fn = buildNodejsFunction(this, `${route.id}Fn`, { + entry: route.entry, + environment: commonEnv, + }); + + this.applyGrants(fn, route, props); + this.functions[route.id] = fn; + + this.httpApi.addRoutes({ + path: route.path, + methods: [route.method], + integration: new HttpLambdaIntegration(`${route.id}Integration`, fn), + authorizer: route.authenticated ? authorizer : undefined, + }); + } + + new CfnOutput(this, 'ApiUrl', { value: this.httpApi.apiEndpoint }); + new CfnOutput(this, 'UserPoolId', { value: props.userPool.userPoolId }); + new CfnOutput(this, 'UserPoolClientId', { value: props.userPoolClient.userPoolClientId }); + } + + private applyGrants(fn: NodejsFunction, route: RouteDefinition, props: ApiStackProps): void { + const grant = (table: Table, access: TableAccess) => { + if (access === 'read') table.grantReadData(fn); + else if (access === 'write') table.grantWriteData(fn); + else table.grantReadWriteData(fn); + }; + + if (route.tables?.events) grant(props.eventsTable, route.tables.events); + if (route.tables?.registrations) grant(props.registrationsTable, route.tables.registrations); + if (route.tables?.users) grant(props.usersTable, route.tables.users); + + if (route.publishesNotifications) { + props.notificationsTopic.grantPublish(fn); + } + + if (route.cognitoActions?.length) { + fn.addToRolePolicy( + new PolicyStatement({ + actions: route.cognitoActions, + resources: [props.userPool.userPoolArn], + }), + ); + } + } +} diff --git a/infrastructure/lib/stacks/auth-stack.ts b/infrastructure/lib/stacks/auth-stack.ts new file mode 100644 index 0000000..e4feb53 --- /dev/null +++ b/infrastructure/lib/stacks/auth-stack.ts @@ -0,0 +1,102 @@ +import { Duration, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib'; +import { Table } from 'aws-cdk-lib/aws-dynamodb'; +import { + AccountRecovery, + OAuthScope, + StringAttribute, + UserPool, + UserPoolClient, + UserPoolEmail, + UserPoolOperation, + VerificationEmailStyle, +} from 'aws-cdk-lib/aws-cognito'; +import { PolicyStatement } from 'aws-cdk-lib/aws-iam'; +import { Construct } from 'constructs'; +import { StageConfig } from '../config/environment'; +import { buildNodejsFunction } from '../constructs/api-lambda'; + +export interface AuthStackProps extends StackProps { + config: StageConfig; + usersTable: Table; +} + +/** + * Cognito is the identity provider for all three entities in the brief + * (Admin, Event Organizer, User). Groups double as the authorization + * mechanism: API Gateway's JWT authorizer surfaces group membership on the + * `cognito:groups` claim, which `getAuthContext`/`requireRole` in the + * backend read directly — no separate roles table to keep in sync. + */ +export class AuthStack extends Stack { + public readonly userPool: UserPool; + public readonly userPoolClient: UserPoolClient; + + constructor(scope: Construct, id: string, props: AuthStackProps) { + super(scope, id, props); + + this.userPool = new UserPool(this, 'UserPool', { + userPoolName: `event-ticketing-${props.config.stageName}`, + selfSignUpEnabled: true, + signInAliases: { email: true }, + autoVerify: { email: true }, + standardAttributes: { + email: { required: true, mutable: true }, + fullname: { required: false, mutable: true }, + }, + customAttributes: { + role: new StringAttribute({ minLen: 3, maxLen: 20, mutable: false }), + }, + passwordPolicy: { + minLength: 8, + requireLowercase: true, + requireUppercase: true, + requireDigits: true, + requireSymbols: false, + }, + accountRecovery: AccountRecovery.EMAIL_ONLY, + userVerification: { + emailStyle: VerificationEmailStyle.CODE, + emailSubject: 'Verify your Event Ticketing account', + }, + email: UserPoolEmail.withCognito(), + removalPolicy: props.config.stageName === 'prod' ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY, + }); + + this.userPoolClient = this.userPool.addClient('WebClient', { + userPoolClientName: `event-ticketing-${props.config.stageName}-web`, + authFlows: { userPassword: true, userSrp: true }, + generateSecret: false, + oAuth: { flows: { authorizationCodeGrant: true }, scopes: [OAuthScope.OPENID, OAuthScope.EMAIL] }, + accessTokenValidity: Duration.hours(1), + idTokenValidity: Duration.hours(1), + refreshTokenValidity: Duration.days(30), + preventUserExistenceErrors: true, + }); + + // Group names are exactly the backend's Role enum values — see the + // note in handlers/auth/post-confirmation-trigger.ts. + ['ADMIN', 'ORGANIZER', 'USER'].forEach((groupName, index) => { + this.userPool.addGroup(`${groupName}Group`, { + groupName, + description: `${groupName} — provisioned by AuthStack`, + precedence: index, + }); + }); + + const postConfirmationFn = buildNodejsFunction(this, 'PostConfirmationTrigger', { + entry: 'auth/post-confirmation-trigger.ts', + environment: { + USERS_TABLE_NAME: props.usersTable.tableName, + }, + }); + props.usersTable.grantWriteData(postConfirmationFn); + postConfirmationFn.addToRolePolicy( + new PolicyStatement({ + actions: ['cognito-idp:AdminAddUserToGroup'], + resources: [this.userPool.userPoolArn], + }), + ); + + this.userPool.addTrigger(UserPoolOperation.POST_CONFIRMATION, postConfirmationFn); + } +} diff --git a/infrastructure/lib/stacks/budget-stack.ts b/infrastructure/lib/stacks/budget-stack.ts new file mode 100644 index 0000000..945e1dc --- /dev/null +++ b/infrastructure/lib/stacks/budget-stack.ts @@ -0,0 +1,61 @@ +import { Stack, StackProps } from 'aws-cdk-lib'; +import { CfnBudget } from 'aws-cdk-lib/aws-budgets'; +import { Construct } from 'constructs'; +import { StageConfig } from '../config/environment'; + +export interface BudgetStackProps extends StackProps { + config: StageConfig; +} + +/** + * The non-functional requirement is explicit: track cost against the Free + * Tier. A CfnBudget with two notification thresholds (80% actual, 100% + * forecasted) emails the operator before spend becomes a surprise — no + * Lambda/DynamoDB/API Gateway usage here should come close to this + * threshold at demo/dev traffic levels, so a breach is a real signal + * something (e.g. a runaway retry loop) needs attention. + */ +export class BudgetStack extends Stack { + constructor(scope: Construct, id: string, props: BudgetStackProps) { + super(scope, id, props); + + new CfnBudget(this, 'MonthlySpendBudget', { + budget: { + budgetName: `event-ticketing-${props.config.stageName}-monthly`, + budgetType: 'COST', + timeUnit: 'MONTHLY', + budgetLimit: { + amount: props.config.monthlyBudgetUsd, + unit: 'USD', + }, + // Matches the `Project` tag applied to every stack in bin/app.ts — + // scopes the budget to this system's resources rather than the + // whole AWS account, so unrelated spend elsewhere in the account + // doesn't trip (or mask) this alert. + costFilters: { + TagKeyValue: ['user:Project$event-ticketing'], + }, + }, + notificationsWithSubscribers: [ + { + notification: { + notificationType: 'ACTUAL', + comparisonOperator: 'GREATER_THAN', + threshold: 80, + thresholdType: 'PERCENTAGE', + }, + subscribers: [{ subscriptionType: 'EMAIL', address: props.config.alertEmail }], + }, + { + notification: { + notificationType: 'FORECASTED', + comparisonOperator: 'GREATER_THAN', + threshold: 100, + thresholdType: 'PERCENTAGE', + }, + subscribers: [{ subscriptionType: 'EMAIL', address: props.config.alertEmail }], + }, + ], + }); + } +} diff --git a/infrastructure/lib/stacks/database-stack.ts b/infrastructure/lib/stacks/database-stack.ts new file mode 100644 index 0000000..47350f3 --- /dev/null +++ b/infrastructure/lib/stacks/database-stack.ts @@ -0,0 +1,76 @@ +import { RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib'; +import { AttributeType, BillingMode, ProjectionType, Table, TableEncryption } from 'aws-cdk-lib/aws-dynamodb'; +import { Construct } from 'constructs'; +import { StageConfig } from '../config/environment'; + +export interface DatabaseStackProps extends StackProps { + config: StageConfig; +} + +export class DatabaseStack extends Stack { + public readonly eventsTable: Table; + public readonly registrationsTable: Table; + public readonly usersTable: Table; + + constructor(scope: Construct, id: string, props: DatabaseStackProps) { + super(scope, id, props); + + const removalPolicy = props.config.stageName === 'prod' ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY; + + this.eventsTable = new Table(this, 'EventsTable', { + tableName: `event-ticketing-${props.config.stageName}-events`, + partitionKey: { name: 'eventId', type: AttributeType.STRING }, + billingMode: BillingMode.PAY_PER_REQUEST, + encryption: TableEncryption.AWS_MANAGED, + pointInTimeRecoverySpecification: { pointInTimeRecoveryEnabled: true }, + removalPolicy, + }); + + this.eventsTable.addGlobalSecondaryIndex({ + indexName: 'StatusStartDateIndex', + partitionKey: { name: 'status', type: AttributeType.STRING }, + sortKey: { name: 'startDate', type: AttributeType.STRING }, + projectionType: ProjectionType.ALL, + }); + + this.eventsTable.addGlobalSecondaryIndex({ + indexName: 'OrganizerIndex', + partitionKey: { name: 'organizerId', type: AttributeType.STRING }, + sortKey: { name: 'createdAt', type: AttributeType.STRING }, + projectionType: ProjectionType.ALL, + }); + + this.registrationsTable = new Table(this, 'RegistrationsTable', { + tableName: `event-ticketing-${props.config.stageName}-registrations`, + partitionKey: { name: 'eventId', type: AttributeType.STRING }, + sortKey: { name: 'userId', type: AttributeType.STRING }, + billingMode: BillingMode.PAY_PER_REQUEST, + encryption: TableEncryption.AWS_MANAGED, + pointInTimeRecoverySpecification: { pointInTimeRecoveryEnabled: true }, + removalPolicy, + }); + + this.registrationsTable.addGlobalSecondaryIndex({ + indexName: 'UserIndex', + partitionKey: { name: 'userId', type: AttributeType.STRING }, + sortKey: { name: 'registeredAt', type: AttributeType.STRING }, + projectionType: ProjectionType.ALL, + }); + + this.usersTable = new Table(this, 'UsersTable', { + tableName: `event-ticketing-${props.config.stageName}-users`, + partitionKey: { name: 'userId', type: AttributeType.STRING }, + billingMode: BillingMode.PAY_PER_REQUEST, + encryption: TableEncryption.AWS_MANAGED, + pointInTimeRecoverySpecification: { pointInTimeRecoveryEnabled: true }, + removalPolicy, + }); + + this.usersTable.addGlobalSecondaryIndex({ + indexName: 'RoleIndex', + partitionKey: { name: 'role', type: AttributeType.STRING }, + sortKey: { name: 'createdAt', type: AttributeType.STRING }, + projectionType: ProjectionType.ALL, + }); + } +} diff --git a/infrastructure/lib/stacks/monitoring-stack.ts b/infrastructure/lib/stacks/monitoring-stack.ts new file mode 100644 index 0000000..326282e --- /dev/null +++ b/infrastructure/lib/stacks/monitoring-stack.ts @@ -0,0 +1,225 @@ +import { Duration, Stack, StackProps } from 'aws-cdk-lib'; +import { Table } from 'aws-cdk-lib/aws-dynamodb'; +import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs'; +import { + Alarm, + ComparisonOperator, + Dashboard, + GraphWidget, + MathExpression, + Metric, + TextWidget, + TreatMissingData, +} from 'aws-cdk-lib/aws-cloudwatch'; +import { SnsAction } from 'aws-cdk-lib/aws-cloudwatch-actions'; +import { Alias } from 'aws-cdk-lib/aws-kms'; +import { Topic } from 'aws-cdk-lib/aws-sns'; +import { EmailSubscription } from 'aws-cdk-lib/aws-sns-subscriptions'; +import { HttpApi } from 'aws-cdk-lib/aws-apigatewayv2'; +import { Construct } from 'constructs'; +import { StageConfig } from '../config/environment'; + +export interface MonitoringStackProps extends StackProps { + config: StageConfig; + httpApi: HttpApi; + functions: Record; + eventsTable: Table; + registrationsTable: Table; + usersTable: Table; +} + +/** + * The non-functional requirement calls for CloudWatch Logs & Alarms. + * Structured logs already land in CloudWatch automatically (Lambda's + * default behavior plus Powertools' JSON formatting); this stack adds the + * "someone gets paged" half — alarms wired to a dedicated ops SNS topic + * with the operator's email subscribed, plus a dashboard for at-a-glance + * health during a demo or a live event. + */ +export class MonitoringStack extends Stack { + constructor(scope: Construct, id: string, props: MonitoringStackProps) { + super(scope, id, props); + + const opsTopic = new Topic(this, 'OpsAlarmTopic', { + topicName: `event-ticketing-${props.config.stageName}-ops-alarms`, + displayName: 'Event Ticketing Ops Alarms', + masterKey: Alias.fromAliasName(this, 'SnsManagedKey', 'alias/aws/sns'), + }); + opsTopic.addSubscription(new EmailSubscription(props.config.alertEmail)); + const alarmAction = new SnsAction(opsTopic); + + const dashboard = new Dashboard(this, 'Dashboard', { + dashboardName: `event-ticketing-${props.config.stageName}`, + }); + + dashboard.addWidgets( + new TextWidget({ + markdown: `# Event Ticketing — ${props.config.stageName}\nLambda errors, API 5xx rate, and DynamoDB throttles at a glance.`, + width: 24, + height: 2, + }), + ); + + // --- Lambda error alarms (one per handler) --- + const errorWidgets: GraphWidget[] = []; + for (const [name, fn] of Object.entries(props.functions)) { + const errorMetric = fn.metricErrors({ period: Duration.minutes(5), statistic: 'Sum' }); + + new Alarm(this, `${name}ErrorAlarm`, { + alarmName: `event-ticketing-${props.config.stageName}-${name}-errors`, + metric: errorMetric, + threshold: 3, + evaluationPeriods: 1, + comparisonOperator: ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD, + treatMissingData: TreatMissingData.NOT_BREACHING, + }).addAlarmAction(alarmAction); + + errorWidgets.push( + new GraphWidget({ + title: `${name} — invocations vs errors`, + left: [fn.metricInvocations({ period: Duration.minutes(5) })], + right: [errorMetric], + width: 8, + height: 6, + }), + ); + } + dashboard.addWidgets(...errorWidgets); + + // --- Lambda duration, all handlers on one widget --- + dashboard.addWidgets( + new GraphWidget({ + title: 'Lambda duration (p99) — all handlers', + left: Object.values(props.functions).map((fn) => + fn.metricDuration({ period: Duration.minutes(5), statistic: 'p99' }), + ), + width: 24, + height: 8, + }), + ); + + // --- Application-level metrics (custom EMF via Powertools) --- + // Emitted from backend/src/lib/http.ts (ApiRequests/ApiErrors on every + // invocation) and services/registration-service.ts + // (RegistrationsCreated/FailedRegistrations) — namespace/dimension + // must match POWERTOOLS_SERVICE_NAME set in buildNodejsFunction(). + const appMetric = (metricName: string) => + new Metric({ + namespace: 'EventTicketing', + metricName, + dimensionsMap: { service: 'event-ticketing' }, + statistic: 'Sum', + period: Duration.minutes(5), + }); + + const apiRequests = appMetric('ApiRequests'); + const apiErrors = appMetric('ApiErrors'); + const registrationsCreated = appMetric('RegistrationsCreated'); + const failedRegistrations = appMetric('FailedRegistrations'); + + // Error rate, not just raw count: (errors / requests) * 100. Catches + // the case a fixed error-count threshold misses — a low-traffic period + // where every one of a handful of requests fails is just as urgent as + // a high-traffic burst of errors, and this normalizes for both. + const errorRate = new MathExpression({ + expression: '(errors / requests) * 100', + usingMetrics: { errors: apiErrors, requests: apiRequests }, + period: Duration.minutes(5), + label: 'API error rate (%)', + }); + + new Alarm(this, 'ApiErrorRateAlarm', { + alarmName: `event-ticketing-${props.config.stageName}-api-error-rate`, + alarmDescription: 'API error rate exceeded 5% over a 5-minute window.', + metric: errorRate, + threshold: 5, + evaluationPeriods: 1, + comparisonOperator: ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD, + treatMissingData: TreatMissingData.NOT_BREACHING, + }).addAlarmAction(alarmAction); + + dashboard.addWidgets( + new GraphWidget({ + title: 'API requests vs errors (custom app metrics)', + left: [apiRequests, apiErrors], + right: [errorRate], + width: 12, + height: 6, + }), + new GraphWidget({ + title: 'Registrations — created vs failed', + left: [registrationsCreated, failedRegistrations], + width: 12, + height: 6, + }), + ); + + // --- API Gateway 5xx rate --- + const api5xx = new Metric({ + namespace: 'AWS/ApiGateway', + metricName: '5xx', + dimensionsMap: { ApiId: props.httpApi.apiId }, + statistic: 'Sum', + period: Duration.minutes(5), + }); + + new Alarm(this, 'Api5xxAlarm', { + alarmName: `event-ticketing-${props.config.stageName}-api-5xx`, + metric: api5xx, + threshold: 5, + evaluationPeriods: 1, + comparisonOperator: ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD, + treatMissingData: TreatMissingData.NOT_BREACHING, + }).addAlarmAction(alarmAction); + + const apiCount = new Metric({ + namespace: 'AWS/ApiGateway', + metricName: 'Count', + dimensionsMap: { ApiId: props.httpApi.apiId }, + statistic: 'Sum', + period: Duration.minutes(5), + }); + + dashboard.addWidgets( + new GraphWidget({ + title: 'API Gateway — requests vs 5xx', + left: [apiCount], + right: [api5xx], + width: 12, + height: 6, + }), + ); + + // --- DynamoDB throttle alarms --- + const tables: Array<[string, Table]> = [ + ['Events', props.eventsTable], + ['Registrations', props.registrationsTable], + ['Users', props.usersTable], + ]; + + const throttleWidgets: GraphWidget[] = []; + for (const [name, table] of tables) { + const throttles = new Metric({ + namespace: 'AWS/DynamoDB', + metricName: 'ThrottledRequests', + dimensionsMap: { TableName: table.tableName }, + statistic: 'Sum', + period: Duration.minutes(5), + }); + + new Alarm(this, `${name}ThrottleAlarm`, { + alarmName: `event-ticketing-${props.config.stageName}-${name.toLowerCase()}-throttles`, + metric: throttles, + threshold: 1, + evaluationPeriods: 1, + comparisonOperator: ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD, + treatMissingData: TreatMissingData.NOT_BREACHING, + }).addAlarmAction(alarmAction); + + throttleWidgets.push( + new GraphWidget({ title: `${name} table — throttled requests`, left: [throttles], width: 8, height: 6 }), + ); + } + dashboard.addWidgets(...throttleWidgets); + } +} diff --git a/infrastructure/lib/stacks/notifications-stack.ts b/infrastructure/lib/stacks/notifications-stack.ts new file mode 100644 index 0000000..ee18350 --- /dev/null +++ b/infrastructure/lib/stacks/notifications-stack.ts @@ -0,0 +1,61 @@ +import { Stack, StackProps } from 'aws-cdk-lib'; +import { Topic } from 'aws-cdk-lib/aws-sns'; +import { LambdaSubscription } from 'aws-cdk-lib/aws-sns-subscriptions'; +import { PolicyStatement } from 'aws-cdk-lib/aws-iam'; +import { Alias } from 'aws-cdk-lib/aws-kms'; +import { EmailIdentity, Identity } from 'aws-cdk-lib/aws-ses'; +import { Construct } from 'constructs'; +import { StageConfig } from '../config/environment'; +import { buildNodejsFunction } from '../constructs/api-lambda'; + +export interface NotificationsStackProps extends StackProps { + config: StageConfig; +} + +/** + * SNS is the decoupling layer the brief asks for: business Lambdas publish + * "something happened" here without knowing how delivery works. The single + * subscriber Lambda in this stack is the only thing that calls SES — see + * docs/decisions.md for why SNS's own email-subscription feature isn't a + * fit for per-user transactional email. + */ +export class NotificationsStack extends Stack { + public readonly topic: Topic; + + constructor(scope: Construct, id: string, props: NotificationsStackProps) { + super(scope, id, props); + + this.topic = new Topic(this, 'NotificationsTopic', { + topicName: `event-ticketing-${props.config.stageName}-notifications`, + displayName: 'Event Ticketing Notifications', + // AWS-managed key — encrypts the topic at rest at no extra cost, + // unlike a customer-managed KMS key which bills per month. + masterKey: Alias.fromAliasName(this, 'SnsManagedKey', 'alias/aws/sns'), + }); + + // SES starts in sandbox mode: both sender and recipient addresses must + // be verified until AWS grants production access. This provisions the + // sender identity automatically — AWS emails a verification link to + // alertEmail that must be clicked once before SendEmail will work. + new EmailIdentity(this, 'SenderEmailIdentity', { + identity: Identity.email(props.config.alertEmail), + }); + + const dispatcherFn = buildNodejsFunction(this, 'NotificationDispatcher', { + entry: 'notifications/dispatch-notification.ts', + environment: { + SENDER_EMAIL: props.config.alertEmail, + }, + description: 'Subscribed to the notifications SNS topic; sends transactional email via SES.', + }); + + dispatcherFn.addToRolePolicy( + new PolicyStatement({ + actions: ['ses:SendEmail', 'ses:SendRawEmail'], + resources: [`arn:aws:ses:${this.region}:${this.account}:identity/*`], + }), + ); + + this.topic.addSubscription(new LambdaSubscription(dispatcherFn)); + } +} diff --git a/infrastructure/package.json b/infrastructure/package.json new file mode 100644 index 0000000..15127aa --- /dev/null +++ b/infrastructure/package.json @@ -0,0 +1,36 @@ +{ + "name": "@azubi-ticketing/infrastructure", + "version": "1.0.0", + "private": true, + "description": "AWS CDK app provisioning the Event Registration & Ticketing System", + "bin": { + "infrastructure": "bin/app.js" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "lint": "eslint bin lib --ext .ts", + "typecheck": "tsc --noEmit -p tsconfig.json", + "test": "jest", + "synth": "cdk synth", + "diff": "cdk diff", + "deploy": "cdk deploy --all --require-approval never", + "deploy:all": "cdk deploy --all --require-approval never", + "destroy": "cdk destroy --all", + "bootstrap": "cdk bootstrap" + }, + "dependencies": { + "aws-cdk-lib": "^2.161.1", + "constructs": "^10.3.0", + "source-map-support": "^0.5.21" + }, + "devDependencies": { + "@types/jest": "^29.5.13", + "@types/node": "^20.16.5", + "aws-cdk": "^2.161.1", + "esbuild": "^0.24.0", + "jest": "^29.7.0", + "ts-jest": "^29.2.5", + "ts-node": "^10.9.2", + "typescript": "^5.5.4" + } +} diff --git a/infrastructure/tsconfig.json b/infrastructure/tsconfig.json new file mode 100644 index 0000000..3e16763 --- /dev/null +++ b/infrastructure/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": ".", + "types": ["node"] + }, + "include": ["bin/**/*.ts", "lib/**/*.ts", "test/**/*.ts"], + "exclude": ["node_modules", "cdk.out", "dist"] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..aea80cd --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "azubi-event-ticketing", + "private": true, + "version": "1.0.0", + "description": "Serverless Event Registration & Ticketing System on AWS", + "engines": { + "node": ">=20.0.0", + "pnpm": ">=9.0.0" + }, + "packageManager": "pnpm@10.7.1", + "pnpm": { + "onlyBuiltDependencies": ["esbuild"] + }, + "scripts": { + "build": "pnpm --filter backend build && pnpm --filter infrastructure build", + "test": "pnpm --filter backend test", + "test:coverage": "pnpm --filter backend test:coverage", + "typecheck": "pnpm --filter backend typecheck && pnpm --filter infrastructure typecheck", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "format": "prettier --write \"**/*.{ts,json,md}\"", + "synth": "pnpm --filter infrastructure synth", + "diff": "pnpm --filter infrastructure diff", + "deploy": "pnpm --filter infrastructure deploy", + "destroy": "pnpm --filter infrastructure destroy", + "seed:admin": "ts-node scripts/seed-admin.ts" + }, + "dependencies": { + "@aws-sdk/client-cognito-identity-provider": "^3.658.1", + "@aws-sdk/client-dynamodb": "^3.658.1", + "@aws-sdk/lib-dynamodb": "^3.658.1" + }, + "devDependencies": { + "@types/node": "^20.16.5", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "@typescript-eslint/parser": "^7.18.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "prettier": "^3.3.3", + "ts-node": "^10.9.2", + "typescript": "^5.5.4" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..27f2971 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,4510 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@aws-sdk/client-cognito-identity-provider': + specifier: ^3.658.1 + version: 3.1101.0 + '@aws-sdk/client-dynamodb': + specifier: ^3.658.1 + version: 3.1101.0 + '@aws-sdk/lib-dynamodb': + specifier: ^3.658.1 + version: 3.1101.0(@aws-sdk/client-dynamodb@3.1101.0) + devDependencies: + '@types/node': + specifier: ^20.16.5 + version: 20.19.43 + '@typescript-eslint/eslint-plugin': + specifier: ^7.18.0 + version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.9.3))(eslint@8.57.1)(typescript@5.9.3) + '@typescript-eslint/parser': + specifier: ^7.18.0 + version: 7.18.0(eslint@8.57.1)(typescript@5.9.3) + eslint: + specifier: ^8.57.0 + version: 8.57.1 + eslint-config-prettier: + specifier: ^9.1.0 + version: 9.1.2(eslint@8.57.1) + prettier: + specifier: ^3.3.3 + version: 3.9.6 + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@20.19.43)(typescript@5.9.3) + typescript: + specifier: ^5.5.4 + version: 5.9.3 + + backend: + dependencies: + '@aws-lambda-powertools/logger': + specifier: ^2.11.0 + version: 2.34.0 + '@aws-lambda-powertools/metrics': + specifier: ^2.11.0 + version: 2.34.0 + '@aws-lambda-powertools/tracer': + specifier: ^2.11.0 + version: 2.34.0 + '@aws-sdk/client-cognito-identity-provider': + specifier: ^3.658.1 + version: 3.1101.0 + '@aws-sdk/client-dynamodb': + specifier: ^3.658.1 + version: 3.1101.0 + '@aws-sdk/client-sesv2': + specifier: ^3.658.1 + version: 3.1101.0 + '@aws-sdk/client-sns': + specifier: ^3.658.1 + version: 3.1101.0 + '@aws-sdk/lib-dynamodb': + specifier: ^3.658.1 + version: 3.1101.0(@aws-sdk/client-dynamodb@3.1101.0) + '@aws-sdk/util-dynamodb': + specifier: ^3.658.1 + version: 3.996.7(@aws-sdk/client-dynamodb@3.1101.0) + ulid: + specifier: ^2.3.0 + version: 2.4.0 + zod: + specifier: ^3.23.8 + version: 3.25.76 + devDependencies: + '@types/aws-lambda': + specifier: ^8.10.145 + version: 8.10.162 + '@types/jest': + specifier: ^29.5.13 + version: 29.5.14 + '@types/node': + specifier: ^20.16.5 + version: 20.19.43 + aws-sdk-client-mock: + specifier: ^4.0.2 + version: 4.1.0 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + ts-jest: + specifier: ^29.2.5 + version: 29.4.12(@babel/core@7.29.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.7))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)))(typescript@5.9.3) + typescript: + specifier: ^5.5.4 + version: 5.9.3 + + infrastructure: + dependencies: + aws-cdk-lib: + specifier: ^2.161.1 + version: 2.263.0(constructs@10.8.0) + constructs: + specifier: ^10.3.0 + version: 10.8.0 + source-map-support: + specifier: ^0.5.21 + version: 0.5.21 + devDependencies: + '@types/jest': + specifier: ^29.5.13 + version: 29.5.14 + '@types/node': + specifier: ^20.16.5 + version: 20.19.43 + aws-cdk: + specifier: ^2.161.1 + version: 2.1134.0 + esbuild: + specifier: ^0.24.0 + version: 0.24.2 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + ts-jest: + specifier: ^29.2.5 + version: 29.4.12(@babel/core@7.29.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.7))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)))(typescript@5.9.3) + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@20.19.43)(typescript@5.9.3) + typescript: + specifier: ^5.5.4 + version: 5.9.3 + +packages: + + '@aws-cdk/asset-awscli-v1@2.2.282': + resolution: {integrity: sha512-7hKMi5tTxDcKGIMIOq14PnY0GBcugW33Uh/2YHDZiEwSxLeFOCYBwhR+BFXONb/EJeVI3RETFgailNZbkcKF6g==} + + '@aws-cdk/asset-node-proxy-agent-v6@2.1.2': + resolution: {integrity: sha512-pDiuqH+qY3zM9lhhLjbKJ1tnKOHzQ2V4Wr/3qsxyKeKAkuPMI/BVGvZG1PbrikUw949cGVTfVEt4ETKKYnrj0Q==} + + '@aws-cdk/cloud-assembly-schema@54.15.0': + resolution: {integrity: sha512-eWdbH+SRmxeTSyECibUdP4MkRqhoXJ7GMFiHJgIt5081sU4D42tsNmwe8rPHQHyFXRTwauxdLNdhJeykOv8+Cg==} + engines: {node: '>= 18.0.0'} + bundledDependencies: + - jsonschema + - semver + + '@aws-lambda-powertools/commons@2.34.0': + resolution: {integrity: sha512-ga89L3UznCwkApsrVAYGywifAh9PpccXZAVE053B6IdKvZrwjv+L+ja1WyzU9sy9UR3wPEdh0LFiUCRZRhTfvQ==} + + '@aws-lambda-powertools/logger@2.34.0': + resolution: {integrity: sha512-FIWQcdX/dqfKE+4H8N9w7y7/3/ANmDpKDgMlMc+yPNx2XDpKK6Ou1zLFYoNt5mV6dOZunFQcKbRWUy6zIDdE0w==} + peerDependencies: + '@aws-lambda-powertools/jmespath': 2.34.0 + '@middy/core': 4.x || 5.x || 6.x || 7.x + peerDependenciesMeta: + '@aws-lambda-powertools/jmespath': + optional: true + '@middy/core': + optional: true + + '@aws-lambda-powertools/metrics@2.34.0': + resolution: {integrity: sha512-nY2ZdyoZVV5jsa9boeDhDn18pff0K/RBsj6mpb44jiA3IRCTMx5va6AY1SMskjFS1GzF9FIOV4NprQP9YsFL2g==} + peerDependencies: + '@middy/core': 4.x || 5.x || 6.x || 7.x + peerDependenciesMeta: + '@middy/core': + optional: true + + '@aws-lambda-powertools/tracer@2.34.0': + resolution: {integrity: sha512-lZukaG9IffDRjQweJlf0tC1ZPF86CDNTJfrhvMdRDxDohZQ/KZpPCyeJ9nsfz9LPlRF6g2KM2jtx/2NBVNYIgg==} + peerDependencies: + '@middy/core': 4.x || 5.x || 6.x || 7.x + peerDependenciesMeta: + '@middy/core': + optional: true + + '@aws-sdk/client-cognito-identity-provider@3.1101.0': + resolution: {integrity: sha512-iINP4bJzVeCN1UDDQ5aRIEaGOCUUf8esOkHp7P7q/mBB+X8icJUitDsCcf4F1poymUO5YK4ArARGF45dH74rSg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/client-dynamodb@3.1101.0': + resolution: {integrity: sha512-3tlBfiRdksyqFggcMsN3AOA9uaqEbt5OK6Ym0MfUxKqLIOwdAlfCKL2GvE8qC0xa2dwPegIDs+grTRpBtzNILQ==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/client-sesv2@3.1101.0': + resolution: {integrity: sha512-5n4COAW5u6T1gOz4t6RueAncImDjK0wdoQEXu1ABnRfLAoNa2dlouubKq3lHLliQdhhEo4so7Cn88ylprab0Ng==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/client-sns@3.1101.0': + resolution: {integrity: sha512-acD9aImYVukKfz2pQU+t6KmgQdhPFj4yPgnid56g18RpUWC7wX/BAKUK13aVXNOmFO43K41G0RopJXEWvDbb3g==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/core@3.977.4': + resolution: {integrity: sha512-CEkcQlMOQJCvul60U7wdAOACjtdgFWDsfJI+6wUOGdhGNV2lGbuJpi/R50QLpFG3Tp+sQxa/RmzC3X7KHbhuTA==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-env@3.972.65': + resolution: {integrity: sha512-lJT2aRw9wCV8jPHyFJjdZLD4HTydL6/22AnCSOB8e/LqOc55nEJGLHkJQeSxhn8QiqyjFwPKQFtMw0ovjRUY/g==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-http@3.972.67': + resolution: {integrity: sha512-N7fw/15hSwI/CPxe5ohOyb7O4ge9f5me1gVIn8OIkBRB0squ8OJqQyDyH/HoL+Sb1W5xdC88jVC+bHkw73iu+Q==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-ini@3.973.10': + resolution: {integrity: sha512-Zh9XRaPnDN9buO7GfWBubS22R6Nq5D6hbyYEMN05LiOnXugm/8WDjUx6y756bSPbdn3aJB2qG4zFW3bN82QhoQ==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-login@3.972.72': + resolution: {integrity: sha512-zZapIKwaHp7TdTf9hbH1I3CVUdEupmt7FXO/BoTQGC+4h6NkXKWpqF2p5WyfpjurDLHCpSyh+BzMlAg8arqWLA==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-node@3.972.76': + resolution: {integrity: sha512-1yzLmRiYSgGC25v7ZZEwJn/auhHHTIHgFOmzL2f36hf1+7jSLcX+1QrAz4760WEzPiiQl8xmlpFhHfl2OoyVzA==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-process@3.972.65': + resolution: {integrity: sha512-e5DbbNteOSalN58U83G6kFa4ECLEuGbGqNBHIXE7zYXA/m4GHblIGjFbSH7wYv6gBV8iNSDcRZBKfQZF5vF9nw==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-sso@3.973.9': + resolution: {integrity: sha512-0V0u4t+KBku9fbh5CPCaC5hUWwSzDafp8nCuDy817zWbp2gz80jO44rMQkiwnZ+k54B+tjAtzRy00DJRGTKGBg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-web-identity@3.972.71': + resolution: {integrity: sha512-e4dwiRltGAaQ+2yxw57Hj0l/BF3BHiG14+QpYE7bGYBlpAq/fkIri2BDhjWon8c0mhhtd2txQBAkQb9BcTStFg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/dynamodb-codec@3.973.39': + resolution: {integrity: sha512-6n1ER8qEvfruOfVFHVYrAtfSOk0ELudJDWyUMMb+M+tiP4rWSU44zd9ilQcM2/ESlRPyzxc2h7dU3R+UT+sVEg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/endpoint-cache@3.972.9': + resolution: {integrity: sha512-LFvdgq8SriaskUcjpBMDE7J2c9RmuT5v3gU36/znV71EU5DKUis4FmGFjCMelKCCViFeVrQADBAlIiOYRhEx6Q==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/lib-dynamodb@3.1101.0': + resolution: {integrity: sha512-ZqKo4lTrbphYbHzvZJox5ytFwXYlwgJooRzenNBv5bFjTK2m6PmLSIP5TCQm2wxpabVS4JDSiYd6fBzrXQBCzQ==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@aws-sdk/client-dynamodb': ^3.1101.0 + + '@aws-sdk/middleware-endpoint-discovery@3.972.27': + resolution: {integrity: sha512-5AJlxrsg27IGGiQauWOdVyqK55EN0EMIwXndkVHhBiPT4CtdSaz89/sAENSw+GP4KF+BOWcgycZFNjkOLmfo1A==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/nested-clients@3.997.39': + resolution: {integrity: sha512-wU5NPnj62Sb7A8xn/Zb+xThe05P3otNtDl37iOIi5DDMeCesNeCckaG+eXWGUs12Z9R34I8CD05TaTe6SIa61g==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/signature-v4-multi-region@3.996.43': + resolution: {integrity: sha512-lKekx8bLBXSv4O+cslk9Zfnw2XKSkWBs3uWL5QGhH2ZAQfNS7FE0vcSSN2vD/AhxX54ZTywWxR4STThoeOXlBA==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/token-providers@3.1100.0': + resolution: {integrity: sha512-THf3MkgY3fNJZ3zdgSenLqR7gSE68KccCj1RCKretlG73Ppszvues02VpCUO9NlB/tZDC483FvGCld+AiPCkvg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/types@3.974.2': + resolution: {integrity: sha512-3W6IUtSxFbH6X7Wb7DzGCV5QiFQsd0g8bOfntpmDxQlzBoKWUMBu/JPQR0DwkE+Hpnxd6db1tXbOwdeHddG6cA==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/util-dynamodb@3.996.7': + resolution: {integrity: sha512-v+WJASG9yaW8qNM7pNSgH1PBYz5mVTf7gzKPi0NqGjLlaCtPdk6EjM1lmv03egA07iXUw6OToGYfW2w8D3kBrg==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@aws-sdk/client-dynamodb': ^3.1088.0 + + '@aws-sdk/xml-builder@3.972.37': + resolution: {integrity: sha512-zKq4HQum8JwDyEuyfuI4bbiAcU0KxP6qy+9PR/IsR92IyE/DaBAikzAS50tjxip4bqIIANpCcG+Yyj6CVhXupg==} + engines: {node: '>=20.0.0'} + + '@aws/lambda-invoke-store@0.3.0': + resolution: {integrity: sha512-sl4Bm6yiMNYrZKkqqDFWN0UfnWhlS8ivKxrYl+6t0gCLrqr8y3B2IqZZbFRkfaVVp7C/baApyh71P+LeE1A2sQ==} + engines: {node: '>=18.0.0'} + + '@babel/code-frame@7.29.7': + resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.29.7': + resolution: {integrity: sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.29.7': + resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.29.8': + resolution: {integrity: sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.29.7': + resolution: {integrity: sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-globals@7.29.7': + resolution: {integrity: sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.29.7': + resolution: {integrity: sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.29.7': + resolution: {integrity: sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-plugin-utils@7.29.7': + resolution: {integrity: sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.29.7': + resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.29.7': + resolution: {integrity: sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.29.7': + resolution: {integrity: sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.8': + resolution: {integrity: sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-syntax-async-generators@7.8.4': + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-bigint@7.8.3': + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-class-properties@7.12.13': + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-class-static-block@7.14.5': + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-attributes@7.29.7': + resolution: {integrity: sha512-zGYcYfq/WmZ4V+kBIXQon9dSSc8ircGZqw9ZaNhhGj9nZkeBu1jHLBDQqYYi5WA9uawvA2sIMbry2nCFhf5Djg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-meta@7.10.4': + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-json-strings@7.8.3': + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-jsx@7.29.7': + resolution: {integrity: sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4': + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-numeric-separator@7.10.4': + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-object-rest-spread@7.8.3': + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3': + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-optional-chaining@7.8.3': + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-private-property-in-object@7.14.5': + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-top-level-await@7.14.5': + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-typescript@7.29.7': + resolution: {integrity: sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/template@7.29.7': + resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.29.8': + resolution: {integrity: sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.29.8': + resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} + engines: {node: '>=6.9.0'} + + '@bcoe/v8-coverage@0.2.3': + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + + '@esbuild/aix-ppc64@0.24.2': + resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.24.2': + resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.24.2': + resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.24.2': + resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.24.2': + resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.24.2': + resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.24.2': + resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.24.2': + resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.24.2': + resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.24.2': + resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.24.2': + resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.24.2': + resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.24.2': + resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.24.2': + resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.24.2': + resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.24.2': + resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.24.2': + resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.24.2': + resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.24.2': + resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.24.2': + resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.24.2': + resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.24.2': + resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.24.2': + resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.24.2': + resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.24.2': + resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@eslint-community/eslint-utils@4.10.1': + resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/eslintrc@2.1.4': + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@eslint/js@8.57.1': + resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@humanwhocodes/config-array@0.13.0': + resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} + engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/object-schema@2.0.3': + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead + + '@istanbuljs/load-nyc-config@1.1.0': + resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} + engines: {node: '>=8'} + + '@istanbuljs/schema@0.1.6': + resolution: {integrity: sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==} + engines: {node: '>=8'} + + '@jest/console@29.7.0': + resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/core@29.7.0': + resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + '@jest/environment@29.7.0': + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/expect-utils@29.7.0': + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/expect@29.7.0': + resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/fake-timers@29.7.0': + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/globals@29.7.0': + resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/reporters@29.7.0': + resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + '@jest/schemas@29.6.3': + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/source-map@29.6.3': + resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/test-result@29.7.0': + resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/test-sequencer@29.7.0': + resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/transform@29.7.0': + resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/types@29.6.3': + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@sinclair/typebox@0.27.12': + resolution: {integrity: sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==} + + '@sinonjs/commons@3.0.1': + resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + + '@sinonjs/fake-timers@10.3.0': + resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + + '@sinonjs/fake-timers@11.2.2': + resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==} + + '@sinonjs/fake-timers@15.4.0': + resolution: {integrity: sha512-DsG+8/LscQIQg68J6Ef3dv10u6nVyetYn923s3/sus5eaGfTo1of5WMZSLf0UJc9KDuKPilPH0UDJCjvNbDNCA==} + + '@sinonjs/samsam@8.0.3': + resolution: {integrity: sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==} + + '@smithy/core@3.31.1': + resolution: {integrity: sha512-CyogUINxvi7C7LDsh8Syo6hVJOT9ckz4rG8dRZfTJ8r91HkMY59PnNooaj7WcHyxEkxPfBAmbgztZU+xTo76lg==} + engines: {node: '>=18.0.0'} + + '@smithy/credential-provider-imds@4.4.16': + resolution: {integrity: sha512-QfuLWAkLzptffFW980AFeHZFdqds2B64rpEd3uJ6lgs3xVn9QegGMUgUcj+4d7dRrAsya3r58ZKpku97WcFb4w==} + engines: {node: '>=18.0.0'} + + '@smithy/fetch-http-handler@5.6.13': + resolution: {integrity: sha512-4fW86pEUOMbrD5nkbyl/tTvPHHWJFbuB2odl6ps9lWfHoXf9HWh3Q/Smh59qH1g7+c/BSZghX6bbUk4gsiMs8A==} + engines: {node: '>=18.0.0'} + + '@smithy/node-http-handler@4.9.13': + resolution: {integrity: sha512-Nmd/Nl35zfYrd+a6OO2cDJb3GPh9bgTjIUhcM+JFfjpp8/osCgboDV5nCT1I01Pv6R13eSKDKLSoVa5ZB6Zsfw==} + engines: {node: '>=18.0.0'} + + '@smithy/service-error-classification@2.1.5': + resolution: {integrity: sha512-uBDTIBBEdAQryvHdc5W8sS5YX7RQzF683XrHePVdFmAgKiMofU15FLSM0/HU03hKTnazdNRFa0YHS7+ArwoUSQ==} + engines: {node: '>=14.0.0'} + + '@smithy/signature-v4@5.6.12': + resolution: {integrity: sha512-I6KLtq3H0qqSuV9vLglfi8puHqzygzWHOnI4z/Rdoo+q50vvo18vBRdPAvvEtcaKROz7Zn6qnPa14kRfPH6PcQ==} + engines: {node: '>=18.0.0'} + + '@smithy/types@2.12.0': + resolution: {integrity: sha512-QwYgloJ0sVNBeBuBs65cIkTbfzV/Q6ZNPCJ99EICFEdJYG50nGIY/uYXp+TbsdJReIuPr0a0kXmCvren3MbRRw==} + engines: {node: '>=14.0.0'} + + '@smithy/types@4.16.1': + resolution: {integrity: sha512-0JFs3V2y2M9tKW5na/qxe69Zv+uxLMO7QBbhxF/FHu/Gp2NFZAAL9tWl9PU02xxo07pb3G9FTyjNc6D5uZrJIg==} + engines: {node: '>=18.0.0'} + + '@tsconfig/node10@1.0.12': + resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==} + + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + + '@types/aws-lambda@8.10.162': + resolution: {integrity: sha512-Fn658grtLOci1oxi1391vvDWJRKNGWRSqfxRkmN/Iy3c0tQH1USMKEXcPYHLvope+ZgTFocx9FRQJx1muBL6qw==} + + '@types/babel__core@7.20.5': + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + + '@types/babel__template@7.4.4': + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + + '@types/cls-hooked@4.3.9': + resolution: {integrity: sha512-CMtHMz6Q/dkfcHarq9nioXH8BDPP+v5xvd+N90lBQ2bdmu06UvnLDqxTKoOJzz4SzIwb/x9i4UXGAAcnUDuIvg==} + + '@types/graceful-fs@4.1.9': + resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + + '@types/istanbul-lib-report@3.0.3': + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + + '@types/istanbul-reports@3.0.4': + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + + '@types/jest@29.5.14': + resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + + '@types/node@20.19.43': + resolution: {integrity: sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==} + + '@types/sinon@17.0.4': + resolution: {integrity: sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew==} + + '@types/sinonjs__fake-timers@15.0.1': + resolution: {integrity: sha512-Ko2tjWJq8oozHzHV+reuvS5KYIRAokHnGbDwGh/J64LntgpbuylF74ipEL24HCyRjf9FOlBiBHWBR1RlVKsI1w==} + + '@types/stack-utils@2.0.3': + resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + + '@types/yargs@17.0.35': + resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} + + '@typescript-eslint/eslint-plugin@7.18.0': + resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/parser@7.18.0': + resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/scope-manager@7.18.0': + resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@typescript-eslint/type-utils@7.18.0': + resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/types@7.18.0': + resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@typescript-eslint/typescript-estree@7.18.0': + resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/utils@7.18.0': + resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + + '@typescript-eslint/visitor-keys@7.18.0': + resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@ungap/structured-clone@1.3.3': + resolution: {integrity: sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg==} + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn-walk@8.3.5: + resolution: {integrity: sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==} + engines: {node: '>=0.4.0'} + + acorn@8.18.0: + resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv@6.15.0: + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + + ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + + async-hook-jl@1.7.6: + resolution: {integrity: sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==} + engines: {node: ^4.7 || >=6.9 || >=7.3} + + atomic-batcher@1.0.2: + resolution: {integrity: sha512-EFGCRj4kLX1dHv1cDzTk+xbjBFj1GnJDpui52YmEcxxHHEWjYyT6l51U7n6WQ28osZH4S9gSybxe56Vm7vB61Q==} + + aws-cdk-lib@2.263.0: + resolution: {integrity: sha512-cXC9wnOr+LknMee9x0kYwofgVs8aN8eBKsbzcE90sDUtpLTgWG2Bd+9koqxBKPeIU8kig/GGBFwJ69Wr+hLKDg==} + engines: {node: '>= 20.0.0'} + peerDependencies: + constructs: ^10.5.0 + bundledDependencies: + - '@aws/cloudformation-validate' + - '@balena/dockerignore' + - '@aws-cdk/cloud-assembly-api' + - case + - fs-extra + - ignore + - jsonschema + - minimatch + - punycode + - semver + - yaml + - mime-types + + aws-cdk@2.1134.0: + resolution: {integrity: sha512-Fy/g+gdpMpkhAAoCNlZtX0s4mD7q58bHlDV6QfbnTeifmQ5cEge26c5rB+U4qKB/bDudxNuJjQk/mSSk0ysnug==} + engines: {node: '>= 18.0.0'} + hasBin: true + + aws-sdk-client-mock@4.1.0: + resolution: {integrity: sha512-h/tOYTkXEsAcV3//6C1/7U4ifSpKyJvb6auveAepqqNJl6TdZaPFEtKjBQNf8UxQdDP850knB2i/whq4zlsxJw==} + + aws-xray-sdk-core@3.12.0: + resolution: {integrity: sha512-lwalRdxXRy+Sn49/vN7W507qqmBRk5Fy2o0a9U6XTjL9IV+oR5PUiiptoBrOcaYCiVuGld8OEbNqhm6wvV3m6A==} + engines: {node: '>= 14.x'} + + babel-jest@29.7.0: + resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + + babel-plugin-istanbul@6.1.1: + resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} + engines: {node: '>=8'} + + babel-plugin-jest-hoist@29.6.3: + resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + babel-preset-current-node-syntax@1.2.0: + resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} + peerDependencies: + '@babel/core': ^7.0.0 || ^8.0.0-0 + + babel-preset-jest@29.6.3: + resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + baseline-browser-mapping@2.11.10: + resolution: {integrity: sha512-35JEvJ5/KKlbCHjMCsONI2w6HE88STjVdHk+C7d8LtcFxUjZR1KeLP9izofn2qs0KUxX5r4z73bwH/rd+JHacw==} + engines: {node: '>=6.0.0'} + hasBin: true + + bowser@2.14.1: + resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==} + + brace-expansion@1.1.18: + resolution: {integrity: sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==} + + brace-expansion@2.1.4: + resolution: {integrity: sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + browserslist@4.28.7: + resolution: {integrity: sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + bs-logger@0.2.6: + resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} + engines: {node: '>= 6'} + + bser@2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + + camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + + caniuse-lite@1.0.30001806: + resolution: {integrity: sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + + ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} + + cjs-module-lexer@1.4.3: + resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + cls-hooked@4.2.2: + resolution: {integrity: sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==} + engines: {node: ^4.7 || >=6.9 || >=7.3 || >=8.2.1} + + co@4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + + collect-v8-coverage@1.0.3: + resolution: {integrity: sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + constructs@10.8.0: + resolution: {integrity: sha512-pJHp2CxvTG0ttp52rZvQfkbspPLZzttWPooIRLBwlZK8rV7ZhkjIkyZWJhIfBDC4YdcwIDmXyUFr1ieJaqjBbg==} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + create-jest@29.7.0: + resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + dedent@1.7.2: + resolution: {integrity: sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + + detect-newline@3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + + diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + diff@4.0.4: + resolution: {integrity: sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==} + engines: {node: '>=0.3.1'} + + diff@5.2.2: + resolution: {integrity: sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==} + engines: {node: '>=0.3.1'} + + dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + + doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + + electron-to-chromium@1.5.399: + resolution: {integrity: sha512-lEcqhErbHjXRvd41rnWLpzbyU/IXfIYo7QwaFWmxGeLiLyY2TBCdHnWY88vB+p3ubnihRypDm66panXl7TylLA==} + + emitter-listener@1.1.2: + resolution: {integrity: sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==} + + emittery@0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} + engines: {node: '>=12'} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + error-ex@1.3.4: + resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + esbuild@0.24.2: + resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} + engines: {node: '>=18'} + hasBin: true + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + eslint-config-prettier@9.1.2: + resolution: {integrity: sha512-iI1f+D2ViGn+uvv5HuHVUamg8ll4tN+JRHGc6IJi4TP9Kl976C57fzPXgseXNs8v0iA8aSJpHsTWjDb9QJamGQ==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + + eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint@8.57.1: + resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + hasBin: true + + espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + + exit@0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} + + expect@29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fastq@1.20.1: + resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} + + fb-watchman@2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + + file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + + flatted@3.4.4: + resolution: {integrity: sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + get-package-type@0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} + + get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + + globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + + globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + + handlebars@4.7.9: + resolution: {integrity: sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==} + engines: {node: '>=0.4.7'} + hasBin: true + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + hasown@2.0.4: + resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} + engines: {node: '>= 0.4'} + + html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + + human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + import-fresh@3.3.1: + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} + engines: {node: '>=6'} + + import-local@3.2.0: + resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} + engines: {node: '>=8'} + hasBin: true + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + inflight@1.0.6: + resolution: {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. + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + + is-core-module@2.16.2: + resolution: {integrity: sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==} + engines: {node: '>= 0.4'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-generator-fn@2.1.0: + resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} + engines: {node: '>=6'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + + is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} + engines: {node: '>=8'} + + istanbul-lib-instrument@5.2.1: + resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} + engines: {node: '>=8'} + + istanbul-lib-instrument@6.0.3: + resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} + engines: {node: '>=10'} + + istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + + istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} + engines: {node: '>=8'} + + jest-changed-files@29.7.0: + resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-circus@29.7.0: + resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-cli@29.7.0: + resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + jest-config@29.7.0: + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + + jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-docblock@29.7.0: + resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-each@29.7.0: + resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-environment-node@29.7.0: + resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-haste-map@29.7.0: + resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-leak-detector@29.7.0: + resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-matcher-utils@29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-mock@29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-pnp-resolver@1.2.3: + resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} + engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true + + jest-regex-util@29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-resolve-dependencies@29.7.0: + resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-resolve@29.7.0: + resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-runner@29.7.0: + resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-runtime@29.7.0: + resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-snapshot@29.7.0: + resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-validate@29.7.0: + resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-watcher@29.7.0: + resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-worker@29.7.0: + resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest@29.7.0: + resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@3.15.1: + resolution: {integrity: sha512-S99WuO3HlhO3XN41EtYUNl9zzXjoJx7QvmipxsJVxtCBT0YHEFy+iOJhjSvrmV12nYhWpZaM8lPHkJm0yUMbag==} + hasBin: true + + js-yaml@4.3.1: + resolution: {integrity: sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==} + hasBin: true + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + just-extend@6.2.0: + resolution: {integrity: sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==} + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + + leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + + makeerror@1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + + minimatch@3.1.5: + resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} + + minimatch@9.0.9: + resolution: {integrity: sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==} + engines: {node: '>=16 || 14 >=14.17'} + + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + mnemonist@0.38.3: + resolution: {integrity: sha512-2K9QYubXx/NAjv4VLq1d1Ly8pWNC5L3BrixtdkyTegXWJIqY+zLNDhhX/A+ZwWt70tB1S8H4BE8FLYEFyNoOBw==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + + nise@6.1.5: + resolution: {integrity: sha512-SnRDPDBjxZZoU2n0+gzzLtSvo1OZo7j6jnbXsoh3AFxEGhaFU7ZF0TmefuKERq79wxR2U+MPn7ArW+Tl+clC3A==} + + node-int64@0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + + node-releases@2.0.51: + resolution: {integrity: sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==} + engines: {node: '>=18'} + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + + obliterator@1.6.1: + resolution: {integrity: sha512-9WXswnqINnnhOG/5SLimUlzuU1hFJUc8zkwyD59Sd+dPOMf05PmnYG/d6Q7HZ+KmgkZJa1PxRso6QdM3sTNHig==} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + path-to-regexp@8.4.2: + resolution: {integrity: sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==} + + path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} + engines: {node: '>= 6'} + + pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier@3.9.6: + resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==} + engines: {node: '>=14'} + hasBin: true + + pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + pure-rand@6.1.0: + resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + resolve-cwd@3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + + resolve.exports@2.0.3: + resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} + engines: {node: '>=10'} + + resolve@1.22.12: + resolution: {integrity: sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==} + engines: {node: '>= 0.4'} + hasBin: true + + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} + engines: {node: '>=10'} + hasBin: true + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + shimmer@1.2.1: + resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==} + + signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + + sinon@18.0.1: + resolution: {integrity: sha512-a2N2TDY1uGviajJ6r4D1CyRAkzE9NNVlYOV1wX5xQDuAk0ONgzgRl0EjCQuRCPxOwp13ghsMwt9Gdldujs39qw==} + + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + + source-map-support@0.5.13: + resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + + source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + stack-chain@1.3.7: + resolution: {integrity: sha512-D8cWtWVdIe/jBA7v5p5Hwl5yOSOrmZPWDPe2KxQ5UAGD+nxbxU0lKXA4h85Ta6+qgdKVL3vUxsbIZjc1kBG7ug==} + + stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + + string-length@4.0.2: + resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} + engines: {node: '>=10'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-bom@4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + + strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + + text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + tmpl@1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + ts-api-utils@1.4.3: + resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + + ts-jest@29.4.12: + resolution: {integrity: sha512-Ov6ClY53Fflh6BGAnY2DlTq1hYDrTycz2PVTXBWFW2CU+9zrEqAp9fWdGXl42EXO5RLSFAcAZ2JFKbP+zBTFfw==} + engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/transform': ^29.0.0 || ^30.0.0 + '@jest/types': ^29.0.0 || ^30.0.0 + babel-jest: ^29.0.0 || ^30.0.0 + esbuild: '*' + jest: ^29.0.0 || ^30.0.0 + jest-util: ^29.0.0 || ^30.0.0 + typescript: '>=4.3 <7' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/transform': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + jest-util: + optional: true + + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + + type-detect@4.1.0: + resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} + engines: {node: '>=4'} + + type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + + type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} + engines: {node: '>=16'} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + uglify-js@3.19.3: + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + engines: {node: '>=0.8.0'} + hasBin: true + + ulid@2.4.0: + resolution: {integrity: sha512-fIRiVTJNcSRmXKPZtGzFQv9WRrZ3M9eoptl/teFJvjOzmpU+/K/JH6HZ8deBfb5vMEpicJcLn7JmvdknlMq7Zg==} + hasBin: true + + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + + v8-to-istanbul@9.3.0: + resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} + engines: {node: '>=10.12.0'} + + walker@1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + wordwrap@1.0.0: + resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + write-file-atomic@4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.3: + resolution: {integrity: sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==} + engines: {node: '>=12'} + + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + + zod@3.25.76: + resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} + +snapshots: + + '@aws-cdk/asset-awscli-v1@2.2.282': {} + + '@aws-cdk/asset-node-proxy-agent-v6@2.1.2': {} + + '@aws-cdk/cloud-assembly-schema@54.15.0': {} + + '@aws-lambda-powertools/commons@2.34.0': + dependencies: + '@aws/lambda-invoke-store': 0.3.0 + + '@aws-lambda-powertools/logger@2.34.0': + dependencies: + '@aws-lambda-powertools/commons': 2.34.0 + '@aws/lambda-invoke-store': 0.3.0 + + '@aws-lambda-powertools/metrics@2.34.0': + dependencies: + '@aws-lambda-powertools/commons': 2.34.0 + '@aws/lambda-invoke-store': 0.3.0 + + '@aws-lambda-powertools/tracer@2.34.0': + dependencies: + '@aws-lambda-powertools/commons': 2.34.0 + '@aws/lambda-invoke-store': 0.3.0 + aws-xray-sdk-core: 3.12.0 + + '@aws-sdk/client-cognito-identity-provider@3.1101.0': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/credential-provider-node': 3.972.76 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/fetch-http-handler': 5.6.13 + '@smithy/node-http-handler': 4.9.13 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/client-dynamodb@3.1101.0': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/credential-provider-node': 3.972.76 + '@aws-sdk/dynamodb-codec': 3.973.39 + '@aws-sdk/middleware-endpoint-discovery': 3.972.27 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/fetch-http-handler': 5.6.13 + '@smithy/node-http-handler': 4.9.13 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/client-sesv2@3.1101.0': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/credential-provider-node': 3.972.76 + '@aws-sdk/signature-v4-multi-region': 3.996.43 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/fetch-http-handler': 5.6.13 + '@smithy/node-http-handler': 4.9.13 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/client-sns@3.1101.0': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/credential-provider-node': 3.972.76 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/fetch-http-handler': 5.6.13 + '@smithy/node-http-handler': 4.9.13 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/core@3.977.4': + dependencies: + '@aws-sdk/types': 3.974.2 + '@aws-sdk/xml-builder': 3.972.37 + '@aws/lambda-invoke-store': 0.3.0 + '@smithy/core': 3.31.1 + '@smithy/signature-v4': 5.6.12 + '@smithy/types': 4.16.1 + bowser: 2.14.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-env@3.972.65': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-http@3.972.67': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/fetch-http-handler': 5.6.13 + '@smithy/node-http-handler': 4.9.13 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-ini@3.973.10': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/credential-provider-env': 3.972.65 + '@aws-sdk/credential-provider-http': 3.972.67 + '@aws-sdk/credential-provider-login': 3.972.72 + '@aws-sdk/credential-provider-process': 3.972.65 + '@aws-sdk/credential-provider-sso': 3.973.9 + '@aws-sdk/credential-provider-web-identity': 3.972.71 + '@aws-sdk/nested-clients': 3.997.39 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/credential-provider-imds': 4.4.16 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-login@3.972.72': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/nested-clients': 3.997.39 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-node@3.972.76': + dependencies: + '@aws-sdk/credential-provider-env': 3.972.65 + '@aws-sdk/credential-provider-http': 3.972.67 + '@aws-sdk/credential-provider-ini': 3.973.10 + '@aws-sdk/credential-provider-process': 3.972.65 + '@aws-sdk/credential-provider-sso': 3.973.9 + '@aws-sdk/credential-provider-web-identity': 3.972.71 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/credential-provider-imds': 4.4.16 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-process@3.972.65': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-sso@3.973.9': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/nested-clients': 3.997.39 + '@aws-sdk/token-providers': 3.1100.0 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-web-identity@3.972.71': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/nested-clients': 3.997.39 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/dynamodb-codec@3.973.39': + dependencies: + '@aws-sdk/core': 3.977.4 + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/endpoint-cache@3.972.9': + dependencies: + mnemonist: 0.38.3 + tslib: 2.8.1 + + '@aws-sdk/lib-dynamodb@3.1101.0(@aws-sdk/client-dynamodb@3.1101.0)': + dependencies: + '@aws-sdk/client-dynamodb': 3.1101.0 + '@aws-sdk/core': 3.977.4 + '@aws-sdk/util-dynamodb': 3.996.7(@aws-sdk/client-dynamodb@3.1101.0) + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/middleware-endpoint-discovery@3.972.27': + dependencies: + '@aws-sdk/endpoint-cache': 3.972.9 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/nested-clients@3.997.39': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/signature-v4-multi-region': 3.996.43 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/fetch-http-handler': 5.6.13 + '@smithy/node-http-handler': 4.9.13 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/signature-v4-multi-region@3.996.43': + dependencies: + '@aws-sdk/types': 3.974.2 + '@smithy/signature-v4': 5.6.12 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/token-providers@3.1100.0': + dependencies: + '@aws-sdk/core': 3.977.4 + '@aws-sdk/nested-clients': 3.997.39 + '@aws-sdk/types': 3.974.2 + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/types@3.974.2': + dependencies: + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws-sdk/util-dynamodb@3.996.7(@aws-sdk/client-dynamodb@3.1101.0)': + dependencies: + '@aws-sdk/client-dynamodb': 3.1101.0 + tslib: 2.8.1 + + '@aws-sdk/xml-builder@3.972.37': + dependencies: + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@aws/lambda-invoke-store@0.3.0': {} + + '@babel/code-frame@7.29.7': + dependencies: + '@babel/helper-validator-identifier': 7.29.7 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.29.7': {} + + '@babel/core@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-compilation-targets': 7.29.7 + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7) + '@babel/helpers': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/template': 7.29.7 + '@babel/traverse': 7.29.8 + '@babel/types': 7.29.8 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.29.8': + dependencies: + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + + '@babel/helper-compilation-targets@7.29.7': + dependencies: + '@babel/compat-data': 7.29.7 + '@babel/helper-validator-option': 7.29.7 + browserslist: 4.28.7 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-globals@7.29.7': {} + + '@babel/helper-module-imports@7.29.7': + dependencies: + '@babel/traverse': 7.29.8 + '@babel/types': 7.29.8 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-module-imports': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + '@babel/traverse': 7.29.8 + transitivePeerDependencies: + - supports-color + + '@babel/helper-plugin-utils@7.29.7': {} + + '@babel/helper-string-parser@7.29.7': {} + + '@babel/helper-validator-identifier@7.29.7': {} + + '@babel/helper-validator-option@7.29.7': {} + + '@babel/helpers@7.29.7': + dependencies: + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + + '@babel/parser@7.29.8': + dependencies: + '@babel/types': 7.29.8 + + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-import-attributes@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-jsx@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/plugin-syntax-typescript@7.29.7(@babel/core@7.29.7)': + dependencies: + '@babel/core': 7.29.7 + '@babel/helper-plugin-utils': 7.29.7 + + '@babel/template@7.29.7': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 + + '@babel/traverse@7.29.8': + dependencies: + '@babel/code-frame': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/helper-globals': 7.29.7 + '@babel/parser': 7.29.8 + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.29.8': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + + '@bcoe/v8-coverage@0.2.3': {} + + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + + '@esbuild/aix-ppc64@0.24.2': + optional: true + + '@esbuild/android-arm64@0.24.2': + optional: true + + '@esbuild/android-arm@0.24.2': + optional: true + + '@esbuild/android-x64@0.24.2': + optional: true + + '@esbuild/darwin-arm64@0.24.2': + optional: true + + '@esbuild/darwin-x64@0.24.2': + optional: true + + '@esbuild/freebsd-arm64@0.24.2': + optional: true + + '@esbuild/freebsd-x64@0.24.2': + optional: true + + '@esbuild/linux-arm64@0.24.2': + optional: true + + '@esbuild/linux-arm@0.24.2': + optional: true + + '@esbuild/linux-ia32@0.24.2': + optional: true + + '@esbuild/linux-loong64@0.24.2': + optional: true + + '@esbuild/linux-mips64el@0.24.2': + optional: true + + '@esbuild/linux-ppc64@0.24.2': + optional: true + + '@esbuild/linux-riscv64@0.24.2': + optional: true + + '@esbuild/linux-s390x@0.24.2': + optional: true + + '@esbuild/linux-x64@0.24.2': + optional: true + + '@esbuild/netbsd-arm64@0.24.2': + optional: true + + '@esbuild/netbsd-x64@0.24.2': + optional: true + + '@esbuild/openbsd-arm64@0.24.2': + optional: true + + '@esbuild/openbsd-x64@0.24.2': + optional: true + + '@esbuild/sunos-x64@0.24.2': + optional: true + + '@esbuild/win32-arm64@0.24.2': + optional: true + + '@esbuild/win32-ia32@0.24.2': + optional: true + + '@esbuild/win32-x64@0.24.2': + optional: true + + '@eslint-community/eslint-utils@4.10.1(eslint@8.57.1)': + dependencies: + eslint: 8.57.1 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.12.2': {} + + '@eslint/eslintrc@2.1.4': + dependencies: + ajv: 6.15.0 + debug: 4.4.3 + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.2 + import-fresh: 3.3.1 + js-yaml: 4.3.1 + minimatch: 3.1.5 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@8.57.1': {} + + '@humanwhocodes/config-array@0.13.0': + dependencies: + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.4.3 + minimatch: 3.1.5 + transitivePeerDependencies: + - supports-color + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/object-schema@2.0.3': {} + + '@istanbuljs/load-nyc-config@1.1.0': + dependencies: + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.15.1 + resolve-from: 5.0.0 + + '@istanbuljs/schema@0.1.6': {} + + '@jest/console@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + chalk: 4.1.2 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + slash: 3.0.0 + + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + + '@jest/environment@29.7.0': + dependencies: + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + jest-mock: 29.7.0 + + '@jest/expect-utils@29.7.0': + dependencies: + jest-get-type: 29.6.3 + + '@jest/expect@29.7.0': + dependencies: + expect: 29.7.0 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + + '@jest/fake-timers@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 20.19.43 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 + + '@jest/globals@29.7.0': + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/types': 29.6.3 + jest-mock: 29.7.0 + transitivePeerDependencies: + - supports-color + + '@jest/reporters@29.7.0': + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.31 + '@types/node': 20.19.43 + chalk: 4.1.2 + collect-v8-coverage: 1.0.3 + exit: 0.1.2 + glob: 7.2.3 + graceful-fs: 4.2.11 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-instrument: 6.0.3 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.2.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + jest-worker: 29.7.0 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.3.0 + transitivePeerDependencies: + - supports-color + + '@jest/schemas@29.6.3': + dependencies: + '@sinclair/typebox': 0.27.12 + + '@jest/source-map@29.6.3': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + callsites: 3.1.0 + graceful-fs: 4.2.11 + + '@jest/test-result@29.7.0': + dependencies: + '@jest/console': 29.7.0 + '@jest/types': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + collect-v8-coverage: 1.0.3 + + '@jest/test-sequencer@29.7.0': + dependencies: + '@jest/test-result': 29.7.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + slash: 3.0.0 + + '@jest/transform@29.7.0': + dependencies: + '@babel/core': 7.29.7 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.31 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + micromatch: 4.0.8 + pirates: 4.0.7 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + + '@jest/types@29.6.3': + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@types/node': 20.19.43 + '@types/yargs': 17.0.35 + chalk: 4.1.2 + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.20.1 + + '@sinclair/typebox@0.27.12': {} + + '@sinonjs/commons@3.0.1': + dependencies: + type-detect: 4.0.8 + + '@sinonjs/fake-timers@10.3.0': + dependencies: + '@sinonjs/commons': 3.0.1 + + '@sinonjs/fake-timers@11.2.2': + dependencies: + '@sinonjs/commons': 3.0.1 + + '@sinonjs/fake-timers@15.4.0': + dependencies: + '@sinonjs/commons': 3.0.1 + + '@sinonjs/samsam@8.0.3': + dependencies: + '@sinonjs/commons': 3.0.1 + type-detect: 4.1.0 + + '@smithy/core@3.31.1': + dependencies: + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@smithy/credential-provider-imds@4.4.16': + dependencies: + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@smithy/fetch-http-handler@5.6.13': + dependencies: + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@smithy/node-http-handler@4.9.13': + dependencies: + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@smithy/service-error-classification@2.1.5': + dependencies: + '@smithy/types': 2.12.0 + + '@smithy/signature-v4@5.6.12': + dependencies: + '@smithy/core': 3.31.1 + '@smithy/types': 4.16.1 + tslib: 2.8.1 + + '@smithy/types@2.12.0': + dependencies: + tslib: 2.8.1 + + '@smithy/types@4.16.1': + dependencies: + tslib: 2.8.1 + + '@tsconfig/node10@1.0.12': {} + + '@tsconfig/node12@1.0.11': {} + + '@tsconfig/node14@1.0.3': {} + + '@tsconfig/node16@1.0.4': {} + + '@types/aws-lambda@8.10.162': {} + + '@types/babel__core@7.20.5': + dependencies: + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 + '@types/babel__generator': 7.27.0 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.28.0 + + '@types/babel__generator@7.27.0': + dependencies: + '@babel/types': 7.29.8 + + '@types/babel__template@7.4.4': + dependencies: + '@babel/parser': 7.29.8 + '@babel/types': 7.29.8 + + '@types/babel__traverse@7.28.0': + dependencies: + '@babel/types': 7.29.8 + + '@types/cls-hooked@4.3.9': + dependencies: + '@types/node': 20.19.43 + + '@types/graceful-fs@4.1.9': + dependencies: + '@types/node': 20.19.43 + + '@types/istanbul-lib-coverage@2.0.6': {} + + '@types/istanbul-lib-report@3.0.3': + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + + '@types/istanbul-reports@3.0.4': + dependencies: + '@types/istanbul-lib-report': 3.0.3 + + '@types/jest@29.5.14': + dependencies: + expect: 29.7.0 + pretty-format: 29.7.0 + + '@types/node@20.19.43': + dependencies: + undici-types: 6.21.0 + + '@types/sinon@17.0.4': + dependencies: + '@types/sinonjs__fake-timers': 15.0.1 + + '@types/sinonjs__fake-timers@15.0.1': {} + + '@types/stack-utils@2.0.3': {} + + '@types/yargs-parser@21.0.3': {} + + '@types/yargs@17.0.35': + dependencies: + '@types/yargs-parser': 21.0.3 + + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.9.3))(eslint@8.57.1)(typescript@5.9.3)': + dependencies: + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.9.3) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.1)(typescript@5.9.3) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 7.18.0 + eslint: 8.57.1 + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.4.3(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.9.3)': + dependencies: + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.4.3 + eslint: 8.57.1 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@7.18.0': + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + + '@typescript-eslint/type-utils@7.18.0(eslint@8.57.1)(typescript@5.9.3)': + dependencies: + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.9.3) + debug: 4.4.3 + eslint: 8.57.1 + ts-api-utils: 1.4.3(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@7.18.0': {} + + '@typescript-eslint/typescript-estree@7.18.0(typescript@5.9.3)': + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.4.3 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.9 + semver: 7.8.5 + ts-api-utils: 1.4.3(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@7.18.0(eslint@8.57.1)(typescript@5.9.3)': + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@8.57.1) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3) + eslint: 8.57.1 + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/visitor-keys@7.18.0': + dependencies: + '@typescript-eslint/types': 7.18.0 + eslint-visitor-keys: 3.4.3 + + '@ungap/structured-clone@1.3.3': {} + + acorn-jsx@5.3.2(acorn@8.18.0): + dependencies: + acorn: 8.18.0 + + acorn-walk@8.3.5: + dependencies: + acorn: 8.18.0 + + acorn@8.18.0: {} + + ajv@6.15.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ansi-escapes@4.3.2: + dependencies: + type-fest: 0.21.3 + + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + ansi-styles@5.2.0: {} + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.2 + + arg@4.1.3: {} + + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + + argparse@2.0.1: {} + + array-union@2.1.0: {} + + async-hook-jl@1.7.6: + dependencies: + stack-chain: 1.3.7 + + atomic-batcher@1.0.2: {} + + aws-cdk-lib@2.263.0(constructs@10.8.0): + dependencies: + '@aws-cdk/asset-awscli-v1': 2.2.282 + '@aws-cdk/asset-node-proxy-agent-v6': 2.1.2 + '@aws-cdk/cloud-assembly-schema': 54.15.0 + constructs: 10.8.0 + + aws-cdk@2.1134.0: {} + + aws-sdk-client-mock@4.1.0: + dependencies: + '@types/sinon': 17.0.4 + sinon: 18.0.1 + tslib: 2.8.1 + + aws-xray-sdk-core@3.12.0: + dependencies: + '@aws-sdk/types': 3.974.2 + '@smithy/service-error-classification': 2.1.5 + '@types/cls-hooked': 4.3.9 + atomic-batcher: 1.0.2 + cls-hooked: 4.2.2 + semver: 7.8.5 + + babel-jest@29.7.0(@babel/core@7.29.7): + dependencies: + '@babel/core': 7.29.7 + '@jest/transform': 29.7.0 + '@types/babel__core': 7.20.5 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.6.3(@babel/core@7.29.7) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-istanbul@6.1.1: + dependencies: + '@babel/helper-plugin-utils': 7.29.7 + '@istanbuljs/load-nyc-config': 1.1.0 + '@istanbuljs/schema': 0.1.6 + istanbul-lib-instrument: 5.2.1 + test-exclude: 6.0.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-jest-hoist@29.6.3: + dependencies: + '@babel/template': 7.29.7 + '@babel/types': 7.29.8 + '@types/babel__core': 7.20.5 + '@types/babel__traverse': 7.28.0 + + babel-preset-current-node-syntax@1.2.0(@babel/core@7.29.7): + dependencies: + '@babel/core': 7.29.7 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.29.7) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.29.7) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.29.7) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.29.7) + '@babel/plugin-syntax-import-attributes': 7.29.7(@babel/core@7.29.7) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.29.7) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.29.7) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.29.7) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.29.7) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.29.7) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.29.7) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.29.7) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.29.7) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.29.7) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.29.7) + + babel-preset-jest@29.6.3(@babel/core@7.29.7): + dependencies: + '@babel/core': 7.29.7 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.2.0(@babel/core@7.29.7) + + balanced-match@1.0.2: {} + + baseline-browser-mapping@2.11.10: {} + + bowser@2.14.1: {} + + brace-expansion@1.1.18: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + brace-expansion@2.1.4: + dependencies: + balanced-match: 1.0.2 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + browserslist@4.28.7: + dependencies: + baseline-browser-mapping: 2.11.10 + caniuse-lite: 1.0.30001806 + electron-to-chromium: 1.5.399 + node-releases: 2.0.51 + update-browserslist-db: 1.2.3(browserslist@4.28.7) + + bs-logger@0.2.6: + dependencies: + fast-json-stable-stringify: 2.1.0 + + bser@2.1.1: + dependencies: + node-int64: 0.4.0 + + buffer-from@1.1.2: {} + + callsites@3.1.0: {} + + camelcase@5.3.1: {} + + camelcase@6.3.0: {} + + caniuse-lite@1.0.30001806: {} + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + char-regex@1.0.2: {} + + ci-info@3.9.0: {} + + cjs-module-lexer@1.4.3: {} + + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + cls-hooked@4.2.2: + dependencies: + async-hook-jl: 1.7.6 + emitter-listener: 1.1.2 + semver: 5.7.2 + + co@4.6.0: {} + + collect-v8-coverage@1.0.3: {} + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + + concat-map@0.0.1: {} + + constructs@10.8.0: {} + + convert-source-map@2.0.0: {} + + create-jest@29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + create-require@1.1.1: {} + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + dedent@1.7.2: {} + + deep-is@0.1.4: {} + + deepmerge@4.3.1: {} + + detect-newline@3.1.0: {} + + diff-sequences@29.6.3: {} + + diff@4.0.4: {} + + diff@5.2.2: {} + + dir-glob@3.0.1: + dependencies: + path-type: 4.0.0 + + doctrine@3.0.0: + dependencies: + esutils: 2.0.3 + + electron-to-chromium@1.5.399: {} + + emitter-listener@1.1.2: + dependencies: + shimmer: 1.2.1 + + emittery@0.13.1: {} + + emoji-regex@8.0.0: {} + + error-ex@1.3.4: + dependencies: + is-arrayish: 0.2.1 + + es-errors@1.3.0: {} + + esbuild@0.24.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.24.2 + '@esbuild/android-arm': 0.24.2 + '@esbuild/android-arm64': 0.24.2 + '@esbuild/android-x64': 0.24.2 + '@esbuild/darwin-arm64': 0.24.2 + '@esbuild/darwin-x64': 0.24.2 + '@esbuild/freebsd-arm64': 0.24.2 + '@esbuild/freebsd-x64': 0.24.2 + '@esbuild/linux-arm': 0.24.2 + '@esbuild/linux-arm64': 0.24.2 + '@esbuild/linux-ia32': 0.24.2 + '@esbuild/linux-loong64': 0.24.2 + '@esbuild/linux-mips64el': 0.24.2 + '@esbuild/linux-ppc64': 0.24.2 + '@esbuild/linux-riscv64': 0.24.2 + '@esbuild/linux-s390x': 0.24.2 + '@esbuild/linux-x64': 0.24.2 + '@esbuild/netbsd-arm64': 0.24.2 + '@esbuild/netbsd-x64': 0.24.2 + '@esbuild/openbsd-arm64': 0.24.2 + '@esbuild/openbsd-x64': 0.24.2 + '@esbuild/sunos-x64': 0.24.2 + '@esbuild/win32-arm64': 0.24.2 + '@esbuild/win32-ia32': 0.24.2 + '@esbuild/win32-x64': 0.24.2 + + escalade@3.2.0: {} + + escape-string-regexp@2.0.0: {} + + escape-string-regexp@4.0.0: {} + + eslint-config-prettier@9.1.2(eslint@8.57.1): + dependencies: + eslint: 8.57.1 + + eslint-scope@7.2.2: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint@8.57.1: + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@8.57.1) + '@eslint-community/regexpp': 4.12.2 + '@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.3.3 + ajv: 6.15.0 + chalk: 4.1.2 + cross-spawn: 7.0.6 + debug: 4.4.3 + 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.7.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.3.1 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.5 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + + espree@9.6.1: + dependencies: + acorn: 8.18.0 + acorn-jsx: 5.3.2(acorn@8.18.0) + eslint-visitor-keys: 3.4.3 + + esprima@4.0.1: {} + + esquery@1.7.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + + esutils@2.0.3: {} + + execa@5.1.1: + dependencies: + cross-spawn: 7.0.6 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + + exit@0.1.2: {} + + expect@29.7.0: + dependencies: + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + + fast-deep-equal@3.1.3: {} + + fast-glob@3.3.3: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fastq@1.20.1: + dependencies: + reusify: 1.1.0 + + fb-watchman@2.0.2: + dependencies: + bser: 2.1.1 + + file-entry-cache@6.0.1: + dependencies: + flat-cache: 3.2.0 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@3.2.0: + dependencies: + flatted: 3.4.4 + keyv: 4.5.4 + rimraf: 3.0.2 + + flatted@3.4.4: {} + + fs.realpath@1.0.0: {} + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + gensync@1.0.0-beta.2: {} + + get-caller-file@2.0.5: {} + + get-package-type@0.1.0: {} + + get-stream@6.0.1: {} + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.5 + once: 1.4.0 + path-is-absolute: 1.0.1 + + globals@13.24.0: + dependencies: + type-fest: 0.20.2 + + globby@11.1.0: + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.3 + ignore: 5.3.2 + merge2: 1.4.1 + slash: 3.0.0 + + graceful-fs@4.2.11: {} + + graphemer@1.4.0: {} + + handlebars@4.7.9: + dependencies: + minimist: 1.2.8 + neo-async: 2.6.2 + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: + uglify-js: 3.19.3 + + has-flag@4.0.0: {} + + hasown@2.0.4: + dependencies: + function-bind: 1.1.2 + + html-escaper@2.0.2: {} + + human-signals@2.1.0: {} + + ignore@5.3.2: {} + + import-fresh@3.3.1: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + import-local@3.2.0: + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + + imurmurhash@0.1.4: {} + + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + + is-arrayish@0.2.1: {} + + is-core-module@2.16.2: + dependencies: + hasown: 2.0.4 + + is-extglob@2.1.1: {} + + is-fullwidth-code-point@3.0.0: {} + + is-generator-fn@2.1.0: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-number@7.0.0: {} + + is-path-inside@3.0.3: {} + + is-stream@2.0.1: {} + + isexe@2.0.0: {} + + istanbul-lib-coverage@3.2.2: {} + + istanbul-lib-instrument@5.2.1: + dependencies: + '@babel/core': 7.29.7 + '@babel/parser': 7.29.8 + '@istanbuljs/schema': 0.1.6 + istanbul-lib-coverage: 3.2.2 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + istanbul-lib-instrument@6.0.3: + dependencies: + '@babel/core': 7.29.7 + '@babel/parser': 7.29.8 + '@istanbuljs/schema': 0.1.6 + istanbul-lib-coverage: 3.2.2 + semver: 7.8.5 + transitivePeerDependencies: + - supports-color + + istanbul-lib-report@3.0.1: + dependencies: + istanbul-lib-coverage: 3.2.2 + make-dir: 4.0.0 + supports-color: 7.2.0 + + istanbul-lib-source-maps@4.0.1: + dependencies: + debug: 4.4.3 + istanbul-lib-coverage: 3.2.2 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + + istanbul-reports@3.2.0: + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + + jest-changed-files@29.7.0: + dependencies: + execa: 5.1.1 + jest-util: 29.7.0 + p-limit: 3.1.0 + + jest-circus@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + chalk: 4.1.2 + co: 4.6.0 + dedent: 1.7.2 + is-generator-fn: 2.1.0 + jest-each: 29.7.0 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + p-limit: 3.1.0 + pretty-format: 29.7.0 + pure-rand: 6.1.0 + slash: 3.0.0 + stack-utils: 2.0.6 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-cli@29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.3 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + jest-config@29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)): + dependencies: + '@babel/core': 7.29.7 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.29.7) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 20.19.43 + ts-node: 10.9.2(@types/node@20.19.43)(typescript@5.9.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-diff@29.7.0: + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-docblock@29.7.0: + dependencies: + detect-newline: 3.1.0 + + jest-each@29.7.0: + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + jest-get-type: 29.6.3 + jest-util: 29.7.0 + pretty-format: 29.7.0 + + jest-environment-node@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + jest-mock: 29.7.0 + jest-util: 29.7.0 + + jest-get-type@29.6.3: {} + + jest-haste-map@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/graceful-fs': 4.1.9 + '@types/node': 20.19.43 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + jest-worker: 29.7.0 + micromatch: 4.0.8 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.3 + + jest-leak-detector@29.7.0: + dependencies: + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-matcher-utils@29.7.0: + dependencies: + chalk: 4.1.2 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-message-util@29.7.0: + dependencies: + '@babel/code-frame': 7.29.7 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.3 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + + jest-mock@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + jest-util: 29.7.0 + + jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): + optionalDependencies: + jest-resolve: 29.7.0 + + jest-regex-util@29.6.3: {} + + jest-resolve-dependencies@29.7.0: + dependencies: + jest-regex-util: 29.6.3 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + + jest-resolve@29.7.0: + dependencies: + chalk: 4.1.2 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0) + jest-util: 29.7.0 + jest-validate: 29.7.0 + resolve: 1.22.12 + resolve.exports: 2.0.3 + slash: 3.0.0 + + jest-runner@29.7.0: + dependencies: + '@jest/console': 29.7.0 + '@jest/environment': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + chalk: 4.1.2 + emittery: 0.13.1 + graceful-fs: 4.2.11 + jest-docblock: 29.7.0 + jest-environment-node: 29.7.0 + jest-haste-map: 29.7.0 + jest-leak-detector: 29.7.0 + jest-message-util: 29.7.0 + jest-resolve: 29.7.0 + jest-runtime: 29.7.0 + jest-util: 29.7.0 + jest-watcher: 29.7.0 + jest-worker: 29.7.0 + p-limit: 3.1.0 + source-map-support: 0.5.13 + transitivePeerDependencies: + - supports-color + + jest-runtime@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/globals': 29.7.0 + '@jest/source-map': 29.6.3 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + chalk: 4.1.2 + cjs-module-lexer: 1.4.3 + collect-v8-coverage: 1.0.3 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + slash: 3.0.0 + strip-bom: 4.0.0 + transitivePeerDependencies: + - supports-color + + jest-snapshot@29.7.0: + dependencies: + '@babel/core': 7.29.7 + '@babel/generator': 7.29.8 + '@babel/plugin-syntax-jsx': 7.29.7(@babel/core@7.29.7) + '@babel/plugin-syntax-typescript': 7.29.7(@babel/core@7.29.7) + '@babel/types': 7.29.8 + '@jest/expect-utils': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-preset-current-node-syntax: 1.2.0(@babel/core@7.29.7) + chalk: 4.1.2 + expect: 29.7.0 + graceful-fs: 4.2.11 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + natural-compare: 1.4.0 + pretty-format: 29.7.0 + semver: 7.8.5 + transitivePeerDependencies: + - supports-color + + jest-util@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + chalk: 4.1.2 + ci-info: 3.9.0 + graceful-fs: 4.2.11 + picomatch: 2.3.2 + + jest-validate@29.7.0: + dependencies: + '@jest/types': 29.6.3 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.6.3 + leven: 3.1.0 + pretty-format: 29.7.0 + + jest-watcher@29.7.0: + dependencies: + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.19.43 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + emittery: 0.13.1 + jest-util: 29.7.0 + string-length: 4.0.2 + + jest-worker@29.7.0: + dependencies: + '@types/node': 20.19.43 + jest-util: 29.7.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + + jest@29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + js-tokens@4.0.0: {} + + js-yaml@3.15.1: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + + js-yaml@4.3.1: + dependencies: + argparse: 2.0.1 + + jsesc@3.1.0: {} + + json-buffer@3.0.1: {} + + json-parse-even-better-errors@2.3.1: {} + + json-schema-traverse@0.4.1: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + json5@2.2.3: {} + + just-extend@6.2.0: {} + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + kleur@3.0.3: {} + + leven@3.1.0: {} + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + lines-and-columns@1.2.4: {} + + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lodash.memoize@4.1.2: {} + + lodash.merge@4.6.2: {} + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + make-dir@4.0.0: + dependencies: + semver: 7.8.5 + + make-error@1.3.6: {} + + makeerror@1.0.12: + dependencies: + tmpl: 1.0.5 + + merge-stream@2.0.0: {} + + merge2@1.4.1: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.2 + + mimic-fn@2.1.0: {} + + minimatch@3.1.5: + dependencies: + brace-expansion: 1.1.18 + + minimatch@9.0.9: + dependencies: + brace-expansion: 2.1.4 + + minimist@1.2.8: {} + + mnemonist@0.38.3: + dependencies: + obliterator: 1.6.1 + + ms@2.1.3: {} + + natural-compare@1.4.0: {} + + neo-async@2.6.2: {} + + nise@6.1.5: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 15.4.0 + just-extend: 6.2.0 + path-to-regexp: 8.4.2 + + node-int64@0.4.0: {} + + node-releases@2.0.51: {} + + normalize-path@3.0.0: {} + + npm-run-path@4.0.1: + dependencies: + path-key: 3.1.1 + + obliterator@1.6.1: {} + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + + onetime@5.1.2: + dependencies: + mimic-fn: 2.1.0 + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + p-try@2.2.0: {} + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + parse-json@5.2.0: + dependencies: + '@babel/code-frame': 7.29.7 + error-ex: 1.3.4 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + + path-exists@4.0.0: {} + + path-is-absolute@1.0.1: {} + + path-key@3.1.1: {} + + path-parse@1.0.7: {} + + path-to-regexp@8.4.2: {} + + path-type@4.0.0: {} + + picocolors@1.1.1: {} + + picomatch@2.3.2: {} + + pirates@4.0.7: {} + + pkg-dir@4.2.0: + dependencies: + find-up: 4.1.0 + + prelude-ls@1.2.1: {} + + prettier@3.9.6: {} + + pretty-format@29.7.0: + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.3.1 + + prompts@2.4.2: + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + + punycode@2.3.1: {} + + pure-rand@6.1.0: {} + + queue-microtask@1.2.3: {} + + react-is@18.3.1: {} + + require-directory@2.1.1: {} + + resolve-cwd@3.0.0: + dependencies: + resolve-from: 5.0.0 + + resolve-from@4.0.0: {} + + resolve-from@5.0.0: {} + + resolve.exports@2.0.3: {} + + resolve@1.22.12: + dependencies: + es-errors: 1.3.0 + is-core-module: 2.16.2 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + + reusify@1.1.0: {} + + rimraf@3.0.2: + dependencies: + glob: 7.2.3 + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + semver@5.7.2: {} + + semver@6.3.1: {} + + semver@7.8.5: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + shimmer@1.2.1: {} + + signal-exit@3.0.7: {} + + sinon@18.0.1: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 11.2.2 + '@sinonjs/samsam': 8.0.3 + diff: 5.2.2 + nise: 6.1.5 + supports-color: 7.2.0 + + sisteransi@1.0.5: {} + + slash@3.0.0: {} + + source-map-support@0.5.13: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + + source-map-support@0.5.21: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + + source-map@0.6.1: {} + + sprintf-js@1.0.3: {} + + stack-chain@1.3.7: {} + + stack-utils@2.0.6: + dependencies: + escape-string-regexp: 2.0.0 + + string-length@4.0.2: + dependencies: + char-regex: 1.0.2 + strip-ansi: 6.0.1 + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-bom@4.0.0: {} + + strip-final-newline@2.0.0: {} + + strip-json-comments@3.1.1: {} + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + supports-color@8.1.1: + dependencies: + has-flag: 4.0.0 + + supports-preserve-symlinks-flag@1.0.0: {} + + test-exclude@6.0.0: + dependencies: + '@istanbuljs/schema': 0.1.6 + glob: 7.2.3 + minimatch: 3.1.5 + + text-table@0.2.0: {} + + tmpl@1.0.5: {} + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + ts-api-utils@1.4.3(typescript@5.9.3): + dependencies: + typescript: 5.9.3 + + ts-jest@29.4.12(@babel/core@7.29.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.7))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)))(typescript@5.9.3): + dependencies: + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + handlebars: 4.7.9 + jest: 29.7.0(@types/node@20.19.43)(ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3)) + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.8.5 + type-fest: 4.41.0 + typescript: 5.9.3 + yargs-parser: 21.1.1 + optionalDependencies: + '@babel/core': 7.29.7 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.29.7) + esbuild: 0.24.2 + jest-util: 29.7.0 + + ts-node@10.9.2(@types/node@20.19.43)(typescript@5.9.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.12 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.19.43 + acorn: 8.18.0 + acorn-walk: 8.3.5 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.4 + make-error: 1.3.6 + typescript: 5.9.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + + tslib@2.8.1: {} + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + type-detect@4.0.8: {} + + type-detect@4.1.0: {} + + type-fest@0.20.2: {} + + type-fest@0.21.3: {} + + type-fest@4.41.0: {} + + typescript@5.9.3: {} + + uglify-js@3.19.3: + optional: true + + ulid@2.4.0: {} + + undici-types@6.21.0: {} + + update-browserslist-db@1.2.3(browserslist@4.28.7): + dependencies: + browserslist: 4.28.7 + escalade: 3.2.0 + picocolors: 1.1.1 + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + v8-compile-cache-lib@3.0.1: {} + + v8-to-istanbul@9.3.0: + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@types/istanbul-lib-coverage': 2.0.6 + convert-source-map: 2.0.0 + + walker@1.0.8: + dependencies: + makeerror: 1.0.12 + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + word-wrap@1.2.5: {} + + wordwrap@1.0.0: {} + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrappy@1.0.2: {} + + write-file-atomic@4.0.2: + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + + y18n@5.0.8: {} + + yallist@3.1.1: {} + + yargs-parser@21.1.1: {} + + yargs@17.7.3: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + yn@3.1.1: {} + + yocto-queue@0.1.0: {} + + zod@3.25.76: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..89819af --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - "backend" + - "infrastructure" diff --git a/scripts/seed-admin.ts b/scripts/seed-admin.ts new file mode 100644 index 0000000..4fa6b26 --- /dev/null +++ b/scripts/seed-admin.ts @@ -0,0 +1,100 @@ +/** + * One-off ops script: creates the first Admin account. + * + * Admins are deliberately NOT available through /auth/signup (see + * docs/decisions.md) — a self-service role selector that could grant + * ADMIN would be a privilege-escalation hole. This script is the sanctioned + * way to create the first Admin after a fresh deploy; every subsequent + * Admin can be promoted by an existing Admin directly in Cognito/DynamoDB. + * + * Usage: + * USER_POOL_ID=... USERS_TABLE_NAME=... AWS_REGION=us-east-1 \ + * npm run seed:admin -- --email admin@example.com --name "Site Admin" --password 'Str0ng!Passw0rd' + */ +import { + AdminAddUserToGroupCommand, + AdminCreateUserCommand, + AdminSetUserPasswordCommand, + CognitoIdentityProviderClient, + MessageActionType, +} from '@aws-sdk/client-cognito-identity-provider'; +import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; +import { DynamoDBDocumentClient, PutCommand } from '@aws-sdk/lib-dynamodb'; + +function requireArg(flag: string): string { + const index = process.argv.indexOf(flag); + if (index === -1 || !process.argv[index + 1]) { + throw new Error(`Missing required argument ${flag}`); + } + return process.argv[index + 1]; +} + +function requireEnv(name: string): string { + const value = process.env[name]; + if (!value) { + throw new Error(`Missing required environment variable: ${name}`); + } + return value; +} + +async function main(): Promise { + const email = requireArg('--email').trim().toLowerCase(); + const name = requireArg('--name'); + const password = requireArg('--password'); + + const userPoolId = requireEnv('USER_POOL_ID'); + const usersTableName = requireEnv('USERS_TABLE_NAME'); + + const cognito = new CognitoIdentityProviderClient({}); + const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({})); + + console.log(`Creating Cognito user ${email} in pool ${userPoolId}...`); + const created = await cognito.send( + new AdminCreateUserCommand({ + UserPoolId: userPoolId, + Username: email, + MessageAction: MessageActionType.SUPPRESS, + UserAttributes: [ + { Name: 'email', Value: email }, + { Name: 'email_verified', Value: 'true' }, + { Name: 'name', Value: name }, + { Name: 'custom:role', Value: 'ADMIN' }, + ], + }), + ); + + const userId = created.User?.Attributes?.find((a) => a.Name === 'sub')?.Value; + if (!userId) { + throw new Error('Cognito did not return a sub for the created user.'); + } + + console.log('Setting permanent password...'); + await cognito.send( + new AdminSetUserPasswordCommand({ + UserPoolId: userPoolId, + Username: email, + Password: password, + Permanent: true, + }), + ); + + console.log('Adding to ADMIN group...'); + await cognito.send( + new AdminAddUserToGroupCommand({ UserPoolId: userPoolId, Username: email, GroupName: 'ADMIN' }), + ); + + console.log('Writing profile to Users table...'); + await ddb.send( + new PutCommand({ + TableName: usersTableName, + Item: { userId, email, name, role: 'ADMIN', createdAt: new Date().toISOString() }, + }), + ); + + console.log(`Done. ${email} (userId=${userId}) can now log in via POST /auth/login as an Admin.`); +} + +main().catch((err) => { + console.error(err instanceof Error ? err.message : err); + process.exit(1); +}); diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..187f92b --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "commonjs", + "lib": ["ES2022"], + "moduleResolution": "node", + "declaration": false, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "noImplicitThis": true, + "alwaysStrict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "sourceMap": true + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..4d16ce8 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "scripts", + "types": ["node"] + }, + "include": ["scripts/**/*.ts"], + "exclude": ["node_modules", "backend", "infrastructure", "dist"] +} From e4d9f98dcb69149a987136fb3ecdf11bb6ee387e Mon Sep 17 00:00:00 2001 From: ezekielelvis Date: Sat, 1 Aug 2026 20:36:22 +0000 Subject: [PATCH 2/2] Fix branching-strategy.md: branch protection isn't applied yet gh api .../branches/main/protection 403s on this private repo under the free GitHub plan (needs Pro or public visibility). Documented the actual state and the exact command to run once that's available, instead of claiming a rule that isn't actually enforced. Co-Authored-By: Claude Sonnet 5 --- docs/branching-strategy.md | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/docs/branching-strategy.md b/docs/branching-strategy.md index f6d2aa9..5d857ac 100644 --- a/docs/branching-strategy.md +++ b/docs/branching-strategy.md @@ -38,11 +38,29 @@ like, whenever a maintainer chooses to run it. ## Branch protection on `main` -Applied via `gh api repos/ForkYeahMan/Azubi_Final_Capstone/branches/main/protection`: +**Not yet enabled** — this repository is private, and GitHub's branch +protection rules require GitHub Pro (or the repo being public) on the free +plan; `gh api .../branches/main/protection` currently 403s with "Upgrade to +GitHub Pro or make this repository public to enable this feature." Until +one of those changes, `main` is protected by convention (this doc) and by +CI gating the PR, not by a server-enforced rule. -- Require the `CI / validate` status check to pass before merging -- Require a pull request before merging (no direct pushes) -- Require branches to be up to date with `main` before merging +Once available (Pro upgrade, org plan, or making the repo public), apply: -These can be adjusted in the repo's Settings → Branches once more -contributors are involved (e.g. requiring N approving reviews). +```bash +gh api repos/ForkYeahMan/Azubi_Final_Capstone/branches/main/protection \ + -X PUT -H "Accept: application/vnd.github+json" \ + -f 'required_status_checks[strict]=true' \ + -f 'required_status_checks[checks][][context]=validate' \ + -F 'enforce_admins=false' \ + -F 'required_pull_request_reviews=null' \ + -F 'restrictions=null' \ + -F 'required_linear_history=false' \ + -F 'allow_force_pushes=false' \ + -F 'allow_deletions=false' +``` + +This requires the `validate` job in `.github/workflows/ci.yml` to pass and +a pull request before merging (no direct pushes), and can be tightened +further in Settings → Branches once more contributors are involved (e.g. +requiring N approving reviews).