From 1ab14ba45fbef8249c3c4bfac7c900add8ca7b83 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 23 May 2026 17:27:22 -0400 Subject: [PATCH] Phase 1-2 of server consolidation + security hardening --- CONSOLIDATION_PLAN.md | 751 +++++++ inventory-server/auth/server.js | 19 + .../dashboard/aircall-server/.env.example | 21 - .../dashboard/aircall-server/README.md | 55 - .../aircall-server/package-lock.json | 1914 ----------------- .../dashboard/aircall-server/package.json | 23 - .../dashboard/aircall-server/server.js | 83 - .../src/config/aircall.config.js | 15 - .../src/routes/aircall.routes.js | 57 - .../aircall-server/src/routes/index.js | 32 - .../services/aircall/AircallDataManager.js | 298 --- .../src/services/aircall/AircallService.js | 138 -- .../src/services/base/BaseService.js | 32 - .../src/services/base/DataManager.js | 320 --- .../dashboard/aircall-server/src/utils/db.js | 15 - .../aircall-server/src/utils/logger.js | 37 - .../aircall-server/src/utils/redis.js | 23 - .../aircall-server/src/utils/timeUtils.js | 262 --- .../dashboard/auth-server/.env.example | 10 - .../dashboard/auth-server/index.js | 203 -- .../dashboard/auth-server/package-lock.json | 1044 --------- .../dashboard/auth-server/package.json | 22 - .../gorgias-server/package-lock.json | 1068 --------- .../dashboard/gorgias-server/package.json | 19 - .../gorgias-server/routes/gorgias.routes.js | 119 - .../dashboard/gorgias-server/server.js | 31 - .../services/gorgias.service.js | 119 - inventory-server/shared/auth/middleware.js | 101 + inventory-server/shared/auth/verify.js | 37 + inventory-server/shared/cors/policy.js | 24 + inventory-server/shared/db/pg.js | 19 + inventory-server/shared/db/redis.js | 27 + inventory-server/shared/errors/handler.js | 18 + inventory-server/shared/logging/index.js | 2 + inventory-server/shared/logging/logger.js | 27 + .../shared/logging/request-log.js | 32 + inventory-server/shared/package.json | 28 + inventory-server/shared/rate-limit/login.js | 17 + .../components/dashboard/AircallDashboard.jsx | 405 ---- .../components/dashboard/GorgiasOverview.jsx | 407 ---- .../src/components/dashboard/Navigation.jsx | 2 - inventory/src/config/dashboard.ts | 4 - inventory/src/pages/Dashboard.tsx | 12 - inventory/src/types/dashboard.d.ts | 10 - inventory/tsconfig.tsbuildinfo | 2 +- inventory/vite.config.ts | 25 - 46 files changed, 1103 insertions(+), 6826 deletions(-) create mode 100644 CONSOLIDATION_PLAN.md delete mode 100644 inventory-server/dashboard/aircall-server/.env.example delete mode 100644 inventory-server/dashboard/aircall-server/README.md delete mode 100644 inventory-server/dashboard/aircall-server/package-lock.json delete mode 100644 inventory-server/dashboard/aircall-server/package.json delete mode 100644 inventory-server/dashboard/aircall-server/server.js delete mode 100644 inventory-server/dashboard/aircall-server/src/config/aircall.config.js delete mode 100644 inventory-server/dashboard/aircall-server/src/routes/aircall.routes.js delete mode 100644 inventory-server/dashboard/aircall-server/src/routes/index.js delete mode 100644 inventory-server/dashboard/aircall-server/src/services/aircall/AircallDataManager.js delete mode 100644 inventory-server/dashboard/aircall-server/src/services/aircall/AircallService.js delete mode 100644 inventory-server/dashboard/aircall-server/src/services/base/BaseService.js delete mode 100644 inventory-server/dashboard/aircall-server/src/services/base/DataManager.js delete mode 100644 inventory-server/dashboard/aircall-server/src/utils/db.js delete mode 100644 inventory-server/dashboard/aircall-server/src/utils/logger.js delete mode 100644 inventory-server/dashboard/aircall-server/src/utils/redis.js delete mode 100644 inventory-server/dashboard/aircall-server/src/utils/timeUtils.js delete mode 100644 inventory-server/dashboard/auth-server/.env.example delete mode 100644 inventory-server/dashboard/auth-server/index.js delete mode 100644 inventory-server/dashboard/auth-server/package-lock.json delete mode 100644 inventory-server/dashboard/auth-server/package.json delete mode 100644 inventory-server/dashboard/gorgias-server/package-lock.json delete mode 100644 inventory-server/dashboard/gorgias-server/package.json delete mode 100644 inventory-server/dashboard/gorgias-server/routes/gorgias.routes.js delete mode 100644 inventory-server/dashboard/gorgias-server/server.js delete mode 100644 inventory-server/dashboard/gorgias-server/services/gorgias.service.js create mode 100644 inventory-server/shared/auth/middleware.js create mode 100644 inventory-server/shared/auth/verify.js create mode 100644 inventory-server/shared/cors/policy.js create mode 100644 inventory-server/shared/db/pg.js create mode 100644 inventory-server/shared/db/redis.js create mode 100644 inventory-server/shared/errors/handler.js create mode 100644 inventory-server/shared/logging/index.js create mode 100644 inventory-server/shared/logging/logger.js create mode 100644 inventory-server/shared/logging/request-log.js create mode 100644 inventory-server/shared/package.json create mode 100644 inventory-server/shared/rate-limit/login.js delete mode 100644 inventory/src/components/dashboard/AircallDashboard.jsx delete mode 100644 inventory/src/components/dashboard/GorgiasOverview.jsx diff --git a/CONSOLIDATION_PLAN.md b/CONSOLIDATION_PLAN.md new file mode 100644 index 0000000..b8bb753 --- /dev/null +++ b/CONSOLIDATION_PLAN.md @@ -0,0 +1,751 @@ +# Server Consolidation & Security Hardening Plan + +Audit-driven plan to (a) reduce 12 PM2 processes to 3 application servers + 1 auth server, (b) put every API endpoint behind real authentication, and (c) standardize on ESM across all Node services. Approach is "do it properly the first time" — no half-finished pieces, no deferred cleanup. + +--- + +## Status (2026-05-23) + +| Phase | Status | Notes | +|---|---|---| +| 1 — Decommission dead services | **Complete** | aircall/gorgias/clarity/legacy-auth-server deleted from repo + PM2 + Caddyfile + ecosystem.cjs | +| 2 — Build shared `lib/` | **Complete** | Lives at `inventory-server/shared/` (see Deviations). `/verify` endpoint live on auth-server | +| 3 — Convert auth-server + inventory-server to ESM | Not started | Next up. Auth-server is still CJS but has the new `/verify` route added in CJS form | +| 4 — Build `dashboard-server` (the merge) | Not started | klaviyo/meta/google/typeform still run as 4 separate PM2 apps | +| 5 — Convert `acot-server` to ESM | Not started | | +| 6 — Auth hardening | Not started | Shared modules exist (`shared/rate-limit`, `shared/cors`, `shared/logging`) but no service consumes them yet. JWT_SECRET footgun discovered — see 6.4 | +| 7 — Caddyfile final form | Partial | Dead routes removed; `forward_auth` gate + `/uploads/*` gating + per-vendor cleanup deferred to after Phase 4 | +| 8 — ecosystem.config.cjs final form | Partial | Dead apps removed; final shape depends on Phase 4 merge | + +**Live PM2 count: 10** (down from 13). Target after Phase 4: 5 application apps + acot-phone-server + lt-wordlist-api. + +--- + +## Goals + +- Every public-facing endpoint requires a valid auth token (Caddy gate + per-server middleware + per-route permission checks for sensitive operations). +- Reduce service count from 12 PM2 processes to 4: `inventory-server`, `acot-server`, `dashboard-server`, `auth-server`. +- Standardize on ESM (`"type": "module"`) across all Node services. +- Decommission `aircall-server`, `gorgias-server`, `clarity-server`, and the legacy `auth-server` (port 3003). +- Eliminate dependency duplication: one Redis client, one Postgres pool helper, one logger, one auth middleware — shared across services. + +## Non-goals + +- Rewriting business logic. Route handlers move as-is unless they break under ESM or shared middleware. +- Switching auth providers (we keep JWT + bcrypt + Postgres). +- Replacing PM2 or Caddy. +- Migrating Klaviyo/Meta/Google/Typeform's external API contracts. + +--- + +## Target architecture + +``` + ┌──────────────────────────┐ + │ tools.acherryontop.com │ + │ (Caddy) │ + │ forward_auth gate ─────┼──► auth-server:3011 + └────────────┬─────────────┘ /verify endpoint + │ + ┌────────────────────────────────┼────────────────────────────────┐ + ▼ ▼ ▼ + ┌─────────────────────┐ ┌──────────────────────┐ ┌─────────────────────┐ + │ inventory-server │ │ dashboard-server │ │ acot-server │ + │ :3010 (ESM) │ │ :3015 (ESM) │ │ :3012 (ESM) │ + │ │ │ │ │ │ + │ /api/products │ │ /api/klaviyo/* │ │ /api/acot/* │ + │ /api/orders │ │ /api/meta/* │ │ (MySQL via SSH) │ + │ /api/analytics │ │ /api/google-*/* │ │ │ + │ /api/dashboard │ │ /api/typeform/* │ │ │ + │ ... (~25 routers) │ │ │ │ │ + └─────────────────────┘ └──────────────────────┘ └─────────────────────┘ + │ │ │ + ├── Postgres (inventory_db) ├── Postgres (klaviyo) └── MySQL (workpi, via ssh2 tunnel) + ├── shared lib/ ◄────────────────┤ + │ - auth middleware ├── Redis (shared client) + │ - permission helper └── shared lib/ ◄─────────────────┐ + │ - logger │ + │ - pg pool factory │ + │ - error formatter │ + └─────────────────────────────────────────────────────────────────┘ + │ + ┌──────────────────┴───┐ + │ auth-server │ + │ :3011 (ESM) │ + │ /login, /me, │ + │ /verify, user mgmt │ + └──────────────────────┘ +``` + +PM2 process count: **12 → 4** (plus `acot-phone-server` and `lt-wordlist-api`, which stay as-is — out of scope). + +--- + +## Phase 1 — Decommission dead/leaving services + +Status: **Complete (2026-05-23)**. All four services removed from repo, PM2, Caddyfile, and ecosystem.config.cjs. Frontend widgets (`AircallDashboard.jsx`, `GorgiasOverview.jsx`) and their dashboard.ts/Navigation.jsx/vite.config.ts wiring also removed. Verification: smoke-tested `https://tools.acherryontop.com/api/{aircall,gorgias,clarity}/*` → 404. Backups left at `/home/matt/{ecosystem.config.cjs,Caddyfile}.bak.2026-05-23`. + +### To remove + +| Service | Reason | Steps | +|---|---|---| +| `aircall-server` (3002) | Migrating off Aircall | `pm2 delete aircall-server`; remove from `ecosystem.config.cjs`; remove `/api/aircall/*` from Caddyfile; drop `inventory/dashboard/aircall-server/` directory; remove MongoDB connection from any frontend code; cancel Mongo if it was only feeding Aircall | +| `gorgias-server` (3006) | Migrating off Gorgias | same pattern; check frontend for `/api/gorgias/*` callers and delete the dashboards/widgets that use them | +| `clarity-server` (3009) | Already dead (no `.js` files, not in ecosystem) | remove `/api/clarity/*` from Caddyfile; delete `inventory/dashboard/clarity-server/` directory | +| `auth-server` (3003, legacy) | Replaced by `new-auth-server` on 3011 | grep entire codebase for `dashboard-auth` and `localhost:3003`; redirect or remove callers; `pm2 delete auth-server`; remove from ecosystem; remove `/dashboard-auth/*` from Caddyfile; delete `inventory/dashboard/auth-server/` directory | + +### Verification before deletion + +```bash +# from inventory/ root — find any references before removing +grep -rn "aircall\|/api/aircall" inventory/src/ inventory-server/src/ +grep -rn "gorgias\|/api/gorgias" inventory/src/ inventory-server/src/ +grep -rn "/dashboard-auth\|localhost:3003" inventory/src/ inventory-server/src/ +grep -rn "/api/clarity" inventory/src/ inventory-server/src/ +``` + +Any remaining callers must be deleted or repointed before the server is removed. Do **not** leave a 502 response in production. + +### Database/secret cleanup + +- Drop the MongoDB instance feeding Aircall (after confirming no other consumers). +- Rotate any Gorgias/Aircall API keys still in `.env` files (defense in depth — they'll be useless soon anyway, but commit hygiene matters). +- Remove `MONGODB_URI`, `AIRCALL_*`, `GORGIAS_*` from any `.env` files. + +--- + +## Phase 2 — Build the shared `lib/` + +Status: **Complete (2026-05-23)**. All 11 modules written under `inventory-server/shared/` (NOT repo root — see Deviations). `/verify` endpoint added to auth-server in CJS form (will move to shared/auth/verify.js usage during Phase 3 ESM conversion). Smoke-tested with no-token / bad-token / expired-token / valid-token cases. No service consumes shared/ yet; that happens in Phases 3–5. + +### Location + +A single shared directory at the repo root: `shared/` (sibling of `inventory/` and `acot-phone/`). Each service imports from it via a relative path. We do **not** introduce npm workspaces yet — relative imports are fine for three consumers and avoid the npm-link / hoisting headaches. + +### Modules to create + +``` +shared/ +├── package.json # "type": "module" +├── auth/ +│ ├── middleware.js # authenticate(), requirePermission(), requireAdmin() +│ └── verify.js # verifyToken() — pure function, no Express dependency +├── db/ +│ ├── pg.js # createPool(envPrefix) — returns configured Pool +│ └── redis.js # createRedis() — single client, lazy-connect +├── logging/ +│ ├── logger.js # pino-based, redacts Authorization/Cookie +│ └── request-log.js # Express middleware, structured access log +├── errors/ +│ └── handler.js # consistent error envelope, no leak in prod +├── cors/ +│ └── policy.js # single allowed-origins list, exported as cors() options +└── rate-limit/ + └── login.js # express-rate-limit config for /login +``` + +### Auth middleware spec (`shared/auth/middleware.js`) + +```js +// Pseudocode — final implementation matches the existing pattern in +// inventory/auth/routes.js authenticate() but factored out. + +export function authenticate({ pool }) { + return async (req, res, next) => { + const header = req.headers.authorization; + if (!header?.startsWith('Bearer ')) { + return res.status(401).json({ error: 'Authentication required' }); + } + try { + const decoded = jwt.verify(header.slice(7), process.env.JWT_SECRET); + // Short-circuit DB hit with an in-memory cache, 60s TTL keyed by token jti + const user = await loadUserCached(pool, decoded.userId); + if (!user.is_active) return res.status(403).json({ error: 'Account inactive' }); + req.user = user; + next(); + } catch { + res.status(401).json({ error: 'Invalid token' }); + } + }; +} + +export function requirePermission(code) { + return (req, res, next) => { + if (req.user.is_admin) return next(); + if (req.user.permissions?.includes(code)) return next(); + res.status(403).json({ error: 'Insufficient permissions' }); + }; +} + +export const requireAdmin = (req, res, next) => + req.user.is_admin ? next() : res.status(403).json({ error: 'Admin only' }); +``` + +### Why a 60s in-memory user cache + +`forward_auth` in Caddy will call `auth-server` on every request. Each per-server `authenticate()` middleware also has a DB lookup to load permissions. Without caching, every API request becomes 1 SQL query for the user row + 1 for permissions. 60s TTL is short enough that deactivating a user takes effect within a minute, long enough that Klaviyo dashboards (which fire dozens of requests on load) don't hammer Postgres. + +### Add to `auth-server`: a `/verify` endpoint + +Caddy's `forward_auth` only needs "is this token valid? give me a user-id." Today's `/me` does that but with a full permissions join. Add a lightweight `/verify` that: + +- Verifies JWT signature only (no DB hit). +- Returns `200` with `X-User-Id` and `X-User-Is-Admin` response headers (which Caddy `copy_headers` will pass to upstream). +- Returns `401` on bad token. + +**Decision: each service re-verifies the JWT independently.** Caddy's `forward_auth` is a fast first-pass reject for obviously bad tokens, but the security boundary is the per-server `authenticate()` middleware. Cost is negligible (one HMAC-SHA256 per request); the upside is that a misconfigured Caddyfile can never let an unauthenticated request reach a backend. Upstream services do **not** trust any `X-User-*` headers from Caddy — they parse the `Authorization` header themselves. + +--- + +## Phase 3 — Convert `auth-server` and `inventory-server` to ESM + +Status: **Not started.** Lift the easy ones first. These two stay standalone (don't merge into anything), so they're isolated changes. The auth-server's new `/verify` route (added in Phase 2) is currently CJS — refactor it during this phase to import from `../shared/auth/verify.js`. + +### Mechanical conversion + +Per service: + +1. Add `"type": "module"` to `package.json`. +2. Convert `require()` → `import`. `module.exports` → `export` / `export default`. +3. Fix `__dirname`/`__filename` (use `import.meta.url` + `fileURLToPath`). +4. Convert any dynamic require (e.g., conditional plugin loading) to `await import()`. +5. Update any sub-imports that don't include the file extension — ESM requires `./foo.js`, not `./foo`. +6. Update `ecosystem.config.cjs` if any service entry depended on CJS semantics. The ecosystem file itself can stay `.cjs` — PM2 reads it as config, doesn't matter what the apps it spawns are. +7. Update nodemon config / scripts. + +### Risk areas in inventory-server + +- `routes/ai.js` does a lazy init (`aiRouter.initInBackground()` called from `server.js`) — confirm the export shape still works as a default export of an Express router with a sidecar function. May need to split into `export default router; export function initInBackground() {}`. +- Multer setup in `routes/import.js` — straightforward, no ESM-specific concerns. +- SSE setup in `server.js` — moves over cleanly, no module-system entanglement. +- The `child_process.spawn` calls for metrics calculation: ESM doesn't change `child_process` behavior, but if any spawned script uses `require()` of a sibling, that sibling must also be ESM (or stay CJS with a `.cjs` extension). + +### Test strategy + +- After conversion, `pm2 start ecosystem.config.cjs --only inventory-server` on the server, watch logs for require/import errors at startup. +- Hit `/health`, then the most exercised endpoints (`/api/products`, `/api/dashboard/overview`, `/api/analytics/...`). If startup is clean and three smoke endpoints work, ESM conversion is done. Functional correctness is preserved because no logic changed. + +### Auth-server + +Already small (~200 LOC server.js + ~few hundred in routes.js + permissions.js). 1-day conversion. Add the new `/verify` endpoint as part of this work. + +--- + +## Phase 4 — Build `dashboard-server` (the merge) + +Status: **Not started.** The big merge. Klaviyo + Meta + Google + Typeform → one ESM service. Highest-risk phase — see Rollback strategy for the per-vendor cutover plan. + +### Layout + +``` +inventory/dashboard/ +├── server.js # entry: load env, init Postgres+Redis, mount routes, listen +├── package.json # "type": "module", deps from all 4 source servers (deduped) +├── .env # KLAVIYO_*, META_*, GOOGLE_*, TYPEFORM_*, shared DB_*, REDIS_URL +├── routes/ +│ ├── klaviyo/ # absorbed from dashboard/klaviyo-server/src/ +│ ├── meta/ # absorbed from dashboard/meta-server/ +│ ├── google/ # absorbed from dashboard/google-server/ +│ └── typeform/ # absorbed from dashboard/typeform-server/ +├── services/ # per-vendor API clients (Klaviyo SDK calls, etc.) +├── scripts/ +│ └── import-campaign-products.js # one-shot, moved from klaviyo-server/scripts/ +└── logs/ +``` + +### Mount points + +```js +// server.js (sketch) +import { authenticate, requirePermission } from '../../shared/auth/middleware.js'; +import { createPool } from '../../shared/db/pg.js'; +import { createRedis } from '../../shared/db/redis.js'; +import { logger, requestLog } from '../../shared/logging/index.js'; +import corsPolicy from '../../shared/cors/policy.js'; +import errorHandler from '../../shared/errors/handler.js'; + +import klaviyoRouter from './routes/klaviyo/index.js'; +import metaRouter from './routes/meta/index.js'; +import googleRouter from './routes/google/index.js'; +import typeformRouter from './routes/typeform/index.js'; + +const app = express(); +const pool = await createPool('KLAVIYO_DB'); // klaviyo has its own DB; others can share or have none +const redis = await createRedis(); + +app.use(requestLog); +app.use(cors(corsPolicy)); +app.use(express.json({ limit: '10mb' })); + +// Everything below this line requires a valid token. +app.use('/api', authenticate({ pool })); + +app.use('/api/klaviyo', klaviyoRouter({ pool, redis })); +app.use('/api/meta', metaRouter({ redis })); +app.use('/api/google-analytics', googleRouter({ redis })); // matches Caddy /api/dashboard-analytics rewrite +app.use('/api/typeform', typeformRouter({ redis })); + +app.get('/health', (req, res) => res.json({ ok: true })); +app.use(errorHandler); + +app.listen(process.env.DASHBOARD_PORT || 3015); +``` + +### Per-vendor routers + +Each vendor's existing route file becomes a factory that takes the shared `pool`/`redis` and returns an Express router. Replace each server's per-instance pool/redis with the injected one. + +### Permission gates (sensitive routes only) + +Authenticated-only is the default after `app.use('/api', authenticate(...))`. For sensitive operations, add `requirePermission` per route: + +- Anything that mutates Klaviyo lists/segments → `requirePermission('klaviyo_write')` +- Triggering a campaign sync → `requirePermission('klaviyo_admin')` +- Read-only dashboards → no extra check beyond authenticate. + +Define the new permission codes in the `permissions` table via a migration in Phase 6. + +### Dependency dedup + +**Decision: standardize on `ioredis`.** Klaviyo's larger codebase already uses it, and `ioredis` has better cluster/sentinel support if we ever need it. Update `meta`/`google`/`typeform` call sites — each is a handful of `get`/`set` calls, mechanical conversion. Remove the `redis` package from `dashboard-server`'s `package.json`. + +### Env consolidation + +Single `.env` at `inventory/dashboard/.env`, prefixed keys: + +``` +DASHBOARD_PORT=3015 +KLAVIYO_API_KEY=... +KLAVIYO_DB_HOST=... +KLAVIYO_DB_NAME=... +META_ACCESS_TOKEN=... +GOOGLE_SERVICE_ACCOUNT_KEY=... +TYPEFORM_TOKEN=... +REDIS_URL=... +JWT_SECRET=... # shared with auth-server; same secret means same tokens valid here +``` + +### Klaviyo's `scripts/import-campaign-products.js` + +One-shot script — keep it, but run it from the merged dashboard-server's directory. Update the script's imports to ESM. If it's run via cron, update the cron entry to the new path. + +### Risk: shared error states + +When all four vendors share a Redis client, a Redis hiccup affects all four. Make sure the connection has retry config (`ioredis` defaults are reasonable but verify) and that vendor routes degrade gracefully when Redis is unavailable (most use it as a cache, so cache-miss → fall through to upstream API is the right behavior). + +--- + +## Phase 5 — Convert `acot-server` to ESM (stays standalone) + +Status: **Not started.** Largest single conversion (~5K LOC), but no merge involved. + +### Special concern: ssh2 tunnel + +`acot-server` opens an SSH tunnel via `ssh2` to access the production MySQL at `192.168.1.5:3309`. The tunnel must be: + +- Established before the HTTP listener starts (so no requests fail with "no DB connection"). +- Re-established on disconnect (`ssh2` connection's `close` event → recreate). +- Cleanly torn down on `SIGTERM`/`SIGINT` so PM2 restarts don't leak file descriptors. + +Verify (or add) this lifecycle handling as part of the conversion. If it's already correct, conversion is mechanical; if not, this is a good moment to fix it. + +### Test strategy + +Same as inventory-server: start with PM2, smoke-test the most-used `/api/acot/*` endpoints, watch logs for unhandled rejection or tunnel-close events. + +--- + +## Phase 6 — Auth hardening + +Status: **Not started.** This is the security work that justifies the whole refactor. Runs in parallel with phases 3–5 where possible. Shared building blocks already exist (`shared/rate-limit/login.js`, `shared/cors/policy.js`, `shared/logging/request-log.js`, `shared/errors/handler.js`) — Phase 6 is about *applying* them per-service. + +### 6.1 Caddy `forward_auth` gate + +Add to the `tools.acherryontop.com` block, before the `@api_routes` handler: + +```caddyfile +# Forward-auth gate for all API traffic +@needs_auth path /api/* /chat-api/* +handle @needs_auth { + forward_auth localhost:3011 { + uri /verify + copy_headers Authorization + # On 401/403, Caddy returns the auth-server's response body verbatim + } + # Existing per-vendor handle blocks remain below this line +} + +# /auth-inv/* stays public (you need to log in!) +handle /auth-inv/* { + uri strip_prefix /auth-inv + reverse_proxy localhost:3011 +} +``` + +The `forward_auth` directive subrequests `/verify` on the auth-server. If it returns 2xx, the request proceeds upstream. If 401/403, Caddy returns that response to the client and never hits the backend. + +This is the **first** line of defense. Per-server middleware (`shared/auth/middleware.js`) is the **second** line — re-verifies the JWT independently. Defense in depth: a Caddyfile typo can't open a hole. + +### 6.2 Per-route permission gates + +After per-server `authenticate()`, add `requirePermission(code)` to destructive or sensitive routes. Audit needed in: + +- `inventory-server/src/routes/config.js` — global config writes → `admin` +- `inventory-server/src/routes/import.js` — uploads, deletes, generate-upc → `product_import` +- `inventory-server/src/routes/data-management.js` — CSV operations → `data_management` +- `inventory-server/src/routes/ai-prompts.js` — prompt edits → `ai_admin` +- `inventory-server/src/routes/templates.js` — template writes → `templates_write` +- `inventory-server/src/routes/reusable-images.js` — image management → `image_admin` +- `inventory-server/src/routes/products.js` — only one POST (`/resolve-identifiers`); evaluate whether it needs a permission code or authenticated-only is fine +- `inventory-server/src/routes/product-editor-audit-log.js` and `import-audit-log.js` — read-only by sensitive users → `audit_read` +- `dashboard-server` Klaviyo/Meta/Google/Typeform write endpoints → vendor-specific codes per above + +Migration: a single SQL script that inserts the new permission codes into the `permissions` table and assigns them to existing admin users. Non-admin users get permissions explicitly granted via the user management UI. + +```sql +INSERT INTO permissions (code, name) VALUES + ('product_import', 'Product Import'), + ('data_management', 'Data Management'), + ('ai_admin', 'AI Settings Admin'), + ('templates_write', 'Template Editing'), + ('image_admin', 'Image Management'), + ('audit_read', 'Audit Log Access'), + ('klaviyo_write', 'Klaviyo Write'), + ('klaviyo_admin', 'Klaviyo Admin'), + ('meta_write', 'Meta Write'), + ('google_write', 'Google Analytics Write'), + ('typeform_write', 'Typeform Write'), + ('acot_admin', 'ACOT Server Admin') +ON CONFLICT (code) DO NOTHING; +``` + +### 6.3 Rate limiting on login + +`shared/rate-limit/login.js`: + +```js +import rateLimit from 'express-rate-limit'; +export const loginLimiter = rateLimit({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 10, // 10 attempts per IP per window + message: { error: 'Too many login attempts, try again later' }, + standardHeaders: true, + legacyHeaders: false, +}); +``` + +Apply in `auth-server` on the `/login` route. Consider also rate-limiting `/verify` and `/me` (much higher cap, ~600/min — they're called legitimately by every page load). + +### 6.4 JWT secret rotation + +- Rotate `JWT_SECRET` to a fresh 32-byte random string as part of the deployment. +- Document that rotation logs out all users — acceptable for an internal tool, do it during off-hours. +- Add `JWT_SECRET` to the env var validation block in `auth-server/server.js` (refuse to start if not set). +- **Fix the existing footgun**: `/var/www/ecosystem.config.cjs` currently has `JWT_SECRET: process.env.JWT_SECRET` *after* `...inventoryEnv` in the new-auth-server block. This shadows the `.env` value with whatever the shell exported when PM2 was started — which has already silently diverged at least once (detected and fixed 2026-05-23 by a clean PM2 restart in a shell without JWT_SECRET exported). Delete that override line during rotation; let `.env` be the single source of truth. + +### 6.5 Request logging + +`shared/logging/request-log.js` — log method, path, status, duration, user-id (if authenticated). **Never** log `Authorization` or `Cookie` headers. Remove the current `server.js:79-87` debug middleware in inventory-server (it logs full headers including the bearer token). + +### 6.6 CORS lockdown + +Current `middleware/cors.js` allows `192.168.*.*` and `10.*.*.*` with `credentials: true`. Tighten to explicit known origins: + +```js +origin: [ + 'https://tools.acherryontop.com', + 'https://inventory.kent.pw', + /^http:\/\/localhost:(5174|5175)$/, +] +``` + +If anyone genuinely needs LAN access, add their specific IP, not a `/16` range. + +### 6.7 Upload hardening + +`POST /api/import/upload-image` (multer-backed) needs: + +- File-size limit set on multer config (current limit may be defaulted — verify). +- MIME-type allowlist (image/jpeg, image/png, image/webp; reject everything else). +- Filename sanitization (no `..`, no absolute paths, generate UUID-based names server-side). +- The Caddy `/uploads/*` handler currently serves any file in the uploads directory publicly. Move this **behind** the auth gate: include `/uploads/*` in `@needs_auth`. If some images are referenced from public emails (Klaviyo newsletter), put **those** in a separate public bucket; everything else stays gated. + +### 6.8 Frontend token storage + +**Decision: stay on `localStorage`.** This is an internal tool with no untrusted user-generated HTML being rendered, so the XSS-token-theft surface is small. The `forward_auth` gate is the main security gap we're addressing; cookie-based auth would be a larger, separate project (cookie-parser, CSRF double-submit pattern, AuthContext refactor) that doesn't change the threat model for an internal tool with no public sign-up. + +Sanity check during this refactor: grep the React codebase for `dangerouslySetInnerHTML`. If any usages exist, verify each one is rendering trusted (server-controlled, not user-supplied) content. If a user-supplied content path exists, that's a real XSS vector and needs separate remediation regardless of token-storage choice. + +### 6.9 Remove debug middleware + +[inventory-server/src/server.js:79-87](inventory-server/src/server.js#L79-L87) logs full request headers including `Authorization`. Delete this block. Replace with `shared/logging/request-log.js`. + +### 6.10 `lt-wordlist-api` token + +`ADD_WORD_TOKEN` is currently hardcoded in `/var/www/ecosystem.config.cjs`. Move to `/opt/lt-wordlist-api/.env`, rotate the token value, update any callers. + +### 6.11 Audit logging for sensitive operations + +Already have `import-audit-log` and `product-editor-audit-log` tables. Extend the pattern: + +- Log `user_id`, `endpoint`, `params`, `result` for `config.js` writes and `data-management.js` operations. +- Schema: reuse the existing audit table pattern or add a generic `system_audit_log` table. +- Don't log request bodies wholesale (may contain large blobs); log the action and the target ID. + +--- + +## Phase 7 — Caddyfile final form + +After all phases, the `tools.acherryontop.com` block looks like: + +```caddyfile +tools.acherryontop.com { + import security_headers + + # Public: login endpoint + handle /auth-inv/* { + uri strip_prefix /auth-inv + reverse_proxy localhost:3011 + } + + # Public: static frontend assets + @static path *.js *.css *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 + handle @static { + header Cache-Control "public, max-age=2592000" + root * /var/www/inventory/frontend/build + file_server + } + + # All API + uploads: auth gate first + @gated path /api/* /chat-api/* /uploads/* + handle @gated { + forward_auth localhost:3011 { + uri /verify + copy_headers Authorization + } + + # Uploaded files + handle /uploads/* { + root * /var/www/inventory + file_server + } + + # Vendor dashboard routes → merged dashboard-server + handle /api/klaviyo/* { reverse_proxy localhost:3015 } + handle /api/meta/* { reverse_proxy localhost:3015 } + handle /api/google-analytics/* { reverse_proxy localhost:3015 } + handle /api/typeform/* { reverse_proxy localhost:3015 } + + # ACOT-specific + handle /api/acot/* { reverse_proxy localhost:3012 } + + # Chat + handle /chat-api/* { + uri strip_prefix /chat-api + reverse_proxy localhost:3014 + } + + # Catch-all: inventory-server + handle /api/* { reverse_proxy localhost:3010 } + } + + handle /health { reverse_proxy localhost:3010 } + + # SPA fallback + handle { + root * /var/www/inventory/frontend/build + try_files {path} /index.html + file_server + encode gzip + } + + handle_errors { + respond "{err.status_code} {err.status_text}" + } +} +``` + +Removed: `/dashboard-auth/*`, `/api/aircall/*`, `/api/gorgias/*`, `/api/clarity/*`, the LAN/`Access-Control-Allow-Origin "*"` permissive defaults on `/api/*`. Kept: `/apiv2/*` and `/apiv2-test/*` proxies to backend.acherryontop.com (out of scope, separate system). + +--- + +## Phase 8 — ecosystem.config.cjs final form + +```js +module.exports = { + apps: [ + { + name: 'auth-server', + script: './inventory/auth/server.js', + cwd: '/var/www', + env: { NODE_ENV: 'production', AUTH_PORT: 3011 }, + ...commonSettings, + }, + { + name: 'inventory-server', + script: './inventory/src/server.js', + cwd: '/var/www', + env: { NODE_ENV: 'production', PORT: 3010, UPLOADS_DIR: '/var/www/inventory/uploads' }, + ...commonSettings, + }, + { + name: 'dashboard-server', + script: './inventory/dashboard/server.js', + cwd: '/var/www', + env: { NODE_ENV: 'production', DASHBOARD_PORT: 3015 }, + ...commonSettings, + }, + { + name: 'acot-server', + script: './inventory/dashboard/acot-server/server.js', + cwd: '/var/www', + env: { NODE_ENV: 'production', ACOT_PORT: 3012 }, + ...commonSettings, + }, + { + name: 'chat-server', + script: './inventory/chat/server.js', + cwd: '/var/www', + env: { NODE_ENV: 'production', PORT: 3014 }, + ...commonSettings, + }, + // acot-phone-server and lt-wordlist-api unchanged + ], +}; +``` + +Five entries instead of twelve. Each app loads its own `.env` from its directory (already handled by `dotenv.config`). + +--- + +## Sequencing & dependencies + +``` +Phase 1 (decommission) ──┬─────────────────────────────────────────┐ + │ │ + ▼ │ + Phase 2 (shared lib/) │ + │ │ + ┌──────────────┼──────────────┐ │ + ▼ ▼ ▼ ▼ + Phase 3a Phase 3b Phase 4 Phase 6 (auth hardening + inventory-server auth-server dashboard-server runs alongside 3+4+5, + to ESM to ESM + /verify build & test completes after them) + │ │ │ │ + └──────────────┼──────────────┘ │ + ▼ │ + Phase 5 (acot-server to ESM) ──────────────────►│ + ▼ + Phase 7 (Caddy cutover) + │ + ▼ + Phase 8 (PM2 final state) +``` + +Phase 1 unblocks everything (fewer services to convert). +Phase 2 is the foundation; nothing else can start until shared `lib/` exists. +Phases 3–5 can run in parallel; they touch independent services. +Phase 6's sub-items can be developed alongside 3–5 but **enabled** only after them (no point adding `requirePermission` to a route that doesn't yet have `authenticate`). +Phase 7 is the cutover: Caddyfile flip happens when all backend changes are deployed. +Phase 8 is cleanup: remove dead PM2 entries. + +Estimated effort, end-to-end: **~3 weeks of focused work** by one engineer. Phase 1 ≈ 1 day, Phase 2 ≈ 2 days, Phase 3 ≈ 3 days (both services), Phase 4 ≈ 5–7 days (the merge), Phase 5 ≈ 2–3 days, Phase 6 ≈ 3–4 days, Phase 7+8 ≈ 1 day. + +--- + +## Testing strategy + +No formal test suite exists today (per CLAUDE.md). For a refactor this size, that's a gap to close — but writing tests retroactively for 15K LOC of routes is a separate, larger project. For this refactor: + +### Manual smoke testing per phase + +A checklist of representative endpoints to hit after each deploy: + +- `inventory-server`: `/api/products`, `/api/dashboard/overview`, `/api/analytics/revenue`, `/api/orders`, `/api/purchase-orders`, `/api/import/list-uploads`, `/api/config/global` +- `dashboard-server`: `/api/klaviyo/campaigns`, `/api/meta/insights`, `/api/google-analytics/...`, `/api/typeform/responses` +- `acot-server`: `/api/acot/...` (top-3 endpoints by call volume — pull from access logs) +- `auth-server`: `/login`, `/me`, `/verify` + +Each smoke test runs (a) without a token → expect 401, (b) with an invalid token → expect 401, (c) with a valid token → expect 2xx. + +### Frontend integration check + +After deploys, log into the SPA and exercise each major page (Overview, Products, Analytics, Dashboard, Klaviyo, Meta, etc.). If everything loads and dashboards populate, the auth + routing layer is intact. + +### Test scaffold during Phase 2 (committed) + +While building `shared/`, set up `vitest` (lightweight, ESM-native, fast) as the standard test runner for the repo. Initial coverage focuses on the security-critical surface only: + +- `shared/auth/verify.js` — known good token, expired token, wrong-signature token, malformed token, missing token. +- `shared/auth/middleware.js` — request with no header → 401; bad header → 401; valid token + inactive user → 403; valid token + missing permission → 403; valid token + correct permission → next() called with `req.user` populated. +- `shared/auth/middleware.js` user-cache TTL: same token within 60s → one DB hit; same token after 61s → two DB hits. + +`package.json` gets a `"test": "vitest run"` script at the repo root and per-service. Set up but don't backfill broader test coverage — that's a separate, larger project. The vitest scaffold gives future work a foothold; this refactor commits to having tests for the auth boundary specifically because that's what's load-bearing for the whole security model. + +--- + +## Rollback strategy + +Each phase produces an independently deployable state. Rollback per phase: + +- **Phase 1**: re-add removed services to ecosystem; restore from git. Don't roll back data deletions — only do those after a week of stable production. +- **Phases 3, 5**: ESM conversion is per-service; if one service breaks, `pm2 restart ` to the previous commit. Other services unaffected. +- **Phase 4**: the dashboard-server merge is the highest-risk change. Plan: deploy `dashboard-server` to a non-conflicting port (3015) while leaving the old per-vendor servers running. Cut over Caddy routes one vendor at a time (start with Meta — smallest). If any vendor breaks, point Caddy back to the old server (still running) for that vendor, debug, retry. Only delete the old servers after all four are stable on `dashboard-server`. +- **Phases 6, 7**: Caddy config is git-tracked. `git revert` + `caddy reload` rolls back in seconds. Auth changes are additive (defense in depth) — if `forward_auth` causes problems, comment it out and per-server middleware continues protecting routes. + +--- + +## Out of scope (intentional) + +These came up in the audit but aren't part of this refactor: + +- `httpOnly` cookie auth (deferred — current `localStorage` acceptable for internal tool). +- Replacing PM2 with systemd or Docker. +- Test coverage beyond the auth-critical surface. +- `apiv2`/`apiv2-test` proxies to `backend.acherryontop.com` — separate system, not touched. +- `acot-phone-server` and `lt-wordlist-api` — staying as-is. +- Centralized observability stack (Prometheus, Grafana). The logger work in Phase 6.5 sets up the data, but shipping it somewhere is future work. + +--- + +## Concrete deliverables + +When this is done: + +- 4 application PM2 processes instead of 12 (plus 2 unchanged: acot-phone, lt-wordlist). +- All `/api/*` and `/chat-api/*` requests gated at Caddy and re-verified at each upstream. +- Sensitive endpoints additionally gated by per-permission checks. +- One ESM standard across the entire Node codebase. +- One shared `lib/` for auth, logging, DB, errors, CORS. +- Login rate-limited. +- `JWT_SECRET` rotated. +- Old auth-server, Aircall, Gorgias, Clarity directories deleted from the repo. +- Caddyfile slimmed to one auth-gated block. +- Permission codes inserted into `permissions` table for granular authorization. +- No half-finished pieces, no `// TODO: add auth later` comments, no deferred secrets cleanup. + +--- + +## Deviations from original plan (recorded during execution) + +These are decisions made during Phase 1/2 implementation that amend the spec above. Future phases should follow the deviated path, not the original sketch. + +1. **`shared/` location.** Original plan placed `shared/` at the repo root as a sibling of `inventory/` and `acot-phone/`. Implemented at `inventory-server/shared/` (= `/var/www/inventory/shared/` on the server) instead. Reason: the actual project root *is* `/var/www/inventory/`; placing shared/ outside it would have meant building a deployment story for it that doesn't exist. Import paths change accordingly: + - From `inventory-server/{auth,src,chat}/server.js` → `../shared/...` + - From `inventory-server/dashboard/{vendor}-server/server.js` → `../../shared/...` + +2. **`/verify` response headers.** Plan specified `X-User-Id` + `X-User-Is-Admin`. Implemented as `X-User-Id` + `X-User-Username` (both available from the JWT payload). `X-User-Is-Admin` was dropped because `is_admin` isn't in the JWT today and returning it would require a DB lookup — violating the "no DB hit" principle. To restore `X-User-Is-Admin`, enrich the JWT payload at login time (one-line change in `auth/routes.js`) during Phase 6, then echo from `/verify`. Upstreams don't trust these headers anyway (they re-verify), so the omission is informational, not security-relevant. + +3. **User cache key in `shared/auth/middleware.js`.** Plan sketch mentioned "60s TTL keyed by token jti". Implemented as keyed by `userId` instead — the JWT doesn't currently include a `jti` claim, and the cache's invalidation semantics are "this user was deactivated/changed permissions" (per-user), not "this token was revoked" (per-token). The plan's pseudocode already used `loadUserCached(pool, decoded.userId)` so this matches the spirit. + +4. **Redis client safety.** `shared/db/redis.js` sets `enableOfflineQueue: false` and `lazyConnect: true`. Plan didn't specify but these defaults mean a Redis hiccup fails fast (route fall-through to upstream API as designed in Phase 4 risk notes) rather than queueing commands indefinitely. + +5. **CORS allowed origins kept `https://acot.site`.** Plan example listed three origins; production has acot.site as a redirect to tools.acherryontop.com but also reaches the API directly in some flows. Kept it to avoid breakage. LAN wildcards (`192.168.*`, `10.*`) and `Access-Control-Allow-Origin "*"` are NOT included in the new `shared/cors/policy.js` per the plan's Phase 6.6 spirit, but the legacy `inventory-server/src/middleware/cors.js` still has them until services are migrated to consume `shared/cors/`. + +6. **Defunct permission codes left in DB.** Removed the `dashboard:gorgias` and `dashboard:calls` Protected blocks from the frontend, but the corresponding permission rows in the `permissions` table are still there (assigned to some users). They're inert (no UI references them) but should be cleaned up alongside the Phase 6.2 permissions migration. + +7. **PM2 process names retained `new-auth-server` (not `auth-server`).** Plan's Phase 8 final form names it `auth-server` (after the legacy 3003 one is removed). Decided to keep the existing `new-auth-server` name through Phase 2 to avoid a rename mid-stream. Phase 8 can rename if desired, but it's cosmetic — all wiring is by port (3011) not name. + +8. **Caddyfile changes via admin API on `:2020`.** The Caddyfile is owned by root and matt has no passwordless sudo. Cutover used `curl -X POST .../load` on the Caddy admin port (which matt can hit), then a separate `sudo cp /home/matt/Caddyfile.new /etc/caddy/Caddyfile` step to persist the on-disk file. Future Caddyfile changes can follow the same pattern. Backup convention: `/etc/caddy/Caddyfile.bak.YYYY-MM-DD`. + +9. **Path-naming.** Plan uses `inventory/` as the top-level (server-side path convention). Locally the equivalent is `inventory-server/`. Whenever the plan says `inventory/dashboard/foo/`, read that as `/var/www/inventory/dashboard/foo/` on the server or `inventory-server/dashboard/foo/` locally. diff --git a/inventory-server/auth/server.js b/inventory-server/auth/server.js index 203ee5e..fd6e32c 100644 --- a/inventory-server/auth/server.js +++ b/inventory-server/auth/server.js @@ -156,6 +156,25 @@ app.get('/me', async (req, res) => { } }); +// Caddy forward_auth target: JWT signature check only, no DB hit. +// Returns 200 with X-User-Id / X-User-Username on success, 401 otherwise. +// Per-service middleware re-verifies the token independently; these headers +// are informational and must not be trusted by upstreams. +app.all('/verify', (req, res) => { + const header = req.headers.authorization; + if (!header || !header.startsWith('Bearer ')) { + return res.status(401).json({ error: 'No token provided' }); + } + try { + const decoded = jwt.verify(header.slice(7), process.env.JWT_SECRET); + res.set('X-User-Id', String(decoded.userId)); + if (decoded.username) res.set('X-User-Username', decoded.username); + res.status(200).end(); + } catch (err) { + res.status(401).json({ error: err.name === 'TokenExpiredError' ? 'Token expired' : 'Invalid token' }); + } +}); + // Mount all routes from routes.js app.use('/', authRoutes); diff --git a/inventory-server/dashboard/aircall-server/.env.example b/inventory-server/dashboard/aircall-server/.env.example deleted file mode 100644 index 156f6a3..0000000 --- a/inventory-server/dashboard/aircall-server/.env.example +++ /dev/null @@ -1,21 +0,0 @@ -# Server Configuration -NODE_ENV=development -AIRCALL_PORT=3002 -LOG_LEVEL=info - -# Aircall API Credentials -AIRCALL_API_ID=your_aircall_api_id -AIRCALL_API_TOKEN=your_aircall_api_token - -# Database Configuration -MONGODB_URI=mongodb://localhost:27017/dashboard -MONGODB_DB=dashboard -REDIS_URL=redis://localhost:6379 - -# Service Configuration -TIMEZONE=America/New_York -DAY_STARTS_AT=1 # Business day starts at 1 AM ET - -# Optional Settings -REDIS_TTL=300 # Cache TTL in seconds (5 minutes) -COLLECTION_NAME=aircall_daily_data \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/README.md b/inventory-server/dashboard/aircall-server/README.md deleted file mode 100644 index 8a42546..0000000 --- a/inventory-server/dashboard/aircall-server/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Aircall Server - -A standalone server for handling Aircall metrics and data processing. - -## Setup - -1. Install dependencies: -```bash -npm install -``` - -2. Set up environment variables: -```bash -cp .env.example .env -``` -Then edit `.env` with your configuration. - -Required environment variables: -- `AIRCALL_API_ID`: Your Aircall API ID -- `AIRCALL_API_TOKEN`: Your Aircall API Token -- `MONGODB_URI`: MongoDB connection string -- `REDIS_URL`: Redis connection string -- `AIRCALL_PORT`: Server port (default: 3002) - -## Running the Server - -### Development -```bash -npm run dev -``` - -### Production -Using PM2: -```bash -pm2 start ecosystem.config.js --env production -``` - -## API Endpoints - -### GET /api/aircall/metrics/:timeRange -Get Aircall metrics for a specific time range. - -Parameters: -- `timeRange`: One of ['today', 'yesterday', 'last7days', 'last30days', 'last90days'] - -### GET /api/aircall/health -Get server health status. - -## Architecture - -The server uses: -- Express.js for the API -- MongoDB for data storage -- Redis for caching -- Winston for logging \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/package-lock.json b/inventory-server/dashboard/aircall-server/package-lock.json deleted file mode 100644 index 91017cb..0000000 --- a/inventory-server/dashboard/aircall-server/package-lock.json +++ /dev/null @@ -1,1914 +0,0 @@ -{ - "name": "aircall-server", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "aircall-server", - "version": "1.0.0", - "dependencies": { - "axios": "^1.6.2", - "cors": "^2.8.5", - "dotenv": "^16.3.1", - "express": "^4.18.2", - "mongodb": "^6.3.0", - "redis": "^4.6.11", - "winston": "^3.11.0" - }, - "devDependencies": { - "nodemon": "^3.0.2" - } - }, - "node_modules/@colors/colors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", - "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "license": "MIT", - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@dabh/diagnostics": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", - "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", - "license": "MIT", - "dependencies": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" - } - }, - "node_modules/@mongodb-js/saslprep": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", - "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", - "license": "MIT", - "dependencies": { - "sparse-bitfield": "^3.0.3" - } - }, - "node_modules/@redis/bloom": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", - "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/client": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.0.tgz", - "integrity": "sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==", - "license": "MIT", - "dependencies": { - "cluster-key-slot": "1.1.2", - "generic-pool": "3.9.0", - "yallist": "4.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@redis/graph": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", - "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/json": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", - "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/search": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", - "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/time-series": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", - "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@types/triple-beam": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", - "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "license": "MIT" - }, - "node_modules/@types/webidl-conversions": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", - "license": "MIT" - }, - "node_modules/@types/whatwg-url": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", - "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", - "license": "MIT", - "dependencies": { - "@types/webidl-conversions": "*" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "license": "MIT" - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, - "node_modules/axios": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", - "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.4", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/bson": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.1.tgz", - "integrity": "sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==", - "license": "Apache-2.0", - "engines": { - "node": ">=16.20.1" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", - "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.0", - "es-define-property": "^1.0.0", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.2.tgz", - "integrity": "sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "get-intrinsic": "^1.2.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/cluster-key-slot": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", - "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/color": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.3", - "color-string": "^1.6.0" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "license": "MIT" - }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "license": "MIT", - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "node_modules/colorspace": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", - "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", - "license": "MIT", - "dependencies": { - "color": "^3.1.3", - "text-hex": "1.0.x" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "license": "MIT" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", - "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, - "node_modules/enabled": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", - "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.12", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/fecha": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", - "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "license": "MIT" - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/fn.name": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", - "license": "MIT" - }, - "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/generic-pool": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", - "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", - "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "dunder-proto": "^1.0.0", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "function-bind": "^1.1.2", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "license": "MIT", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "dev": true, - "license": "ISC" - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "license": "MIT" - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/kuler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", - "license": "MIT" - }, - "node_modules/logform": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", - "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", - "license": "MIT", - "dependencies": { - "@colors/colors": "1.6.0", - "@types/triple-beam": "^1.3.2", - "fecha": "^4.2.0", - "ms": "^2.1.1", - "safe-stable-stringify": "^2.3.1", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/logform/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/math-intrinsics": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", - "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/memory-pager": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", - "license": "MIT" - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mongodb": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.12.0.tgz", - "integrity": "sha512-RM7AHlvYfS7jv7+BXund/kR64DryVI+cHbVAy9P61fnb1RcWZqOW1/Wj2YhqMCx+MuYhqTRGv7AwHBzmsCKBfA==", - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/saslprep": "^1.1.9", - "bson": "^6.10.1", - "mongodb-connection-string-url": "^3.0.0" - }, - "engines": { - "node": ">=16.20.1" - }, - "peerDependencies": { - "@aws-sdk/credential-providers": "^3.188.0", - "@mongodb-js/zstd": "^1.1.0 || ^2.0.0", - "gcp-metadata": "^5.2.0", - "kerberos": "^2.0.1", - "mongodb-client-encryption": ">=6.0.0 <7", - "snappy": "^7.2.2", - "socks": "^2.7.1" - }, - "peerDependenciesMeta": { - "@aws-sdk/credential-providers": { - "optional": true - }, - "@mongodb-js/zstd": { - "optional": true - }, - "gcp-metadata": { - "optional": true - }, - "kerberos": { - "optional": true - }, - "mongodb-client-encryption": { - "optional": true - }, - "snappy": { - "optional": true - }, - "socks": { - "optional": true - } - } - }, - "node_modules/mongodb-connection-string-url": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", - "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", - "license": "Apache-2.0", - "dependencies": { - "@types/whatwg-url": "^11.0.2", - "whatwg-url": "^13.0.0" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/nodemon": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", - "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^4", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^7.5.3", - "simple-update-notifier": "^2.0.0", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "bin": { - "nodemon": "bin/nodemon.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } - }, - "node_modules/nodemon/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/nodemon/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/one-time": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", - "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", - "license": "MIT", - "dependencies": { - "fn.name": "1.x.x" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", - "license": "MIT" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "license": "MIT" - }, - "node_modules/pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true, - "license": "MIT" - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/redis": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.0.tgz", - "integrity": "sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==", - "license": "MIT", - "workspaces": [ - "./packages/*" - ], - "dependencies": { - "@redis/bloom": "1.2.0", - "@redis/client": "1.6.0", - "@redis/graph": "1.1.1", - "@redis/json": "1.0.7", - "@redis/search": "1.2.0", - "@redis/time-series": "1.1.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/safe-stable-stringify": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", - "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "license": "MIT", - "dependencies": { - "is-arrayish": "^0.3.1" - } - }, - "node_modules/simple-update-notifier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", - "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/sparse-bitfield": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", - "license": "MIT", - "dependencies": { - "memory-pager": "^1.0.2" - } - }, - "node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", - "license": "MIT" - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/touch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", - "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", - "dev": true, - "license": "ISC", - "bin": { - "nodetouch": "bin/nodetouch.js" - } - }, - "node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "license": "MIT", - "dependencies": { - "punycode": "^2.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/triple-beam": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", - "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", - "license": "MIT", - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/undefsafe": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", - "dev": true, - "license": "MIT" - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "license": "MIT" - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-url": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", - "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", - "license": "MIT", - "dependencies": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/winston": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", - "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", - "license": "MIT", - "dependencies": { - "@colors/colors": "^1.6.0", - "@dabh/diagnostics": "^2.0.2", - "async": "^3.2.3", - "is-stream": "^2.0.0", - "logform": "^2.7.0", - "one-time": "^1.0.0", - "readable-stream": "^3.4.0", - "safe-stable-stringify": "^2.3.1", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.9.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/winston-transport": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", - "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", - "license": "MIT", - "dependencies": { - "logform": "^2.7.0", - "readable-stream": "^3.6.2", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "license": "ISC" - } - } -} diff --git a/inventory-server/dashboard/aircall-server/package.json b/inventory-server/dashboard/aircall-server/package.json deleted file mode 100644 index 7c3a8ab..0000000 --- a/inventory-server/dashboard/aircall-server/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "aircall-server", - "version": "1.0.0", - "description": "Aircall metrics server", - "type": "module", - "main": "server.js", - "scripts": { - "start": "node server.js", - "dev": "nodemon server.js" - }, - "dependencies": { - "axios": "^1.6.2", - "cors": "^2.8.5", - "dotenv": "^16.3.1", - "express": "^4.18.2", - "mongodb": "^6.3.0", - "redis": "^4.6.11", - "winston": "^3.11.0" - }, - "devDependencies": { - "nodemon": "^3.0.2" - } -} \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/server.js b/inventory-server/dashboard/aircall-server/server.js deleted file mode 100644 index 7c63a54..0000000 --- a/inventory-server/dashboard/aircall-server/server.js +++ /dev/null @@ -1,83 +0,0 @@ -import express from 'express'; -import cors from 'cors'; -import dotenv from 'dotenv'; -import path from 'path'; -import { fileURLToPath } from 'url'; -import { createRoutes } from './src/routes/index.js'; -import { aircallConfig } from './src/config/aircall.config.js'; -import { connectMongoDB } from './src/utils/db.js'; -import { createRedisClient } from './src/utils/redis.js'; -import { createLogger } from './src/utils/logger.js'; - -// Get directory name in ES modules -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -// Load environment variables from the correct path -dotenv.config({ path: path.resolve(__dirname, '.env') }); - -// Validate required environment variables -const requiredEnvVars = ['AIRCALL_API_ID', 'AIRCALL_API_TOKEN', 'MONGODB_URI', 'REDIS_URL']; -const missingEnvVars = requiredEnvVars.filter(envVar => !process.env[envVar]); - -if (missingEnvVars.length > 0) { - console.error('Missing required environment variables:', missingEnvVars); - process.exit(1); -} - -const app = express(); -const port = process.env.AIRCALL_PORT || 3002; -const logger = createLogger('aircall-server'); - -// Middleware -app.use(cors()); -app.use(express.json()); - -// Connect to databases -let mongodb; -let redis; - -async function initializeServer() { - try { - // Connect to MongoDB - mongodb = await connectMongoDB(); - logger.info('Connected to MongoDB'); - - // Connect to Redis - redis = await createRedisClient(); - logger.info('Connected to Redis'); - - // Initialize configs with database connections - const configs = { - aircall: { - ...aircallConfig, - mongodb, - redis, - logger - } - }; - - // Initialize routes - const routes = createRoutes(configs, logger); - app.use('/api', routes); - - // Error handling middleware - app.use((err, req, res, next) => { - logger.error('Server error:', err); - res.status(500).json({ - error: 'Internal server error', - message: err.message - }); - }); - - // Start server - app.listen(port, () => { - logger.info(`Aircall server listening on port ${port}`); - }); - } catch (error) { - logger.error('Failed to initialize server:', error); - process.exit(1); - } -} - -initializeServer(); \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/config/aircall.config.js b/inventory-server/dashboard/aircall-server/src/config/aircall.config.js deleted file mode 100644 index ad455c6..0000000 --- a/inventory-server/dashboard/aircall-server/src/config/aircall.config.js +++ /dev/null @@ -1,15 +0,0 @@ -export const aircallConfig = { - serviceName: 'aircall', - apiId: process.env.AIRCALL_API_ID, - apiToken: process.env.AIRCALL_API_TOKEN, - timezone: 'America/New_York', - dayStartsAt: 1, - storeHistory: true, - collection: 'aircall_daily_data', - redisTTL: 300, // 5 minutes cache for current day - endpoints: { - metrics: { - ttl: 300 - } - } -}; \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/routes/aircall.routes.js b/inventory-server/dashboard/aircall-server/src/routes/aircall.routes.js deleted file mode 100644 index 06c1551..0000000 --- a/inventory-server/dashboard/aircall-server/src/routes/aircall.routes.js +++ /dev/null @@ -1,57 +0,0 @@ -import express from 'express'; -import { AircallService } from '../services/aircall/AircallService.js'; - -export const createAircallRoutes = (config, logger) => { - const router = express.Router(); - const aircallService = new AircallService(config); - - router.get('/metrics/:timeRange?', async (req, res) => { - try { - const { timeRange = 'today' } = req.params; - const allowedRanges = ['today', 'yesterday', 'last7days', 'last30days', 'last90days']; - - if (!allowedRanges.includes(timeRange)) { - return res.status(400).json({ - error: 'Invalid time range', - allowedRanges - }); - } - - const metrics = await aircallService.getMetrics(timeRange); - - res.json({ - ...metrics, - _meta: { - timeRange, - generatedAt: new Date().toISOString(), - dataPoints: metrics.daily_data?.length || 0 - } - }); - } catch (error) { - logger.error('Error fetching Aircall metrics:', error); - res.status(500).json({ - error: 'Failed to fetch Aircall metrics', - message: error.message - }); - } - }); - - // Health check endpoint - router.get('/health', (req, res) => { - const mongoConnected = !!aircallService.mongodb?.db; - const redisConnected = !!aircallService.redis?.isOpen; - - const health = { - status: mongoConnected && redisConnected ? 'ok' : 'degraded', - service: 'aircall', - timestamp: new Date().toISOString(), - connections: { - mongodb: mongoConnected, - redis: redisConnected - } - }; - res.json(health); - }); - - return router; -}; \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/routes/index.js b/inventory-server/dashboard/aircall-server/src/routes/index.js deleted file mode 100644 index 77c0e19..0000000 --- a/inventory-server/dashboard/aircall-server/src/routes/index.js +++ /dev/null @@ -1,32 +0,0 @@ -import express from 'express'; -import { createAircallRoutes } from './aircall.routes.js'; - -export const createRoutes = (configs, logger) => { - const router = express.Router(); - - // Mount Aircall routes - router.use('/aircall', createAircallRoutes(configs.aircall, logger)); - - // Health check endpoint - router.get('/health', (req, res) => { - const services = req.services || {}; - res.status(200).json({ - status: 'ok', - timestamp: new Date(), - services: { - redis: services.redis?.isReady || false, - mongodb: services.mongo?.readyState === 1 || false - } - }); - }); - - // Catch-all 404 handler - router.use('*', (req, res) => { - res.status(404).json({ - error: 'Not Found', - message: `Route ${req.originalUrl} not found` - }); - }); - - return router; -}; \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/services/aircall/AircallDataManager.js b/inventory-server/dashboard/aircall-server/src/services/aircall/AircallDataManager.js deleted file mode 100644 index 8aa92f4..0000000 --- a/inventory-server/dashboard/aircall-server/src/services/aircall/AircallDataManager.js +++ /dev/null @@ -1,298 +0,0 @@ -import { DataManager } from "../base/DataManager.js"; - -export class AircallDataManager extends DataManager { - constructor(mongodb, redis, timeManager) { - const options = { - collection: "aircall_daily_data", - redisTTL: 300 // 5 minutes cache - }; - super(mongodb, redis, timeManager, options); - this.options = options; - } - - ensureDate(d) { - if (d instanceof Date) return d; - if (typeof d === 'string') return new Date(d); - if (typeof d === 'number') return new Date(d); - console.error('Invalid date value:', d); - return new Date(); // fallback to current date - } - - async storeHistoricalPeriod(start, end, calls) { - if (!this.mongodb) return; - - try { - if (!Array.isArray(calls)) { - console.error("Invalid calls data:", calls); - return; - } - - // Group calls by true day boundaries using TimeManager - const dailyCallsMap = new Map(); - - calls.forEach((call) => { - try { - const timestamp = call.started_at * 1000; // Convert to milliseconds - const callDate = this.ensureDate(timestamp); - const dayBounds = this.timeManager.getDayBounds(callDate); - const dayKey = dayBounds.start.toISOString(); - - if (!dailyCallsMap.has(dayKey)) { - dailyCallsMap.set(dayKey, { - date: dayBounds.start, - calls: [], - }); - } - dailyCallsMap.get(dayKey).calls.push(call); - } catch (err) { - console.error('Error processing call:', err, call); - } - }); - - // Iterate over each day in the period using day boundaries - const dates = []; - let currentDate = this.ensureDate(start); - const endDate = this.ensureDate(end); - - while (currentDate < endDate) { - const dayBounds = this.timeManager.getDayBounds(currentDate); - dates.push(dayBounds.start); - currentDate.setUTCDate(currentDate.getUTCDate() + 1); - } - - for (const date of dates) { - try { - const dateKey = date.toISOString(); - const dayData = dailyCallsMap.get(dateKey); - const dayCalls = dayData ? dayData.calls : []; - - // Process calls for this day using the same processing logic - const metrics = this.processCallData(dayCalls); - - // Insert a daily_data record for this day - metrics.daily_data = [ - { - date: date.toISOString().split("T")[0], - inbound: metrics.by_direction.inbound, - outbound: metrics.by_direction.outbound, - }, - ]; - - // Store this day's processed data as historical - await this.storeHistoricalDay(date, metrics); - } catch (err) { - console.error('Error processing date:', err, date); - } - } - - } catch (error) { - console.error("Error storing historical period:", error, error.stack); - throw error; - } - } - - processCallData(calls) { - // If calls is already processed (has total, by_direction, etc.), return it - if (calls && calls.total !== undefined) { - console.log('Data already processed:', { - total: calls.total, - by_direction: calls.by_direction - }); - // Return a clean copy of the processed data - return { - total: calls.total, - by_direction: calls.by_direction, - by_status: calls.by_status, - by_missed_reason: calls.by_missed_reason, - by_hour: calls.by_hour, - by_users: calls.by_users, - daily_data: calls.daily_data, - duration_distribution: calls.duration_distribution, - average_duration: calls.average_duration - }; - } - - console.log('Processing raw calls:', { - count: calls.length, - sample: calls.length > 0 ? { - id: calls[0].id, - direction: calls[0].direction, - status: calls[0].status - } : null - }); - - // Process raw calls - const metrics = { - total: calls.length, - by_direction: { inbound: 0, outbound: 0 }, - by_status: { answered: 0, missed: 0 }, - by_missed_reason: {}, - by_hour: Array(24).fill(0), - by_users: {}, - daily_data: [], - duration_distribution: [ - { range: "0-1m", count: 0 }, - { range: "1-5m", count: 0 }, - { range: "5-15m", count: 0 }, - { range: "15-30m", count: 0 }, - { range: "30m+", count: 0 }, - ], - average_duration: 0, - total_duration: 0, - }; - - // Group calls by date for daily data - const dailyCallsMap = new Map(); - - calls.forEach((call) => { - try { - // Direction metrics - metrics.by_direction[call.direction]++; - - // Get call date and hour using TimeManager - const timestamp = call.started_at * 1000; // Convert to milliseconds - const callDate = this.ensureDate(timestamp); - const dayBounds = this.timeManager.getDayBounds(callDate); - const dayKey = dayBounds.start.toISOString().split("T")[0]; - const hour = callDate.getHours(); - metrics.by_hour[hour]++; - - // Status and duration metrics - if (call.answered_at) { - metrics.by_status.answered++; - const duration = call.ended_at - call.answered_at; - metrics.total_duration += duration; - - // Duration distribution - if (duration <= 60) { - metrics.duration_distribution[0].count++; - } else if (duration <= 300) { - metrics.duration_distribution[1].count++; - } else if (duration <= 900) { - metrics.duration_distribution[2].count++; - } else if (duration <= 1800) { - metrics.duration_distribution[3].count++; - } else { - metrics.duration_distribution[4].count++; - } - - // Track user performance - if (call.user) { - const userId = call.user.id; - if (!metrics.by_users[userId]) { - metrics.by_users[userId] = { - id: userId, - name: call.user.name, - total: 0, - answered: 0, - missed: 0, - total_duration: 0, - average_duration: 0, - }; - } - metrics.by_users[userId].total++; - metrics.by_users[userId].answered++; - metrics.by_users[userId].total_duration += duration; - } - } else { - metrics.by_status.missed++; - if (call.missed_call_reason) { - metrics.by_missed_reason[call.missed_call_reason] = - (metrics.by_missed_reason[call.missed_call_reason] || 0) + 1; - } - - // Track missed calls by user - if (call.user) { - const userId = call.user.id; - if (!metrics.by_users[userId]) { - metrics.by_users[userId] = { - id: userId, - name: call.user.name, - total: 0, - answered: 0, - missed: 0, - total_duration: 0, - average_duration: 0, - }; - } - metrics.by_users[userId].total++; - metrics.by_users[userId].missed++; - } - } - - // Group by date for daily data - if (!dailyCallsMap.has(dayKey)) { - dailyCallsMap.set(dayKey, { date: dayKey, inbound: 0, outbound: 0 }); - } - dailyCallsMap.get(dayKey)[call.direction]++; - } catch (err) { - console.error('Error processing call:', err, call); - } - }); - - // Calculate average durations for users - Object.values(metrics.by_users).forEach((user) => { - if (user.answered > 0) { - user.average_duration = Math.round(user.total_duration / user.answered); - } - }); - - // Calculate global average duration - if (metrics.by_status.answered > 0) { - metrics.average_duration = Math.round( - metrics.total_duration / metrics.by_status.answered - ); - } - - // Convert daily data map to sorted array - metrics.daily_data = Array.from(dailyCallsMap.values()).sort((a, b) => - a.date.localeCompare(b.date) - ); - - delete metrics.total_duration; - - console.log('Processed metrics:', { - total: metrics.total, - by_direction: metrics.by_direction, - by_status: metrics.by_status, - daily_data_count: metrics.daily_data.length - }); - - return metrics; - } - - async storeHistoricalDay(date, data) { - if (!this.mongodb) return; - - try { - const collection = this.mongodb.collection(this.options.collection); - const dayBounds = this.timeManager.getDayBounds(this.ensureDate(date)); - - // Ensure consistent data structure with metrics nested in data field - const document = { - date: dayBounds.start, - data: { - total: data.total, - by_direction: data.by_direction, - by_status: data.by_status, - by_missed_reason: data.by_missed_reason, - by_hour: data.by_hour, - by_users: data.by_users, - daily_data: data.daily_data, - duration_distribution: data.duration_distribution, - average_duration: data.average_duration - }, - updatedAt: new Date() - }; - - await collection.updateOne( - { date: dayBounds.start }, - { $set: document }, - { upsert: true } - ); - } catch (error) { - console.error("Error storing historical day:", error); - throw error; - } - } -} \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/services/aircall/AircallService.js b/inventory-server/dashboard/aircall-server/src/services/aircall/AircallService.js deleted file mode 100644 index 92c7173..0000000 --- a/inventory-server/dashboard/aircall-server/src/services/aircall/AircallService.js +++ /dev/null @@ -1,138 +0,0 @@ -import axios from "axios"; -import { Buffer } from "buffer"; -import { BaseService } from "../base/BaseService.js"; -import { AircallDataManager } from "./AircallDataManager.js"; - -export class AircallService extends BaseService { - constructor(config) { - super(config); - this.baseUrl = "https://api.aircall.io/v1"; - console.log('Initializing Aircall service with credentials:', { - apiId: config.apiId ? 'present' : 'missing', - apiToken: config.apiToken ? 'present' : 'missing' - }); - this.auth = Buffer.from(`${config.apiId}:${config.apiToken}`).toString( - "base64" - ); - this.dataManager = new AircallDataManager( - this.mongodb, - this.redis, - this.timeManager - ); - - if (!config.apiId || !config.apiToken) { - throw new Error("Aircall API credentials are required"); - } - } - - async getMetrics(timeRange) { - const dateRange = await this.timeManager.getDateRange(timeRange); - console.log('Fetching metrics for date range:', { - start: dateRange.start.toISOString(), - end: dateRange.end.toISOString() - }); - - return this.dataManager.getData(dateRange, async (range) => { - const calls = await this.fetchAllCalls(range.start, range.end); - console.log('Fetched calls:', { - count: calls.length, - sample: calls.length > 0 ? calls[0] : null - }); - return calls; - }); - } - - async fetchAllCalls(start, end) { - try { - let allCalls = []; - let currentPage = 1; - let hasMore = true; - let totalPages = null; - - while (hasMore) { - const response = await this.makeRequest("/calls", { - from: Math.floor(start.getTime() / 1000), - to: Math.floor(end.getTime() / 1000), - order: "asc", - page: currentPage, - per_page: 50, - }); - - console.log('API Response:', { - page: currentPage, - totalPages: response.meta.total_pages, - callsCount: response.calls?.length, - params: { - from: Math.floor(start.getTime() / 1000), - to: Math.floor(end.getTime() / 1000) - } - }); - - if (!response.calls) { - throw new Error("Invalid API response format"); - } - - allCalls = [...allCalls, ...response.calls]; - hasMore = response.meta.next_page_link !== null; - totalPages = response.meta.total_pages; - currentPage++; - - if (hasMore) { - // Rate limiting pause - await new Promise((resolve) => setTimeout(resolve, 1)); - } - } - - return allCalls; - } catch (error) { - console.error("Error fetching all calls:", error); - throw error; - } - } - - async makeRequest(endpoint, params = {}) { - try { - console.log('Making API request:', { - endpoint, - params - }); - const response = await axios.get(`${this.baseUrl}${endpoint}`, { - headers: { - Authorization: `Basic ${this.auth}`, - "Content-Type": "application/json", - }, - params, - }); - return response.data; - } catch (error) { - if (error.response?.status === 429) { - console.log("Rate limit reached, waiting before retry..."); - await new Promise((resolve) => setTimeout(resolve, 5000)); - return this.makeRequest(endpoint, params); - } - - this.handleApiError(error, `Error making request to ${endpoint}`); - } - } - - validateApiResponse(response, context = "") { - if (!response || typeof response !== "object") { - throw new Error(`${context}: Invalid API response format`); - } - - if (response.error) { - throw new Error(`${context}: ${response.error}`); - } - - return true; - } - - getPaginationInfo(meta) { - return { - currentPage: meta.current_page, - totalPages: meta.total_pages, - hasNextPage: meta.next_page_link !== null, - totalRecords: meta.total, - }; - } -} \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/services/base/BaseService.js b/inventory-server/dashboard/aircall-server/src/services/base/BaseService.js deleted file mode 100644 index 55ed888..0000000 --- a/inventory-server/dashboard/aircall-server/src/services/base/BaseService.js +++ /dev/null @@ -1,32 +0,0 @@ -import { createTimeManager } from '../../utils/timeUtils.js'; - -export class BaseService { - constructor(config) { - this.config = config; - this.mongodb = config.mongodb; - this.redis = config.redis; - this.logger = config.logger; - this.timeManager = createTimeManager(config.timezone, config.dayStartsAt); - } - - handleApiError(error, context = '') { - this.logger.error(`API Error ${context}:`, { - message: error.message, - status: error.response?.status, - data: error.response?.data, - }); - - if (error.response) { - const status = error.response.status; - const message = error.response.data?.message || error.response.statusText; - - if (status === 429) { - throw new Error('API rate limit exceeded. Please try again later.'); - } - - throw new Error(`API error (${status}): ${message}`); - } - - throw error; - } -} \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/services/base/DataManager.js b/inventory-server/dashboard/aircall-server/src/services/base/DataManager.js deleted file mode 100644 index 0dfc125..0000000 --- a/inventory-server/dashboard/aircall-server/src/services/base/DataManager.js +++ /dev/null @@ -1,320 +0,0 @@ -export class DataManager { - constructor(mongodb, redis, timeManager, options) { - this.mongodb = mongodb; - this.redis = redis; - this.timeManager = timeManager; - this.options = options || {}; - } - - ensureDate(d) { - if (d instanceof Date) return d; - if (typeof d === 'string') return new Date(d); - if (typeof d === 'number') return new Date(d); - if (d && d.date) return new Date(d.date); // Handle MongoDB records - console.error('Invalid date value:', d); - return new Date(); // fallback to current date - } - - async getData(dateRange, fetchFn) { - try { - // Get historical data from MongoDB - const historicalData = await this.getHistoricalDays(dateRange.start, dateRange.end); - - // Find any missing date ranges - const missingRanges = this.findMissingDateRanges(dateRange.start, dateRange.end, historicalData); - - // Fetch missing data - for (const range of missingRanges) { - const data = await fetchFn(range); - await this.storeHistoricalPeriod(range.start, range.end, data); - } - - // Get updated historical data - const updatedData = await this.getHistoricalDays(dateRange.start, dateRange.end); - - // Handle both nested and flat data structures - if (updatedData && updatedData.length > 0) { - // Process each record and combine them - const processedData = updatedData.map(record => { - if (record.data) { - return record.data; - } - if (record.total !== undefined) { - return { - total: record.total, - by_direction: record.by_direction, - by_status: record.by_status, - by_missed_reason: record.by_missed_reason, - by_hour: record.by_hour, - by_users: record.by_users, - daily_data: record.daily_data, - duration_distribution: record.duration_distribution, - average_duration: record.average_duration - }; - } - return null; - }).filter(Boolean); - - // Combine the data - if (processedData.length > 0) { - return this.combineMetrics(processedData); - } - } - - // Otherwise process as raw call data - return this.processCallData(updatedData); - } catch (error) { - console.error('Error in getData:', error); - throw error; - } - } - - findMissingDateRanges(start, end, existingDates) { - const missingRanges = []; - const existingDatesSet = new Set( - existingDates.map((d) => { - // Handle both nested and flat data structures - const date = d.date ? d.date : d; - return this.ensureDate(date).toISOString().split("T")[0]; - }) - ); - - let current = new Date(start); - const endDate = new Date(end); - - while (current < endDate) { - const dayBounds = this.timeManager.getDayBounds(current); - const dayKey = dayBounds.start.toISOString().split("T")[0]; - - if (!existingDatesSet.has(dayKey)) { - // Found a missing day - const missingStart = new Date(dayBounds.start); - const missingEnd = new Date(dayBounds.end); - - missingRanges.push({ - start: missingStart, - end: missingEnd, - }); - } - - // Move to the next day using timeManager to ensure proper business day boundaries - current = new Date(dayBounds.end.getTime() + 1); - } - - return missingRanges; - } - - async getCurrentDay(fetchFn) { - const now = new Date(); - const todayBounds = this.timeManager.getDayBounds(now); - const todayKey = this.timeManager.formatDate(todayBounds.start); - const cacheKey = `${this.options.collection}:current_day:${todayKey}`; - - try { - // Check cache first - if (this.redis?.isOpen) { - const cached = await this.redis.get(cacheKey); - if (cached) { - const parsedCache = JSON.parse(cached); - if (parsedCache.total !== undefined) { - // Use timeManager to check if the cached data is for today - const cachedDate = new Date(parsedCache.daily_data[0].date); - const isToday = this.timeManager.isToday(cachedDate); - - if (isToday) { - return parsedCache; - } - } - } - } - - // Get safe end time that's never in the future - const safeEnd = this.timeManager.getCurrentBusinessDayEnd(); - - // Fetch and process current day data with safe end time - const data = await fetchFn({ - start: todayBounds.start, - end: safeEnd - }); - - if (!data) { - return null; - } - - // Cache the data with a shorter TTL for today's data - if (this.redis?.isOpen) { - const ttl = Math.min( - this.options.redisTTL, - 60 * 5 // 5 minutes max for today's data - ); - await this.redis.set(cacheKey, JSON.stringify(data), { - EX: ttl, - }); - } - - return data; - } catch (error) { - console.error('Error in getCurrentDay:', error); - throw error; - } - } - - getDayCount(start, end) { - // Calculate full days between dates using timeManager - const startDay = this.timeManager.getDayBounds(start); - const endDay = this.timeManager.getDayBounds(end); - return Math.ceil((endDay.end - startDay.start) / (24 * 60 * 60 * 1000)); - } - - async fetchMissingDays(start, end, existingData, fetchFn) { - const existingDates = new Set( - existingData.map((d) => this.timeManager.formatDate(d.date)) - ); - const missingData = []; - - let currentDate = new Date(start); - while (currentDate < end) { - const dayBounds = this.timeManager.getDayBounds(currentDate); - const dateString = this.timeManager.formatDate(dayBounds.start); - - if (!existingDates.has(dateString)) { - const data = await fetchFn({ - start: dayBounds.start, - end: dayBounds.end, - }); - - await this.storeHistoricalDay(dayBounds.start, data); - missingData.push(data); - } - - // Move to next day using timeManager to ensure proper business day boundaries - currentDate = new Date(dayBounds.end.getTime() + 1); - } - - return missingData; - } - - async getHistoricalDays(start, end) { - try { - if (!this.mongodb) return []; - - const collection = this.mongodb.collection(this.options.collection); - const startDay = this.timeManager.getDayBounds(start); - const endDay = this.timeManager.getDayBounds(end); - - const records = await collection - .find({ - date: { - $gte: startDay.start, - $lt: endDay.start, - }, - }) - .sort({ date: 1 }) - .toArray(); - - return records; - } catch (error) { - console.error('Error getting historical days:', error); - return []; - } - } - - combineMetrics(metricsArray) { - if (!metricsArray || metricsArray.length === 0) return null; - if (metricsArray.length === 1) return metricsArray[0]; - - const combined = { - total: 0, - by_direction: { inbound: 0, outbound: 0 }, - by_status: { answered: 0, missed: 0 }, - by_missed_reason: {}, - by_hour: Array(24).fill(0), - by_users: {}, - daily_data: [], - duration_distribution: [ - { range: '0-1m', count: 0 }, - { range: '1-5m', count: 0 }, - { range: '5-15m', count: 0 }, - { range: '15-30m', count: 0 }, - { range: '30m+', count: 0 } - ], - average_duration: 0 - }; - - let totalAnswered = 0; - let totalDuration = 0; - - metricsArray.forEach(metrics => { - // Sum basic metrics - combined.total += metrics.total; - combined.by_direction.inbound += metrics.by_direction.inbound; - combined.by_direction.outbound += metrics.by_direction.outbound; - combined.by_status.answered += metrics.by_status.answered; - combined.by_status.missed += metrics.by_status.missed; - - // Combine missed reasons - Object.entries(metrics.by_missed_reason).forEach(([reason, count]) => { - combined.by_missed_reason[reason] = (combined.by_missed_reason[reason] || 0) + count; - }); - - // Sum hourly data - metrics.by_hour.forEach((count, hour) => { - combined.by_hour[hour] += count; - }); - - // Combine user data - Object.entries(metrics.by_users).forEach(([userId, userData]) => { - if (!combined.by_users[userId]) { - combined.by_users[userId] = { - id: userData.id, - name: userData.name, - total: 0, - answered: 0, - missed: 0, - total_duration: 0, - average_duration: 0 - }; - } - combined.by_users[userId].total += userData.total; - combined.by_users[userId].answered += userData.answered; - combined.by_users[userId].missed += userData.missed; - combined.by_users[userId].total_duration += userData.total_duration || 0; - }); - - // Combine duration distribution - metrics.duration_distribution.forEach((dist, index) => { - combined.duration_distribution[index].count += dist.count; - }); - - // Accumulate for average duration calculation - if (metrics.average_duration && metrics.by_status.answered) { - totalDuration += metrics.average_duration * metrics.by_status.answered; - totalAnswered += metrics.by_status.answered; - } - - // Merge daily data - if (metrics.daily_data) { - combined.daily_data.push(...metrics.daily_data); - } - }); - - // Calculate final average duration - if (totalAnswered > 0) { - combined.average_duration = Math.round(totalDuration / totalAnswered); - } - - // Calculate user averages - Object.values(combined.by_users).forEach(user => { - if (user.answered > 0) { - user.average_duration = Math.round(user.total_duration / user.answered); - } - }); - - // Sort and deduplicate daily data - combined.daily_data = Array.from( - new Map(combined.daily_data.map(item => [item.date, item])).values() - ).sort((a, b) => a.date.localeCompare(b.date)); - - return combined; - } -} \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/utils/db.js b/inventory-server/dashboard/aircall-server/src/utils/db.js deleted file mode 100644 index c6b2a01..0000000 --- a/inventory-server/dashboard/aircall-server/src/utils/db.js +++ /dev/null @@ -1,15 +0,0 @@ -import { MongoClient } from 'mongodb'; - -const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost:27017/dashboard'; -const DB_NAME = process.env.MONGODB_DB || 'dashboard'; - -export async function connectMongoDB() { - try { - const client = await MongoClient.connect(MONGODB_URI); - console.log('Connected to MongoDB'); - return client.db(DB_NAME); - } catch (error) { - console.error('MongoDB connection error:', error); - throw error; - } -} \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/utils/logger.js b/inventory-server/dashboard/aircall-server/src/utils/logger.js deleted file mode 100644 index 80a200f..0000000 --- a/inventory-server/dashboard/aircall-server/src/utils/logger.js +++ /dev/null @@ -1,37 +0,0 @@ -import winston from 'winston'; -import path from 'path'; -import { fileURLToPath } from 'url'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -export function createLogger(service) { - // Create logs directory relative to the project root (two levels up from utils) - const logsDir = path.join(__dirname, '../../logs'); - - return winston.createLogger({ - level: process.env.LOG_LEVEL || 'info', - format: winston.format.combine( - winston.format.timestamp(), - winston.format.json() - ), - defaultMeta: { service }, - transports: [ - // Write all logs to console - new winston.transports.Console({ - format: winston.format.combine( - winston.format.colorize(), - winston.format.simple() - ) - }), - // Write all logs to service-specific files - new winston.transports.File({ - filename: path.join(logsDir, `${service}-error.log`), - level: 'error' - }), - new winston.transports.File({ - filename: path.join(logsDir, `${service}-combined.log`) - }) - ] - }); -} \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/utils/redis.js b/inventory-server/dashboard/aircall-server/src/utils/redis.js deleted file mode 100644 index ee51cce..0000000 --- a/inventory-server/dashboard/aircall-server/src/utils/redis.js +++ /dev/null @@ -1,23 +0,0 @@ -import { createClient } from 'redis'; - -const REDIS_URL = process.env.REDIS_URL || 'redis://localhost:6379'; - -export async function createRedisClient() { - try { - const client = createClient({ - url: REDIS_URL - }); - - await client.connect(); - console.log('Connected to Redis'); - - client.on('error', (err) => { - console.error('Redis error:', err); - }); - - return client; - } catch (error) { - console.error('Redis connection error:', error); - throw error; - } -} \ No newline at end of file diff --git a/inventory-server/dashboard/aircall-server/src/utils/timeUtils.js b/inventory-server/dashboard/aircall-server/src/utils/timeUtils.js deleted file mode 100644 index ac53e06..0000000 --- a/inventory-server/dashboard/aircall-server/src/utils/timeUtils.js +++ /dev/null @@ -1,262 +0,0 @@ -class TimeManager { - static ALLOWED_RANGES = ['today', 'yesterday', 'last2days', 'last7days', 'last30days', 'last90days', - 'previous7days', 'previous30days', 'previous90days']; - - constructor(timezone = 'America/New_York', dayStartsAt = 1) { - this.timezone = timezone; - this.dayStartsAt = dayStartsAt; - } - - getDayBounds(date) { - try { - const now = new Date(); - const targetDate = new Date(date); - - // For today - if ( - targetDate.getUTCFullYear() === now.getUTCFullYear() && - targetDate.getUTCMonth() === now.getUTCMonth() && - targetDate.getUTCDate() === now.getUTCDate() - ) { - // If current time is before day start (1 AM ET / 6 AM UTC), - // use previous day's start until now - const todayStart = new Date(Date.UTC( - now.getUTCFullYear(), - now.getUTCMonth(), - now.getUTCDate(), - this.dayStartsAt + 5, - 0, - 0, - 0 - )); - - if (now < todayStart) { - const yesterdayStart = new Date(todayStart); - yesterdayStart.setUTCDate(yesterdayStart.getUTCDate() - 1); - return { start: yesterdayStart, end: now }; - } - - return { start: todayStart, end: now }; - } - - // For past days, use full 24-hour period - const normalizedDate = new Date(Date.UTC( - targetDate.getUTCFullYear(), - targetDate.getUTCMonth(), - targetDate.getUTCDate() - )); - - const dayStart = new Date(normalizedDate); - dayStart.setUTCHours(this.dayStartsAt + 5, 0, 0, 0); - - const dayEnd = new Date(dayStart); - dayEnd.setUTCDate(dayEnd.getUTCDate() + 1); - - return { start: dayStart, end: dayEnd }; - } catch (error) { - console.error('Error in getDayBounds:', error); - throw new Error(`Failed to calculate day bounds: ${error.message}`); - } - } - - getDateRange(period) { - try { - const now = new Date(); - const todayBounds = this.getDayBounds(now); - const end = new Date(); - - switch (period) { - case 'today': - return { - start: todayBounds.start, - end - }; - case 'yesterday': { - const yesterday = new Date(now); - yesterday.setDate(yesterday.getDate() - 1); - return this.getDayBounds(yesterday); - } - case 'last2days': { - const twoDaysAgo = new Date(now); - twoDaysAgo.setDate(twoDaysAgo.getDate() - 2); - return this.getDayBounds(twoDaysAgo); - } - case 'last7days': { - const start = new Date(now); - start.setDate(start.getDate() - 6); - return { - start: this.getDayBounds(start).start, - end - }; - } - case 'previous7days': { - const end = new Date(now); - end.setDate(end.getDate() - 7); - const start = new Date(end); - start.setDate(start.getDate() - 6); - return { - start: this.getDayBounds(start).start, - end: this.getDayBounds(end).end - }; - } - case 'last30days': { - const start = new Date(now); - start.setDate(start.getDate() - 29); - return { - start: this.getDayBounds(start).start, - end - }; - } - case 'previous30days': { - const end = new Date(now); - end.setDate(end.getDate() - 30); - const start = new Date(end); - start.setDate(start.getDate() - 29); - return { - start: this.getDayBounds(start).start, - end: this.getDayBounds(end).end - }; - } - case 'last90days': { - const start = new Date(now); - start.setDate(start.getDate() - 89); - return { - start: this.getDayBounds(start).start, - end - }; - } - case 'previous90days': { - const end = new Date(now); - end.setDate(end.getDate() - 90); - const start = new Date(end); - start.setDate(start.getDate() - 89); - return { - start: this.getDayBounds(start).start, - end: this.getDayBounds(end).end - }; - } - default: - throw new Error(`Unsupported time period: ${period}`); - } - } catch (error) { - console.error('Error in getDateRange:', error); - throw error; - } - } - - getPreviousPeriod(period) { - try { - const now = new Date(); - - switch (period) { - case 'today': - return 'yesterday'; - case 'yesterday': { - // Return bounds for 2 days ago - const twoDaysAgo = new Date(now); - twoDaysAgo.setDate(twoDaysAgo.getDate() - 2); - return this.getDayBounds(twoDaysAgo); - } - case 'last7days': { - // Return bounds for previous 7 days - const end = new Date(now); - end.setDate(end.getDate() - 7); - const start = new Date(end); - start.setDate(start.getDate() - 7); - return { - start: this.getDayBounds(start).start, - end: this.getDayBounds(end).end - }; - } - case 'last30days': { - const end = new Date(now); - end.setDate(end.getDate() - 30); - const start = new Date(end); - start.setDate(start.getDate() - 30); - return { - start: this.getDayBounds(start).start, - end: this.getDayBounds(end).end - }; - } - case 'last90days': { - const end = new Date(now); - end.setDate(end.getDate() - 90); - const start = new Date(end); - start.setDate(start.getDate() - 90); - return { - start: this.getDayBounds(start).start, - end: this.getDayBounds(end).end - }; - } - default: - throw new Error(`Unsupported time period: ${period}`); - } - } catch (error) { - console.error('Error in getPreviousPeriod:', error); - throw error; - } - } - - getCurrentBusinessDayEnd() { - try { - const now = new Date(); - const todayBounds = this.getDayBounds(now); - - // If current time is before day start (1 AM ET / 6 AM UTC), - // then we're still in yesterday's business day - const todayStart = new Date(Date.UTC( - now.getUTCFullYear(), - now.getUTCMonth(), - now.getUTCDate(), - this.dayStartsAt + 5, - 0, - 0, - 0 - )); - - if (now < todayStart) { - const yesterdayBounds = this.getDayBounds(new Date(now.getTime() - 24 * 60 * 60 * 1000)); - return yesterdayBounds.end; - } - - // Return the earlier of current time or today's end - return now < todayBounds.end ? now : todayBounds.end; - } catch (error) { - console.error('Error in getCurrentBusinessDayEnd:', error); - return new Date(); - } - } - - isValidTimeRange(timeRange) { - return TimeManager.ALLOWED_RANGES.includes(timeRange); - } - - isToday(date) { - const now = new Date(); - const targetDate = new Date(date); - return ( - targetDate.getUTCFullYear() === now.getUTCFullYear() && - targetDate.getUTCMonth() === now.getUTCMonth() && - targetDate.getUTCDate() === now.getUTCDate() - ); - } - - formatDate(date) { - try { - return date.toLocaleString('en-US', { - timeZone: this.timezone, - year: 'numeric', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - second: '2-digit' - }); - } catch (error) { - console.error('Error formatting date:', error); - return date.toISOString(); - } - } -} - -export const createTimeManager = (timezone, dayStartsAt) => new TimeManager(timezone, dayStartsAt); \ No newline at end of file diff --git a/inventory-server/dashboard/auth-server/.env.example b/inventory-server/dashboard/auth-server/.env.example deleted file mode 100644 index fa8d941..0000000 --- a/inventory-server/dashboard/auth-server/.env.example +++ /dev/null @@ -1,10 +0,0 @@ -# Server Configuration -NODE_ENV=development -PORT=3003 - -# Authentication -JWT_SECRET=your-secret-key-here -DASHBOARD_PASSWORD=your-dashboard-password-here - -# Cookie Settings -COOKIE_DOMAIN=localhost # In production: .kent.pw \ No newline at end of file diff --git a/inventory-server/dashboard/auth-server/index.js b/inventory-server/dashboard/auth-server/index.js deleted file mode 100644 index c1e0fe3..0000000 --- a/inventory-server/dashboard/auth-server/index.js +++ /dev/null @@ -1,203 +0,0 @@ -// auth-server/index.js -const path = require('path'); -require('dotenv').config({ path: path.join(__dirname, '.env') }); -const express = require('express'); -const cors = require('cors'); -const cookieParser = require('cookie-parser'); -const jwt = require('jsonwebtoken'); - -// Debug environment variables -console.log('Environment variables loaded from:', path.join(__dirname, '.env')); -console.log('Current directory:', __dirname); -console.log('Available env vars:', Object.keys(process.env)); - -const app = express(); -const PORT = process.env.PORT || 3003; -const JWT_SECRET = process.env.JWT_SECRET; -const DASHBOARD_PASSWORD = process.env.DASHBOARD_PASSWORD; - -// Validate required environment variables -if (!JWT_SECRET || !DASHBOARD_PASSWORD) { - console.error('Missing required environment variables:'); - if (!JWT_SECRET) console.error('- JWT_SECRET'); - if (!DASHBOARD_PASSWORD) console.error('- DASHBOARD_PASSWORD'); - process.exit(1); -} - -// Middleware -app.use(express.json()); -app.use(cookieParser()); - -// Configure CORS -const corsOptions = { - origin: function(origin, callback) { - const allowedOrigins = [ - 'http://localhost:3000', - 'https://tools.acherryontop.com' - ]; - - console.log('CORS check for origin:', origin); - - // Allow local network IPs (192.168.1.xxx) - if (origin && origin.match(/^http:\/\/192\.168\.1\.\d{1,3}(:\d+)?$/)) { - callback(null, true); - return; - } - - // Check if origin is in allowed list - if (!origin || allowedOrigins.indexOf(origin) !== -1) { - callback(null, true); - } else { - callback(new Error('Not allowed by CORS')); - } - }, - credentials: true, - methods: ['GET', 'POST', 'OPTIONS'], - allowedHeaders: ['Content-Type', 'Authorization', 'Cookie', 'Accept'], - exposedHeaders: ['Set-Cookie'] -}; - -app.use(cors(corsOptions)); -app.options('*', cors(corsOptions)); - -// Debug logging -app.use((req, res, next) => { - console.log(`${new Date().toISOString()} ${req.method} ${req.url}`); - console.log('Headers:', req.headers); - console.log('Cookies:', req.cookies); - next(); -}); - -// Health check endpoint -app.get('/health', (req, res) => { - res.json({ - status: 'ok', - timestamp: new Date().toISOString() - }); -}); - -// Auth endpoints -app.post('/login', (req, res) => { - console.log('Login attempt received'); - console.log('Request body:', req.body); - console.log('Origin:', req.headers.origin); - - const { password } = req.body; - - if (!password) { - console.log('No password provided'); - return res.status(400).json({ - success: false, - message: 'Password is required' - }); - } - - console.log('Comparing passwords...'); - console.log('Provided password length:', password.length); - console.log('Expected password length:', DASHBOARD_PASSWORD.length); - - if (password === DASHBOARD_PASSWORD) { - console.log('Password matched'); - const token = jwt.sign({ authorized: true }, JWT_SECRET, { - expiresIn: '24h' - }); - - // Determine if request is from local network - const isLocalNetwork = req.headers.origin?.includes('192.168.1.') || req.headers.origin?.includes('localhost'); - - const cookieOptions = { - httpOnly: true, - secure: !isLocalNetwork, // Only use secure for non-local requests - sameSite: isLocalNetwork ? 'lax' : 'none', - path: '/', - maxAge: 24 * 60 * 60 * 1000 // 24 hours - }; - - // Only set domain for production - if (!isLocalNetwork) { - cookieOptions.domain = '.kent.pw'; - } - - console.log('Setting cookie with options:', cookieOptions); - res.cookie('token', token, cookieOptions); - - console.log('Response headers:', res.getHeaders()); - res.json({ - success: true, - debug: { - origin: req.headers.origin, - cookieOptions - } - }); - } else { - console.log('Password mismatch'); - res.status(401).json({ - success: false, - message: 'Invalid password' - }); - } -}); - -// Modify the check endpoint to log more info -app.get('/check', (req, res) => { - console.log('Auth check received'); - console.log('All cookies:', req.cookies); - console.log('Headers:', req.headers); - - const token = req.cookies.token; - - if (!token) { - console.log('No token found in cookies'); - return res.status(401).json({ - authenticated: false, - error: 'no_token' - }); - } - - try { - const decoded = jwt.verify(token, JWT_SECRET); - console.log('Token verified successfully:', decoded); - res.json({ authenticated: true }); - } catch (err) { - console.log('Token verification failed:', err.message); - res.status(401).json({ - authenticated: false, - error: 'invalid_token', - message: err.message - }); - } -}); - -app.post('/logout', (req, res) => { - const isLocalNetwork = req.headers.origin?.includes('192.168.1.') || req.headers.origin?.includes('localhost'); - const cookieOptions = { - httpOnly: true, - secure: !isLocalNetwork, - sameSite: isLocalNetwork ? 'lax' : 'none', - path: '/', - domain: isLocalNetwork ? undefined : '.kent.pw' - }; - - console.log('Clearing cookie with options:', cookieOptions); - res.clearCookie('token', cookieOptions); - res.json({ success: true }); -}); - -// Error handling middleware -app.use((err, req, res, next) => { - console.error('Server error:', err); - res.status(500).json({ - success: false, - message: 'Internal server error', - error: err.message - }); -}); - -// Start server -app.listen(PORT, () => { - console.log(`Auth server running on port ${PORT}`); - console.log('Environment:', process.env.NODE_ENV); - console.log('CORS origins:', corsOptions.origin); - console.log('JWT_SECRET length:', JWT_SECRET?.length); - console.log('DASHBOARD_PASSWORD length:', DASHBOARD_PASSWORD?.length); -}); \ No newline at end of file diff --git a/inventory-server/dashboard/auth-server/package-lock.json b/inventory-server/dashboard/auth-server/package-lock.json deleted file mode 100644 index 3173680..0000000 --- a/inventory-server/dashboard/auth-server/package-lock.json +++ /dev/null @@ -1,1044 +0,0 @@ -{ - "name": "auth-server", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "auth-server", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "cookie-parser": "^1.4.7", - "cors": "^2.8.5", - "date-fns": "^4.1.0", - "date-fns-tz": "^3.2.0", - "dotenv": "^16.4.7", - "express": "^4.21.1", - "express-session": "^1.18.1", - "jsonwebtoken": "^9.0.2" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "license": "BSD-3-Clause" - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-parser": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.7.tgz", - "integrity": "sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw==", - "license": "MIT", - "dependencies": { - "cookie": "0.7.2", - "cookie-signature": "1.0.6" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/cookie-parser/node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "license": "MIT" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/date-fns": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", - "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/kossnocorp" - } - }, - "node_modules/date-fns-tz": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-3.2.0.tgz", - "integrity": "sha512-sg8HqoTEulcbbbVXeg84u5UnlsQa8GS5QXMqjjYIhS4abEVVKIUwe0/l/UhrZdKaL/W5eWZNlbTeEIiOXTcsBQ==", - "license": "MIT", - "peerDependencies": { - "date-fns": "^3.0.0 || ^4.0.0" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", - "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.12", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/express-session": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.2.tgz", - "integrity": "sha512-SZjssGQC7TzTs9rpPDuUrR23GNZ9+2+IkA/+IJWmvQilTr5OSliEHGF+D9scbIpdC6yGtTI0/VhaHoVes2AN/A==", - "license": "MIT", - "dependencies": { - "cookie": "0.7.2", - "cookie-signature": "1.0.7", - "debug": "2.6.9", - "depd": "~2.0.0", - "on-headers": "~1.1.0", - "parseurl": "~1.3.3", - "safe-buffer": "5.2.1", - "uid-safe": "~2.1.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/express-session/node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express-session/node_modules/cookie-signature": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", - "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", - "license": "MIT" - }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz", - "integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "license": "MIT", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", - "license": "MIT", - "dependencies": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=12", - "npm": ">=6" - } - }, - "node_modules/jsonwebtoken/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "license": "MIT", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "license": "MIT", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", - "license": "MIT" - }, - "node_modules/lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", - "license": "MIT" - }, - "node_modules/lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", - "license": "MIT" - }, - "node_modules/lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", - "license": "MIT" - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "license": "MIT" - }, - "node_modules/lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", - "license": "MIT" - }, - "node_modules/lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "license": "MIT" - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", - "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", - "license": "MIT" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/random-bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/uid-safe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", - "license": "MIT", - "dependencies": { - "random-bytes": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - } - } -} diff --git a/inventory-server/dashboard/auth-server/package.json b/inventory-server/dashboard/auth-server/package.json deleted file mode 100644 index 9254323..0000000 --- a/inventory-server/dashboard/auth-server/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "auth-server", - "version": "1.0.0", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "description": "", - "dependencies": { - "cookie-parser": "^1.4.7", - "cors": "^2.8.5", - "date-fns": "^4.1.0", - "date-fns-tz": "^3.2.0", - "dotenv": "^16.4.7", - "express": "^4.21.1", - "express-session": "^1.18.1", - "jsonwebtoken": "^9.0.2" - } -} diff --git a/inventory-server/dashboard/gorgias-server/package-lock.json b/inventory-server/dashboard/gorgias-server/package-lock.json deleted file mode 100644 index 9242a0b..0000000 --- a/inventory-server/dashboard/gorgias-server/package-lock.json +++ /dev/null @@ -1,1068 +0,0 @@ -{ - "name": "gorgias-server", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "gorgias-server", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "axios": "^1.7.9", - "cors": "^2.8.5", - "dotenv": "^16.4.7", - "express": "^4.21.2", - "redis": "^4.7.0" - } - }, - "node_modules/@redis/bloom": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", - "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/client": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.0.tgz", - "integrity": "sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==", - "license": "MIT", - "dependencies": { - "cluster-key-slot": "1.1.2", - "generic-pool": "3.9.0", - "yallist": "4.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@redis/graph": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", - "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/json": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", - "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/search": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", - "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/time-series": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", - "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", - "license": "MIT", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, - "node_modules/axios": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", - "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.4", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", - "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/cluster-key-slot": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", - "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "license": "MIT" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", - "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.12", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/generic-pool": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", - "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", - "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "dunder-proto": "^1.0.0", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "function-bind": "^1.1.2", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "license": "MIT", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", - "license": "MIT" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "license": "MIT" - }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/redis": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.0.tgz", - "integrity": "sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==", - "license": "MIT", - "workspaces": [ - "./packages/*" - ], - "dependencies": { - "@redis/bloom": "1.2.0", - "@redis/client": "1.6.0", - "@redis/graph": "1.1.1", - "@redis/json": "1.0.7", - "@redis/search": "1.2.0", - "@redis/time-series": "1.1.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "license": "ISC" - } - } -} diff --git a/inventory-server/dashboard/gorgias-server/package.json b/inventory-server/dashboard/gorgias-server/package.json deleted file mode 100644 index 6240316..0000000 --- a/inventory-server/dashboard/gorgias-server/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "gorgias-server", - "version": "1.0.0", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "description": "", - "dependencies": { - "axios": "^1.7.9", - "cors": "^2.8.5", - "dotenv": "^16.4.7", - "express": "^4.21.2", - "redis": "^4.7.0" - } -} diff --git a/inventory-server/dashboard/gorgias-server/routes/gorgias.routes.js b/inventory-server/dashboard/gorgias-server/routes/gorgias.routes.js deleted file mode 100644 index 3a6199d..0000000 --- a/inventory-server/dashboard/gorgias-server/routes/gorgias.routes.js +++ /dev/null @@ -1,119 +0,0 @@ -const express = require('express'); -const router = express.Router(); -const gorgiasService = require('../services/gorgias.service'); - -// Get statistics -router.post('/stats/:name', async (req, res) => { - try { - const { name } = req.params; - const filters = req.body; - - console.log(`Fetching ${name} statistics with filters:`, filters); - - if (!name) { - return res.status(400).json({ - error: 'Missing statistic name', - details: 'The name parameter is required' - }); - } - - const data = await gorgiasService.getStatistics(name, filters); - - if (!data) { - return res.status(404).json({ - error: 'No data found', - details: `No statistics found for ${name}` - }); - } - - res.json({ data }); - } catch (error) { - console.error('Statistics error:', { - name: req.params.name, - filters: req.body, - error: error.message, - stack: error.stack, - response: error.response?.data - }); - - // Handle specific error cases - if (error.response?.status === 401) { - return res.status(401).json({ - error: 'Authentication failed', - details: 'Invalid Gorgias API credentials' - }); - } - - if (error.response?.status === 404) { - return res.status(404).json({ - error: 'Not found', - details: `Statistics type '${req.params.name}' not found` - }); - } - - if (error.response?.status === 400) { - return res.status(400).json({ - error: 'Invalid request', - details: error.response?.data?.message || 'The request was invalid', - data: error.response?.data - }); - } - - res.status(500).json({ - error: 'Failed to fetch statistics', - details: error.response?.data?.message || error.message, - data: error.response?.data - }); - } -}); - -// Get tickets -router.get('/tickets', async (req, res) => { - try { - const data = await gorgiasService.getTickets(req.query); - res.json(data); - } catch (error) { - console.error('Tickets error:', { - params: req.query, - error: error.message, - response: error.response?.data - }); - - if (error.response?.status === 401) { - return res.status(401).json({ - error: 'Authentication failed', - details: 'Invalid Gorgias API credentials' - }); - } - - if (error.response?.status === 400) { - return res.status(400).json({ - error: 'Invalid request', - details: error.response?.data?.message || 'The request was invalid', - data: error.response?.data - }); - } - - res.status(500).json({ - error: 'Failed to fetch tickets', - details: error.response?.data?.message || error.message, - data: error.response?.data - }); - } -}); - -// Get customer satisfaction -router.get('/satisfaction', async (req, res) => { - try { - const data = await gorgiasService.getCustomerSatisfaction(req.query); - res.json(data); - } catch (error) { - console.error('Satisfaction error:', error); - res.status(500).json({ - error: 'Failed to fetch customer satisfaction', - details: error.response?.data || error.message - }); - } -}); - -module.exports = router; \ No newline at end of file diff --git a/inventory-server/dashboard/gorgias-server/server.js b/inventory-server/dashboard/gorgias-server/server.js deleted file mode 100644 index f0c05c4..0000000 --- a/inventory-server/dashboard/gorgias-server/server.js +++ /dev/null @@ -1,31 +0,0 @@ -const express = require('express'); -const cors = require('cors'); -const path = require('path'); -require('dotenv').config({ - path: path.resolve(__dirname, '.env') -}); - -const app = express(); -const port = process.env.PORT || 3006; - -app.use(cors()); -app.use(express.json()); - -// Import routes -const gorgiasRoutes = require('./routes/gorgias.routes'); - -// Use routes -app.use('/api/gorgias', gorgiasRoutes); - -// Error handling middleware -app.use((err, req, res, next) => { - console.error(err.stack); - res.status(500).json({ error: 'Something went wrong!' }); -}); - -// Start server -app.listen(port, () => { - console.log(`Gorgias API server running on port ${port}`); -}); - -module.exports = app; diff --git a/inventory-server/dashboard/gorgias-server/services/gorgias.service.js b/inventory-server/dashboard/gorgias-server/services/gorgias.service.js deleted file mode 100644 index a34a41e..0000000 --- a/inventory-server/dashboard/gorgias-server/services/gorgias.service.js +++ /dev/null @@ -1,119 +0,0 @@ -const axios = require('axios'); -const { createClient } = require('redis'); - -class GorgiasService { - constructor() { - this.redis = createClient({ - url: process.env.REDIS_URL - }); - - this.redis.on('error', err => console.error('Redis Client Error:', err)); - this.redis.connect().catch(err => console.error('Redis connection error:', err)); - - // Create base64 encoded auth string - const auth = Buffer.from(`${process.env.GORGIAS_API_USERNAME}:${process.env.GORGIAS_API_KEY}`).toString('base64'); - - this.apiClient = axios.create({ - baseURL: `https://${process.env.GORGIAS_DOMAIN}.gorgias.com/api`, - headers: { - 'Authorization': `Basic ${auth}`, - 'Content-Type': 'application/json' - } - }); - } - - async getStatistics(name, filters = {}) { - const cacheKey = `gorgias:stats:${name}:${JSON.stringify(filters)}`; - - try { - // Try Redis first - const cachedData = await this.redis.get(cacheKey); - if (cachedData) { - console.log(`Statistics ${name} found in Redis cache`); - return JSON.parse(cachedData); - } - - console.log(`Fetching ${name} statistics with filters:`, filters); - - // Convert dates to UTC midnight if not already set - if (!filters.start_datetime || !filters.end_datetime) { - const start = new Date(filters.start_datetime || filters.start_date); - start.setUTCHours(0, 0, 0, 0); - const end = new Date(filters.end_datetime || filters.end_date); - end.setUTCHours(23, 59, 59, 999); - - filters = { - ...filters, - start_datetime: start.toISOString(), - end_datetime: end.toISOString() - }; - } - - // Fetch from API - const response = await this.apiClient.post(`/stats/${name}`, filters); - const data = response.data; - - // Save to Redis with 5 minute expiry - await this.redis.set(cacheKey, JSON.stringify(data), { - EX: 300 // 5 minutes - }); - - return data; - } catch (error) { - console.error(`Error in getStatistics for ${name}:`, { - error: error.message, - filters, - response: error.response?.data - }); - throw error; - } - } - - async getTickets(params = {}) { - const cacheKey = `gorgias:tickets:${JSON.stringify(params)}`; - - try { - // Try Redis first - const cachedData = await this.redis.get(cacheKey); - if (cachedData) { - console.log('Tickets found in Redis cache'); - return JSON.parse(cachedData); - } - - // Convert dates to UTC midnight - const formattedParams = { ...params }; - if (params.start_date) { - const start = new Date(params.start_date); - start.setUTCHours(0, 0, 0, 0); - formattedParams.start_datetime = start.toISOString(); - delete formattedParams.start_date; - } - if (params.end_date) { - const end = new Date(params.end_date); - end.setUTCHours(23, 59, 59, 999); - formattedParams.end_datetime = end.toISOString(); - delete formattedParams.end_date; - } - - // Fetch from API - const response = await this.apiClient.get('/tickets', { params: formattedParams }); - const data = response.data; - - // Save to Redis with 5 minute expiry - await this.redis.set(cacheKey, JSON.stringify(data), { - EX: 300 // 5 minutes - }); - - return data; - } catch (error) { - console.error('Error fetching tickets:', { - error: error.message, - params, - response: error.response?.data - }); - throw error; - } - } -} - -module.exports = new GorgiasService(); \ No newline at end of file diff --git a/inventory-server/shared/auth/middleware.js b/inventory-server/shared/auth/middleware.js new file mode 100644 index 0000000..91d4fc1 --- /dev/null +++ b/inventory-server/shared/auth/middleware.js @@ -0,0 +1,101 @@ +import { extractBearerToken, verifyToken, TokenError } from './verify.js'; + +const USER_CACHE_TTL_MS = 60_000; + +function createUserCache() { + const entries = new Map(); + return { + get(userId) { + const hit = entries.get(userId); + if (!hit) return null; + if (Date.now() - hit.cachedAt > USER_CACHE_TTL_MS) { + entries.delete(userId); + return null; + } + return hit.user; + }, + set(userId, user) { + entries.set(userId, { user, cachedAt: Date.now() }); + }, + invalidate(userId) { + entries.delete(userId); + }, + }; +} + +async function loadUser(pool, userId) { + const userResult = await pool.query( + 'SELECT id, username, email, is_admin, is_active FROM users WHERE id = $1', + [userId] + ); + const user = userResult.rows[0]; + if (!user) return null; + + if (user.is_admin) { + user.permissions = []; + return user; + } + + const permResult = await pool.query( + `SELECT p.code + FROM permissions p + JOIN user_permissions up ON p.id = up.permission_id + WHERE up.user_id = $1`, + [userId] + ); + user.permissions = permResult.rows.map((r) => r.code); + return user; +} + +export function authenticate({ pool, secret = process.env.JWT_SECRET }) { + const cache = createUserCache(); + + return async function authenticateMiddleware(req, res, next) { + let decoded; + try { + const token = extractBearerToken(req.headers.authorization); + decoded = verifyToken(token, secret); + } catch (err) { + if (err instanceof TokenError) { + return res.status(401).json({ error: err.message }); + } + return res.status(401).json({ error: 'Authentication required' }); + } + + try { + let user = cache.get(decoded.userId); + if (!user) { + user = await loadUser(pool, decoded.userId); + if (!user) { + return res.status(401).json({ error: 'User not found' }); + } + cache.set(decoded.userId, user); + } + if (!user.is_active) { + cache.invalidate(decoded.userId); + return res.status(403).json({ error: 'Account inactive' }); + } + req.user = user; + next(); + } catch (err) { + next(err); + } + }; +} + +export function requirePermission(code) { + return function requirePermissionMiddleware(req, res, next) { + if (!req.user) return res.status(401).json({ error: 'Authentication required' }); + if (req.user.is_admin) return next(); + if (Array.isArray(req.user.permissions) && req.user.permissions.includes(code)) { + return next(); + } + res.status(403).json({ error: 'Insufficient permissions' }); + }; +} + +export function requireAdmin(req, res, next) { + if (!req.user) return res.status(401).json({ error: 'Authentication required' }); + if (req.user.is_admin) return next(); + res.status(403).json({ error: 'Admin only' }); +} diff --git a/inventory-server/shared/auth/verify.js b/inventory-server/shared/auth/verify.js new file mode 100644 index 0000000..ae3691c --- /dev/null +++ b/inventory-server/shared/auth/verify.js @@ -0,0 +1,37 @@ +import jwt from 'jsonwebtoken'; + +export class TokenError extends Error { + constructor(message, code) { + super(message); + this.name = 'TokenError'; + this.code = code; + } +} + +export function extractBearerToken(authorizationHeader) { + if (!authorizationHeader || typeof authorizationHeader !== 'string') { + throw new TokenError('No token provided', 'missing'); + } + if (!authorizationHeader.startsWith('Bearer ')) { + throw new TokenError('Malformed Authorization header', 'malformed'); + } + const token = authorizationHeader.slice(7).trim(); + if (!token) { + throw new TokenError('Empty bearer token', 'malformed'); + } + return token; +} + +export function verifyToken(token, secret) { + if (!secret) { + throw new TokenError('JWT_SECRET not configured', 'misconfigured'); + } + try { + return jwt.verify(token, secret); + } catch (err) { + if (err.name === 'TokenExpiredError') { + throw new TokenError('Token expired', 'expired'); + } + throw new TokenError('Invalid token', 'invalid'); + } +} diff --git a/inventory-server/shared/cors/policy.js b/inventory-server/shared/cors/policy.js new file mode 100644 index 0000000..cd441bc --- /dev/null +++ b/inventory-server/shared/cors/policy.js @@ -0,0 +1,24 @@ +export const allowedOrigins = [ + 'https://tools.acherryontop.com', + 'https://inventory.kent.pw', + 'https://acot.site', + /^http:\/\/localhost:(5174|5175)$/, +]; + +export const corsOptions = { + origin(origin, callback) { + if (!origin) return callback(null, true); + const ok = allowedOrigins.some((allowed) => + allowed instanceof RegExp ? allowed.test(origin) : allowed === origin + ); + if (ok) return callback(null, true); + callback(new Error('CORS not allowed')); + }, + methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], + allowedHeaders: ['Content-Type', 'Authorization'], + exposedHeaders: ['Content-Type'], + credentials: true, + maxAge: 600, +}; + +export default corsOptions; diff --git a/inventory-server/shared/db/pg.js b/inventory-server/shared/db/pg.js new file mode 100644 index 0000000..50c2349 --- /dev/null +++ b/inventory-server/shared/db/pg.js @@ -0,0 +1,19 @@ +import pg from 'pg'; + +const { Pool } = pg; + +export function createPool(envPrefix = 'DB', overrides = {}) { + const get = (key) => process.env[`${envPrefix}_${key}`]; + + return new Pool({ + host: overrides.host ?? get('HOST'), + user: overrides.user ?? get('USER'), + password: overrides.password ?? get('PASSWORD'), + database: overrides.database ?? get('NAME'), + port: overrides.port ?? Number(get('PORT')) || 5432, + ssl: (overrides.ssl ?? get('SSL')) === 'true' ? { rejectUnauthorized: false } : false, + max: overrides.max ?? 20, + idleTimeoutMillis: overrides.idleTimeoutMillis ?? 30_000, + connectionTimeoutMillis: overrides.connectionTimeoutMillis ?? 5_000, + }); +} diff --git a/inventory-server/shared/db/redis.js b/inventory-server/shared/db/redis.js new file mode 100644 index 0000000..0d26d8c --- /dev/null +++ b/inventory-server/shared/db/redis.js @@ -0,0 +1,27 @@ +import Redis from 'ioredis'; + +export function createRedis(overrides = {}) { + const url = overrides.url ?? process.env.REDIS_URL; + + const options = { + lazyConnect: true, + maxRetriesPerRequest: 3, + enableOfflineQueue: false, + retryStrategy(times) { + return Math.min(times * 200, 2_000); + }, + ...overrides, + }; + + if (url) { + return new Redis(url, options); + } + + return new Redis({ + host: overrides.host ?? process.env.REDIS_HOST ?? 'localhost', + port: overrides.port ?? Number(process.env.REDIS_PORT) || 6379, + username: overrides.username ?? process.env.REDIS_USERNAME, + password: overrides.password ?? process.env.REDIS_PASSWORD, + ...options, + }); +} diff --git a/inventory-server/shared/errors/handler.js b/inventory-server/shared/errors/handler.js new file mode 100644 index 0000000..948013b --- /dev/null +++ b/inventory-server/shared/errors/handler.js @@ -0,0 +1,18 @@ +import { logger } from '../logging/logger.js'; + +export function errorHandler(err, req, res, _next) { + const status = err.status ?? err.statusCode ?? 500; + + logger.error({ + err: { message: err.message, stack: err.stack, code: err.code }, + method: req.method, + url: req.url, + userId: req.user?.id, + }, 'request failed'); + + const body = { error: status >= 500 ? 'Internal server error' : err.message }; + if (process.env.NODE_ENV !== 'production' && status >= 500) { + body.detail = err.message; + } + res.status(status).json(body); +} diff --git a/inventory-server/shared/logging/index.js b/inventory-server/shared/logging/index.js new file mode 100644 index 0000000..c92d612 --- /dev/null +++ b/inventory-server/shared/logging/index.js @@ -0,0 +1,2 @@ +export { logger, createLogger } from './logger.js'; +export { requestLog } from './request-log.js'; diff --git a/inventory-server/shared/logging/logger.js b/inventory-server/shared/logging/logger.js new file mode 100644 index 0000000..a6076ce --- /dev/null +++ b/inventory-server/shared/logging/logger.js @@ -0,0 +1,27 @@ +import { pino } from 'pino'; + +const REDACTED_PATHS = [ + 'req.headers.authorization', + 'req.headers.cookie', + 'headers.authorization', + 'headers.cookie', + '*.password', + '*.token', + '*.jwt', +]; + +export function createLogger(options = {}) { + return pino({ + level: process.env.LOG_LEVEL ?? 'info', + redact: { + paths: REDACTED_PATHS, + censor: '[REDACTED]', + }, + base: { + service: options.service ?? process.env.SERVICE_NAME ?? 'inventory', + }, + ...options, + }); +} + +export const logger = createLogger(); diff --git a/inventory-server/shared/logging/request-log.js b/inventory-server/shared/logging/request-log.js new file mode 100644 index 0000000..3e1aded --- /dev/null +++ b/inventory-server/shared/logging/request-log.js @@ -0,0 +1,32 @@ +import { pinoHttp } from 'pino-http'; +import { logger } from './logger.js'; + +export function requestLog(options = {}) { + return pinoHttp({ + logger, + customLogLevel(req, res, err) { + if (err || res.statusCode >= 500) return 'error'; + if (res.statusCode >= 400) return 'warn'; + return 'info'; + }, + customSuccessMessage(req, res) { + return `${req.method} ${req.url} ${res.statusCode}`; + }, + customErrorMessage(req, res, err) { + return `${req.method} ${req.url} ${res.statusCode} ${err?.message ?? ''}`; + }, + serializers: { + req(req) { + return { + method: req.method, + url: req.url, + userId: req.raw?.user?.id, + }; + }, + res(res) { + return { statusCode: res.statusCode }; + }, + }, + ...options, + }); +} diff --git a/inventory-server/shared/package.json b/inventory-server/shared/package.json new file mode 100644 index 0000000..58bc2d9 --- /dev/null +++ b/inventory-server/shared/package.json @@ -0,0 +1,28 @@ +{ + "name": "@inventory/shared", + "version": "1.0.0", + "description": "Shared modules used by inventory-server, auth-server, dashboard-server, and acot-server", + "type": "module", + "private": true, + "exports": { + "./auth/middleware": "./auth/middleware.js", + "./auth/verify": "./auth/verify.js", + "./db/pg": "./db/pg.js", + "./db/redis": "./db/redis.js", + "./logging/logger": "./logging/logger.js", + "./logging/request-log": "./logging/request-log.js", + "./logging": "./logging/index.js", + "./errors/handler": "./errors/handler.js", + "./cors/policy": "./cors/policy.js", + "./rate-limit/login": "./rate-limit/login.js" + }, + "dependencies": { + "cors": "^2.8.5", + "express-rate-limit": "^7.4.0", + "ioredis": "^5.4.0", + "jsonwebtoken": "^9.0.2", + "pg": "^8.11.3", + "pino": "^9.5.0", + "pino-http": "^10.3.0" + } +} diff --git a/inventory-server/shared/rate-limit/login.js b/inventory-server/shared/rate-limit/login.js new file mode 100644 index 0000000..9c9906a --- /dev/null +++ b/inventory-server/shared/rate-limit/login.js @@ -0,0 +1,17 @@ +import rateLimit from 'express-rate-limit'; + +export const loginLimiter = rateLimit({ + windowMs: 15 * 60 * 1000, + max: 10, + message: { error: 'Too many login attempts, try again later' }, + standardHeaders: true, + legacyHeaders: false, +}); + +export const verifyLimiter = rateLimit({ + windowMs: 60 * 1000, + max: 600, + message: { error: 'Too many requests' }, + standardHeaders: true, + legacyHeaders: false, +}); diff --git a/inventory/src/components/dashboard/AircallDashboard.jsx b/inventory/src/components/dashboard/AircallDashboard.jsx deleted file mode 100644 index f879b32..0000000 --- a/inventory/src/components/dashboard/AircallDashboard.jsx +++ /dev/null @@ -1,405 +0,0 @@ -// components/AircallDashboard.jsx -import React, { useState, useEffect } from "react"; -import { Card, CardContent } from "@/components/ui/card"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; -import { - BarChart, - Bar, - XAxis, - YAxis, - CartesianGrid, - Tooltip as RechartsTooltip, - Legend, - ResponsiveContainer, -} from "recharts"; - -// Import shared components and tokens -import { - DashboardChartTooltip, - DashboardStatCard, - DashboardStatCardSkeleton, - DashboardSectionHeader, - DashboardErrorState, - DashboardTable, - ChartSkeleton, - CARD_STYLES, - METRIC_COLORS, -} from "@/components/dashboard/shared"; -import { Phone, Clock, Zap, Timer } from "lucide-react"; - -// Aircall-specific colors using the standardized palette -const CHART_COLORS = { - inbound: METRIC_COLORS.aov, // Purple for inbound - outbound: METRIC_COLORS.revenue, // Green for outbound - missed: METRIC_COLORS.comparison, // Amber for missed - answered: METRIC_COLORS.revenue, // Green for answered - duration: METRIC_COLORS.orders, // Blue for duration - hourly: METRIC_COLORS.tertiary, // Pink for hourly -}; - -const TIME_RANGES = [ - { label: "Today", value: "today" }, - { label: "Yesterday", value: "yesterday" }, - { label: "Last 7 Days", value: "last7days" }, - { label: "Last 30 Days", value: "last30days" }, - { label: "Last 90 Days", value: "last90days" }, -]; - -const REFRESH_INTERVAL = 5 * 60 * 1000; - -const formatDuration = (seconds) => { - const hours = Math.floor(seconds / 3600); - const minutes = Math.floor((seconds % 3600) / 60); - const remainingSeconds = seconds % 60; - - if (hours > 0) { - return `${hours}h ${minutes}m`; - } - return `${minutes}m ${remainingSeconds}s`; -}; - -const AircallDashboard = () => { - const [timeRange, setTimeRange] = useState("last7days"); - const [metrics, setMetrics] = useState(null); - const [lastUpdated, setLastUpdated] = useState(null); - const [isLoading, setIsLoading] = useState(true); - const [error, setError] = useState(null); - const [agentSort, setAgentSort] = useState({ - key: "total", - direction: "desc", - }); - - const safeArray = (arr) => (Array.isArray(arr) ? arr : []); - - const sortedAgents = metrics?.by_users - ? Object.values(metrics.by_users).sort((a, b) => { - const multiplier = agentSort.direction === "desc" ? -1 : 1; - return multiplier * (a[agentSort.key] - b[agentSort.key]); - }) - : []; - - const chartData = { - hourly: metrics?.by_hour - ? metrics.by_hour.map((count, hour) => ({ - hour: new Date(2000, 0, 1, hour).toLocaleString('en-US', { - hour: 'numeric', - hour12: true - }).toUpperCase(), - calls: count || 0, - })) - : [], - - missedReasons: metrics?.by_missed_reason - ? Object.entries(metrics.by_missed_reason).map(([reason, count]) => ({ - reason: (reason || "").replace(/_/g, " "), - count: count || 0, - })) - : [], - - daily: safeArray(metrics?.daily_data).map((day) => ({ - ...day, - inbound: day.inbound || 0, - outbound: day.outbound || 0, - date: new Date(day.date).toLocaleString('en-US', { - month: 'short', - day: 'numeric' - }), - })), - }; - - // Column definitions for Agent Performance table - const agentColumns = [ - { - key: "name", - header: "Agent", - render: (value) => {value}, - }, - { - key: "total", - header: "Total Calls", - align: "right", - sortable: true, - render: (value) => {value}, - }, - { - key: "answered", - header: "Answered", - align: "right", - sortable: true, - render: (value) => {value}, - }, - { - key: "missed", - header: "Missed", - align: "right", - sortable: true, - render: (value) => {value}, - }, - { - key: "average_duration", - header: "Avg Duration", - align: "right", - sortable: true, - render: (value) => {formatDuration(value)}, - }, - ]; - - // Column definitions for Missed Reasons table - const missedReasonsColumns = [ - { - key: "reason", - header: "Reason", - render: (value) => {value}, - }, - { - key: "count", - header: "Count", - align: "right", - render: (value) => {value}, - }, - ]; - - const fetchData = async () => { - try { - setIsLoading(true); - const response = await fetch(`/api/aircall/metrics/${timeRange}`); - if (!response.ok) throw new Error("Failed to fetch metrics"); - const data = await response.json(); - setMetrics(data); - setLastUpdated(data._meta?.generatedAt); - setError(null); - } catch (err) { - setError(err.message); - } finally { - setIsLoading(false); - } - }; - - useEffect(() => { - fetchData(); - const interval = setInterval(fetchData, REFRESH_INTERVAL); - return () => clearInterval(interval); - }, [timeRange]); - - if (error) { - return ( - - - - - - ); - } - - return ( -
- - - - - - - {TIME_RANGES.map((range) => ( - - {range.label} - - ))} - - - } - /> - - - {/* Metric Cards */} -
- {isLoading ? ( - [...Array(4)].map((_, i) => ( - - )) - ) : metrics ? ( - <> - - ↑ {metrics.by_direction.inbound} in - ↓ {metrics.by_direction.outbound} out - - } - icon={Phone} - iconColor="blue" - /> - - - {metrics.by_status.answered} answered - {metrics.by_status.missed} missed - - } - icon={Zap} - iconColor="green" - /> - - - - 0 - ? `${Math.round(metrics.total / metrics.daily_data.length)} calls/day` - : "N/A" - } - tooltip={ - metrics?.duration_distribution - ? `Duration Distribution: ${metrics.duration_distribution.map(d => `${d.range}: ${d.count}`).join(', ')}` - : undefined - } - icon={Timer} - iconColor="teal" - /> - - ) : null} -
- - {/* Charts and Tables Section */} -
- {/* Charts Row */} -
- {/* Daily Call Volume */} - - - - {isLoading ? ( - - ) : ( - - - - - - } /> - - - - - - )} - - - - {/* Hourly Distribution */} - - - - {isLoading ? ( - - ) : ( - - - - - - } /> - - - - )} - - -
- - {/* Tables Row */} -
- {/* Agent Performance */} - - - - agent.id} - sortConfig={agentSort} - onSort={(key, direction) => setAgentSort({ key, direction })} - maxHeight="md" - compact - /> - - - - {/* Missed Call Reasons Table */} - - - - `${reason.reason}-${index}`} - maxHeight="md" - compact - /> - - -
-
-
-
-
- ); -}; - -export default AircallDashboard; diff --git a/inventory/src/components/dashboard/GorgiasOverview.jsx b/inventory/src/components/dashboard/GorgiasOverview.jsx deleted file mode 100644 index 7a6ccc5..0000000 --- a/inventory/src/components/dashboard/GorgiasOverview.jsx +++ /dev/null @@ -1,407 +0,0 @@ -import React, { useState, useEffect, useCallback } from "react"; -import { Card, CardContent } from "@/components/ui/card"; -import { - Select, - SelectTrigger, - SelectContent, - SelectItem, - SelectValue, -} from "@/components/ui/select"; -import { - Mail, - Send, - ArrowUp, - ArrowDown, - Zap, - Timer, - BarChart3, - ClipboardCheck, - Star, -} from "lucide-react"; -import axios from "axios"; -import { CARD_STYLES } from "@/lib/dashboard/designTokens"; -import { - DashboardStatCard, - DashboardStatCardSkeleton, - DashboardSectionHeader, - DashboardErrorState, - DashboardTable, -} from "@/components/dashboard/shared"; - -const TIME_RANGES = { - "today": "Today", - "7": "Last 7 Days", - "14": "Last 14 Days", - "30": "Last 30 Days", - "90": "Last 90 Days", -}; - -const formatDuration = (seconds) => { - const hours = Math.floor(seconds / 3600); - const minutes = Math.floor((seconds % 3600) / 60); - return hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`; -}; - -const getDateRange = (days) => { - const now = new Date(); - const easternTime = new Date( - now.toLocaleString("en-US", { timeZone: "America/New_York" }) - ); - - if (days === "today") { - const start = new Date(easternTime); - start.setHours(0, 0, 0, 0); - - const end = new Date(easternTime); - end.setHours(23, 59, 59, 999); - - return { - start_datetime: start.toISOString(), - end_datetime: end.toISOString() - }; - } - - const end = new Date(easternTime); - end.setHours(23, 59, 59, 999); - - const start = new Date(easternTime); - start.setDate(start.getDate() - Number(days)); - start.setHours(0, 0, 0, 0); - - return { - start_datetime: start.toISOString(), - end_datetime: end.toISOString() - }; -}; - -// Trend cell component with arrow and color -const TrendCell = ({ delta }) => { - if (delta === 0) return null; - - const isPositive = delta > 0; - const colorClass = isPositive - ? "text-green-600 dark:text-green-500" - : "text-red-600 dark:text-red-500"; - - return ( -
- {isPositive ? ( - - ) : ( - - )} - {Math.abs(delta)}% -
- ); -}; - -const GorgiasOverview = () => { - const [timeRange, setTimeRange] = useState("7"); - const [data, setData] = useState({}); - const [loading, setLoading] = useState(true); - const [error, setError] = useState(null); - - const loadStats = useCallback(async () => { - setLoading(true); - const filters = getDateRange(timeRange); - - try { - const [overview, channelStats, agentStats, satisfaction] = - await Promise.all([ - axios.post('/api/gorgias/stats/overview', filters) - .then(res => res.data?.data?.data?.data || []), - axios.post('/api/gorgias/stats/tickets-created-per-channel', filters) - .then(res => res.data?.data?.data?.data?.lines || []), - axios.post('/api/gorgias/stats/tickets-closed-per-agent', filters) - .then(res => res.data?.data?.data?.data?.lines || []), - axios.post('/api/gorgias/stats/satisfaction-surveys', filters) - .then(res => res.data?.data?.data?.data || []), - ]); - - setData({ - overview, - channels: channelStats, - agents: agentStats, - satisfaction, - }); - - setError(null); - } catch (err) { - console.error("Error loading stats:", err); - const errorMessage = err.response?.data?.error || err.message; - setError(errorMessage); - if (err.response?.status === 401) { - setError('Authentication failed. Please check your Gorgias API credentials.'); - } - } finally { - setLoading(false); - } - }, [timeRange]); - - useEffect(() => { - loadStats(); - const interval = setInterval(loadStats, 5 * 60 * 1000); - return () => clearInterval(interval); - }, [loadStats]); - - // Convert overview array to stats format - const stats = (data.overview || []).reduce((acc, item) => { - acc[item.name] = { - value: item.value || 0, - delta: item.delta || 0, - type: item.type, - more_is_better: item.more_is_better - }; - return acc; - }, {}); - - // Process satisfaction data - const satisfactionStats = (data.satisfaction || []).reduce((acc, item) => { - if (item.name !== 'response_distribution') { - acc[item.name] = { - value: item.value || 0, - delta: item.delta || 0, - type: item.type, - more_is_better: item.more_is_better - }; - } - return acc; - }, {}); - - // Process channel data - const channels = (data.channels?.map(line => ({ - name: line[0]?.value || '', - total: line[1]?.value || 0, - percentage: line[2]?.value || 0, - delta: line[3]?.value || 0 - })) || []).sort((a, b) => b.total - a.total); - - // Process agent data - const agents = (data.agents?.map(line => ({ - name: line[0]?.value || '', - closed: line[1]?.value || 0, - rating: line[2]?.value, - percentage: line[3]?.value || 0, - delta: line[4]?.value || 0 - })) || []).filter(agent => agent.name !== "Unassigned"); - - // Column definitions for Channel Distribution table - const channelColumns = [ - { - key: "name", - header: "Channel", - render: (value) => {value}, - }, - { - key: "total", - header: "Total", - align: "right", - render: (value) => {value}, - }, - { - key: "percentage", - header: "%", - align: "right", - render: (value) => {value}%, - }, - { - key: "delta", - header: "Change", - align: "right", - render: (value) => , - }, - ]; - - // Column definitions for Agent Performance table - const agentColumns = [ - { - key: "name", - header: "Agent", - render: (value) => {value}, - }, - { - key: "closed", - header: "Closed", - align: "right", - render: (value) => {value}, - }, - { - key: "rating", - header: "Rating", - align: "right", - render: (value) => ( - - {value ? `${value}/5` : "-"} - - ), - }, - { - key: "delta", - header: "Change", - align: "right", - render: (value) => , - }, - ]; - - if (error) { - return ( - - - - - - ); - } - - return ( - - setTimeRange(value)} - > - - - {TIME_RANGES[timeRange]} - - - - {[ - ["today", "Today"], - ["7", "Last 7 Days"], - ["14", "Last 14 Days"], - ["30", "Last 30 Days"], - ["90", "Last 90 Days"], - ].map(([value, label]) => ( - - {label} - - ))} - - - } - /> - - -
- {loading ? ( - [...Array(7)].map((_, i) => ( - - )) - ) : ( - <> - - - - - - - - - )} -
- -
- {/* Channel Distribution */} - - - - `${channel.name}-${index}`} - maxHeight="md" - compact - /> - - - - {/* Agent Performance */} - - - - `${agent.name}-${index}`} - maxHeight="md" - compact - /> - - -
-
-
- ); -}; - -export default GorgiasOverview; diff --git a/inventory/src/components/dashboard/Navigation.jsx b/inventory/src/components/dashboard/Navigation.jsx index 7c3ccfb..8b39244 100644 --- a/inventory/src/components/dashboard/Navigation.jsx +++ b/inventory/src/components/dashboard/Navigation.jsx @@ -31,8 +31,6 @@ const Navigation = () => { { id: "user-behavior", label: "User Behavior", permission: "dashboard:user_behavior" }, { id: "meta-campaigns", label: "Meta Ads", permission: "dashboard:meta_campaigns" }, { id: "typeform", label: "Customer Surveys", permission: "dashboard:typeform" }, - { id: "gorgias-overview", label: "Customer Service", permission: "dashboard:gorgias" }, - { id: "calls", label: "Calls", permission: "dashboard:calls" }, ]; // Filter sections based on user permissions diff --git a/inventory/src/config/dashboard.ts b/inventory/src/config/dashboard.ts index 4a906a1..d4bde65 100644 --- a/inventory/src/config/dashboard.ts +++ b/inventory/src/config/dashboard.ts @@ -5,15 +5,11 @@ const isLocal = window.location.hostname === 'localhost' || window.location.host const useProxy = !isLocal && (window.location.hostname === 'inventory.kent.pw' || window.location.hostname === 'inventory.tools.acherryontop.com' || window.location.hostname === 'tools.acherryontop.com'); const liveDashboardConfig = { - auth: isDev || useProxy ? '/dashboard-auth' : 'https://tools.acherryontop.com/auth', - aircall: isDev || useProxy ? '/api/aircall' : 'https://tools.acherryontop.com/api/aircall', klaviyo: isDev || useProxy ? '/api/klaviyo' : 'https://tools.acherryontop.com/api/klaviyo', meta: isDev || useProxy ? '/api/meta' : 'https://tools.acherryontop.com/api/meta', - gorgias: isDev || useProxy ? '/api/gorgias' : 'https://tools.acherryontop.com/api/gorgias', analytics: isDev || useProxy ? '/api/dashboard-analytics' : 'https://tools.acherryontop.com/api/analytics', typeform: isDev || useProxy ? '/api/typeform' : 'https://tools.acherryontop.com/api/typeform', acot: isDev || useProxy ? '/api/acot' : 'https://tools.acherryontop.com/api/acot', - clarity: isDev || useProxy ? '/api/clarity' : 'https://tools.acherryontop.com/api/clarity' }; export default liveDashboardConfig; \ No newline at end of file diff --git a/inventory/src/pages/Dashboard.tsx b/inventory/src/pages/Dashboard.tsx index 288fb66..07aa0a7 100644 --- a/inventory/src/pages/Dashboard.tsx +++ b/inventory/src/pages/Dashboard.tsx @@ -1,7 +1,6 @@ import { ScrollProvider } from "@/contexts/DashboardScrollContext"; import { ThemeProvider } from "@/components/dashboard/theme/ThemeProvider"; import { Protected } from "@/components/auth/Protected"; -import AircallDashboard from "@/components/dashboard/AircallDashboard"; import EventFeed from "@/components/dashboard/EventFeed"; import StatCards from "@/components/dashboard/StatCards"; import FinancialOverview from "@/components/dashboard/FinancialOverview"; @@ -9,7 +8,6 @@ import ProductGrid from "@/components/dashboard/ProductGrid"; import SalesChart from "@/components/dashboard/SalesChart"; import KlaviyoCampaigns from "@/components/dashboard/KlaviyoCampaigns"; import MetaCampaigns from "@/components/dashboard/MetaCampaigns"; -import GorgiasOverview from "@/components/dashboard/GorgiasOverview"; import AnalyticsDashboard from "@/components/dashboard/AnalyticsDashboard"; import RealtimeAnalytics from "@/components/dashboard/RealtimeAnalytics"; import UserBehaviorDashboard from "@/components/dashboard/UserBehaviorDashboard"; @@ -113,16 +111,6 @@ export function Dashboard() { - -
- -
-
- -
- -
-
diff --git a/inventory/src/types/dashboard.d.ts b/inventory/src/types/dashboard.d.ts index de0a775..6afc50a 100644 --- a/inventory/src/types/dashboard.d.ts +++ b/inventory/src/types/dashboard.d.ts @@ -9,11 +9,6 @@ declare module '@/components/dashboard/DateTime' { export default DateTimeWeatherDisplay; } -declare module '@/components/dashboard/AircallDashboard' { - const AircallDashboard: React.ComponentType; - export default AircallDashboard; -} - declare module '@/components/dashboard/EventFeed' { const EventFeed: React.ComponentType; export default EventFeed; @@ -44,11 +39,6 @@ declare module '@/components/dashboard/MetaCampaigns' { export default MetaCampaigns; } -declare module '@/components/dashboard/GorgiasOverview' { - const GorgiasOverview: React.ComponentType; - export default GorgiasOverview; -} - declare module '@/components/dashboard/AnalyticsDashboard' { const AnalyticsDashboard: React.ComponentType; export default AnalyticsDashboard; diff --git a/inventory/tsconfig.tsbuildinfo b/inventory/tsconfig.tsbuildinfo index 0e23e97..8fe1170 100644 --- a/inventory/tsconfig.tsbuildinfo +++ b/inventory/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/config.ts","./src/main.tsx","./src/vite-env.d.ts","./src/components/config.ts","./src/components/ai/aidescriptioncompare.tsx","./src/components/analytics/agingsellthrough.tsx","./src/components/analytics/capitalefficiency.tsx","./src/components/analytics/discountimpact.tsx","./src/components/analytics/growthmomentum.tsx","./src/components/analytics/inventoryflow.tsx","./src/components/analytics/inventorytrends.tsx","./src/components/analytics/inventoryvaluetrend.tsx","./src/components/analytics/portfolioanalysis.tsx","./src/components/analytics/seasonalpatterns.tsx","./src/components/analytics/stockhealth.tsx","./src/components/analytics/stockoutrisk.tsx","./src/components/auth/firstaccessiblepage.tsx","./src/components/auth/protected.tsx","./src/components/auth/requireauth.tsx","./src/components/bulk-edit/bulkeditrow.tsx","./src/components/chat/chatroom.tsx","./src/components/chat/chattest.tsx","./src/components/chat/roomlist.tsx","./src/components/chat/searchresults.tsx","./src/components/create-po/addproductsdialog.tsx","./src/components/create-po/confirmationview.tsx","./src/components/create-po/lineitemstable.tsx","./src/components/create-po/pofloatingselectionbar.tsx","./src/components/create-po/reviewmatchesdialog.tsx","./src/components/create-po/supplierselector.tsx","./src/components/create-po/constants.ts","./src/components/create-po/parsespreadsheet.ts","./src/components/create-po/resolveidentifiers.ts","./src/components/create-po/types.ts","./src/components/dashboard/financialoverview.tsx","./src/components/dashboard/operationsmetrics.tsx","./src/components/dashboard/payrollmetrics.tsx","./src/components/dashboard/periodselectionpopover.tsx","./src/components/dashboard/shared/dashboardbadge.tsx","./src/components/dashboard/shared/dashboardcharttooltip.tsx","./src/components/dashboard/shared/dashboardmultistatcardmini.tsx","./src/components/dashboard/shared/dashboardsectionheader.tsx","./src/components/dashboard/shared/dashboardskeleton.tsx","./src/components/dashboard/shared/dashboardstatcard.tsx","./src/components/dashboard/shared/dashboardstatcardmini.tsx","./src/components/dashboard/shared/dashboardstates.tsx","./src/components/dashboard/shared/dashboardtable.tsx","./src/components/dashboard/shared/index.ts","./src/components/discount-simulator/configpanel.tsx","./src/components/discount-simulator/resultschart.tsx","./src/components/discount-simulator/resultstable.tsx","./src/components/discount-simulator/summarycard.tsx","./src/components/forecasting/daterangepickerquick.tsx","./src/components/forecasting/columns.tsx","./src/components/layout/appsidebar.tsx","./src/components/layout/mainlayout.tsx","./src/components/layout/navuser.tsx","./src/components/newsletter/campaignhistorydialog.tsx","./src/components/newsletter/newsletterstats.tsx","./src/components/newsletter/recommendationtable.tsx","./src/components/overview/bestsellers.tsx","./src/components/overview/forecastaccuracy.tsx","./src/components/overview/forecastmetrics.tsx","./src/components/overview/overstockmetrics.tsx","./src/components/overview/purchasemetrics.tsx","./src/components/overview/replenishmentmetrics.tsx","./src/components/overview/salesmetrics.tsx","./src/components/overview/stockmetrics.tsx","./src/components/overview/topoverstockedproducts.tsx","./src/components/overview/topreplenishproducts.tsx","./src/components/product-editor/comboboxfield.tsx","./src/components/product-editor/editablecomboboxfield.tsx","./src/components/product-editor/editableinput.tsx","./src/components/product-editor/editablemultiselect.tsx","./src/components/product-editor/imagemanager.tsx","./src/components/product-editor/producteditform.tsx","./src/components/product-editor/productsearch.tsx","./src/components/product-editor/types.ts","./src/components/product-editor/useproductsuggestions.ts","./src/components/product-import/createproductcategorydialog.tsx","./src/components/product-import/reactspreadsheetimport.tsx","./src/components/product-import/config.ts","./src/components/product-import/index.ts","./src/components/product-import/translationsrsiprops.ts","./src/components/product-import/types.ts","./src/components/product-import/components/closeconfirmationdialog.tsx","./src/components/product-import/components/modalwrapper.tsx","./src/components/product-import/components/providers.tsx","./src/components/product-import/components/savesessiondialog.tsx","./src/components/product-import/components/savedsessionslist.tsx","./src/components/product-import/components/table.tsx","./src/components/product-import/hooks/usersi.ts","./src/components/product-import/steps/steps.tsx","./src/components/product-import/steps/uploadflow.tsx","./src/components/product-import/steps/imageuploadstep/imageuploadstep.tsx","./src/components/product-import/steps/imageuploadstep/types.ts","./src/components/product-import/steps/imageuploadstep/components/droppablecontainer.tsx","./src/components/product-import/steps/imageuploadstep/components/genericdropzone.tsx","./src/components/product-import/steps/imageuploadstep/components/unassignedimagessection.tsx","./src/components/product-import/steps/imageuploadstep/components/productcard/copybutton.tsx","./src/components/product-import/steps/imageuploadstep/components/productcard/imagedropzone.tsx","./src/components/product-import/steps/imageuploadstep/components/productcard/productcard.tsx","./src/components/product-import/steps/imageuploadstep/components/productcard/sortableimage.tsx","./src/components/product-import/steps/imageuploadstep/components/unassignedimagessection/unassignedimageitem.tsx","./src/components/product-import/steps/imageuploadstep/hooks/usebulkimageupload.ts","./src/components/product-import/steps/imageuploadstep/hooks/usedraganddrop.ts","./src/components/product-import/steps/imageuploadstep/hooks/useproductimageoperations.ts","./src/components/product-import/steps/imageuploadstep/hooks/useproductimagesinit.ts","./src/components/product-import/steps/imageuploadstep/hooks/useurlimageupload.ts","./src/components/product-import/steps/matchcolumnsstep/matchcolumnsstep.tsx","./src/components/product-import/steps/matchcolumnsstep/types.ts","./src/components/product-import/steps/matchcolumnsstep/components/matchicon.tsx","./src/components/product-import/steps/matchcolumnsstep/components/templatecolumn.tsx","./src/components/product-import/steps/matchcolumnsstep/utils/findmatch.ts","./src/components/product-import/steps/matchcolumnsstep/utils/findunmatchedrequiredfields.ts","./src/components/product-import/steps/matchcolumnsstep/utils/getfieldoptions.ts","./src/components/product-import/steps/matchcolumnsstep/utils/getmatchedcolumns.ts","./src/components/product-import/steps/matchcolumnsstep/utils/normalizecheckboxvalue.ts","./src/components/product-import/steps/matchcolumnsstep/utils/normalizetabledata.ts","./src/components/product-import/steps/matchcolumnsstep/utils/setcolumn.ts","./src/components/product-import/steps/matchcolumnsstep/utils/setignorecolumn.ts","./src/components/product-import/steps/matchcolumnsstep/utils/setsubcolumn.ts","./src/components/product-import/steps/matchcolumnsstep/utils/uniqueentries.ts","./src/components/product-import/steps/selectheaderstep/selectheaderstep.tsx","./src/components/product-import/steps/selectheaderstep/components/selectheadertable.tsx","./src/components/product-import/steps/selectheaderstep/components/columns.tsx","./src/components/product-import/steps/selectsheetstep/selectsheetstep.tsx","./src/components/product-import/steps/uploadstep/uploadstep.tsx","./src/components/product-import/steps/uploadstep/components/dropzone.tsx","./src/components/product-import/steps/uploadstep/components/columns.tsx","./src/components/product-import/steps/uploadstep/utils/readfilesasync.ts","./src/components/product-import/steps/validationstep/index.tsx","./src/components/product-import/steps/validationstep/components/aisuggestionbadge.tsx","./src/components/product-import/steps/validationstep/components/copydownbanner.tsx","./src/components/product-import/steps/validationstep/components/floatingselectionbar.tsx","./src/components/product-import/steps/validationstep/components/initializingoverlay.tsx","./src/components/product-import/steps/validationstep/components/searchabletemplateselect.tsx","./src/components/product-import/steps/validationstep/components/suggestionbadges.tsx","./src/components/product-import/steps/validationstep/components/validationcontainer.tsx","./src/components/product-import/steps/validationstep/components/validationfooter.tsx","./src/components/product-import/steps/validationstep/components/validationtable.tsx","./src/components/product-import/steps/validationstep/components/validationtoolbar.tsx","./src/components/product-import/steps/validationstep/components/cells/checkboxcell.tsx","./src/components/product-import/steps/validationstep/components/cells/comboboxcell.tsx","./src/components/product-import/steps/validationstep/components/cells/inputcell.tsx","./src/components/product-import/steps/validationstep/components/cells/multiselectcell.tsx","./src/components/product-import/steps/validationstep/components/cells/multilineinput.tsx","./src/components/product-import/steps/validationstep/components/cells/selectcell.tsx","./src/components/product-import/steps/validationstep/contexts/aisuggestionscontext.tsx","./src/components/product-import/steps/validationstep/dialogs/aidebugdialog.tsx","./src/components/product-import/steps/validationstep/dialogs/aivalidationprogress.tsx","./src/components/product-import/steps/validationstep/dialogs/aivalidationresults.tsx","./src/components/product-import/steps/validationstep/dialogs/sanitycheckdialog.tsx","./src/components/product-import/steps/validationstep/hooks/useautoinlineaivalidation.ts","./src/components/product-import/steps/validationstep/hooks/usecopydownvalidation.ts","./src/components/product-import/steps/validationstep/hooks/usefieldoptions.ts","./src/components/product-import/steps/validationstep/hooks/useinlineaivalidation.ts","./src/components/product-import/steps/validationstep/hooks/useproductlines.ts","./src/components/product-import/steps/validationstep/hooks/usesanitycheck.ts","./src/components/product-import/steps/validationstep/hooks/usetemplatemanagement.ts","./src/components/product-import/steps/validationstep/hooks/useupcvalidation.ts","./src/components/product-import/steps/validationstep/hooks/usevalidationactions.ts","./src/components/product-import/steps/validationstep/hooks/useaivalidation/index.ts","./src/components/product-import/steps/validationstep/hooks/useaivalidation/useaiapi.ts","./src/components/product-import/steps/validationstep/hooks/useaivalidation/useaiprogress.ts","./src/components/product-import/steps/validationstep/hooks/useaivalidation/useaitransform.ts","./src/components/product-import/steps/validationstep/store/selectors.ts","./src/components/product-import/steps/validationstep/store/types.ts","./src/components/product-import/steps/validationstep/store/validationstore.ts","./src/components/product-import/steps/validationstep/utils/aivalidationutils.ts","./src/components/product-import/steps/validationstep/utils/countryutils.ts","./src/components/product-import/steps/validationstep/utils/datamutations.ts","./src/components/product-import/steps/validationstep/utils/inlineaipayload.ts","./src/components/product-import/steps/validationstep/utils/priceutils.ts","./src/components/product-import/steps/validationstep/utils/upcutils.ts","./src/components/product-import/utils/exceedsmaxrecords.ts","./src/components/product-import/utils/mapdata.ts","./src/components/product-import/utils/mapworkbook.ts","./src/components/product-import/utils/steps.ts","./src/components/products/productdetail.tsx","./src/components/products/productfilters.tsx","./src/components/products/productsummarycards.tsx","./src/components/products/producttable.tsx","./src/components/products/producttableskeleton.tsx","./src/components/products/productviews.tsx","./src/components/products/statusbadge.tsx","./src/components/products/columndefinitions.ts","./src/components/purchase-orders/categorymetricscard.tsx","./src/components/purchase-orders/filtercontrols.tsx","./src/components/purchase-orders/ordermetricscard.tsx","./src/components/purchase-orders/paginationcontrols.tsx","./src/components/purchase-orders/pipelinecard.tsx","./src/components/purchase-orders/purchaseorderaccordion.tsx","./src/components/purchase-orders/purchaseorderstable.tsx","./src/components/purchase-orders/vendormetricscard.tsx","./src/components/settings/auditlog.tsx","./src/components/settings/datamanagement.tsx","./src/components/settings/globalsettings.tsx","./src/components/settings/permissionselector.tsx","./src/components/settings/productsettings.tsx","./src/components/settings/promptmanagement.tsx","./src/components/settings/reusableimagemanagement.tsx","./src/components/settings/templatemanagement.tsx","./src/components/settings/userform.tsx","./src/components/settings/userlist.tsx","./src/components/settings/usermanagement.tsx","./src/components/settings/vendorsettings.tsx","./src/components/templates/searchproducttemplatedialog.tsx","./src/components/templates/templateform.tsx","./src/components/ui/accordion.tsx","./src/components/ui/alert-dialog.tsx","./src/components/ui/alert.tsx","./src/components/ui/avatar.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/calendar.tsx","./src/components/ui/card.tsx","./src/components/ui/carousel.tsx","./src/components/ui/checkbox.tsx","./src/components/ui/code.tsx","./src/components/ui/collapsible.tsx","./src/components/ui/command.tsx","./src/components/ui/date-range-picker-narrow.tsx","./src/components/ui/date-range-picker.tsx","./src/components/ui/dialog.tsx","./src/components/ui/drawer.tsx","./src/components/ui/dropdown-menu.tsx","./src/components/ui/form.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/page-loading.tsx","./src/components/ui/pagination.tsx","./src/components/ui/popover.tsx","./src/components/ui/progress.tsx","./src/components/ui/radio-group.tsx","./src/components/ui/scroll-area.tsx","./src/components/ui/select.tsx","./src/components/ui/separator.tsx","./src/components/ui/sheet.tsx","./src/components/ui/sidebar.tsx","./src/components/ui/skeleton.tsx","./src/components/ui/sonner.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/components/ui/toast.tsx","./src/components/ui/toaster.tsx","./src/components/ui/toggle-group.tsx","./src/components/ui/toggle.tsx","./src/components/ui/tooltip.tsx","./src/config/dashboard.ts","./src/contexts/authcontext.tsx","./src/contexts/dashboardscrollcontext.tsx","./src/contexts/importsessioncontext.tsx","./src/hooks/use-mobile.tsx","./src/hooks/use-toast.ts","./src/hooks/usedebounce.ts","./src/hooks/useimportautosave.ts","./src/lib/utils.ts","./src/lib/dashboard/chartconfig.ts","./src/lib/dashboard/designtokens.ts","./src/pages/analytics.tsx","./src/pages/blackfridaydashboard.tsx","./src/pages/brands.tsx","./src/pages/bulkedit.tsx","./src/pages/categories.tsx","./src/pages/chat.tsx","./src/pages/createpurchaseorder.tsx","./src/pages/dashboard.tsx","./src/pages/discountsimulator.tsx","./src/pages/forecasting.tsx","./src/pages/htslookup.tsx","./src/pages/import.tsx","./src/pages/login.tsx","./src/pages/newsletter.tsx","./src/pages/overview.tsx","./src/pages/producteditor.tsx","./src/pages/productlines.tsx","./src/pages/products.tsx","./src/pages/purchaseorders.tsx","./src/pages/repeatorders.tsx","./src/pages/settings.tsx","./src/pages/smalldashboard.tsx","./src/pages/speclookup.tsx","./src/services/apiv2.ts","./src/services/importauditlogapi.ts","./src/services/importsessionapi.ts","./src/services/producteditor.ts","./src/services/producteditorauditlog.ts","./src/types/dashboard-shims.d.ts","./src/types/dashboard.d.ts","./src/types/discount-simulator.ts","./src/types/globals.d.ts","./src/types/importsession.ts","./src/types/products.ts","./src/types/react-data-grid.d.ts","./src/types/status-codes.ts","./src/utils/emojiutils.ts","./src/utils/formatcurrency.ts","./src/utils/lifecyclephases.ts","./src/utils/naturallanguageperiod.ts","./src/utils/productutils.ts","./src/utils/transformutils.ts"],"version":"5.6.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/config.ts","./src/main.tsx","./src/vite-env.d.ts","./src/components/config.ts","./src/components/ai/aidescriptioncompare.tsx","./src/components/analytics/agingsellthrough.tsx","./src/components/analytics/capitalefficiency.tsx","./src/components/analytics/discountimpact.tsx","./src/components/analytics/growthmomentum.tsx","./src/components/analytics/inventoryflow.tsx","./src/components/analytics/inventorytrends.tsx","./src/components/analytics/inventoryvaluetrend.tsx","./src/components/analytics/portfolioanalysis.tsx","./src/components/analytics/seasonalpatterns.tsx","./src/components/analytics/stockhealth.tsx","./src/components/analytics/stockoutrisk.tsx","./src/components/auth/firstaccessiblepage.tsx","./src/components/auth/protected.tsx","./src/components/auth/requireauth.tsx","./src/components/bulk-edit/bulkeditrow.tsx","./src/components/chat/chatroom.tsx","./src/components/chat/chattest.tsx","./src/components/chat/roomlist.tsx","./src/components/chat/searchresults.tsx","./src/components/create-po/addproductsdialog.tsx","./src/components/create-po/confirmationview.tsx","./src/components/create-po/lineitemstable.tsx","./src/components/create-po/pofloatingselectionbar.tsx","./src/components/create-po/reviewmatchesdialog.tsx","./src/components/create-po/supplierselector.tsx","./src/components/create-po/constants.ts","./src/components/create-po/parsespreadsheet.ts","./src/components/create-po/resolveidentifiers.ts","./src/components/create-po/types.ts","./src/components/dashboard/financialoverview.tsx","./src/components/dashboard/operationsmetrics.tsx","./src/components/dashboard/payrollmetrics.tsx","./src/components/dashboard/periodselectionpopover.tsx","./src/components/dashboard/shared/dashboardbadge.tsx","./src/components/dashboard/shared/dashboardcharttooltip.tsx","./src/components/dashboard/shared/dashboardmultistatcardmini.tsx","./src/components/dashboard/shared/dashboardsectionheader.tsx","./src/components/dashboard/shared/dashboardskeleton.tsx","./src/components/dashboard/shared/dashboardstatcard.tsx","./src/components/dashboard/shared/dashboardstatcardmini.tsx","./src/components/dashboard/shared/dashboardstates.tsx","./src/components/dashboard/shared/dashboardtable.tsx","./src/components/dashboard/shared/index.ts","./src/components/discount-simulator/configpanel.tsx","./src/components/discount-simulator/resultschart.tsx","./src/components/discount-simulator/resultstable.tsx","./src/components/discount-simulator/summarycard.tsx","./src/components/forecasting/daterangepickerquick.tsx","./src/components/forecasting/columns.tsx","./src/components/layout/appsidebar.tsx","./src/components/layout/mainlayout.tsx","./src/components/layout/navuser.tsx","./src/components/newsletter/campaignhistorydialog.tsx","./src/components/newsletter/newsletterstats.tsx","./src/components/newsletter/recommendationtable.tsx","./src/components/overview/bestsellers.tsx","./src/components/overview/forecastaccuracy.tsx","./src/components/overview/forecastmetrics.tsx","./src/components/overview/overstockmetrics.tsx","./src/components/overview/purchasemetrics.tsx","./src/components/overview/replenishmentmetrics.tsx","./src/components/overview/salesmetrics.tsx","./src/components/overview/stockmetrics.tsx","./src/components/overview/topoverstockedproducts.tsx","./src/components/overview/topreplenishproducts.tsx","./src/components/product-editor/comboboxfield.tsx","./src/components/product-editor/editablecomboboxfield.tsx","./src/components/product-editor/editableinput.tsx","./src/components/product-editor/editablemultiselect.tsx","./src/components/product-editor/imagemanager.tsx","./src/components/product-editor/producteditform.tsx","./src/components/product-editor/productsearch.tsx","./src/components/product-editor/types.ts","./src/components/product-editor/useproductsuggestions.ts","./src/components/product-import/createproductcategorydialog.tsx","./src/components/product-import/reactspreadsheetimport.tsx","./src/components/product-import/config.ts","./src/components/product-import/index.ts","./src/components/product-import/translationsrsiprops.ts","./src/components/product-import/types.ts","./src/components/product-import/components/closeconfirmationdialog.tsx","./src/components/product-import/components/modalwrapper.tsx","./src/components/product-import/components/providers.tsx","./src/components/product-import/components/savesessiondialog.tsx","./src/components/product-import/components/savedsessionslist.tsx","./src/components/product-import/components/table.tsx","./src/components/product-import/hooks/usersi.ts","./src/components/product-import/steps/steps.tsx","./src/components/product-import/steps/uploadflow.tsx","./src/components/product-import/steps/imageuploadstep/imageuploadstep.tsx","./src/components/product-import/steps/imageuploadstep/types.ts","./src/components/product-import/steps/imageuploadstep/components/droppablecontainer.tsx","./src/components/product-import/steps/imageuploadstep/components/genericdropzone.tsx","./src/components/product-import/steps/imageuploadstep/components/unassignedimagessection.tsx","./src/components/product-import/steps/imageuploadstep/components/productcard/copybutton.tsx","./src/components/product-import/steps/imageuploadstep/components/productcard/imagedropzone.tsx","./src/components/product-import/steps/imageuploadstep/components/productcard/productcard.tsx","./src/components/product-import/steps/imageuploadstep/components/productcard/sortableimage.tsx","./src/components/product-import/steps/imageuploadstep/components/unassignedimagessection/unassignedimageitem.tsx","./src/components/product-import/steps/imageuploadstep/hooks/usebulkimageupload.ts","./src/components/product-import/steps/imageuploadstep/hooks/usedraganddrop.ts","./src/components/product-import/steps/imageuploadstep/hooks/useproductimageoperations.ts","./src/components/product-import/steps/imageuploadstep/hooks/useproductimagesinit.ts","./src/components/product-import/steps/imageuploadstep/hooks/useurlimageupload.ts","./src/components/product-import/steps/matchcolumnsstep/matchcolumnsstep.tsx","./src/components/product-import/steps/matchcolumnsstep/types.ts","./src/components/product-import/steps/matchcolumnsstep/components/matchicon.tsx","./src/components/product-import/steps/matchcolumnsstep/components/templatecolumn.tsx","./src/components/product-import/steps/matchcolumnsstep/utils/findmatch.ts","./src/components/product-import/steps/matchcolumnsstep/utils/findunmatchedrequiredfields.ts","./src/components/product-import/steps/matchcolumnsstep/utils/getfieldoptions.ts","./src/components/product-import/steps/matchcolumnsstep/utils/getmatchedcolumns.ts","./src/components/product-import/steps/matchcolumnsstep/utils/normalizecheckboxvalue.ts","./src/components/product-import/steps/matchcolumnsstep/utils/normalizetabledata.ts","./src/components/product-import/steps/matchcolumnsstep/utils/setcolumn.ts","./src/components/product-import/steps/matchcolumnsstep/utils/setignorecolumn.ts","./src/components/product-import/steps/matchcolumnsstep/utils/setsubcolumn.ts","./src/components/product-import/steps/matchcolumnsstep/utils/uniqueentries.ts","./src/components/product-import/steps/selectheaderstep/selectheaderstep.tsx","./src/components/product-import/steps/selectheaderstep/components/selectheadertable.tsx","./src/components/product-import/steps/selectheaderstep/components/columns.tsx","./src/components/product-import/steps/selectsheetstep/selectsheetstep.tsx","./src/components/product-import/steps/uploadstep/uploadstep.tsx","./src/components/product-import/steps/uploadstep/components/dropzone.tsx","./src/components/product-import/steps/uploadstep/components/columns.tsx","./src/components/product-import/steps/uploadstep/utils/readfilesasync.ts","./src/components/product-import/steps/validationstep/index.tsx","./src/components/product-import/steps/validationstep/components/aisuggestionbadge.tsx","./src/components/product-import/steps/validationstep/components/copydownbanner.tsx","./src/components/product-import/steps/validationstep/components/floatingselectionbar.tsx","./src/components/product-import/steps/validationstep/components/initializingoverlay.tsx","./src/components/product-import/steps/validationstep/components/searchabletemplateselect.tsx","./src/components/product-import/steps/validationstep/components/suggestionbadges.tsx","./src/components/product-import/steps/validationstep/components/validationcontainer.tsx","./src/components/product-import/steps/validationstep/components/validationfooter.tsx","./src/components/product-import/steps/validationstep/components/validationtable.tsx","./src/components/product-import/steps/validationstep/components/validationtoolbar.tsx","./src/components/product-import/steps/validationstep/components/cells/checkboxcell.tsx","./src/components/product-import/steps/validationstep/components/cells/comboboxcell.tsx","./src/components/product-import/steps/validationstep/components/cells/inputcell.tsx","./src/components/product-import/steps/validationstep/components/cells/multiselectcell.tsx","./src/components/product-import/steps/validationstep/components/cells/multilineinput.tsx","./src/components/product-import/steps/validationstep/components/cells/selectcell.tsx","./src/components/product-import/steps/validationstep/contexts/aisuggestionscontext.tsx","./src/components/product-import/steps/validationstep/dialogs/aidebugdialog.tsx","./src/components/product-import/steps/validationstep/dialogs/aivalidationprogress.tsx","./src/components/product-import/steps/validationstep/dialogs/aivalidationresults.tsx","./src/components/product-import/steps/validationstep/dialogs/sanitycheckdialog.tsx","./src/components/product-import/steps/validationstep/hooks/useautoinlineaivalidation.ts","./src/components/product-import/steps/validationstep/hooks/usecopydownvalidation.ts","./src/components/product-import/steps/validationstep/hooks/usefieldoptions.ts","./src/components/product-import/steps/validationstep/hooks/useinlineaivalidation.ts","./src/components/product-import/steps/validationstep/hooks/useproductlines.ts","./src/components/product-import/steps/validationstep/hooks/usesanitycheck.ts","./src/components/product-import/steps/validationstep/hooks/usetemplatemanagement.ts","./src/components/product-import/steps/validationstep/hooks/useupcvalidation.ts","./src/components/product-import/steps/validationstep/hooks/usevalidationactions.ts","./src/components/product-import/steps/validationstep/hooks/useaivalidation/index.ts","./src/components/product-import/steps/validationstep/hooks/useaivalidation/useaiapi.ts","./src/components/product-import/steps/validationstep/hooks/useaivalidation/useaiprogress.ts","./src/components/product-import/steps/validationstep/hooks/useaivalidation/useaitransform.ts","./src/components/product-import/steps/validationstep/store/selectors.ts","./src/components/product-import/steps/validationstep/store/types.ts","./src/components/product-import/steps/validationstep/store/validationstore.ts","./src/components/product-import/steps/validationstep/utils/aivalidationutils.ts","./src/components/product-import/steps/validationstep/utils/countryutils.ts","./src/components/product-import/steps/validationstep/utils/datamutations.ts","./src/components/product-import/steps/validationstep/utils/inlineaipayload.ts","./src/components/product-import/steps/validationstep/utils/priceutils.ts","./src/components/product-import/steps/validationstep/utils/upcutils.ts","./src/components/product-import/utils/exceedsmaxrecords.ts","./src/components/product-import/utils/mapdata.ts","./src/components/product-import/utils/mapworkbook.ts","./src/components/product-import/utils/steps.ts","./src/components/products/productdetail.tsx","./src/components/products/productfilters.tsx","./src/components/products/productsummarycards.tsx","./src/components/products/producttable.tsx","./src/components/products/producttableskeleton.tsx","./src/components/products/productviews.tsx","./src/components/products/statusbadge.tsx","./src/components/products/columndefinitions.ts","./src/components/purchase-orders/categorymetricscard.tsx","./src/components/purchase-orders/filtercontrols.tsx","./src/components/purchase-orders/ordermetricscard.tsx","./src/components/purchase-orders/paginationcontrols.tsx","./src/components/purchase-orders/pipelinecard.tsx","./src/components/purchase-orders/purchaseorderaccordion.tsx","./src/components/purchase-orders/purchaseorderstable.tsx","./src/components/purchase-orders/vendormetricscard.tsx","./src/components/settings/auditlog.tsx","./src/components/settings/datamanagement.tsx","./src/components/settings/globalsettings.tsx","./src/components/settings/permissionselector.tsx","./src/components/settings/productsettings.tsx","./src/components/settings/promptmanagement.tsx","./src/components/settings/reusableimagemanagement.tsx","./src/components/settings/templatemanagement.tsx","./src/components/settings/userform.tsx","./src/components/settings/userlist.tsx","./src/components/settings/usermanagement.tsx","./src/components/settings/vendorsettings.tsx","./src/components/templates/searchproducttemplatedialog.tsx","./src/components/templates/templateform.tsx","./src/components/ui/accordion.tsx","./src/components/ui/alert-dialog.tsx","./src/components/ui/alert.tsx","./src/components/ui/avatar.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/calendar.tsx","./src/components/ui/card.tsx","./src/components/ui/carousel.tsx","./src/components/ui/checkbox.tsx","./src/components/ui/code.tsx","./src/components/ui/collapsible.tsx","./src/components/ui/command.tsx","./src/components/ui/date-range-picker-narrow.tsx","./src/components/ui/date-range-picker.tsx","./src/components/ui/dialog.tsx","./src/components/ui/drawer.tsx","./src/components/ui/dropdown-menu.tsx","./src/components/ui/form.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/page-loading.tsx","./src/components/ui/pagination.tsx","./src/components/ui/popover.tsx","./src/components/ui/progress.tsx","./src/components/ui/radio-group.tsx","./src/components/ui/scroll-area.tsx","./src/components/ui/select.tsx","./src/components/ui/separator.tsx","./src/components/ui/sheet.tsx","./src/components/ui/sidebar.tsx","./src/components/ui/skeleton.tsx","./src/components/ui/sonner.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/components/ui/toast.tsx","./src/components/ui/toaster.tsx","./src/components/ui/toggle-group.tsx","./src/components/ui/toggle.tsx","./src/components/ui/tooltip.tsx","./src/config/dashboard.ts","./src/config/uploads.ts","./src/contexts/authcontext.tsx","./src/contexts/dashboardscrollcontext.tsx","./src/contexts/importsessioncontext.tsx","./src/hooks/use-mobile.tsx","./src/hooks/use-toast.ts","./src/hooks/usedebounce.ts","./src/hooks/useimportautosave.ts","./src/lib/utils.ts","./src/lib/dashboard/chartconfig.ts","./src/lib/dashboard/designtokens.ts","./src/pages/analytics.tsx","./src/pages/blackfridaydashboard.tsx","./src/pages/brands.tsx","./src/pages/bulkedit.tsx","./src/pages/categories.tsx","./src/pages/chat.tsx","./src/pages/createpurchaseorder.tsx","./src/pages/dashboard.tsx","./src/pages/discountsimulator.tsx","./src/pages/forecasting.tsx","./src/pages/htslookup.tsx","./src/pages/import.tsx","./src/pages/login.tsx","./src/pages/newsletter.tsx","./src/pages/overview.tsx","./src/pages/producteditor.tsx","./src/pages/productlines.tsx","./src/pages/products.tsx","./src/pages/purchaseorders.tsx","./src/pages/repeatorders.tsx","./src/pages/settings.tsx","./src/pages/smalldashboard.tsx","./src/pages/speclookup.tsx","./src/services/apiv2.ts","./src/services/importauditlogapi.ts","./src/services/importsessionapi.ts","./src/services/producteditor.ts","./src/services/producteditorauditlog.ts","./src/types/dashboard-shims.d.ts","./src/types/dashboard.d.ts","./src/types/discount-simulator.ts","./src/types/globals.d.ts","./src/types/importsession.ts","./src/types/products.ts","./src/types/react-data-grid.d.ts","./src/types/status-codes.ts","./src/utils/emojiutils.ts","./src/utils/formatcurrency.ts","./src/utils/lifecyclephases.ts","./src/utils/naturallanguageperiod.ts","./src/utils/productutils.ts","./src/utils/transformutils.ts"],"version":"5.6.3"} \ No newline at end of file diff --git a/inventory/vite.config.ts b/inventory/vite.config.ts index cc932fe..b914c3f 100644 --- a/inventory/vite.config.ts +++ b/inventory/vite.config.ts @@ -89,12 +89,6 @@ export default defineConfig(({ mode }) => { secure: true, cookieDomainRewrite: "localhost", }, - "/api/aircall": { - target: "https://tools.acherryontop.com", - changeOrigin: true, - secure: false, - rewrite: (path) => path, - }, "/api/klaviyo": { target: "https://tools.acherryontop.com", changeOrigin: true, @@ -107,12 +101,6 @@ export default defineConfig(({ mode }) => { secure: false, rewrite: (path) => path, }, - "/api/gorgias": { - target: "https://tools.acherryontop.com", - changeOrigin: true, - secure: false, - rewrite: (path) => path, - }, "/api/dashboard-analytics": { target: "https://tools.acherryontop.com", changeOrigin: true, @@ -133,12 +121,6 @@ export default defineConfig(({ mode }) => { secure: false, rewrite: (path) => path, }, - "/api/clarity": { - target: "https://tools.acherryontop.com", - changeOrigin: true, - secure: false, - rewrite: (path) => path, - }, "/api": { target: "https://tools.acherryontop.com", changeOrigin: true, @@ -160,13 +142,6 @@ export default defineConfig(({ mode }) => { }) }, }, - "/dashboard-auth": { - target: "https://tools.acherryontop.com", - changeOrigin: true, - secure: false, - ws: true, - rewrite: (path) => path.replace("/dashboard-auth", "/auth"), - }, "/auth-inv": { target: "https://tools.acherryontop.com", changeOrigin: true,