diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3dea06b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +debug.html +.env +.DS_Store +*.log \ No newline at end of file diff --git a/README.md b/README.md index 163d41b9..1b454d00 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,5 @@ # Безопасность веб-приложений. Лабораторка №2 -## Схема сдачи - -1. Получить задание -2. Сделать форк данного репозитория -3. Выполнить задание согласно полученному варианту -4. Сделать PR (pull request) в данный репозиторий -6. Исправить замечания после code review -7. Получить approve -8. Прийти на занятие и защитить работу - Что нужно проявить в работе: - умение разработать завершенное целое веб-приложение, с клиентской и серверной частями (допустимы открытые АПИ) - навыки верстки на html в объеме 200-300 тегов @@ -30,28 +20,31 @@ - обеспечить возможность смотреть расписания в разрезе группы или препода - обеспечить возможность выбора учебной недели (по умолчанию выбирается автоматически) -## Вариант 2. Аналог Прибывалки для электричек +### Функциональность -Сделать веб-версию Прибывалки, только для электричек +#### 1. Просмотр расписания группы +- Выбор группы из выпадающего списка (6413-100503D, 6411-100503D, 6412-100503D) +- Динамическая загрузка расписания через AJAX +- Отображение в виде таблицы: время × дни недели +- Дата под каждым днём недели -Какие нужны возможности: -- находить желаемую ЖД-станцию поиском по названию и по карте -- отображать расписания всех проходящих поездов через выбранную станцию -- отображать расписания для поездов между двумя станциями -- работа через АПИ Яндекс.Расписаний https://yandex.ru/dev/rasp/doc/ru/ (доступ получите сами) -- хорошая работа в условиях экрана смартфона -- бонус: функция "любимых остановок" +#### 2. Просмотр расписания преподавателя +- Поиск преподавателя по фамилии +- Выбор из найденных результатов +- Отображение расписания с указанием групп -## Вариант 3. Прогноз погоды +#### 3. Выбор учебной недели +- Автоматическое определение текущей недели при загрузке +- Ручной выбор недели кнопками "Предыдущая неделя" / "Следующая неделя" +- Диапазон недель: 29-35 + +#### 4. Парсинг реального сайта СГАУ +- Данные извлекаются с `https://ssau.ru/rasp` +- Используется Cheerio для парсинга HTML +- Поддерживаются несколько занятий в одной ячейке +- Для преподавателей используется список известных ID -Сделать одностраничный сайт с картой, на которой можно выбрать населенный пункт и получить прогноз погоды на несколько дней по нему. -Какие нужны возможности: - - увидеть на карте точки с населенными пунктами. Координаты населенных пунктов взять из https://tochno.st/datasets/allsettlements - но все 150 тысяч не нужно, выберите 1 тысячу с самым большим населением. - - при нажатии на точку получить всплывающее окошко с графиками изменения температуры, осадков, силы ветра. API для прогнозов возьмите с https://projecteol.ru/ru/ с соблюдением правил. - - графики рисовать каким-нибудь приличным компонентом, например, https://www.chartjs.org/ - - находить населенный пункт по названию - - можете реализовать с собственным серверным компонентом или придумать, как обойтись без него diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..dc7683c0 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1309 @@ +{ + "name": "websec-2", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "websec-2", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^1.14.0", + "cheerio": "^1.2.0", + "express": "^5.2.1", + "node-fetch": "^2.7.0" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.14.0.tgz", + "integrity": "sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "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==", + "license": "ISC" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cheerio": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.2.0.tgz", + "integrity": "sha512-WDrybc/gKFpTYQutKIK6UvfcuxijIZfMfXaYm8NMsPQxSYvf+13fXUJ4rztGGbJcBQ/GF55gvrZ0Bc0bj/mqvg==", + "license": "MIT", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "encoding-sniffer": "^0.2.1", + "htmlparser2": "^10.1.0", + "parse5": "^7.3.0", + "parse5-htmlparser2-tree-adapter": "^7.1.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^7.19.0", + "whatwg-mimetype": "^4.0.0" + }, + "engines": { + "node": ">=20.18.1" + }, + "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==", + "license": "BSD-2-Clause", + "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/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "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==", + "license": "BSD-2-Clause", + "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==", + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/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==", + "license": "MIT", + "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" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "license": "BSD-2-Clause", + "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==", + "license": "BSD-2-Clause", + "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/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding-sniffer": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz", + "integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==", + "license": "MIT", + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, + "node_modules/encoding-sniffer/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "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==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/htmlparser2": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz", + "integrity": "sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "entities": "^7.0.1" + } + }, + "node_modules/htmlparser2/node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "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==", + "license": "MIT", + "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/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/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==", + "license": "BSD-2-Clause", + "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==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", + "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==", + "license": "MIT", + "dependencies": { + "domhandler": "^5.0.3", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "license": "MIT", + "dependencies": { + "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==", + "license": "BSD-2-Clause", + "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==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "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==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/qs": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undici": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.7.tgz", + "integrity": "sha512-H/nlJ/h0ggGC+uRL3ovD+G0i4bqhvsDOpbDv7At5eFLlj2b41L8QliGbnl2H7SnDiYhENphh1tQFJZf+MyfLsQ==", + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..fdad9e82 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "websec-2", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "axios": "^1.14.0", + "cheerio": "^1.2.0", + "express": "^5.2.1", + "node-fetch": "^2.7.0" + } +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 00000000..df4f0839 --- /dev/null +++ b/public/index.html @@ -0,0 +1,49 @@ + + + + + + Расписание + + + +
+
+
+

