From 557721400573ee4e6976c2ce6e5a3ee6df185004 Mon Sep 17 00:00:00 2001 From: tyuXX Date: Wed, 21 Oct 2026 17:27:53 +0000 Subject: [PATCH] init --- .dockerignore | 7 + .env.example | 4 + .gitignore | 7 + Dockerfile | 41 + README.md | 29 + data/.gitkeep | 0 docker-compose.yml | 33 + package-lock.json | 2114 +++++++++++++++++++++++++++++++++++++ package.json | 40 + public/css/style.css | 692 ++++++++++++ public/js/app.js | 303 ++++++ src/server.ts | 388 +++++++ src/services/db.ts | 127 +++ src/services/insight.ts | 239 +++++ src/services/scraper.ts | 307 ++++++ src/types/index.ts | 58 + test/run-tests.ts | 261 +++++ tsconfig.json | 16 + views/dashboard.ejs | 232 ++++ views/login.ejs | 65 ++ views/partials/footer.ejs | 9 + views/partials/header.ejs | 25 + 22 files changed, 4997 insertions(+) create mode 100644 .dockerignore create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 data/.gitkeep create mode 100644 docker-compose.yml create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/css/style.css create mode 100644 public/js/app.js create mode 100644 src/server.ts create mode 100644 src/services/db.ts create mode 100644 src/services/insight.ts create mode 100644 src/services/scraper.ts create mode 100644 src/types/index.ts create mode 100644 test/run-tests.ts create mode 100644 tsconfig.json create mode 100644 views/dashboard.ejs create mode 100644 views/login.ejs create mode 100644 views/partials/footer.ejs create mode 100644 views/partials/header.ejs diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..74de09b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +dist +.git +.env +*.log +data/*.json +!data/.gitkeep diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7ec7a85 --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +PORT=3000 +SESSION_SECRET=bekultur_secret_session_key_change_in_production +# Optional: Cloudflare Tunnel Token for exposing via Cloudflare +CLOUDFLARE_TUNNEL_TOKEN= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..979a024 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +node_modules/ +dist/ +.env +data/*.json +!data/.gitkeep +*.log +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf52b37 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +# ---------------------------------------------------- +# Stage 1: Build TypeScript Application +# ---------------------------------------------------- +FROM node:18-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY tsconfig.json ./ +COPY src/ ./src/ +COPY views/ ./views/ +COPY public/ ./public/ + +RUN npm run build + +# ---------------------------------------------------- +# Stage 2: Production Runtime +# ---------------------------------------------------- +FROM node:18-alpine AS runner + +WORKDIR /app + +ENV NODE_ENV=production +ENV PORT=3000 + +COPY package*.json ./ +RUN npm install --omit=dev + +# Copy compiled code and assets from builder +COPY --from=builder /app/dist ./dist +COPY views/ ./views +COPY public/ ./public + +# Ensure local data directory exists for persistent JSON db +RUN mkdir -p /app/data + +EXPOSE 3000 + +CMD ["node", "dist/server.js"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..6fc3f53 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# BeKultur + +A simple, fast homework scraper and tracker for Kültür Okulları students. + +It logs into your portal, grabs assigned homework, highlights what's due or checked next week, and lets you check off completed assignments in a local JSON database. + +## Quick Start + +### 1. Install & Run +```bash +npm install +npm run build +npm start +``` + +Access at `http://localhost:3000`. + +### 2. Run with Docker +```bash +docker compose up -d +``` + +## Features + +- **No translated content**: Keeps all Turkish course names and descriptions exactly as written. +- **Local JSON DB**: Checkboxes are stored in `data/db.json` and persist across refreshes. +- **Next Week Insights**: Flags assignments that teachers have marked to check next week. +- **Search & Filters**: Filter by status (`Active`, `Next Week`, `Due Soon`, `Completed`, `Overdue`) or search for book names. +- **Fast History Sync**: Scrapes recent assignments on login, with a button to sync full history. diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4fb6813 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +version: '3.8' + +services: + app: + build: + context: . + dockerfile: Dockerfile + container_name: bekultur + restart: unless-stopped + environment: + - PORT=3000 + - SESSION_SECRET=${SESSION_SECRET:-bekultur_default_secret_key_change_me} + - NODE_ENV=production + volumes: + - ./data:/app/data + networks: + - bekultur-network + + tunnel: + image: cloudflare/cloudflared:latest + container_name: bekultur-tunnel + restart: unless-stopped + command: tunnel run + environment: + - TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN} + depends_on: + - app + networks: + - bekultur-network + +networks: + bekultur-network: + driver: bridge diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..43350fd --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2114 @@ +{ + "name": "bekultur", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bekultur", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^1.7.7", + "cheerio": "^1.0.0-rc.12", + "cookie-parser": "^1.4.7", + "dotenv": "^16.4.5", + "ejs": "^3.1.10", + "express": "^4.21.1", + "express-session": "^1.18.1" + }, + "devDependencies": { + "@types/cookie-parser": "^1.4.7", + "@types/ejs": "^3.1.5", + "@types/express": "^4.17.21", + "@types/express-session": "^1.18.0", + "@types/node": "^20.14.9", + "ts-node": "^10.9.2", + "ts-node-dev": "^2.0.0", + "typescript": "^5.5.2" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.13.tgz", + "integrity": "sha512-gcLdvR9HO1ZJBypsOGqaP6TFEzb6vIta0KSTLt9NAQ6pXQO3cRgSVyCN6pzYqI9DlJgY71XKO0dpDhCf08b3pg==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/body-parser": { + "version": "1.19.6", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", + "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cookie-parser": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/@types/cookie-parser/-/cookie-parser-1.4.10.tgz", + "integrity": "sha512-B4xqkqfZ8Wek+rCOeRxsjMS9OgvzebEzzLYw7NHYuvzb7IdxOkI0ZHGgeEBX4PUM7QGVvNSK60T3OvWj3YfBRg==", + "dev": true, + "peerDependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/ejs": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@types/ejs/-/ejs-3.1.5.tgz", + "integrity": "sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==", + "dev": true + }, + "node_modules/@types/express": { + "version": "4.17.25", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.25.tgz", + "integrity": "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "^1" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.9", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.9.tgz", + "integrity": "sha512-QP2ESEe/ImWY0HDwNAnK9PvEffUyhLTnWkk7KXzHfyeWAnlrDe1fN77bXl6ia8KT3wPlmA7t9/VPRpnf4Ex9sg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/express-session": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@types/express-session/-/express-session-1.19.0.tgz", + "integrity": "sha512-GbypG0bog68UbOq2tSAp7SclvCUm3ha1uDi58OPRGK1NfRvCIu7Gz0M7fTGtpNG1T9a29GpuurQj9zEcT/lMXQ==", + "dev": true, + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", + "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", + "dev": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/qs": { + "version": "6.15.1", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.15.1.tgz", + "integrity": "sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.1.tgz", + "integrity": "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.10.tgz", + "integrity": "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "<1" + } + }, + "node_modules/@types/serve-static/node_modules/@types/send": { + "version": "0.17.6", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.6.tgz", + "integrity": "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==", + "dev": true + }, + "node_modules/@types/strip-json-comments": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz", + "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", + "dev": true + }, + "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==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", + "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/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==" + }, + "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, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "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==" + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz", + "integrity": "sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg==", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.6", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.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==" + }, + "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, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.8", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.8.tgz", + "integrity": "sha512-JNcyFQ64OiijEkPzUBTCe+hyPXUD/3LEldGQ6iF5LR1w00mx9o7xtDWHXBY2iItjdCFGoilOLNQbH943ut7pHA==", + "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.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.16.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, + "node_modules/brace-expansion": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "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, + "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/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "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 + }, + "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==", + "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==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "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==", + "dependencies": { + "cookie": "0.7.2", + "cookie-signature": "1.0.6" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "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==", + "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==", + "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==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/diff": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "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==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/dynamic-dedupe": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz", + "integrity": "sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ==", + "dev": true, + "dependencies": { + "xtend": "^4.0.0" + } + }, + "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==" + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "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==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "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==", + "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==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz", + "integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.5", + "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.13", + "proxy-addr": "~2.0.7", + "qs": "~6.16.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.19.0", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.19.0.tgz", + "integrity": "sha512-0csaMkGq+vaiZTmSMMGkfdCOabYv192VbytFypcvI0MANrp+4i/7yEkJ0sbAEhycQjntaKGzYfjfXQyVb7BHMA==", + "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" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "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==" + }, + "node_modules/filelist": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.6.tgz", + "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "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.2", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz", + "integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "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==", + "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==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "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, + "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==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "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==", + "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==", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/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==" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "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==", + "engines": { + "node": ">= 0.10" + } + }, + "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, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz", + "integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==", + "dev": true, + "dependencies": { + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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, + "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, + "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, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jake": { + "version": "10.9.4", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", + "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", + "dependencies": { + "async": "^3.2.6", + "filelist": "^1.0.4", + "picocolors": "^1.1.1" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "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==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "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==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "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==", + "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==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "dependencies": { + "domhandler": "^5.0.3", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-to-regexp": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/qs": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz", + "integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "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==", + "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==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/raw-body/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==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.13", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz", + "integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.17.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "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" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "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==" + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "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==" + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "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.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "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==", + "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==", + "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/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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, + "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==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node-dev": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-node-dev/-/ts-node-dev-2.0.0.tgz", + "integrity": "sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.1", + "dynamic-dedupe": "^0.3.0", + "minimist": "^1.2.6", + "mkdirp": "^1.0.4", + "resolve": "^1.0.0", + "rimraf": "^2.6.1", + "source-map-support": "^0.5.12", + "tree-kill": "^1.2.2", + "ts-node": "^10.4.0", + "tsconfig": "^7.0.0" + }, + "bin": { + "ts-node-dev": "lib/bin.js", + "tsnd": "lib/bin.js" + }, + "engines": { + "node": ">=0.8.0" + }, + "peerDependencies": { + "node-notifier": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/tsconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz", + "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==", + "dev": true, + "dependencies": { + "@types/strip-bom": "^3.0.0", + "@types/strip-json-comments": "0.0.30", + "strip-bom": "^3.0.0", + "strip-json-comments": "^2.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==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "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==", + "dependencies": { + "random-bytes": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "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==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "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==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e9c988f --- /dev/null +++ b/package.json @@ -0,0 +1,40 @@ +{ + "name": "bekultur", + "version": "1.0.0", + "description": "BeKultur (Better E-Kultur) - Smart homework tracker for Kultur Okullari", + "main": "dist/server.js", + "scripts": { + "build": "tsc && npm run copy-assets", + "copy-assets": "node -e \"const fs=require('fs'); fs.cpSync('views', 'dist/views', {recursive: true}); fs.cpSync('public', 'dist/public', {recursive: true});\"", + "start": "node dist/server.js", + "dev": "ts-node-dev --respawn --transpile-only src/server.ts", + "test": "ts-node test/run-tests.ts" + }, + "keywords": [ + "bekultur", + "kultur-okullari", + "homework-tracker", + "scraper" + ], + "author": "", + "license": "ISC", + "dependencies": { + "axios": "^1.7.7", + "cheerio": "^1.0.0-rc.12", + "cookie-parser": "^1.4.7", + "dotenv": "^16.4.5", + "ejs": "^3.1.10", + "express": "^4.21.1", + "express-session": "^1.18.1" + }, + "devDependencies": { + "@types/cookie-parser": "^1.4.7", + "@types/ejs": "^3.1.5", + "@types/express": "^4.17.21", + "@types/express-session": "^1.18.0", + "@types/node": "^20.14.9", + "ts-node": "^10.9.2", + "ts-node-dev": "^2.0.0", + "typescript": "^5.5.2" + } +} diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..c6804e3 --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,692 @@ +:root { + --primary: #2563eb; + --primary-hover: #1d4ed8; + --text-main: #1e293b; + --text-muted: #64748b; + --text-light: #94a3b8; + --bg-page: #f8fafc; + --bg-card: #ffffff; + --border: #e2e8f0; + + --success: #16a34a; + --warning: #d97706; + --urgent: #ea580c; + --danger: #dc2626; + + --radius: 6px; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; + background-color: var(--bg-page); + color: var(--text-main); + line-height: 1.45; + font-size: 14px; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +code { + font-family: Menlo, Monaco, Consolas, monospace; + font-size: 0.9em; + background: #f1f5f9; + padding: 2px 4px; + border-radius: 3px; +} + +/* ---------------- Header ---------------- */ +.app-header { + background: var(--bg-card); + border-bottom: 1px solid var(--border); +} + +.header-container { + max-width: 1080px; + margin: 0 auto; + padding: 10px 16px; + display: flex; + align-items: center; + justify-content: space-between; +} + +.brand-link { + text-decoration: none; + color: inherit; +} + +.brand-name { + font-size: 1.15rem; + font-weight: 700; + color: var(--text-main); +} + +.user-nav { + display: flex; + align-items: center; + gap: 12px; +} + +.user-id { + font-size: 0.85rem; + color: var(--text-muted); +} + +/* ---------------- Main Layout ---------------- */ +.main-content { + flex: 1; + max-width: 1080px; + width: 100%; + margin: 0 auto; + padding: 18px 16px; +} + +/* ---------------- Buttons ---------------- */ +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 6px 14px; + font-size: 0.85rem; + font-weight: 500; + border-radius: var(--radius); + border: 1px solid transparent; + cursor: pointer; + text-decoration: none; +} + +.btn:disabled { + opacity: 0.6; + cursor: not-allowed; +} + +.btn-primary { + background-color: var(--primary); + color: white; +} + +.btn-primary:hover:not(:disabled) { + background-color: var(--primary-hover); +} + +.btn-secondary { + background-color: white; + border-color: var(--border); + color: var(--text-main); +} + +.btn-secondary:hover:not(:disabled) { + background-color: #f1f5f9; +} + +.btn-outline { + background: transparent; + border-color: var(--border); + color: var(--text-muted); +} + +.btn-outline:hover { + background: #f1f5f9; + color: var(--text-main); +} + +.btn-sm { + padding: 5px 10px; + font-size: 0.8rem; +} + +.btn-block { + width: 100%; +} + +/* ---------------- Login ---------------- */ +.auth-wrapper { + display: flex; + align-items: center; + justify-content: center; + padding-top: 60px; +} + +.auth-card { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 28px 24px; + max-width: 360px; + width: 100%; +} + +.auth-title { + font-size: 1.3rem; + font-weight: 700; + margin-bottom: 4px; +} + +.auth-subtitle { + font-size: 0.85rem; + color: var(--text-muted); + margin-bottom: 20px; +} + +.auth-form { + display: flex; + flex-direction: column; + gap: 14px; +} + +.form-group { + display: flex; + flex-direction: column; + gap: 5px; +} + +.form-label { + font-size: 0.8rem; + font-weight: 600; + color: var(--text-main); +} + +.form-control { + width: 100%; + padding: 8px 10px; + font-size: 0.9rem; + border: 1px solid var(--border); + border-radius: var(--radius); + background: white; +} + +.form-control:focus { + outline: none; + border-color: var(--primary); +} + +.form-row-between { + font-size: 0.85rem; +} + +.checkbox-label { + display: flex; + align-items: center; + gap: 6px; + cursor: pointer; + color: var(--text-muted); +} + +.form-actions { + margin-top: 6px; +} + +/* ---------------- Alerts ---------------- */ +.alert { + padding: 8px 12px; + border-radius: var(--radius); + font-size: 0.85rem; + margin-bottom: 14px; +} + +.alert-danger { + background: #fef2f2; + color: #991b1b; + border: 1px solid #fecaca; +} + +.alert-info { + background: #eff6ff; + color: #1e40af; + border: 1px solid #bfdbfe; +} + +/* ---------------- Dashboard Top Bar ---------------- */ +.dashboard-topbar { + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: wrap; + gap: 12px; + margin-bottom: 18px; +} + +.dashboard-title { + font-size: 1.4rem; + font-weight: 700; +} + +.dashboard-subtitle { + font-size: 0.85rem; + color: var(--text-muted); +} + +.dot-separator { + margin: 0 4px; +} + +.sync-actions { + display: flex; + gap: 8px; +} + +/* ---------------- Stats Grid ---------------- */ +.stats-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); + gap: 10px; + margin-bottom: 18px; +} + +.stat-card { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 12px 14px; +} + +.stat-highlight { + border-left: 3px solid var(--warning); +} + +.stat-label { + color: var(--text-muted); + font-size: 0.75rem; + text-transform: uppercase; + font-weight: 600; + letter-spacing: 0.02em; +} + +.stat-value { + font-size: 1.45rem; + font-weight: 700; + margin: 4px 0 2px; +} + +.stat-subtext { + font-size: 0.75rem; + color: var(--text-muted); +} + +.progress-bar-container { + background: #e2e8f0; + height: 4px; + border-radius: 9999px; + overflow: hidden; + margin-top: 6px; +} + +.progress-bar-fill { + background: var(--success); + height: 100%; + border-radius: 9999px; + transition: width 0.3s; +} + +/* ---------------- Subjects ---------------- */ +.section-card { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: var(--radius); + margin-bottom: 16px; +} + +.section-header { + padding: 10px 14px; + display: flex; + align-items: center; + justify-content: space-between; + border-bottom: 1px solid var(--border); + font-size: 0.85rem; + font-weight: 600; + user-select: none; +} + +.cursor-pointer { + cursor: pointer; +} + +.toggle-indicator { + color: var(--text-muted); + font-size: 0.8rem; +} + +.subject-breakdown-body { + padding: 12px 14px; +} + +.subject-breakdown-body.collapsed { + display: none; +} + +.subject-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); + gap: 10px; +} + +.subject-item { + background: #f8fafc; + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 8px 10px; +} + +.subject-info { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 4px; + font-size: 0.8rem; +} + +.subject-name { + font-weight: 600; +} + +.subject-fraction { + color: var(--text-muted); + font-size: 0.75rem; +} + +.subject-bar { + background: #e2e8f0; + height: 4px; + border-radius: 9999px; + overflow: hidden; +} + +.subject-bar-fill { + background: var(--primary); + height: 100%; + border-radius: 9999px; +} + +/* ---------------- Toolbar ---------------- */ +.toolbar-card { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 12px 14px; + margin-bottom: 12px; + display: flex; + flex-direction: column; + gap: 10px; +} + +.filter-tabs { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.tab-btn { + background: #f1f5f9; + border: 1px solid transparent; + color: var(--text-muted); + padding: 4px 10px; + border-radius: var(--radius); + font-size: 0.8rem; + font-weight: 500; + cursor: pointer; +} + +.tab-btn:hover { + background: #e2e8f0; +} + +.tab-btn.active { + background: var(--primary); + color: white; +} + +.filter-controls { + display: flex; + gap: 8px; +} + +.search-box { + flex: 1; + position: relative; + display: flex; + align-items: center; +} + +.search-input { + width: 100%; + padding: 6px 26px 6px 10px; + font-size: 0.85rem; + border: 1px solid var(--border); + border-radius: var(--radius); +} + +.search-input:focus { + outline: none; + border-color: var(--primary); +} + +.search-clear { + position: absolute; + right: 8px; + background: none; + border: none; + font-size: 1rem; + color: var(--text-light); + cursor: pointer; +} + +.form-select { + padding: 6px 10px; + font-size: 0.85rem; + border: 1px solid var(--border); + border-radius: var(--radius); + background: white; + cursor: pointer; +} + +.list-meta { + font-size: 0.8rem; + color: var(--text-muted); + margin-bottom: 10px; +} + +/* ---------------- Cards ---------------- */ +.assignment-list { + display: flex; + flex-direction: column; + gap: 8px; +} + +.assignment-card { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 12px 14px; + display: flex; + gap: 12px; +} + +.assignment-card.status-next-week:not(.is-completed) { + border-left: 3px solid var(--warning); +} + +.assignment-card.status-due-soon:not(.is-completed) { + border-left: 3px solid var(--urgent); +} + +.assignment-card.status-overdue:not(.is-completed) { + border-left: 3px solid var(--danger); +} + +.assignment-card.status-active:not(.is-completed) { + border-left: 3px solid #38bdf8; +} + +.assignment-card.is-completed { + border-left: 3px solid var(--success); + opacity: 0.65; +} + +.assignment-card.is-completed .card-description { + text-decoration: line-through; + color: var(--text-muted); +} + +.card-checkbox-col { + padding-top: 2px; +} + +.assignment-toggle { + width: 17px; + height: 17px; + cursor: pointer; +} + +.card-content-col { + flex: 1; + display: flex; + flex-direction: column; + gap: 6px; +} + +.card-top-row { + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: wrap; + gap: 6px; +} + +.card-subject-wrap { + display: flex; + align-items: center; + gap: 6px; +} + +.card-subject { + font-size: 0.95rem; + font-weight: 600; +} + +.card-badges { + display: flex; + gap: 4px; +} + +.badge { + font-size: 0.725rem; + font-weight: 600; + padding: 1px 6px; + border-radius: 4px; +} + +.badge-type { + background: #f1f5f9; + color: var(--text-muted); +} + +.badge-active { + background: #e0f2fe; + color: #0369a1; +} + +.badge-next-week { + background: #fef3c7; + color: #b45309; +} + +.badge-due-soon { + background: #ffedd5; + color: #c2410c; +} + +.badge-overdue { + background: #fee2e2; + color: #b91c1c; +} + +.badge-completed { + background: #dcfce7; + color: #15803d; +} + +.badge-check-date { + background: #f3e8ff; + color: #7e22ce; + border: 1px solid #e9d5ff; +} + +.card-sub-meta { + font-size: 0.78rem; + color: var(--text-muted); + display: flex; + gap: 10px; +} + +.card-description { + font-size: 0.88rem; + line-height: 1.45; + color: #1e293b; + white-space: pre-line; + word-break: break-word; + background: #f8fafc; + padding: 6px 10px; + border-radius: 4px; +} + +.card-footer-row { + display: flex; + align-items: center; + justify-content: space-between; + font-size: 0.75rem; + color: var(--text-muted); +} + +.card-timestamps { + display: flex; + gap: 8px; +} + +.card-hash { + font-family: Menlo, Monaco, monospace; + font-size: 0.7rem; + color: var(--text-light); +} + +.empty-state { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 24px; + text-align: center; + color: var(--text-muted); + font-size: 0.85rem; +} + +.empty-state p { + margin-bottom: 8px; +} + +.app-footer { + border-top: 1px solid var(--border); + padding: 12px 16px; + text-align: center; + font-size: 0.75rem; + color: var(--text-light); + margin-top: auto; +} + +.hidden { + display: none !important; +} + +@media (max-width: 600px) { + .dashboard-topbar { + flex-direction: column; + align-items: flex-start; + } + .filter-controls { + flex-direction: column; + } +} diff --git a/public/js/app.js b/public/js/app.js new file mode 100644 index 0000000..0e62125 --- /dev/null +++ b/public/js/app.js @@ -0,0 +1,303 @@ +document.addEventListener('DOMContentLoaded', () => { + const assignmentList = document.getElementById('assignmentList'); + const searchInput = document.getElementById('searchInput'); + const searchClear = document.getElementById('searchClear'); + const subjectSelect = document.getElementById('subjectSelect'); + const filterTabs = document.getElementById('filterTabs'); + const filteredCountText = document.getElementById('filteredCountText'); + const noResults = document.getElementById('noResults'); + const btnResetFilters = document.getElementById('btnResetFilters'); + const syncAlert = document.getElementById('syncAlert'); + const btnSyncRecent = document.getElementById('btnSyncRecent'); + const btnSyncAll = document.getElementById('btnSyncAll'); + const subjectToggleHeader = document.getElementById('subjectToggleHeader'); + const subjectBreakdownBody = document.getElementById('subjectBreakdownBody'); + const subjectToggleIcon = document.getElementById('subjectToggleIcon'); + + let currentTab = 'all'; + let currentSearch = ''; + let currentSubject = ''; + + // Checkbox toggle + if (assignmentList) { + assignmentList.addEventListener('change', async (e) => { + const target = e.target; + if (!target.classList.contains('assignment-toggle')) return; + + const assignmentId = target.dataset.id; + const isChecked = target.checked; + const card = target.closest('.assignment-card'); + if (!card) return; + + if (isChecked) { + card.classList.add('is-completed'); + card.dataset.completed = 'true'; + updateCardBadge(card, 'completed'); + } else { + card.classList.remove('is-completed'); + card.dataset.completed = 'false'; + updateCardBadge(card, card.dataset.status); + } + + try { + const res = await fetch('/api/toggle', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ assignmentId, completed: isChecked }) + }); + const data = await res.json(); + if (data.success && data.stats) { + updateStatsUI(data.stats); + applyFilters(); + } + } catch (err) { + console.error('Failed to toggle assignment:', err); + } + }); + } + + function updateCardBadge(card, status) { + const badgesContainer = card.querySelector('.card-badges'); + if (!badgesContainer) return; + + let existingStatusBadge = badgesContainer.querySelector( + '.badge-completed, .badge-next-week, .badge-due-soon, .badge-overdue, .badge-active' + ); + + if (existingStatusBadge) { + if (status === 'completed') { + existingStatusBadge.className = 'badge badge-completed'; + existingStatusBadge.textContent = 'Done'; + } else { + const orig = card.dataset.status; + if (orig === 'next-week') { + existingStatusBadge.className = 'badge badge-next-week'; + existingStatusBadge.textContent = 'Next Week'; + } else if (orig === 'due-soon') { + existingStatusBadge.className = 'badge badge-due-soon'; + existingStatusBadge.textContent = 'Due Soon'; + } else if (orig === 'overdue') { + existingStatusBadge.className = 'badge badge-overdue'; + existingStatusBadge.textContent = 'Overdue'; + } else { + existingStatusBadge.className = 'badge badge-active'; + existingStatusBadge.textContent = 'Active'; + } + } + } + } + + function updateStatsUI(stats) { + const statCompRate = document.getElementById('statCompletionRate'); + const statCompFrac = document.getElementById('statCompletionFraction'); + const progressBar = document.getElementById('progressBarFill'); + const statActive = document.getElementById('statActiveCount'); + const statNextWeek = document.getElementById('statNextWeekCount'); + const statDueSoon = document.getElementById('statDueSoonCount'); + const statOverdue = document.getElementById('statOverdueCount'); + const statTotal = document.getElementById('statTotalCount'); + + if (statCompRate) statCompRate.textContent = `${stats.completionRate}%`; + if (statCompFrac) statCompFrac.textContent = `${stats.completed} / ${stats.total} done`; + if (progressBar) progressBar.style.width = `${stats.completionRate}%`; + if (statActive) statActive.textContent = stats.active; + if (statNextWeek) statNextWeek.textContent = stats.checkedNextWeek; + if (statDueSoon) statDueSoon.textContent = stats.dueSoon; + if (statOverdue) statOverdue.textContent = stats.overdue; + if (statTotal) statTotal.textContent = stats.total; + + const tabAll = document.getElementById('tabAllCount'); + const tabNext = document.getElementById('tabNextWeekCount'); + const tabAct = document.getElementById('tabActiveCount'); + const tabDue = document.getElementById('tabDueSoonCount'); + const tabComp = document.getElementById('tabCompletedCount'); + const tabOver = document.getElementById('tabOverdueCount'); + + if (tabAll) tabAll.textContent = stats.total; + if (tabNext) tabNext.textContent = stats.checkedNextWeek; + if (tabAct) tabAct.textContent = stats.active; + if (tabDue) tabDue.textContent = stats.dueSoon; + if (tabComp) tabComp.textContent = stats.completed; + if (tabOver) tabOver.textContent = stats.overdue; + + if (stats.bySubject) { + Object.values(stats.bySubject).forEach(s => { + const item = document.querySelector(`.subject-item[data-subject="${CSS.escape(s.subject)}"]`); + if (item) { + const frac = item.querySelector('.subject-fraction'); + const fill = item.querySelector('.subject-bar-fill'); + if (frac) frac.textContent = `${s.completed}/${s.total} (${s.percentage}%)`; + if (fill) fill.style.width = `${s.percentage}%`; + } + }); + } + } + + // Filter tabs + if (filterTabs) { + filterTabs.addEventListener('click', (e) => { + const btn = e.target.closest('.tab-btn'); + if (!btn) return; + filterTabs.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + currentTab = btn.dataset.filter || 'all'; + applyFilters(); + }); + } + + if (searchInput) { + searchInput.addEventListener('input', (e) => { + currentSearch = e.target.value.trim().toLowerCase(); + if (searchClear) searchClear.classList.toggle('hidden', currentSearch.length === 0); + applyFilters(); + }); + } + + if (searchClear) { + searchClear.addEventListener('click', () => { + searchInput.value = ''; + currentSearch = ''; + searchClear.classList.add('hidden'); + applyFilters(); + }); + } + + if (subjectSelect) { + subjectSelect.addEventListener('change', (e) => { + currentSubject = e.target.value; + applyFilters(); + }); + } + + if (btnResetFilters) { + btnResetFilters.addEventListener('click', () => { + currentTab = 'all'; + currentSearch = ''; + currentSubject = ''; + if (searchInput) searchInput.value = ''; + if (searchClear) searchClear.classList.add('hidden'); + if (subjectSelect) subjectSelect.value = ''; + if (filterTabs) { + filterTabs.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active')); + const allTab = filterTabs.querySelector('[data-filter="all"]'); + if (allTab) allTab.classList.add('active'); + } + applyFilters(); + }); + } + + function applyFilters() { + if (!assignmentList) return; + const cards = assignmentList.querySelectorAll('.assignment-card'); + let visibleCount = 0; + + cards.forEach(card => { + const status = card.dataset.status; + const isCompleted = card.dataset.completed === 'true'; + const subject = card.dataset.subject; + const searchText = card.dataset.search || ''; + + let matchesTab = true; + if (currentTab === 'completed') { + matchesTab = isCompleted; + } else if (currentTab === 'active') { + matchesTab = !isCompleted && (status === 'active' || status === 'next-week' || status === 'due-soon'); + } else if (currentTab === 'next-week') { + matchesTab = !isCompleted && status === 'next-week'; + } else if (currentTab === 'due-soon') { + matchesTab = !isCompleted && status === 'due-soon'; + } else if (currentTab === 'overdue') { + matchesTab = !isCompleted && status === 'overdue'; + } + + let matchesSubject = true; + if (currentSubject) { + matchesSubject = (subject === currentSubject); + } + + let matchesSearch = true; + if (currentSearch) { + matchesSearch = searchText.includes(currentSearch); + } + + if (matchesTab && matchesSubject && matchesSearch) { + card.style.display = 'flex'; + visibleCount++; + } else { + card.style.display = 'none'; + } + }); + + if (filteredCountText) { + filteredCountText.textContent = `Showing ${visibleCount} assignments`; + } + + if (noResults) { + noResults.classList.toggle('hidden', visibleCount > 0); + } + } + + // Sync actions + if (btnSyncRecent) { + btnSyncRecent.addEventListener('click', async () => { + btnSyncRecent.disabled = true; + btnSyncRecent.textContent = 'Syncing...'; + showAlert('Fetching recent assignments...', 'info'); + + try { + const res = await fetch('/api/sync', { method: 'POST' }); + const data = await res.json(); + if (data.success) { + window.location.reload(); + } else { + showAlert(`Sync failed: ${data.error}`, 'danger'); + btnSyncRecent.disabled = false; + btnSyncRecent.textContent = 'Sync Recent'; + } + } catch (err) { + showAlert('Network error while syncing.', 'danger'); + btnSyncRecent.disabled = false; + btnSyncRecent.textContent = 'Sync Recent'; + } + }); + } + + if (btnSyncAll) { + btnSyncAll.addEventListener('click', async () => { + btnSyncAll.disabled = true; + btnSyncAll.textContent = 'Syncing all...'; + showAlert('Syncing full history from portal...', 'info'); + + try { + const res = await fetch('/api/sync-all', { method: 'POST' }); + const data = await res.json(); + if (data.success) { + window.location.reload(); + } else { + showAlert(`Sync all failed: ${data.error}`, 'danger'); + btnSyncAll.disabled = false; + btnSyncAll.textContent = 'Sync Full History'; + } + } catch (err) { + showAlert('Network error while syncing full history.', 'danger'); + btnSyncAll.disabled = false; + btnSyncAll.textContent = 'Sync Full History'; + } + }); + } + + function showAlert(msg, type = 'info') { + if (!syncAlert) return; + syncAlert.className = `alert alert-${type}`; + syncAlert.textContent = msg; + syncAlert.classList.remove('hidden'); + } + + // Subject collapse + if (subjectToggleHeader && subjectBreakdownBody && subjectToggleIcon) { + subjectToggleHeader.addEventListener('click', () => { + const isHidden = subjectBreakdownBody.classList.toggle('collapsed'); + subjectToggleIcon.textContent = isHidden ? '▶' : '▼'; + }); + } +}); diff --git a/src/server.ts b/src/server.ts new file mode 100644 index 0000000..7a1d977 --- /dev/null +++ b/src/server.ts @@ -0,0 +1,388 @@ +import express, { Request, Response, NextFunction } from 'express'; +import session from 'express-session'; +import cookieParser from 'cookie-parser'; +import path from 'path'; +import dotenv from 'dotenv'; +import { ScraperService } from './services/scraper'; +import { LocalDatabase } from './services/db'; +import { InsightService } from './services/insight'; +import { Assignment } from './types'; + +dotenv.config(); + +const app = express(); +const PORT = process.env.PORT || 3000; +const SESSION_SECRET = process.env.SESSION_SECRET || 'bekultur_secret_key_change_in_production'; + +// View engine setup +app.set('view engine', 'ejs'); +// Support running from both ts-node (src/../views) and dist (dist/views) +const viewsPath = path.resolve(__dirname, '../views'); +const publicPath = path.resolve(__dirname, '../public'); +app.set('views', viewsPath); + +// Middleware +app.use(express.urlencoded({ extended: true })); +app.use(express.json()); +app.use(cookieParser()); +app.use(express.static(publicPath)); + +app.use( + session({ + secret: SESSION_SECRET, + resave: false, + saveUninitialized: false, + cookie: { + maxAge: 14 * 24 * 60 * 60 * 1000 // 14 days + } + }) +); + +// Augment express-session +declare module 'express-session' { + interface SessionData { + studentId?: string; + portalCookies?: string; + studentName?: string; + } +} + +const db = LocalDatabase.getInstance(); + +// Auth guard helper +function requireAuth(req: Request, res: Response, next: NextFunction) { + if (req.session && req.session.studentId) { + return next(); + } + // Check if studentId remembered in cookie + const rememberedId = req.cookies.bekultur_student_id; + if (rememberedId) { + const creds = db.getRememberedCredentials(rememberedId); + if (creds) { + // Auto re-login in background + ScraperService.login(creds.studentId, creds.password).then(loginRes => { + if (loginRes.success) { + req.session.studentId = creds.studentId; + req.session.portalCookies = loginRes.cookies; + req.session.studentName = loginRes.studentName; + return next(); + } else { + res.clearCookie('bekultur_student_id'); + return res.redirect('/'); + } + }).catch(() => { + return res.redirect('/'); + }); + return; + } + } + res.redirect('/'); +} + +// ---------------------------------------------------- +// Routes +// ---------------------------------------------------- + +/** + * GET / + * Login Page + */ +app.get('/', (req: Request, res: Response) => { + if (req.session && req.session.studentId) { + return res.redirect('/dashboard'); + } + + const rememberedId = req.cookies.bekultur_student_id || ''; + const error = (req.query.error as string) || null; + + res.render('login', { + error, + rememberedId, + title: 'Login - BeKultur (Better E-Kultur)' + }); +}); + +/** + * POST /login + * Authenticate against portal and scrape recent assignments + */ +app.post('/login', async (req: Request, res: Response) => { + const { studentId, password, rememberMe } = req.body; + + if (!studentId || !password) { + return res.render('login', { + error: 'Please enter both Student ID and Password.', + rememberedId: studentId || '', + title: 'Login - BeKultur' + }); + } + + try { + const loginRes = await ScraperService.login(studentId, password); + + if (!loginRes.success) { + return res.render('login', { + error: loginRes.error || 'Authentication failed. Please check your credentials.', + rememberedId: studentId, + title: 'Login - BeKultur' + }); + } + + req.session.studentId = studentId; + req.session.portalCookies = loginRes.cookies; + req.session.studentName = loginRes.studentName; + + // Handle "Remember Me" + if (rememberMe) { + db.saveCredentials(studentId, password); + res.cookie('bekultur_student_id', studentId, { + maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days + httpOnly: true + }); + } else { + db.clearCredentials(studentId); + res.clearCookie('bekultur_student_id'); + } + + // Scrape recent pages (1-2) + try { + const scrapeRes = await ScraperService.scrapeMultiplePages(loginRes.cookies, studentId, 2); + db.mergeAssignments(studentId, scrapeRes.assignments); + } catch (scrapeErr: any) { + console.warn('Initial scrape warning (cached data will be used if available):', scrapeErr.message); + } + + res.redirect('/dashboard'); + } catch (err: any) { + console.error('Login route error:', err); + res.render('login', { + error: 'An unexpected server error occurred during login.', + rememberedId: studentId, + title: 'Login - BeKultur' + }); + } +}); + +/** + * POST /logout + */ +app.post('/logout', (req: Request, res: Response) => { + req.session.destroy(() => { + res.redirect('/'); + }); +}); + +/** + * GET /logout (convenience) + */ +app.get('/logout', (req: Request, res: Response) => { + req.session.destroy(() => { + res.redirect('/'); + }); +}); + +/** + * GET /dashboard + * English dashboard with stats and checkable assignments + */ +app.get('/dashboard', requireAuth, (req: Request, res: Response) => { + const studentId = req.session.studentId!; + const studentStore = db.getStudentStore(studentId); + + // Recalculate status for each assignment relative to current date + const rawList = Object.values(studentStore.assignments); + const updatedAssignments: Assignment[] = rawList.map(item => { + const status = InsightService.computeStatus(item); + return { + ...item, + status + }; + }); + + // Calculate statistics + const stats = InsightService.calculateStats(updatedAssignments); + + // Unique list of subjects for filter + const subjects = Array.from(new Set(updatedAssignments.map(a => a.subject))).sort(); + + // Sort assignments: + // 1. Not completed first + // 2. Priority: next-week & due-soon first, then active, then overdue, then completed + const statusPriority: Record = { + 'due-soon': 1, + 'next-week': 2, + 'active': 3, + 'future': 4, + 'overdue': 5, + 'completed': 6 + }; + + updatedAssignments.sort((a, b) => { + const pA = statusPriority[a.status] || 99; + const pB = statusPriority[b.status] || 99; + if (pA !== pB) return pA - pB; + // secondary sort by end date descending + return (b.parsedEndDate || '').localeCompare(a.parsedEndDate || ''); + }); + + res.render('dashboard', { + title: 'Dashboard - BeKultur', + studentId, + studentName: req.session.studentName || `Student ${studentId}`, + lastSynced: studentStore.lastSynced, + stats, + assignments: updatedAssignments, + subjects + }); +}); + +/** + * POST /api/toggle + * Toggle assignment completion state + */ +app.post('/api/toggle', requireAuth, (req: Request, res: Response) => { + const studentId = req.session.studentId!; + const { assignmentId, completed } = req.body; + + if (!assignmentId) { + return res.status(400).json({ success: false, error: 'Assignment ID is required' }); + } + + const updated = db.toggleAssignment(studentId, assignmentId, completed); + if (!updated) { + return res.status(404).json({ success: false, error: 'Assignment not found' }); + } + + // Recalculate fresh stats + const studentStore = db.getStudentStore(studentId); + const list = Object.values(studentStore.assignments).map(a => ({ + ...a, + status: InsightService.computeStatus(a) + })); + const stats = InsightService.calculateStats(list); + + res.json({ + success: true, + assignment: updated, + stats + }); +}); + +/** + * POST /api/sync + * Sync recent pages (1-2) + */ +app.post('/api/sync', requireAuth, async (req: Request, res: Response) => { + const studentId = req.session.studentId!; + let cookies = req.session.portalCookies; + + try { + // If session cookies missing, attempt re-login using remembered credentials + if (!cookies) { + const creds = db.getRememberedCredentials(studentId); + if (creds) { + const loginRes = await ScraperService.login(creds.studentId, creds.password); + if (loginRes.success) { + cookies = loginRes.cookies; + req.session.portalCookies = cookies; + } + } + } + + if (!cookies) { + return res.status(401).json({ + success: false, + error: 'Session expired. Please log in again to sync.' + }); + } + + const scrapeRes = await ScraperService.scrapeMultiplePages(cookies, studentId, 2); + db.mergeAssignments(studentId, scrapeRes.assignments); + + const store = db.getStudentStore(studentId); + const list = Object.values(store.assignments).map(a => ({ + ...a, + status: InsightService.computeStatus(a) + })); + const stats = InsightService.calculateStats(list); + + res.json({ + success: true, + count: scrapeRes.assignments.length, + lastSynced: store.lastSynced, + stats + }); + } catch (err: any) { + console.error('API sync error:', err.message); + res.status(500).json({ + success: false, + error: `Sync failed: ${err.message}` + }); + } +}); + +/** + * POST /api/sync-all + * Sync all historical pages (pages 1 to 7+) + */ +app.post('/api/sync-all', requireAuth, async (req: Request, res: Response) => { + const studentId = req.session.studentId!; + let cookies = req.session.portalCookies; + + try { + if (!cookies) { + const creds = db.getRememberedCredentials(studentId); + if (creds) { + const loginRes = await ScraperService.login(creds.studentId, creds.password); + if (loginRes.success) { + cookies = loginRes.cookies; + req.session.portalCookies = cookies; + } + } + } + + if (!cookies) { + return res.status(401).json({ + success: false, + error: 'Session expired. Please log in again to sync full history.' + }); + } + + // Scrape up to 20 pages (portal currently has ~7 pages) + const scrapeRes = await ScraperService.scrapeMultiplePages(cookies, studentId, 20); + db.mergeAssignments(studentId, scrapeRes.assignments); + + const store = db.getStudentStore(studentId); + const list = Object.values(store.assignments).map(a => ({ + ...a, + status: InsightService.computeStatus(a) + })); + const stats = InsightService.calculateStats(list); + + res.json({ + success: true, + count: scrapeRes.assignments.length, + totalPages: scrapeRes.totalPages, + lastSynced: store.lastSynced, + stats + }); + } catch (err: any) { + console.error('API sync-all error:', err.message); + res.status(500).json({ + success: false, + error: `Full history sync failed: ${err.message}` + }); + } +}); + +// Start Server +if (process.env.NODE_ENV !== 'test') { + app.listen(PORT, () => { + console.log(`=========================================`); + console.log(` BeKultur (Better E-Kultur) Server`); + console.log(` Running at: http://localhost:${PORT}`); + console.log(`=========================================`); + }); +} + +export default app; diff --git a/src/services/db.ts b/src/services/db.ts new file mode 100644 index 0000000..4da2f96 --- /dev/null +++ b/src/services/db.ts @@ -0,0 +1,127 @@ +import fs from 'fs'; +import path from 'path'; +import { DatabaseSchema, StudentStore, Assignment } from '../types'; + +const DB_FILE = path.resolve(process.cwd(), 'data', 'db.json'); + +export class LocalDatabase { + private static instance: LocalDatabase; + private cache: DatabaseSchema = { students: {} }; + private initialized = false; + + private constructor() { + this.ensureDbExists(); + this.load(); + } + + public static getInstance(): LocalDatabase { + if (!LocalDatabase.instance) { + LocalDatabase.instance = new LocalDatabase(); + } + return LocalDatabase.instance; + } + + private ensureDbExists(): void { + const dir = path.dirname(DB_FILE); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } + if (!fs.existsSync(DB_FILE)) { + const initial: DatabaseSchema = { students: {} }; + fs.writeFileSync(DB_FILE, JSON.stringify(initial, null, 2), 'utf-8'); + } + } + + private load(): void { + try { + if (fs.existsSync(DB_FILE)) { + const raw = fs.readFileSync(DB_FILE, 'utf-8'); + this.cache = JSON.parse(raw) as DatabaseSchema; + if (!this.cache.students) { + this.cache.students = {}; + } + } + this.initialized = true; + } catch (err) { + console.error('Error loading database file, initializing empty:', err); + this.cache = { students: {} }; + } + } + + private save(): void { + try { + const tmpFile = `${DB_FILE}.tmp`; + fs.writeFileSync(tmpFile, JSON.stringify(this.cache, null, 2), 'utf-8'); + fs.renameSync(tmpFile, DB_FILE); + } catch (err) { + console.error('Error saving database:', err); + } + } + + public getStudentStore(studentId: string): StudentStore { + if (!this.cache.students[studentId]) { + this.cache.students[studentId] = { + studentId, + lastSynced: null, + assignments: {} + }; + this.save(); + } + return this.cache.students[studentId]; + } + + public mergeAssignments(studentId: string, newAssignments: Assignment[]): StudentStore { + const student = this.getStudentStore(studentId); + student.lastSynced = new Date().toISOString(); + + for (const item of newAssignments) { + const existing = student.assignments[item.id]; + if (existing) { + // Preserve user completion status and completion timestamp + student.assignments[item.id] = { + ...item, + completed: existing.completed, + completedAt: existing.completedAt + }; + } else { + student.assignments[item.id] = item; + } + } + + this.save(); + return student; + } + + public toggleAssignment(studentId: string, assignmentId: string, completed?: boolean): Assignment | null { + const student = this.getStudentStore(studentId); + const assignment = student.assignments[assignmentId]; + if (!assignment) { + return null; + } + + const newCompleted = completed !== undefined ? completed : !assignment.completed; + assignment.completed = newCompleted; + assignment.completedAt = newCompleted ? new Date().toISOString() : null; + assignment.status = newCompleted ? 'completed' : assignment.status; + + this.save(); + return assignment; + } + + public saveCredentials(studentId: string, password: string): void { + const student = this.getStudentStore(studentId); + student.rememberedCredentials = { studentId, password }; + this.save(); + } + + public clearCredentials(studentId: string): void { + const student = this.getStudentStore(studentId); + delete student.rememberedCredentials; + this.save(); + } + + public getRememberedCredentials(studentId: string): { studentId: string; password: string } | null { + const student = this.cache.students[studentId]; + return student?.rememberedCredentials || null; + } +} diff --git a/src/services/insight.ts b/src/services/insight.ts new file mode 100644 index 0000000..91eef57 --- /dev/null +++ b/src/services/insight.ts @@ -0,0 +1,239 @@ +import { Assignment, AssignmentStatus, DashboardStats, SubjectStat } from '../types'; + +export class InsightService { + /** + * Normalize Turkish text for consistent regex and search matching (handles I / ı / İ / i) + */ + public static normalizeTurkish(str: string): string { + if (!str) return ''; + return str + .replace(/İ/g, 'i') + .replace(/I/g, 'ı') + .toLowerCase(); + } + + /** + * Parse Turkish date string like "20.10.2026" or "8.11.2026" into a Date object + */ + public static parsePortalDate(dateStr: string): Date | null { + if (!dateStr) return null; + const parts = dateStr.trim().split('.'); + if (parts.length !== 3) return null; + + const day = parseInt(parts[0], 10); + const month = parseInt(parts[1], 10) - 1; + const year = parseInt(parts[2], 10); + + if (isNaN(day) || isNaN(month) || isNaN(year)) return null; + return new Date(year, month, day, 23, 59, 59, 999); + } + + /** + * Format Date to ISO date string (YYYY-MM-DD) + */ + public static toISODate(date: Date | null): string | null { + if (!date || isNaN(date.getTime())) return null; + const y = date.getFullYear(); + const m = String(date.getMonth() + 1).padStart(2, '0'); + const d = String(date.getDate()).padStart(2, '0'); + return `${y}-${m}-${d}`; + } + + /** + * Scan description for teacher notes regarding check dates ("kontrol tarihi") + */ + public static extractTeacherCheckNote(description: string): string | null { + if (!description) return null; + const norm = this.normalizeTurkish(description); + + // Pattern 1: "kontrol tarihi 26-30 ekim" or "kontrol tarihi 27 ekim" + const match1 = norm.match(/kontrol\s+tarihi\s*:?\s*([0-9]{1,2}(?:\s*-\s*[0-9]{1,2})?\s+[a-zçğıöşü]+)/); + if (match1) { + return match1[1].trim(); + } + + // Pattern 2: "ödevler 26-30 ekim arasında kontrol edilecektir" + const match2 = norm.match(/ödevler\s+([0-9]{1,2}(?:\s*-\s*[0-9]{1,2})?\s+[a-zçğıöşü]+)\s+arasında\s+kontrol/); + if (match2) { + return match2[1].trim(); + } + + // Pattern 3: "26 10 kontrol" or "26/10 kontrol" + const match3 = norm.match(/([0-9]{1,2}\s+[0-9]{1,2})\s+kontrol/); + if (match3) { + const parts = match3[1].split(/\s+/); + const day = parts[0]; + const monthNum = parseInt(parts[1], 10); + const monthNames = ['', 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık']; + const monthName = monthNames[monthNum] || parts[1]; + return `${day} ${monthName}`; + } + + // Pattern 4: generic "(... kontrol ...)" + const match4 = norm.match(/\(([^)]*kontrol[^)]*)\)/); + if (match4) { + return match4[1].trim(); + } + + return null; + } + + /** + * Classify assignment status based on official dates, teacher notes, and completion flag + */ + public static computeStatus( + assignment: Omit, + refDate: Date = new Date() + ): AssignmentStatus { + if (assignment.completed) { + return 'completed'; + } + + const endDate = this.parsePortalDate(assignment.endDate); + const startDate = this.parsePortalDate(assignment.startDate); + + // If start date is in the future (> today + 2 days) + const todayStart = new Date(refDate.getFullYear(), refDate.getMonth(), refDate.getDate(), 0, 0, 0); + if (startDate && startDate.getTime() > refDate.getTime() + 86400000 * 2) { + return 'future'; + } + + if (!endDate) { + return 'active'; + } + + // Check if already overdue + if (endDate.getTime() < todayStart.getTime()) { + return 'overdue'; + } + + // Current week boundaries (Monday to Sunday) + const currentDay = refDate.getDay(); // 0 is Sunday, 1 is Monday + const distanceToMonday = currentDay === 0 ? -6 : 1 - currentDay; + const thisMonday = new Date(refDate); + thisMonday.setDate(refDate.getDate() + distanceToMonday); + thisMonday.setHours(0, 0, 0, 0); + + const thisSunday = new Date(thisMonday); + thisSunday.setDate(thisMonday.getDate() + 6); + thisSunday.setHours(23, 59, 59, 999); + + const nextMonday = new Date(thisSunday); + nextMonday.setDate(thisSunday.getDate() + 1); + nextMonday.setHours(0, 0, 0, 0); + + const nextSunday = new Date(nextMonday); + nextSunday.setDate(nextMonday.getDate() + 6); + nextSunday.setHours(23, 59, 59, 999); + + // Check if due in next week window + const dueTime = endDate.getTime(); + const isNextWeek = dueTime >= nextMonday.getTime() && dueTime <= nextSunday.getTime(); + + // Check if teacher check note specifically mentions next week + let noteIsNextWeek = false; + if (assignment.detectedCheckDate) { + const lower = assignment.detectedCheckDate.toLowerCase(); + const dayMatches = lower.match(/\d{1,2}/g); + if (dayMatches) { + for (const dm of dayMatches) { + const d = parseInt(dm, 10); + const nextMonDay = nextMonday.getDate(); + const nextSunDay = nextSunday.getDate(); + if (nextMonDay <= nextSunDay) { + if (d >= nextMonDay && d <= nextSunDay) { + noteIsNextWeek = true; + } + } else { + if (d >= nextMonDay || d <= nextSunDay) { + noteIsNextWeek = true; + } + } + } + } + } + + if (isNextWeek || noteIsNextWeek) { + return 'next-week'; + } + + // Due soon: within 3 days from now + const threeDaysFromNow = new Date(refDate); + threeDaysFromNow.setDate(refDate.getDate() + 3); + threeDaysFromNow.setHours(23, 59, 59, 999); + + if (dueTime <= threeDaysFromNow.getTime()) { + return 'due-soon'; + } + + return 'active'; + } + + /** + * Aggregate statistics across a list of assignments + */ + public static calculateStats(assignments: Assignment[]): DashboardStats { + let completed = 0; + let active = 0; + let checkedNextWeek = 0; + let dueSoon = 0; + let overdue = 0; + + const bySubject: Record = {}; + + for (const item of assignments) { + const subj = item.subject.trim() || 'Other'; + if (!bySubject[subj]) { + bySubject[subj] = { + subject: subj, + total: 0, + completed: 0, + active: 0, + percentage: 0 + }; + } + + bySubject[subj].total += 1; + + if (item.completed) { + completed += 1; + bySubject[subj].completed += 1; + } else { + if (item.status === 'overdue') { + overdue += 1; + } else if (item.status === 'next-week') { + checkedNextWeek += 1; + active += 1; + bySubject[subj].active += 1; + } else if (item.status === 'due-soon') { + dueSoon += 1; + active += 1; + bySubject[subj].active += 1; + } else { + active += 1; + bySubject[subj].active += 1; + } + } + } + + // Calculate subject percentages + for (const subj of Object.keys(bySubject)) { + const s = bySubject[subj]; + s.percentage = s.total > 0 ? Math.round((s.completed / s.total) * 100) : 0; + } + + const total = assignments.length; + const completionRate = total > 0 ? Math.round((completed / total) * 100) : 0; + + return { + total, + completed, + active, + checkedNextWeek, + dueSoon, + overdue, + completionRate, + bySubject + }; + } +} diff --git a/src/services/scraper.ts b/src/services/scraper.ts new file mode 100644 index 0000000..76908e9 --- /dev/null +++ b/src/services/scraper.ts @@ -0,0 +1,307 @@ +import axios from 'axios'; +import * as cheerio from 'cheerio'; +import crypto from 'crypto'; +import { Assignment } from '../types'; +import { InsightService } from './insight'; + +const BASE_URL = 'https://ogrenci.ozelbursakulturokullari.com'; +const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'; + +export interface LoginResult { + success: boolean; + cookies: string; + error?: string; + studentName?: string; +} + +export interface ScrapeResult { + assignments: Assignment[]; + totalPages: number; +} + +export class ScraperService { + /** + * Helper to format cookies array from set-cookie headers + */ + private static parseCookies(cookieHeaders: string[] | undefined): string { + if (!cookieHeaders || !cookieHeaders.length) return ''; + return cookieHeaders + .map(c => c.split(';')[0].trim()) + .join('; '); + } + + /** + * Merge new set-cookie headers into existing cookie string + */ + private static mergeCookies(currentCookies: string, newHeaders: string[] | undefined): string { + if (!newHeaders || !newHeaders.length) return currentCookies; + const cookieMap: Record = {}; + + if (currentCookies) { + currentCookies.split(';').forEach(c => { + const [k, ...v] = c.trim().split('='); + if (k) cookieMap[k] = v.join('='); + }); + } + + newHeaders.forEach(c => { + const first = c.split(';')[0].trim(); + const [k, ...v] = first.split('='); + if (k) cookieMap[k] = v.join('='); + }); + + return Object.entries(cookieMap) + .map(([k, v]) => `${k}=${v}`) + .join('; '); + } + + /** + * Authenticate against Kültür Okulları student portal + */ + public static async login(studentId: string, password: string): Promise { + try { + const client = axios.create({ + baseURL: BASE_URL, + headers: { + 'User-Agent': USER_AGENT + }, + maxRedirects: 0, + validateStatus: () => true // Allow handling redirects manually + }); + + // 1. GET /Kullanici/Giris to obtain anti-forgery token and initial cookies + const loginPageRes = await client.get('/Kullanici/Giris'); + let cookies = this.parseCookies(loginPageRes.headers['set-cookie']); + + const $ = cheerio.load(loginPageRes.data); + const token = $('input[name="__RequestVerificationToken"]').val() as string; + + if (!token) { + return { + success: false, + cookies: '', + error: 'Anti-forgery token could not be found on login page.' + }; + } + + // 2. POST /Kullanici/Giris with credentials + const formData = new URLSearchParams(); + formData.append('OgrenciId', studentId.trim()); + formData.append('Parola', password.trim()); + formData.append('__RequestVerificationToken', token); + + const postRes = await client.post('/Kullanici/Giris', formData.toString(), { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Referer': `${BASE_URL}/Kullanici/Giris`, + 'Cookie': cookies + } + }); + + cookies = this.mergeCookies(cookies, postRes.headers['set-cookie']); + + // Check if successful login (302 redirect or has auth cookies) + const hasAuthCookie = cookies.includes('.Ogrenci.Cookie') || cookies.includes('.AspNetCore.Cookies'); + const isRedirectSuccess = postRes.status === 302 && (postRes.headers.location === '/' || postRes.headers.location === ''); + + if (!isRedirectSuccess && !hasAuthCookie) { + const postHtml = String(postRes.data || ''); + const $post = cheerio.load(postHtml); + const errorMsg = $post('.text-danger').text().trim() || 'Invalid Student ID or Password.'; + return { + success: false, + cookies: '', + error: errorMsg + }; + } + + // Check student name if available from home page + let studentName = ''; + try { + const homeRes = await client.get('/', { + headers: { + 'Cookie': cookies + } + }); + cookies = this.mergeCookies(cookies, homeRes.headers['set-cookie']); + const $home = cheerio.load(homeRes.data); + const nameCandidate = $home('.nav-link, .dropdown-toggle, .user-name').text().trim(); + if (nameCandidate) { + studentName = nameCandidate; + } + } catch (homeErr) { + // Non-critical + } + + return { + success: true, + cookies, + studentName + }; + } catch (err: any) { + console.error('Error during portal login:', err.message); + return { + success: false, + cookies: '', + error: `Connection error: ${err.message}` + }; + } + } + + /** + * Scrape homework cards from a single page + */ + public static async scrapePage( + cookies: string, + page: number = 1, + studentId: string + ): Promise { + try { + const url = `${BASE_URL}/Odev?sayfa=${page}`; + const res = await axios.get(url, { + headers: { + 'User-Agent': USER_AGENT, + 'Cookie': cookies, + 'Referer': `${BASE_URL}/` + }, + validateStatus: () => true + }); + + if (res.status === 302 || res.status === 401 || (typeof res.data === 'string' && res.data.includes('girisForm'))) { + throw new Error('Session expired or unauthorized. Please log in again.'); + } + + const $ = cheerio.load(res.data); + const assignments: Assignment[] = []; + + // Discover maximum pages from pagination + let totalPages = 1; + $('.pagination li a').each((_, el) => { + const href = $(el).attr('href') || ''; + const match = href.match(/sayfa=(\d+)/i); + if (match) { + const p = parseInt(match[1], 10); + if (p > totalPages) { + totalPages = p; + } + } + }); + + // Parse each assignment card + $('.kltr-card.mb-4').each((_, cardEl) => { + const card = $(cardEl); + + let subject = ''; + let type = ''; + let unit = ''; + let topic = ''; + let dateRange = ''; + + card.find('.row:first-child .col-md-2, .row:first-child .col-md-3').each((_, colEl) => { + const label = $(colEl).find('p.fw-bold').text().trim().toLowerCase(); + const val = $(colEl).find('p:not(.fw-bold)').text().trim(); + + if (label.includes('ders')) subject = val; + else if (label.includes('tip')) type = val; + else if (label.includes('ünite') || label.includes('unite')) unit = val; + else if (label.includes('konu')) topic = val; + else if (label.includes('başlangıç') || label.includes('bitiş') || label.includes('baslangic')) dateRange = val; + }); + + // Description is in second row + let description = ''; + const descCol = card.find('.row:nth-child(2) .col-md-12'); + if (descCol.length) { + const descP = descCol.find('p:not(.fw-bold)'); + description = descP.text().trim(); + } + + // Parse date range: "20.10.2026 - 26.10.2026" + let startDate = ''; + let endDate = ''; + if (dateRange) { + const parts = dateRange.split('-').map(s => s.trim()); + if (parts.length >= 2) { + startDate = parts[0]; + endDate = parts[1]; + } else { + startDate = parts[0]; + endDate = parts[0]; + } + } + + const parsedStartDate = InsightService.toISODate(InsightService.parsePortalDate(startDate)); + const parsedEndDate = InsightService.toISODate(InsightService.parsePortalDate(endDate)); + + // Generate deterministic ID + const normalizedDesc = description.replace(/\s+/g, ' ').trim(); + const hashPayload = `${studentId}|${subject}|${startDate}|${endDate}|${normalizedDesc}`; + const id = crypto.createHash('sha256').update(hashPayload).digest('hex').slice(0, 16); + + // Detect teacher note + const detectedCheckDate = InsightService.extractTeacherCheckNote(description); + + const assignmentDraft: Omit = { + id, + subject: subject || 'Genel', + type: type || 'Ödev', + unit, + topic, + startDate, + endDate, + parsedStartDate, + parsedEndDate, + description, + detectedCheckDate, + completed: false, + completedAt: null, + page + }; + + const status = InsightService.computeStatus(assignmentDraft); + + assignments.push({ + ...assignmentDraft, + status + }); + }); + + return { + assignments, + totalPages + }; + } catch (err: any) { + console.error(`Error scraping page ${page}:`, err.message); + throw err; + } + } + + /** + * Scrape multiple pages (e.g. pages 1 to maxPages) + */ + public static async scrapeMultiplePages( + cookies: string, + studentId: string, + maxPages: number = 2 + ): Promise { + const firstPage = await this.scrapePage(cookies, 1, studentId); + let allAssignments = [...firstPage.assignments]; + const totalPages = firstPage.totalPages; + + const pagesToFetch = Math.min(totalPages, maxPages); + + for (let p = 2; p <= pagesToFetch; p++) { + try { + const next = await this.scrapePage(cookies, p, studentId); + allAssignments.push(...next.assignments); + } catch (err: any) { + console.error(`Failed to scrape page ${p}, continuing:`, err.message); + } + } + + return { + assignments: allAssignments, + totalPages + }; + } +} diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..8129a16 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,58 @@ +export type AssignmentStatus = + | 'completed' + | 'next-week' + | 'due-soon' + | 'active' + | 'overdue' + | 'future'; + +export interface Assignment { + id: string; // SHA-256 deterministic hash + subject: string; // e.g. "AYT Kimya" (Turkish original) + type: string; // e.g. "Yayın" (Turkish original) + unit: string; + topic: string; + startDate: string; // raw string e.g. "20.10.2026" + endDate: string; // raw string e.g. "26.10.2026" + parsedStartDate: string | null; // ISO "2026-10-20" + parsedEndDate: string | null; // ISO "2026-10-26" + description: string; // original Turkish text + detectedCheckDate: string | null; // e.g. "26-30 Ekim" + status: AssignmentStatus; + completed: boolean; + completedAt: string | null; + page?: number; +} + +export interface SubjectStat { + subject: string; + total: number; + completed: number; + active: number; + percentage: number; +} + +export interface DashboardStats { + total: number; + completed: number; + active: number; + checkedNextWeek: number; + dueSoon: number; + overdue: number; + completionRate: number; + bySubject: Record; +} + +export interface StudentStore { + studentId: string; + lastSynced: string | null; + rememberedCredentials?: { + studentId: string; + password: string; + }; + assignments: Record; +} + +export interface DatabaseSchema { + students: Record; +} diff --git a/test/run-tests.ts b/test/run-tests.ts new file mode 100644 index 0000000..3e1f351 --- /dev/null +++ b/test/run-tests.ts @@ -0,0 +1,261 @@ +import assert from 'assert'; +import { LocalDatabase } from '../src/services/db'; +import { InsightService } from '../src/services/insight'; +import { ScraperService } from '../src/services/scraper'; +import { Assignment } from '../src/types'; + +async function runAllTests() { + console.log('========================================================'); + console.log(' BeKultur - Automated Test Suite'); + console.log('========================================================\n'); + + let passed = 0; + let failed = 0; + + function test(name: string, fn: () => void | Promise) { + return (async () => { + try { + await fn(); + console.log(` ✓ ${name}`); + passed++; + } catch (err: any) { + console.error(` ✗ ${name}`); + console.error(` Error: ${err.message}\n`); + failed++; + } + })(); + } + + // 1. Date Parsing + await test('InsightService: parsePortalDate parses Turkish DD.MM.YYYY correctly', () => { + const d1 = InsightService.parsePortalDate('20.10.2026'); + assert(d1 !== null, 'Date should not be null'); + assert.strictEqual(d1.getFullYear(), 2026); + assert.strictEqual(d1.getMonth(), 9); + assert.strictEqual(d1.getDate(), 20); + + const d2 = InsightService.parsePortalDate('8.11.2026'); + assert(d2 !== null); + assert.strictEqual(d2.getMonth(), 10); + assert.strictEqual(d2.getDate(), 8); + + const invalid = InsightService.parsePortalDate(''); + assert.strictEqual(invalid, null); + }); + + // 2. Teacher Note Extraction + await test('InsightService: extractTeacherCheckNote detects various teacher notes', () => { + const n1 = InsightService.extractTeacherCheckNote('fenomen ayt 237-242 kontrol tarihi 26-30 ekim'); + assert.strictEqual(n1?.toLowerCase(), '26-30 ekim'); + + const n2 = InsightService.extractTeacherCheckNote('3D TYT sf. 99-118 + 3D AYT sf. 123-130 (kontrol tarihi 27 Ekim)'); + assert.strictEqual(n2?.toLowerCase(), '27 ekim'); + + const n3 = InsightService.extractTeacherCheckNote('12 MF:X YAYINCILIK (ÖDEVLER 26-30 EKİM ARASINDA KONTROL EDİLECEKTİR.)'); + assert.strictEqual(n3?.toLowerCase(), '26-30 ekim'); + + const n4 = InsightService.extractTeacherCheckNote('AYT 1. KİTAP [26-56] ÇÖZÜLECEKTİR. 26 10 KONTROL'); + assert.strictEqual(n4?.toLowerCase(), '26 ekim'); + + const nNone = InsightService.extractTeacherCheckNote('Toprak Yayınları Bölüm 4 çözülecek.'); + assert.strictEqual(nNone, null); + }); + + // 3. Status Computation + await test('InsightService: computeStatus correctly handles completed, next-week, and overdue', () => { + const refDate = new Date(2026, 9, 21); + + const s1 = InsightService.computeStatus({ + id: 'test1', + subject: 'Matematik', + type: 'Yayın', + unit: '', + topic: '', + startDate: '10.10.2026', + endDate: '25.10.2026', + parsedStartDate: '2026-10-10', + parsedEndDate: '2026-10-25', + description: 'Test', + detectedCheckDate: null, + completed: true, + completedAt: '2026-10-21T10:00:00Z' + }, refDate); + assert.strictEqual(s1, 'completed'); + + const s2 = InsightService.computeStatus({ + id: 'test2', + subject: 'Biyoloji', + type: 'Yayın', + unit: '', + topic: '', + startDate: '01.10.2026', + endDate: '19.10.2026', + parsedStartDate: '2026-10-01', + parsedEndDate: '2026-10-19', + description: 'Old test', + detectedCheckDate: null, + completed: false, + completedAt: null + }, refDate); + assert.strictEqual(s2, 'overdue'); + + const s3 = InsightService.computeStatus({ + id: 'test3', + subject: 'AYT Kimya', + type: 'Yayın', + unit: '', + topic: '', + startDate: '20.10.2026', + endDate: '26.10.2026', + parsedStartDate: '2026-10-20', + parsedEndDate: '2026-10-26', + description: 'ayt 237-242 kontrol tarihi 26-30 ekim', + detectedCheckDate: '26-30 ekim', + completed: false, + completedAt: null + }, refDate); + assert.strictEqual(s3, 'next-week'); + }); + + // 4. Statistics Calculation + await test('InsightService: calculateStats computes accurate completion rates and subject breakdown', () => { + const sampleAssignments: Assignment[] = [ + { + id: '1', + subject: 'Kimya', + type: 'Yayın', + unit: '', + topic: '', + startDate: '20.10.2026', + endDate: '26.10.2026', + parsedStartDate: '2026-10-20', + parsedEndDate: '2026-10-26', + description: 'Test 1', + detectedCheckDate: null, + status: 'next-week', + completed: false, + completedAt: null + }, + { + id: '2', + subject: 'Kimya', + type: 'Yayın', + unit: '', + topic: '', + startDate: '10.10.2026', + endDate: '15.10.2026', + parsedStartDate: '2026-10-10', + parsedEndDate: '2026-10-15', + description: 'Test 2', + detectedCheckDate: null, + status: 'completed', + completed: true, + completedAt: '2026-10-21T10:00:00Z' + }, + { + id: '3', + subject: 'Fizik', + type: 'Yayın', + unit: '', + topic: '', + startDate: '01.10.2026', + endDate: '10.10.2026', + parsedStartDate: '2026-10-01', + parsedEndDate: '2026-10-10', + description: 'Test 3', + detectedCheckDate: null, + status: 'overdue', + completed: false, + completedAt: null + } + ]; + + const stats = InsightService.calculateStats(sampleAssignments); + assert.strictEqual(stats.total, 3); + assert.strictEqual(stats.completed, 1); + assert.strictEqual(stats.checkedNextWeek, 1); + assert.strictEqual(stats.overdue, 1); + assert.strictEqual(stats.completionRate, 33); + assert.strictEqual(stats.bySubject['Kimya'].total, 2); + assert.strictEqual(stats.bySubject['Kimya'].completed, 1); + assert.strictEqual(stats.bySubject['Kimya'].percentage, 50); + }); + + // 5. Local Database + await test('LocalDatabase: save, merge, and toggle checkboxes in db.json', () => { + const db = LocalDatabase.getInstance(); + const testStudentId = `test_student_${Date.now()}`; + + const testItem: Assignment = { + id: `hash_${Date.now()}`, + subject: 'Matematik', + type: 'Yayın', + unit: 'Fonksiyonlar', + topic: 'Test', + startDate: '20.10.2026', + endDate: '26.10.2026', + parsedStartDate: '2026-10-20', + parsedEndDate: '2026-10-26', + description: 'Sayfa 50-60', + detectedCheckDate: null, + status: 'active', + completed: false, + completedAt: null + }; + + db.mergeAssignments(testStudentId, [testItem]); + let store = db.getStudentStore(testStudentId); + assert(store.assignments[testItem.id]); + assert.strictEqual(store.assignments[testItem.id].completed, false); + + const updated = db.toggleAssignment(testStudentId, testItem.id, true); + assert.strictEqual(updated?.completed, true); + assert(updated?.completedAt !== null); + + db.mergeAssignments(testStudentId, [{ + ...testItem, + completed: false + }]); + store = db.getStudentStore(testStudentId); + assert.strictEqual( + store.assignments[testItem.id].completed, + true, + 'mergeAssignments MUST preserve user checked status!' + ); + + db.saveCredentials(testStudentId, 'test_pass'); + const creds = db.getRememberedCredentials(testStudentId); + assert.strictEqual(creds?.password, 'test_pass'); + db.clearCredentials(testStudentId); + assert.strictEqual(db.getRememberedCredentials(testStudentId), null); + }); + + // 6. Optional Live Portal Test (via environment variables only) + const testStudentId = process.env.TEST_STUDENT_ID; + const testPassword = process.env.TEST_PASSWORD; + + if (testStudentId && testPassword) { + await test('ScraperService: Live portal authentication and scraping', async () => { + const loginRes = await ScraperService.login(testStudentId, testPassword); + assert.strictEqual(loginRes.success, true, `Login failed: ${loginRes.error}`); + + const scrapeRes = await ScraperService.scrapePage(loginRes.cookies, 1, testStudentId); + assert(scrapeRes.assignments.length > 0, 'Page 1 must contain homework cards'); + }); + } else { + console.log(' - Live portal test skipped (set TEST_STUDENT_ID and TEST_PASSWORD to run)'); + } + + console.log('\n--------------------------------------------------------'); + console.log(`Test Results: ${passed} passed, ${failed} failed`); + console.log('--------------------------------------------------------\n'); + + if (failed > 0) { + process.exit(1); + } +} + +runAllTests().catch(err => { + console.error('Fatal test error:', err); + process.exit(1); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d3bc21e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "CommonJS", + "moduleResolution": "node", + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test"] +} diff --git a/views/dashboard.ejs b/views/dashboard.ejs new file mode 100644 index 0000000..65deaf2 --- /dev/null +++ b/views/dashboard.ejs @@ -0,0 +1,232 @@ +<%- include('partials/header') %> + +
+ +
+
+

Homework

+

+ Student #<%= studentId %> + • + + <% if (lastSynced) { %> + Last synced: <%= new Date(lastSynced).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) %> + <% } else { %> + Not synced + <% } %> + +

+
+ +
+ + +
+
+ +
+ + +
+
+
Completion
+
<%= stats.completionRate %>%
+
<%= stats.completed %> / <%= stats.total %> done
+
+
+
+
+ +
+
Active
+
<%= stats.active %>
+
In progress
+
+ +
+
Checked Next Week
+
<%= stats.checkedNextWeek %>
+
Due or checked next week
+
+ +
+
Due Soon
+
<%= stats.dueSoon %>
+
Within 3 days
+
+ +
+
Overdue
+
<%= stats.overdue %>
+
Past deadline
+
+ +
+
Total
+
<%= stats.total %>
+
All assignments
+
+
+ + +
+
+ Subjects (<%= Object.keys(stats.bySubject).length %>) + ▼ +
+
+
+ <% Object.values(stats.bySubject).forEach(function(subj) { %> +
+
+ <%= subj.subject %> + <%= subj.completed %>/<%= subj.total %> (<%= subj.percentage %>%) +
+
+
+
+
+ <% }); %> +
+
+
+ + +
+
+ + + + + + +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ Showing <%= assignments.length %> assignments +
+ + +
+

No matching assignments found.

+ +
+ + +
+ <% assignments.forEach(function(item) { %> +
+
+ + > +
+ +
+
+
+ <%= item.subject %> + <% if (item.type) { %> + <%= item.type %> + <% } %> +
+ +
+ <% if (item.detectedCheckDate) { %> + + Kontrol: <%= item.detectedCheckDate %> + + <% } %> + + <% if (item.completed) { %> + Done + <% } else if (item.status === 'next-week') { %> + Next Week + <% } else if (item.status === 'due-soon') { %> + Due Soon + <% } else if (item.status === 'overdue') { %> + Overdue + <% } else { %> + Active + <% } %> +
+
+ + <% if (item.unit || item.topic) { %> +
+ <% if (item.unit) { %>Ünite: <%= item.unit %><% } %> + <% if (item.topic) { %>Konu: <%= item.topic %><% } %> +
+ <% } %> + +
+ <%= item.description %> +
+ +
+
+ <%= item.startDate %> — <%= item.endDate %> +
+ +
+ <% if (item.completed && item.completedAt) { %> + Done: <%= new Date(item.completedAt).toLocaleDateString() %> + <% } %> + #<%= item.id %> +
+
+
+
+ <% }); %> +
+
+ +<%- include('partials/footer') %> diff --git a/views/login.ejs b/views/login.ejs new file mode 100644 index 0000000..46c9804 --- /dev/null +++ b/views/login.ejs @@ -0,0 +1,65 @@ +<%- include('partials/header') %> + +
+
+

BeKultur

+

Log in with your school portal credentials.

+ + <% if (typeof error !== 'undefined' && error) { %> +
+ <%= error %> +
+ <% } %> + +
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+ +
+
+
+
+ + + +<%- include('partials/footer') %> diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs new file mode 100644 index 0000000..03e2498 --- /dev/null +++ b/views/partials/footer.ejs @@ -0,0 +1,9 @@ + +
+
+ BeKultur +
+
+ + + diff --git a/views/partials/header.ejs b/views/partials/header.ejs new file mode 100644 index 0000000..200b408 --- /dev/null +++ b/views/partials/header.ejs @@ -0,0 +1,25 @@ + + + + + + <%= typeof title !== 'undefined' ? title : 'BeKultur' %> + + + +
+
+
+ + BeKultur + +
+ <% if (typeof studentId !== 'undefined' && studentId) { %> +
+ Student: <%= studentId %> + Log out +
+ <% } %> +
+
+