Расписание

+

Выберите группу или найдите преподавателя

+
+
+ +
+ + +
+ + + +
+ + 31 неделя + +
+ +
+
+
+

Выберите группу для просмотра расписания

+

или введите фамилию преподавателя

+
+
+
+
+ + + + + \ No newline at end of file diff --git a/public/script.js b/public/script.js new file mode 100644 index 00000000..c36ce017 --- /dev/null +++ b/public/script.js @@ -0,0 +1,343 @@ +let currentGroupId = null; +let currentWeek = 31; +let scheduleData = null; +let currentView = 'group'; +let currentTeacherId = null; +let currentTeacherName = ''; + +const days = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота']; +const timeSlots = ['08:00', '09:45', '11:30', '13:30', '15:15', '17:00']; + +const fullTimeSlots = { + '08:00': '08:00 - 09:35', + '09:45': '09:45 - 11:20', + '11:30': '11:30 - 13:05', + '13:30': '13:30 - 15:05', + '15:15': '15:15 - 16:50', + '17:00': '17:00 - 18:35' +}; + +function getCurrentWeek() { + const today = new Date(); + const startDate = new Date(2026, 2, 30); + const diffTime = today - startDate; + const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24)); + let weekNumber = Math.floor(diffDays / 7) + 31; + if (weekNumber < 29) weekNumber = 29; + if (weekNumber > 35) weekNumber = 35; + return weekNumber; +} + +$(document).ready(function() { + console.log('Скрипт загружен'); + + currentWeek = getCurrentWeek(); + updateWeekDisplay(); + + loadGroups(); + + $('#loadBtn').click(function() { + currentGroupId = $('#groupSelect').val(); + if (!currentGroupId) { + alert('Пожалуйста, выберите группу'); + return; + } + currentView = 'group'; + loadSchedule(); + }); + + $('#searchTeacherBtn').click(function() { + const query = $('#teacherSearchInput').val().trim(); + if (query.length < 2) { + alert('Введите минимум 2 символа'); + return; + } + searchTeacher(query); + }); + + $('#weekPrevBtn').click(function() { + if (currentWeek > 29) { + currentWeek--; + updateWeekDisplay(); + if (currentView === 'group' && currentGroupId) { + loadSchedule(); + } else if (currentView === 'teacher' && currentTeacherId) { + loadTeacherSchedule(currentTeacherId, currentTeacherName); + } + } + }); + + $('#weekNextBtn').click(function() { + if (currentWeek < 35) { + currentWeek++; + updateWeekDisplay(); + if (currentView === 'group' && currentGroupId) { + loadSchedule(); + } else if (currentView === 'teacher' && currentTeacherId) { + loadTeacherSchedule(currentTeacherId, currentTeacherName); + } + } + }); +}); + +function loadGroups() { + console.log('Загрузка групп...'); + + $.ajax({ + url: '/api/groups', + method: 'GET', + timeout: 5000, + success: function(data) { + console.log('Группы получены:', data); + const $select = $('#groupSelect'); + $select.empty(); + $select.append(''); + + if (Array.isArray(data)) { + data.forEach(group => { + $select.append(``); + }); + } else { + $select.append(''); + $select.append(''); + $select.append(''); + } + }, + error: function(xhr, status, error) { + console.error('Ошибка загрузки групп:', error); + const $select = $('#groupSelect'); + $select.empty(); + $select.append(''); + $select.append(''); + $select.append(''); + $select.append(''); + } + }); +} + +function loadSchedule() { + if (!currentGroupId) return; + + $('#scheduleContainer').html('

Загрузка расписания...

'); + + console.log(`Загрузка расписания для группы ${currentGroupId}, неделя ${currentWeek}`); + + $.ajax({ + url: `/api/schedule/group/${currentGroupId}?week=${currentWeek}`, + method: 'GET', + timeout: 15000, + success: function(data) { + console.log('Расписание получено:', data); + scheduleData = data; + + if (data && data.weeks && data.weeks.weeks) { + renderScheduleTable(false); + updateGroupInfo(); + currentView = 'group'; + } else { + showError('Не удалось загрузить расписание'); + } + }, + error: function(xhr, status, error) { + console.error('Ошибка:', status, error); + showError('Ошибка загрузки расписания'); + } + }); +} + +function searchTeacher(query) { + $('#scheduleContainer').html('

Поиск преподавателя...

'); + + $.ajax({ + url: `/api/search/teacher?q=${encodeURIComponent(query)}`, + method: 'GET', + success: function(teachers) { + if (teachers.length === 0) { + showError('Преподаватель не найден'); + return; + } + + let html = '

Найденные преподаватели:

'; + teachers.forEach(teacher => { + html += ` +
+ ${escapeHtml(teacher.name)} + +
+ `; + }); + html += '
'; + $('#scheduleContainer').html(html); + + $('.btn-select-teacher').click(function() { + const teacherId = $(this).closest('.teacher-result').data('id'); + const teacherName = $(this).closest('.teacher-result').data('name'); + loadTeacherSchedule(teacherId, teacherName); + }); + }, + error: function() { + showError('Ошибка поиска'); + } + }); +} + +function loadTeacherSchedule(teacherId, teacherName) { + currentView = 'teacher'; + currentTeacherId = teacherId; + currentTeacherName = teacherName; + + $('#scheduleContainer').html('

Загрузка расписания преподавателя...

'); + + $.ajax({ + url: `/api/schedule/teacher?id=${teacherId}&week=${currentWeek}`, + method: 'GET', + success: function(data) { + scheduleData = data; + if (data && data.weeks && data.weeks.weeks) { + renderScheduleTable(true); + $('#groupTitle').text(`Расписание: ${teacherName}`); + $('#groupSubtitle').text('Преподаватель'); + } else { + showError('Не удалось загрузить расписание'); + } + }, + error: function() { + showError('Ошибка загрузки'); + } + }); +} + +function renderScheduleTable(isTeacher) { + if (!scheduleData || !scheduleData.weeks || !scheduleData.weeks.weeks) { + showError('Нет данных для отображения'); + return; + } + + const weekData = scheduleData.weeks.weeks[currentWeek]; + if (!weekData) { + showError(`Нет данных за ${currentWeek} неделю`); + return; + } + + const lessonsMap = {}; + const datesMap = {}; + + weekData.forEach(day => { + lessonsMap[day.day] = {}; + datesMap[day.day] = day.date || ''; + if (day.lessons && Array.isArray(day.lessons)) { + day.lessons.forEach(lesson => { + if (lesson.time) { + const startTime = lesson.time.split('-')[0]; + if (lessonsMap[day.day][startTime]) { + if (!Array.isArray(lessonsMap[day.day][startTime])) { + lessonsMap[day.day][startTime] = [lessonsMap[day.day][startTime]]; + } + lessonsMap[day.day][startTime].push(lesson); + } else { + lessonsMap[day.day][startTime] = lesson; + } + } + }); + } + }); + + let html = ''; + html += ''; + html += ''; + html += ''; + + days.forEach(day => { + const date = datesMap[day] ? `
${formatDate(datesMap[day])}` : ''; + html += ``; + }); + html += ''; + html += ''; + html += ''; + + timeSlots.forEach(timeSlot => { + html += ''; + html += ``; + + days.forEach(day => { + const lessonData = lessonsMap[day] ? lessonsMap[day][timeSlot] : null; + + html += ``; + }); + + html += ''; + }); + + html += ''; + html += '
Время${day}${date}
${fullTimeSlots[timeSlot]}`; + + if (lessonData) { + const lessons = Array.isArray(lessonData) ? lessonData : [lessonData]; + + lessons.forEach((lesson, idx) => { + if (isTeacher) { + html += ` +
+
${escapeHtml(lesson.name)}
+
${escapeHtml(lesson.room)}
+ ${escapeHtml(lesson.type)} + ${lesson.groups ? `
Группы: ${escapeHtml(lesson.groups)}
` : ''} +
+ `; + } else { + html += ` +
+
${escapeHtml(lesson.name)}
+
${escapeHtml(lesson.teacher)}
+
${escapeHtml(lesson.room)}
+ ${escapeHtml(lesson.type)} +
+ `; + } + if (idx < lessons.length - 1) { + html += `
`; + } + }); + } else { + html += `
`; + } + + html += `
'; + + $('#scheduleContainer').html(html); +} + +function formatDate(dateStr) { + if (!dateStr) return ''; + const parts = dateStr.split('.'); + if (parts.length === 3) { + return `${parts[0]}.${parts[1]}`; + } + return dateStr; +} + +function updateWeekDisplay() { + $('#currentWeekLabel').html(`${currentWeek} неделя`); + $('#weekPrevBtn').prop('disabled', currentWeek <= 29); + $('#weekNextBtn').prop('disabled', currentWeek >= 35); +} + +function updateGroupInfo() { + const groupName = $('#groupSelect option:selected').text(); + $('#groupTitle').text(`Расписание, ${groupName}`); + $('#groupSubtitle').text('10.05.03 Информационная безопасность автоматизированных систем'); +} + +function escapeHtml(str) { + if (!str) return ''; + return str.replace(/[&<>]/g, function(m) { + if (m === '&') return '&'; + if (m === '<') return '<'; + if (m === '>') return '>'; + return m; + }); +} + +function showError(message) { + $('#scheduleContainer').html(`

${message}

`); +} \ No newline at end of file diff --git a/public/style.css b/public/style.css new file mode 100644 index 00000000..e50cf112 --- /dev/null +++ b/public/style.css @@ -0,0 +1,377 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: -apple-system, 'Segoe UI', 'Roboto', sans-serif; + background: #f0f2f5; + padding: 20px; +} + +.app { + max-width: 1400px; + margin: 0 auto; + background: white; + border-radius: 16px; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); + overflow: hidden; +} + +.header { + background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); + color: white; + padding: 24px 30px; +} + +.group-info h1 { + font-size: 28px; + margin-bottom: 8px; +} + +.subtitle { + font-size: 14px; + opacity: 0.9; +} + +.group-selector, .teacher-search { + padding: 20px 30px; + background: #f8f9fa; + border-bottom: 1px solid #e0e0e0; + display: flex; + gap: 15px; + align-items: center; + flex-wrap: wrap; +} + +.group-select, .teacher-search-input { + flex: 1; + min-width: 250px; + padding: 10px 12px; + border: 1px solid #ccc; + border-radius: 8px; + font-size: 14px; + background: white; +} + +.btn-primary, .btn-secondary { + padding: 10px 24px; + color: white; + border: none; + border-radius: 8px; + font-size: 14px; + cursor: pointer; + transition: background 0.2s; +} + +.btn-primary { + background: #4a90e2; +} + +.btn-primary:hover { + background: #357abd; +} + +.btn-secondary { + background: #6c757d; +} + +.btn-secondary:hover { + background: #5a6268; +} + +.week-navigation { + padding: 15px 30px; + background: white; + border-bottom: 1px solid #e0e0e0; + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + gap: 15px; +} + +.week-nav-btn { + padding: 8px 20px; + background: #f0f2f5; + border: 1px solid #d0d0d0; + border-radius: 6px; + cursor: pointer; + font-size: 14px; + transition: all 0.2s; +} + +.week-nav-btn:hover:not(:disabled) { + background: #4a90e2; + color: white; + border-color: #4a90e2; +} + +.week-nav-btn:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.week-current { + font-size: 18px; + font-weight: 600; + color: #4a90e2; +} + +.day-date { + font-size: 11px; + font-weight: normal; + color: #888; + display: block; + margin-top: 4px; +} + +.schedule-wrapper { + padding: 20px 30px; + overflow-x: auto; +} + +.schedule-table { + width: 100%; + border-collapse: collapse; + font-size: 13px; + min-width: 700px; +} + +.schedule-table th { + background: #f8f9fa; + padding: 12px 10px; + text-align: center; + font-weight: 600; + border: 1px solid #e0e0e0; + font-size: 13px; +} + +.schedule-table td { + border: 1px solid #e0e0e0; + padding: 10px; + vertical-align: top; + background: white; +} + +.time-column { + background: #fafbfc; + font-weight: 500; + color: #000000; + text-align: left; + width: 100px; + font-size: 12px; + white-space: nowrap; +} + +.time-column strong { + font-weight: 500; + color: #000000; +} + +.lesson-cell { + min-height: 80px; +} + +.lesson-item { + margin-bottom: 6px; + padding: 6px; + background: #f8f9fa; + border-radius: 6px; + transition: all 0.2s; +} + +.lesson-item:hover { + background: #e8f0fe; + transform: translateX(2px); +} + +.lesson-name { + font-weight: 600; + color: #1a1a2e; + margin-bottom: 3px; + font-size: 12px; +} + +.lesson-teacher { + font-size: 10px; + color: #666; + margin-bottom: 2px; +} + +.lesson-room { + font-size: 10px; + color: #4a90e2; + font-weight: 500; +} + +.lesson-type { + display: inline-block; + font-size: 10px; + padding: 2px 6px; + border-radius: 4px; + background: #e8f0fe; + color: #4a90e2; + margin-top: 4px; +} + +.lesson-separator { + height: 1px; + background: #e0e0e0; + margin: 8px 0; +} + +.lesson-item:last-child { + margin-bottom: 0; +} + +.no-lessons { + color: #ccc; + font-size: 12px; + text-align: center; + padding: 15px 0; +} + +.placeholder { + text-align: center; + padding: 60px 20px; + color: #999; +} + +.placeholder span { + font-size: 48px; + display: block; + margin-bottom: 15px; +} + +.schedule-table tbody tr { + height: auto; +} + +.search-results { + padding: 20px; +} + +.search-results h3 { + margin-bottom: 15px; +} + +.teacher-result { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px; + border-bottom: 1px solid #eee; +} + +.btn-select-teacher { + padding: 5px 15px; + background: #4a90e2; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +.lesson-groups { + font-size: 10px; + color: #666; + margin-top: 4px; +} + +@media (max-width: 768px) { + body { + padding: 10px; + } + + .header { + padding: 20px; + } + + .group-info h1 { + font-size: 20px; + } + + .group-selector, .teacher-search { + padding: 15px 20px; + flex-direction: column; + } + + .group-select, .teacher-search-input { + width: 100%; + min-width: auto; + } + + .btn-primary, .btn-secondary { + width: 100%; + } + + .week-navigation { + padding: 12px 20px; + } + + .week-current { + font-size: 14px; + } + + .schedule-wrapper { + padding: 15px 20px; + } + + .schedule-table { + font-size: 10px; + min-width: 650px; + } + + .schedule-table th, + .schedule-table td { + padding: 6px; + } + + .time-column { + width: 75px; + font-size: 9px; + } + + .time-column strong { + font-size: 9px; + } + + .lesson-item { + padding: 4px; + margin-bottom: 4px; + } + + .lesson-name { + font-size: 10px; + } + + .lesson-teacher, .lesson-room { + font-size: 9px; + } + + .lesson-type { + font-size: 8px; + padding: 1px 4px; + } + + .day-date { + font-size: 9px; + } +} + +@media (max-width: 480px) { + .schedule-wrapper { + padding: 10px 15px; + } + + .schedule-table { + font-size: 9px; + min-width: 550px; + } + + .time-column { + width: 60px; + } +} \ No newline at end of file diff --git a/server.js b/server.js new file mode 100644 index 00000000..cd7ff507 --- /dev/null +++ b/server.js @@ -0,0 +1,370 @@ +const express = require('express'); +const fetch = require('node-fetch'); +const cheerio = require('cheerio'); +const app = express(); +const PORT = 3000; + +app.use(express.static('public')); + +const groups = { + '6413-100503D': '1213641978', + '6411-100503D': '1282690301', + '6412-100503D': '1282690279' +}; + +const knownTeachers = [ + { id: '335824546', name: 'Максимов А.И.' }, + { id: '664017039', name: 'Борисов А.Н.' }, + { id: '364272302', name: 'Агафонов А.А.' }, + { id: '333991624', name: 'Веричев А.В.' }, + { id: '432837452', name: 'Юзькив Р.Р.' }, + { id: '544973937', name: 'Шапиро Д.А.' }, + { id: '147619112', name: 'Кузнецов А.В.' }, + { id: '651422674', name: 'Позднякова Д.С.' }, + { id: '62061001', name: 'Мясников В.В.' } +]; + +app.get('/api/groups', (req, res) => { + res.json([ + { id: '1213641978', name: '6413-100503D' }, + { id: '1282690301', name: '6411-100503D' }, + { id: '1282690279', name: '6412-100503D' } + ]); +}); + +app.get('/api/schedule/group/:id', async (req, res) => { + const groupId = req.params.id; + const week = req.query.week || '31'; + + let groupName = '6413-100503D'; + for (const [name, id] of Object.entries(groups)) { + if (id === groupId) { + groupName = name; + break; + } + } + + try { + const url = `https://ssau.ru/rasp?groupId=${groupId}&selectedWeek=${week}`; + console.log(`Parsing group: ${url}`); + + const response = await fetch(url, { + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' + } + }); + + const html = await response.text(); + const schedule = parseGroupSchedule(html, groupName, week); + res.json(schedule); + + } catch (error) { + console.error('Parse error:', error.message); + res.status(500).json({ error: error.message }); + } +}); + +app.get('/api/search/teacher', async (req, res) => { + const query = req.query.q; + if (!query || query.length < 2) { + return res.json([]); + } + + try { + const url = `https://ssau.ru/rasp?search=${encodeURIComponent(query)}`; + console.log(`Searching teacher: ${url}`); + + const response = await fetch(url, { + headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } + }); + + const html = await response.text(); + const $ = cheerio.load(html); + + const teachers = []; + + $('.schedule__teacher a').each((i, el) => { + const name = $(el).text().trim(); + const href = $(el).attr('href'); + const match = href && href.match(/staffId=(\d+)/); + if (match && name && name.toLowerCase().includes(query.toLowerCase())) { + if (!teachers.find(t => t.id === match[1])) { + teachers.push({ id: match[1], name: name }); + } + } + }); + + if (teachers.length === 0) { + const matched = knownTeachers.filter(t => + t.name.toLowerCase().includes(query.toLowerCase()) + ); + return res.json(matched); + } + + res.json(teachers.slice(0, 10)); + + } catch (error) { + console.error('Search error:', error); + const matched = knownTeachers.filter(t => + t.name.toLowerCase().includes(query.toLowerCase()) + ); + res.json(matched); + } +}); + +app.get('/api/schedule/teacher', async (req, res) => { + const teacherId = req.query.id; + const week = req.query.week || '31'; + + try { + const url = `https://ssau.ru/rasp?staffId=${teacherId}&selectedWeek=${week}`; + console.log(`Parsing teacher: ${url}`); + + const response = await fetch(url, { + headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } + }); + + const html = await response.text(); + const schedule = parseTeacherSchedule(html, teacherId, week); + res.json(schedule); + + } catch (error) { + console.error('Teacher parse error:', error); + res.status(500).json({ error: error.message }); + } +}); + + +function parseGroupSchedule(html, groupName, weekNum) { + const $ = cheerio.load(html); + + const scheduleItems = $('.schedule__items'); + if (scheduleItems.length === 0) { + throw new Error('Schedule container not found'); + } + + const days = []; + scheduleItems.find('.schedule__head:not(:has(.schedule__time-item))').each((i, el) => { + const weekday = $(el).find('.schedule__head-weekday').text().trim(); + const date = $(el).find('.schedule__head-date').text().trim(); + if (weekday && date) { + days.push({ weekday: capitalizeDay(weekday), date, index: i }); + } + }); + + if (days.length === 0) { + throw new Error('No days found'); + } + + console.log(`Found days: ${days.length}`); + + const weekData = []; + days.forEach((day, idx) => { + weekData.push({ + day: day.weekday, + date: day.date, + lessons: [] + }); + }); + + const timeBlocks = scheduleItems.find('.schedule__time'); + + timeBlocks.each((timeBlockIndex, timeBlock) => { + const $timeBlock = $(timeBlock); + + const timeItems = $timeBlock.find('.schedule__time-item'); + const timeRange = []; + timeItems.each((i, timeEl) => { + const timeText = $(timeEl).text().trim(); + const time = timeText.split(' ')[0]; + if (time) timeRange.push(time); + }); + + let timeInterval = ''; + if (timeRange.length === 2) { + timeInterval = `${timeRange[0]}-${timeRange[1]}`; + } else if (timeRange.length === 1) { + timeInterval = timeRange[0]; + } + + let nextElement = $timeBlock.next(); + let dayIndex = 0; + + while (nextElement.length && !nextElement.hasClass('schedule__time')) { + if (nextElement.hasClass('schedule__item') && !nextElement.hasClass('schedule__head')) { + const lessonElements = nextElement.find('.schedule__lesson'); + + lessonElements.each((lessonIdx, lessonElem) => { + const $lesson = $(lessonElem); + + const subject = $lesson.find('.schedule__discipline').text().trim(); + if (subject && dayIndex < days.length) { + const type = $lesson.find('.schedule__lesson-type-chip').text().trim(); + const place = $lesson.find('.schedule__place').text().trim(); + + let teacherName = ''; + const teacherLink = $lesson.find('.schedule__teacher a'); + if (teacherLink.length) { + teacherName = teacherLink.text().trim(); + } else { + teacherName = $lesson.find('.schedule__teacher').text().trim(); + } + + weekData[dayIndex].lessons.push({ + time: formatTimeRange(timeInterval), + name: subject, + teacher: teacherName || 'Не указан', + room: place || 'Не указана', + type: type || 'Занятие' + }); + } + }); + dayIndex++; + } + nextElement = nextElement.next(); + } + }); + + const totalLessons = weekData.reduce((sum, day) => sum + day.lessons.length, 0); + console.log(`Parsed lessons: ${totalLessons}`); + + return { + group: groupName, + fullName: '10.05.03 Информационная безопасность автоматизированных систем', + weeks: { + current: parseInt(weekNum) || 31, + weeks: { + [weekNum]: weekData + } + } + }; +} + +function parseTeacherSchedule(html, teacherId, weekNum) { + const $ = cheerio.load(html); + + const scheduleItems = $('.schedule__items'); + if (scheduleItems.length === 0) { + throw new Error('Schedule container not found'); + } + + const weekData = []; + const daysMap = {}; + + scheduleItems.find('.schedule__head:not(:has(.schedule__time-item))').each((i, el) => { + const weekday = $(el).find('.schedule__head-weekday').text().trim(); + const date = $(el).find('.schedule__head-date').text().trim(); + if (weekday && date) { + daysMap[i] = { weekday: capitalizeDay(weekday), date }; + } + }); + + const timeBlocks = scheduleItems.find('.schedule__time'); + + timeBlocks.each((timeBlockIndex, timeBlock) => { + const $timeBlock = $(timeBlock); + + const timeItems = $timeBlock.find('.schedule__time-item'); + const timeRange = []; + timeItems.each((i, timeEl) => { + const timeText = $(timeEl).text().trim(); + const time = timeText.split(' ')[0]; + if (time) timeRange.push(time); + }); + + let timeInterval = ''; + if (timeRange.length === 2) { + timeInterval = `${timeRange[0]}-${timeRange[1]}`; + } else if (timeRange.length === 1) { + timeInterval = timeRange[0]; + } + + let nextElement = $timeBlock.next(); + let dayIndex = 0; + + while (nextElement.length && !nextElement.hasClass('schedule__time')) { + if (nextElement.hasClass('schedule__item') && !nextElement.hasClass('schedule__head')) { + const lessonElements = nextElement.find('.schedule__lesson'); + + lessonElements.each((lessonIdx, lessonElem) => { + const $lesson = $(lessonElem); + + const subject = $lesson.find('.schedule__discipline').text().trim(); + if (subject && daysMap[dayIndex]) { + const type = $lesson.find('.schedule__lesson-type-chip').text().trim(); + const place = $lesson.find('.schedule__place').text().trim(); + + const groupsList = []; + $lesson.find('.schedule__groups a').each((i, groupEl) => { + groupsList.push($(groupEl).text().trim()); + }); + + let dayObj = weekData.find(d => d.day === daysMap[dayIndex].weekday); + if (!dayObj) { + dayObj = { + day: daysMap[dayIndex].weekday, + date: daysMap[dayIndex].date, + lessons: [] + }; + weekData.push(dayObj); + } + + dayObj.lessons.push({ + time: formatTimeRange(timeInterval), + name: subject, + room: place || 'Не указана', + type: type || 'Занятие', + groups: groupsList.join(', ') + }); + } + }); + dayIndex++; + } + nextElement = nextElement.next(); + } + }); + + return { + teacherId: teacherId, + fullName: 'Расписание преподавателя', + weeks: { + current: parseInt(weekNum) || 31, + weeks: { + [weekNum]: weekData + } + } + }; +} + +function capitalizeDay(day) { + const days = { + 'понедельник': 'Понедельник', + 'вторник': 'Вторник', + 'среда': 'Среда', + 'четверг': 'Четверг', + 'пятница': 'Пятница', + 'суббота': 'Суббота' + }; + return days[day.toLowerCase()] || day; +} + +function formatTimeRange(timeStr) { + const timeMap = { + '08:00': '08:00-09:35', + '09:35': '09:35-11:20', + '09:45': '09:45-11:20', + '11:20': '11:20-13:05', + '11:30': '11:30-13:05', + '13:05': '13:05-14:50', + '13:30': '13:30-15:05', + '15:05': '15:05-16:50', + '15:15': '15:15-16:50', + '16:50': '16:50-18:35', + '17:00': '17:00-18:35' + }; + return timeMap[timeStr] || timeStr; +} + +app.listen(PORT, () => { + console.log(`Server running at http://localhost:${PORT}`); +}); \ No newline at end of file diff --git "a/\320\236\320\261\321\211\320\265\320\265 \321\200\320\260\321\201\320\277\320\270\321\201\320\260\320\275\320\270\320\265.jpg" "b/\320\236\320\261\321\211\320\265\320\265 \321\200\320\260\321\201\320\277\320\270\321\201\320\260\320\275\320\270\320\265.jpg" new file mode 100644 index 00000000..b541c2de Binary files /dev/null and "b/\320\236\320\261\321\211\320\265\320\265 \321\200\320\260\321\201\320\277\320\270\321\201\320\260\320\275\320\270\320\265.jpg" differ diff --git "a/\320\240\320\260\321\201\320\277\320\270\321\201\320\260\320\275\320\270\320\265 \320\277\321\200\320\265\320\277\320\276\320\264\320\260\320\262\320\260\321\202\320\265\320\273\321\217.jpg" "b/\320\240\320\260\321\201\320\277\320\270\321\201\320\260\320\275\320\270\320\265 \320\277\321\200\320\265\320\277\320\276\320\264\320\260\320\262\320\260\321\202\320\265\320\273\321\217.jpg" new file mode 100644 index 00000000..23eb4473 Binary files /dev/null and "b/\320\240\320\260\321\201\320\277\320\270\321\201\320\260\320\275\320\270\320\265 \320\277\321\200\320\265\320\277\320\276\320\264\320\260\320\262\320\260\321\202\320\265\320\273\321\217.jpg" differ