ЛР 2 - БПИ2301 - Степанов - на 5 #199
@@ -0,0 +1,21 @@
|
|||||||
|
name: Lab 2 application
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
application:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 20
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: make check
|
||||||
|
- run: bash scripts/bootstrap.sh
|
||||||
|
- run: docker compose pull db cache
|
||||||
|
- run: docker compose build migrate
|
||||||
|
- run: docker compose up -d --no-build --pull never
|
||||||
|
- run: curl -fsS --retry 40 --retry-delay 2 --retry-all-errors http://127.0.0.1:8080/health/ready
|
||||||
|
- run: make test BASE_URL=http://127.0.0.1:8080
|
||||||
|
- if: always()
|
||||||
|
run: docker compose down
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
24.22.1
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
FROM node:24.22.1-bookworm-slim AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci --ignore-scripts --no-audit --no-fund
|
||||||
|
COPY tsconfig.json ./
|
||||||
|
COPY src ./src
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:24.22.1-bookworm-slim AS production-dependencies
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci --omit=dev --ignore-scripts --no-audit --no-fund
|
||||||
|
|
||||||
|
FROM node:24.22.1-bookworm-slim AS runtime
|
||||||
|
ENV NODE_ENV=production APP_HOST=0.0.0.0 APP_PORT=8080 LOG_LEVEL=info
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=production-dependencies /app/node_modules ./node_modules
|
||||||
|
COPY --from=build /app/dist ./dist
|
||||||
|
COPY package.json ./
|
||||||
|
COPY contracts/openapi.json ./contracts/openapi.json
|
||||||
|
COPY migrations ./migrations
|
||||||
|
USER node
|
||||||
|
EXPOSE 8080
|
||||||
|
STOPSIGNAL SIGTERM
|
||||||
|
HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=3 \
|
||||||
|
CMD ["node", "--input-type=module", "-e", "const r = await fetch('http://127.0.0.1:' + process.env.APP_PORT + '/health/ready', {signal: AbortSignal.timeout(2000)}); if (r.status !== 200) process.exit(1)"]
|
||||||
|
CMD ["node", "dist/server.js"]
|
||||||
@@ -1,37 +1,85 @@
|
|||||||
# Отчёт — лабораторная 2
|
# ЛР2. PostgreSQL, сессии и Valkey
|
||||||
|
|
||||||
- Автор, группа: TODO
|
Артём Степанов, БПИ2301. Целевая оценка — **5**, трек 2 «План запроса и восстановление». Проверенная версия решения — `4abfcf2`, ветка `solution/BPI2301-stepanov`. Измерения выполнены 4 декабря 2026 года.
|
||||||
- Целевая оценка; выбранный трек 5, если нужен: TODO
|
|
||||||
- Commit/PR: TODO после публикации
|
|
||||||
- Использованные источники, библиотеки и помощь ИИ: TODO
|
|
||||||
|
|
||||||
## Запуск из чистого clone
|
## 1. Состав и запуск
|
||||||
|
|
||||||
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
|
Из ЛР1 перенесены пользователи, чаты, членство, сообщения и курсорная пагинация. Состояние теперь хранится в PostgreSQL. При регистрации нужен пароль, для входа используется Basic, а для запросов от имени пользователя — Bearer. Заголовок `X-User-Id` больше не служит удостоверением личности.
|
||||||
|
|
||||||
## Архитектура и решения
|
Стенд запускается в Docker Compose. API написан на TypeScript и Fastify, базовый образ — Node.js 24.22.1. PostgreSQL 17.6 хранит данные и сессии, Valkey 8.1.3 кеширует профили. Docker Engine 26.1.4, Compose 2.27.1; Docker выделено 8 виртуальных CPU и 3 948 572 672 байта памяти. В Compose для API по умолчанию заданы 1 CPU и 256 МиБ. [Конфигурация](compose.yaml) · [Среда исходного запуска](evidence/environment.txt).
|
||||||
|
|
||||||
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab1, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
|
Из корня чистого клона при свободном порте 8080:
|
||||||
|
|
||||||
## Доказательства критериев
|
```bash
|
||||||
|
make check
|
||||||
|
bash scripts/bootstrap.sh
|
||||||
|
docker compose config --quiet
|
||||||
|
docker compose pull db cache
|
||||||
|
docker compose build migrate
|
||||||
|
docker compose up -d --no-build --pull never
|
||||||
|
curl -fsS --retry 40 --retry-delay 2 --retry-all-errors http://127.0.0.1:8080/health/ready
|
||||||
|
make test BASE_URL=http://127.0.0.1:8080
|
||||||
|
make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=http://127.0.0.1:8080
|
||||||
|
python3 scripts/acceptance.py
|
||||||
|
```
|
||||||
|
|
||||||
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
|
Bootstrap создаёт локальный `.env`. Сервис `migrate` и API используют один образ. После готовности PostgreSQL миграция применяет схему, затем стартует API. Снаружи опубликован только API на `127.0.0.1:8080`. Для завершения работы используется `docker compose down`, именованные тома сохраняются.
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| Публичный smoke | make test | TODO | TODO |
|
|
||||||
| Остальные пункты уровня 3 | TODO | TODO | TODO |
|
|
||||||
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
|
|
||||||
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
|
|
||||||
|
|
||||||
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
|
## 2. Хранение данных и аутентификация
|
||||||
|
|
||||||
## Эксперименты и отказы
|
Таблицы `users`, `sessions`, `chats`, `members` и `messages` связаны внешними ключами. Уникальность имени пользователя обеспечивает ограничение PostgreSQL, пара «чат, участник» является первичным ключом `members`. В таблице `migrations` учитываются применённые миграции. При создании чата приложение в одной транзакции проверяет участников, добавляет чат и записывает членство. Данные в SQL передаются параметрами. Пул по умолчанию ограничен восемью соединениями, ожидание соединения — 2 с, выполнение SQL — 4 с. [Миграция](migrations/001.sql) · [Транзакции и пул](src/db.ts) · [Запросы к чатам и сообщениям](src/store.ts).
|
||||||
|
|
||||||
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
|
Пароль хранится в виде производной scrypt с индивидуальной случайной солью. При успешном входе сервер выдаёт случайный токен. В `sessions` записываются его SHA-256, владелец и срок действия. На каждом защищённом запросе сервер сначала проверяет сессию в PostgreSQL, а затем получает профиль. Запись Valkey `profile:<id>` живёт 60 с. Профиль в этом API неизменяем. При промахе или отказе кеша профиль читается из PostgreSQL. Logout отзывает сессию, поэтому наличие профиля в кеше не продлевает доступ. [Аутентификация и кеш](src/auth.ts).
|
||||||
|
|
||||||
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
|
## 3. Проверки приложения
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| TODO | TODO | TODO | TODO |
|
|
||||||
|
|
||||||
## Ограничения и следующие шаги
|
| Что проверялось | Наблюдение |
|
||||||
|
|---|---|
|
||||||
|
| Контракт | Валидация OpenAPI 3.1 и JSON Schema прошла с openapi-spec-validator 0.7.2. [Вывод](evidence/openapi.txt) |
|
||||||
|
| Миграции | В базе появились шесть таблиц. После повторного запуска в журнале осталась одна запись `001.sql`. [Вывод PostgreSQL](evidence/migrations.txt) |
|
||||||
|
| Публичный сценарий | `make test` прошёл. В отдельной проверке создание сообщения вернуло 201, второй участник прочитал его, logout вернул 204, запрос с тем же токеном после выхода — 401. [Smoke](evidence/smoke.txt) |
|
||||||
|
| Сохранность при рестарте | У PostgreSQL и Valkey время запуска изменилось с 17:13:05 UTC, у API — с 17:13:08 UTC, у всех трёх новое время — 17:33:40 UTC. После рестарта прежний токен сохранил доступ, а подтверждённое сообщение совпало с исходным. [До](evidence/restart-before.txt) · [После](evidence/restart-after.txt) · [Тест](evidence/persistence.txt) |
|
||||||
|
| Гонка регистрации и атомарность | Из восьми запросов с одним именем один получил 201, семь — 409. Несуществующий участник при создании чата дал 400. Число чатов до и после совпало. [Проверки сценария](scripts/acceptance.py) · [Результат](evidence/acceptance.txt) |
|
||||||
|
| Отказы и срок сессии | При остановке Valkey действующая сессия получила профиль (200), анонимный запрос — 401. При остановке PostgreSQL liveness вернул 200, readiness и запрос профиля с действующей сессией — 503. После запуска базы readiness восстановился. При TTL 2 с запрос через 3 с получил 401. [Результат](evidence/acceptance.txt) |
|
||||||
|
| Использование кеша | За один smoke-прогон счётчики выросли с 0 до 11 попаданий и с 0 до 3 промахов. Доля попаданий в этом сценарии — 11/14, или 78,6%. [До](evidence/cache-before.txt) · [После](evidence/cache-after.txt) |
|
||||||
|
|
||||||
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
|
Первый тест отказа PostgreSQL выявил ошибку. После остановки базы API завершился с кодом 1: пул выдал необработанное событие `error` при разрыве уже открытого соединения. Добавлен обработчик ошибок простаивающих соединений. После пересборки тот же тест дошёл до проверки срока сессии и завершился успешно. [Исправление](src/db.ts) · [Повторный прогон](evidence/acceptance.txt).
|
||||||
|
|
||||||
|
Собственные тесты покрывают разбор Basic с UTF-8 и двоеточием в пароле, отклонение некорректных данных, привязку курсора к ресурсу, формат UUID и параметра limit. Прошли все 4 теста, ошибок и пропусков — 0. [Вывод TAP](evidence/student-tests.txt).
|
||||||
|
|
||||||
|
Команда для воспроизведения после сборки:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -v "$PWD/student-tests:/app/student-tests:ro" mtusi-lab2-app:local \
|
||||||
|
node --test student-tests/credentials.test.mjs student-tests/logic.test.mjs
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. Исследование индекса истории
|
||||||
|
|
||||||
|
**Гипотеза.** Для истории одного чата индекс по `(chat_id, created_at, id)` позволит сразу читать сообщения в нужном порядке. Добавление записей в такой индекс может обходиться дороже.
|
||||||
|
|
||||||
|
Команда `bash scripts/research.sh` создаёт отдельную экспериментальную базу. Две таблицы получили по 100 000 сообщений из одного набора входных данных. Распределение по десяти чатам: 90 000 сообщений в крупнейшем, 1 112 в одном и по 1 111 в восьми остальных. Для каждой таблицы измерялась вставка с уже созданным индексом. После `ANALYZE` сравнивался запрос последних 51 сообщений большого чата с сортировкой по `created_at DESC, id DESC`. Время чтения взято из `Execution Time`, обращения к буферам — из верхнего узла плана. [Методика](scripts/research.sh) · [Распределение](evidence/plans-20261204204549/distribution.txt) · [Планы и время вставок](evidence/plans-20261204204549/plans.txt).
|
||||||
|
|
||||||
|
| Измерение | Индекс по chat_id | Индекс по (chat_id, created_at, id) |
|
||||||
|
|---|---:|---:|
|
||||||
|
| Вставка 100 000 сообщений, мс | 4 284,598 | 4 752,484 |
|
||||||
|
| Чтение 51 строки, мс | 31,121 | 0,058 |
|
||||||
|
| Обращения к блокам в кеше PostgreSQL, shared hit | 1 280 | 24 |
|
||||||
|
|
||||||
|
В первом случае условию соответствовало 90% таблицы. PostgreSQL выбрал параллельное последовательное сканирование, сортировку top-N и Gather Merge. Во втором случае он прошёл составной индекс в обратном направлении и остановился на 51-й строке. В этом замере выборка ускорилась примерно в 537 раз, вставка заняла на 468 мс (10,9%) больше. Замер одиночный, порядок вставок фиксирован, страницы находились в кеше. Эти цифры характеризуют данный набор и SQL-запрос; полная задержка HTTP сюда не входит.
|
||||||
|
|
||||||
|
**Следующая страница API.** Приложение сортирует сообщения по возрастанию и продолжает чтение после пары `(created_at, id)`. Для проверки курсор взят у 9 000-го сообщения. В измеряемом запросе PostgreSQL применил `Index Scan using history_key`, включив и `chat_id`, и сравнение пары в `Index Cond`. Результат — 51 строка, 40 обращений к буферам, планирование 0,112 мс, выполнение 0,087 мс. Отдельная сортировка отсутствует. API запрашивает на одну запись больше размера страницы, чтобы определить наличие продолжения. [План страницы](evidence/plans-20261204204549/api-keyset.txt).
|
||||||
|
|
||||||
|
## 5. Резервная копия и границы восстановления
|
||||||
|
|
||||||
|
С экспериментальной базы сделана логическая копия `pg_dump -Fc`. После `pg_restore` в отдельную базу совпали количество сообщений (100 000) и MD5 упорядоченных полей сообщений (`737f6db64b1a456f3f433b3c408f2a9c`). Показания секундного счётчика для dump и restore — 1 и 0 соответственно. Точную длительность первого восстановления этот счётчик не даёт. [Время](evidence/plans-20261204204549/recovery.txt) · [Исходная база](evidence/plans-20261204204549/bench_20261204204549.digest) · [Восстановленная база](evidence/plans-20261204204549/restore_20261204204549.digest).
|
||||||
|
|
||||||
|
Затем запущен независимый экземпляр PostgreSQL проекта `lab2recovery20261204205002` с новым пустым томом. Восстановление того же дампа заняло **0,645 с** по `time pg_restore` (real). На новом томе запрос вернул **100 000** сообщений. Для пяти сообщений, выбранных по возрастанию UUID, совпали идентификаторы сообщения, чата и отправителя, текст и время. [Количество](evidence/plans-20261204204549/new-volume-count.txt) · [Исходная выборка](evidence/plans-20261204204549/sample-bench_20261204204549.txt) · [После восстановления](evidence/plans-20261204204549/sample-new-volume.txt) · [Результат сравнения](evidence/plans-20261204204549/new-volume-check.txt).
|
||||||
|
|
||||||
|
Дамп возвращает состояние на момент снимка. Изменения, зафиксированные после снимка и до отказа, из этой копии восстановить нельзя. Потенциальная потеря охватывает весь этот промежуток. Периодическое резервное копирование и архивирование WAL в эксперименте не настраивались. В 0,645 с входит выполнение восстановления в уже готовую БД; запуск экземпляра, перевод клиентов и проверка приложения потребуют отдельного времени.
|
||||||
|
|
||||||
|
## 6. Воспроизводимость
|
||||||
|
|
||||||
|
В чистом локальном клоне коммита `4abfcf2` развёрнут отдельный проект `lab2clean20261204205817`. При первом запросе порт ещё не принимал соединения, повторная попытка вернула `{"status":"ok"}`. Прошли публичный API-сценарий и проверка сохранности сообщения и действующей сессии после полного рестарта. Итоговая строка — `PASS: clean clone, smoke and persistence`. [Журнал чистого клона](evidence/clean-clone.txt) · [Конфигурация CI](.github/workflows/application.yml).
|
||||||
|
|
||||||
|
Основа работы — задание, OpenAPI и публичные тесты курса. При подготовке реализации, сценариев проверки, разборе сбоя и оформлении отчёта использовался Codex. Численные результаты взяты из приведённых локальных прогонов. [Задание](README.md) · [Контракт](contracts/openapi.json).
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
name: mtusi-lab2
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:17.6-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: lab
|
||||||
|
POSTGRES_DB: lab
|
||||||
|
POSTGRES_PASSWORD: ${PG_PASS:?run scripts/bootstrap.sh}
|
||||||
|
volumes:
|
||||||
|
- pg:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
- CMD-SHELL
|
||||||
|
- pg_isready -U lab -d lab
|
||||||
|
interval: 2s
|
||||||
|
timeout: 2s
|
||||||
|
retries: 30
|
||||||
|
cache:
|
||||||
|
image: valkey/valkey:8.1.3-alpine
|
||||||
|
command:
|
||||||
|
- valkey-server
|
||||||
|
- --appendonly
|
||||||
|
- 'yes'
|
||||||
|
- --requirepass
|
||||||
|
- ${CACHE_PASS:?}
|
||||||
|
volumes:
|
||||||
|
- cache:/data
|
||||||
|
migrate:
|
||||||
|
build: .
|
||||||
|
image: mtusi-lab2-app:local
|
||||||
|
command:
|
||||||
|
- node
|
||||||
|
- dist/migrate.js
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: postgresql://lab:${PG_PASS}@db:5432/lab
|
||||||
|
CACHE_URL: redis://:${CACHE_PASS}@cache:6379
|
||||||
|
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
cache:
|
||||||
|
condition: service_started
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
api:
|
||||||
|
image: mtusi-lab2-app:local
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: postgresql://lab:${PG_PASS}@db:5432/lab
|
||||||
|
CACHE_URL: redis://:${CACHE_PASS}@cache:6379
|
||||||
|
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||||
|
PG_POOL_SIZE: ${PG_POOL_SIZE:-8}
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
cache:
|
||||||
|
condition: service_started
|
||||||
|
migrate:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
read_only: true
|
||||||
|
cap_drop:
|
||||||
|
- ALL
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
tmpfs:
|
||||||
|
- /tmp
|
||||||
|
mem_limit: ${API_MEM:-256m}
|
||||||
|
cpus: ${API_CPUS:-1.0}
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:8080:8080
|
||||||
|
volumes:
|
||||||
|
pg: {}
|
||||||
|
cache: {}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
Container lab2study20261204200345-cache-1 Stopping
|
||||||
|
Container lab2study20261204200345-cache-1 Stopped
|
||||||
|
Container lab2study20261204200345-cache-1 Starting
|
||||||
|
Container lab2study20261204200345-cache-1 Started
|
||||||
|
Container lab2study20261204200345-db-1 Stopping
|
||||||
|
Container lab2study20261204200345-db-1 Stopped
|
||||||
|
Container lab2study20261204200345-db-1 Starting
|
||||||
|
Container lab2study20261204200345-db-1 Started
|
||||||
|
Container lab2study20261204200345-api-1 Recreate
|
||||||
|
Container lab2study20261204200345-api-1 Recreated
|
||||||
|
Container lab2study20261204200345-api-1 Starting
|
||||||
|
Container lab2study20261204200345-api-1 Started
|
||||||
|
Container lab2study20261204200345-api-1 Recreate
|
||||||
|
Container lab2study20261204200345-api-1 Recreated
|
||||||
|
Container lab2study20261204200345-api-1 Starting
|
||||||
|
Container lab2study20261204200345-api-1 Started
|
||||||
|
Concurrent registration, rollback, cache outage, DB outage and session expiry passed.
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
keyspace_hits:11
|
||||||
|
keyspace_misses:3
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
keyspace_hits:0
|
||||||
|
keyspace_misses:0
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
python3 scripts/check_contract.py
|
||||||
|
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
Cloning into '/tmp/tmp.M3y0Dvfxys/lab2'...
|
||||||
|
4abfcf2cd90042cc613e237af5c513f5250d9409
|
||||||
|
python3 scripts/check_contract.py
|
||||||
|
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||||
|
#0 building with "default" instance using docker driver
|
||||||
|
|
||||||
|
#1 [migrate internal] load build definition from Dockerfile
|
||||||
|
#1 transferring dockerfile: 1.09kB done
|
||||||
|
#1 DONE 0.0s
|
||||||
|
|
||||||
|
#2 [migrate internal] load metadata for docker.io/library/node:24.22.1-bookworm-slim
|
||||||
|
#2 DONE 0.0s
|
||||||
|
|
||||||
|
#3 [migrate internal] load .dockerignore
|
||||||
|
#3 transferring context: 196B done
|
||||||
|
#3 DONE 0.0s
|
||||||
|
|
||||||
|
#4 [migrate build 1/7] FROM docker.io/library/node:24.22.1-bookworm-slim
|
||||||
|
#4 DONE 0.0s
|
||||||
|
|
||||||
|
#5 [migrate internal] load build context
|
||||||
|
#5 transferring context: 123.04kB done
|
||||||
|
#5 DONE 0.0s
|
||||||
|
|
||||||
|
#6 [migrate build 4/7] RUN npm ci --ignore-scripts --no-audit --no-fund
|
||||||
|
#6 CACHED
|
||||||
|
|
||||||
|
#7 [migrate build 3/7] COPY package.json package-lock.json ./
|
||||||
|
#7 CACHED
|
||||||
|
|
||||||
|
#8 [migrate build 2/7] WORKDIR /app
|
||||||
|
#8 CACHED
|
||||||
|
|
||||||
|
#9 [migrate build 5/7] COPY tsconfig.json ./
|
||||||
|
#9 CACHED
|
||||||
|
|
||||||
|
#10 [migrate build 6/7] COPY src ./src
|
||||||
|
#10 DONE 0.0s
|
||||||
|
|
||||||
|
#11 [migrate build 7/7] RUN npm run build
|
||||||
|
#11 0.289
|
||||||
|
#11 0.289 > mtusi-messenger-lab2@1.0.0 build
|
||||||
|
#11 0.289 > tsc -p tsconfig.json
|
||||||
|
#11 0.289
|
||||||
|
#11 DONE 3.9s
|
||||||
|
|
||||||
|
#12 [migrate runtime 4/7] COPY --from=build /app/dist ./dist
|
||||||
|
#12 CACHED
|
||||||
|
|
||||||
|
#13 [migrate production-dependencies 4/4] RUN npm ci --omit=dev --ignore-scripts --no-audit --no-fund
|
||||||
|
#13 CACHED
|
||||||
|
|
||||||
|
#14 [migrate runtime 5/7] COPY package.json ./
|
||||||
|
#14 CACHED
|
||||||
|
|
||||||
|
#15 [migrate runtime 3/7] COPY --from=production-dependencies /app/node_modules ./node_modules
|
||||||
|
#15 CACHED
|
||||||
|
|
||||||
|
#16 [migrate runtime 6/7] COPY contracts/openapi.json ./contracts/openapi.json
|
||||||
|
#16 CACHED
|
||||||
|
|
||||||
|
#17 [migrate runtime 7/7] COPY migrations ./migrations
|
||||||
|
#17 DONE 0.0s
|
||||||
|
|
||||||
|
#18 [migrate] exporting to image
|
||||||
|
#18 exporting layers 0.0s done
|
||||||
|
#18 writing image sha256:7ecaf69286572126c7ac4b338cee9abadb8bb249f54d079820efdf283d33f63d done
|
||||||
|
#18 naming to docker.io/library/mtusi-lab2-app:local done
|
||||||
|
#18 DONE 0.1s
|
||||||
|
Network lab2clean20261204205817_default Creating
|
||||||
|
Network lab2clean20261204205817_default Created
|
||||||
|
Volume "lab2clean20261204205817_pg" Creating
|
||||||
|
Volume "lab2clean20261204205817_pg" Created
|
||||||
|
Volume "lab2clean20261204205817_cache" Creating
|
||||||
|
Volume "lab2clean20261204205817_cache" Created
|
||||||
|
Container lab2clean20261204205817-db-1 Creating
|
||||||
|
Container lab2clean20261204205817-cache-1 Creating
|
||||||
|
Container lab2clean20261204205817-db-1 Created
|
||||||
|
Container lab2clean20261204205817-cache-1 Created
|
||||||
|
Container lab2clean20261204205817-migrate-1 Creating
|
||||||
|
Container lab2clean20261204205817-migrate-1 Created
|
||||||
|
Container lab2clean20261204205817-api-1 Creating
|
||||||
|
Container lab2clean20261204205817-api-1 Created
|
||||||
|
Container lab2clean20261204205817-cache-1 Starting
|
||||||
|
Container lab2clean20261204205817-db-1 Starting
|
||||||
|
Container lab2clean20261204205817-cache-1 Started
|
||||||
|
Container lab2clean20261204205817-db-1 Started
|
||||||
|
Container lab2clean20261204205817-db-1 Waiting
|
||||||
|
Container lab2clean20261204205817-db-1 Healthy
|
||||||
|
Container lab2clean20261204205817-migrate-1 Starting
|
||||||
|
Container lab2clean20261204205817-migrate-1 Started
|
||||||
|
Container lab2clean20261204205817-migrate-1 Waiting
|
||||||
|
Container lab2clean20261204205817-db-1 Waiting
|
||||||
|
Container lab2clean20261204205817-db-1 Healthy
|
||||||
|
Container lab2clean20261204205817-migrate-1 Exited
|
||||||
|
Container lab2clean20261204205817-api-1 Starting
|
||||||
|
Container lab2clean20261204205817-api-1 Started
|
||||||
|
curl: (7) Failed to connect to 127.0.0.1 port 8080 after 0 ms: Could not connect to server
|
||||||
|
{"status":"ok"}
|
||||||
|
python3 tests/smoke.py --base-url "http://127.0.0.1:8080"
|
||||||
|
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||||
|
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1:8080"
|
||||||
|
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||||
|
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||||
|
PASS: clean clone, smoke and persistence
|
||||||
|
Container lab2clean20261204205817-api-1 Stopping
|
||||||
|
Container lab2clean20261204205817-api-1 Stopped
|
||||||
|
Container lab2clean20261204205817-api-1 Removing
|
||||||
|
Container lab2clean20261204205817-api-1 Removed
|
||||||
|
Container lab2clean20261204205817-migrate-1 Stopping
|
||||||
|
Container lab2clean20261204205817-migrate-1 Stopped
|
||||||
|
Container lab2clean20261204205817-migrate-1 Removing
|
||||||
|
Container lab2clean20261204205817-migrate-1 Removed
|
||||||
|
Container lab2clean20261204205817-cache-1 Stopping
|
||||||
|
Container lab2clean20261204205817-db-1 Stopping
|
||||||
|
Container lab2clean20261204205817-db-1 Stopped
|
||||||
|
Container lab2clean20261204205817-db-1 Removing
|
||||||
|
Container lab2clean20261204205817-db-1 Removed
|
||||||
|
Container lab2clean20261204205817-cache-1 Stopped
|
||||||
|
Container lab2clean20261204205817-cache-1 Removing
|
||||||
|
Container lab2clean20261204205817-cache-1 Removed
|
||||||
|
Network lab2clean20261204205817_default Removing
|
||||||
|
Network lab2clean20261204205817_default Removed
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
2026-12-04T20:16:16+03:00
|
||||||
|
project=lab2study20261204200345
|
||||||
|
65003b61195361aac238f19c9bff0027ca58e09e
|
||||||
|
client=26.1.4 server=26.1.4
|
||||||
|
Docker Compose version v2.27.1-desktop.1
|
||||||
|
cpus=8 ram_bytes=3948572672
|
||||||
|
CONTAINER REPOSITORY TAG IMAGE ID SIZE
|
||||||
|
lab2study20261204200345-api-1 mtusi-lab2-app local d59cebbd1962 240MB
|
||||||
|
lab2study20261204200345-cache-1 valkey/valkey 8.1.3-alpine 49292cc259b2 47.9MB
|
||||||
|
lab2study20261204200345-db-1 postgres 17.6-alpine d741b3768746 278MB
|
||||||
|
lab2study20261204200345-migrate-1 mtusi-lab2-app local d59cebbd1962 240MB
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
List of relations
|
||||||
|
Schema | Name | Type | Owner
|
||||||
|
--------+------------+-------+-------
|
||||||
|
public | chats | table | lab
|
||||||
|
public | members | table | lab
|
||||||
|
public | messages | table | lab
|
||||||
|
public | migrations | table | lab
|
||||||
|
public | sessions | table | lab
|
||||||
|
public | users | table | lab
|
||||||
|
(6 rows)
|
||||||
|
|
||||||
|
name
|
||||||
|
---------
|
||||||
|
001.sql
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
Container lab2study20261204200345-db-1 Running
|
||||||
|
Container lab2study20261204200345-cache-1 Running
|
||||||
|
name | count
|
||||||
|
---------+-------
|
||||||
|
001.sql | 1
|
||||||
|
(1 row)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/home/stepanov/study/vp/lab1/.venv/bin/python scripts/validate_openapi.py
|
||||||
|
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1:8080"
|
||||||
|
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||||
|
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
QUERY PLAN
|
||||||
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Limit (cost=0.42..5.07 rows=51 width=68) (actual time=0.014..0.032 rows=51 loops=1)
|
||||||
|
Buffers: shared hit=40
|
||||||
|
-> Index Scan using history_key on messages (cost=0.42..7429.49 rows=81483 width=68) (actual time=0.013..0.029 rows=51 loops=1)
|
||||||
|
Index Cond: ((chat_id = '10253fd7-f49d-4add-97e2-130e62ab0306'::uuid) AND (ROW(created_at, id) > ROW('2026-12-04 17:45:54.914+00'::timestamp with time zone, '9a28ea29-1091-42e7-b44a-3872ced57edc'::uuid)))
|
||||||
|
Buffers: shared hit=40
|
||||||
|
Planning:
|
||||||
|
Buffers: shared hit=6
|
||||||
|
Planning Time: 0.112 ms
|
||||||
|
Execution Time: 0.087 ms
|
||||||
|
(9 rows)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
100000|737f6db64b1a456f3f433b3c408f2a9c
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
chat_id | count
|
||||||
|
--------------------------------------+-------
|
||||||
|
10253fd7-f49d-4add-97e2-130e62ab0306 | 90000
|
||||||
|
606e396f-a079-4d72-a249-2829fcebf542 | 1112
|
||||||
|
5d840c9d-bee0-4fe0-9eb9-91368e28d7fe | 1111
|
||||||
|
91610601-c5ca-4714-865a-fa76ff5df6e9 | 1111
|
||||||
|
d36eefd0-6f0b-4561-9b33-dc3c3652502c | 1111
|
||||||
|
e81a6804-79e7-4167-b831-a13b4ce50ad0 | 1111
|
||||||
|
21059ea6-77da-42a7-9241-c3a4afcf4cf7 | 1111
|
||||||
|
d44d420d-4c4c-4118-a135-fa868ddef743 | 1111
|
||||||
|
9593d1a4-77d9-4175-81e2-44dc84101145 | 1111
|
||||||
|
263f0414-8926-490e-bfa5-6ec08ed6a82d | 1111
|
||||||
|
(10 rows)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS: selected rows on new volume
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
100000
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
Timing is on.
|
||||||
|
INSERT 0 1
|
||||||
|
Time: 3.601 ms
|
||||||
|
INSERT 0 10
|
||||||
|
Time: 2.276 ms
|
||||||
|
SELECT 100000
|
||||||
|
Time: 463.510 ms
|
||||||
|
DROP INDEX
|
||||||
|
Time: 3.420 ms
|
||||||
|
CREATE TABLE
|
||||||
|
Time: 5.623 ms
|
||||||
|
ALTER TABLE
|
||||||
|
Time: 4.390 ms
|
||||||
|
CREATE INDEX
|
||||||
|
Time: 2.480 ms
|
||||||
|
INSERT 0 100000
|
||||||
|
Time: 4284.598 ms (00:04.285)
|
||||||
|
CREATE INDEX
|
||||||
|
Time: 4.338 ms
|
||||||
|
INSERT 0 100000
|
||||||
|
Time: 4752.484 ms (00:04.752)
|
||||||
|
ANALYZE
|
||||||
|
Time: 67.604 ms
|
||||||
|
ANALYZE
|
||||||
|
Time: 66.671 ms
|
||||||
|
Time: 0.725 ms
|
||||||
|
QUERY PLAN
|
||||||
|
--------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Limit (cost=4738.03..4743.89 rows=51 width=68) (actual time=23.277..31.083 rows=51 loops=1)
|
||||||
|
Buffers: shared hit=1280
|
||||||
|
-> Gather Merge (cost=4738.03..10831.42 rows=52986 width=68) (actual time=23.275..31.076 rows=51 loops=1)
|
||||||
|
Workers Planned: 1
|
||||||
|
Workers Launched: 1
|
||||||
|
Buffers: shared hit=1280
|
||||||
|
-> Sort (cost=3738.02..3870.48 rows=52986 width=68) (actual time=13.960..13.973 rows=40 loops=2)
|
||||||
|
Sort Key: created_at DESC, id DESC
|
||||||
|
Sort Method: top-N heapsort Memory: 36kB
|
||||||
|
Buffers: shared hit=1280
|
||||||
|
Worker 0: Sort Method: top-N heapsort Memory: 37kB
|
||||||
|
-> Parallel Seq Scan on alternative (cost=0.00..1970.29 rows=52986 width=68) (actual time=0.008..6.159 rows=45000 loops=2)
|
||||||
|
Filter: (chat_id = '10253fd7-f49d-4add-97e2-130e62ab0306'::uuid)
|
||||||
|
Rows Removed by Filter: 5000
|
||||||
|
Buffers: shared hit=1235
|
||||||
|
Planning:
|
||||||
|
Buffers: shared hit=49
|
||||||
|
Planning Time: 0.391 ms
|
||||||
|
Execution Time: 31.121 ms
|
||||||
|
(19 rows)
|
||||||
|
|
||||||
|
Time: 32.904 ms
|
||||||
|
QUERY PLAN
|
||||||
|
----------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Limit (cost=0.42..4.81 rows=51 width=68) (actual time=0.022..0.037 rows=51 loops=1)
|
||||||
|
Buffers: shared hit=24
|
||||||
|
-> Index Scan Backward using history_key on messages (cost=0.42..7736.02 rows=89770 width=68) (actual time=0.021..0.033 rows=51 loops=1)
|
||||||
|
Index Cond: (chat_id = '10253fd7-f49d-4add-97e2-130e62ab0306'::uuid)
|
||||||
|
Buffers: shared hit=24
|
||||||
|
Planning:
|
||||||
|
Buffers: shared hit=33
|
||||||
|
Planning Time: 0.550 ms
|
||||||
|
Execution Time: 0.058 ms
|
||||||
|
(9 rows)
|
||||||
|
|
||||||
|
Time: 1.354 ms
|
||||||
|
DROP TABLE
|
||||||
|
Time: 8.325 ms
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
dump_seconds=1
|
||||||
|
restore_seconds=0
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
100000|737f6db64b1a456f3f433b3c408f2a9c
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
000070d9-f6ca-4aec-82ed-6fdd8461df3f|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 86373|2026-12-04 17:45:55.373+00
|
||||||
|
0000a738-48b6-4079-b568-30f07bd781ea|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 68540|2026-12-04 17:45:55.277+00
|
||||||
|
00011c09-22d8-476b-bbdc-c649baf3c6fc|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 81174|2026-12-04 17:45:55.348+00
|
||||||
|
000167a9-a525-40a5-a5e2-38f1e0e64ead|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 58751|2026-12-04 17:45:55.181+00
|
||||||
|
0001d9f2-4d6b-4baf-bc2e-9d1719f748ab|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 6471|2026-12-04 17:45:54.904+00
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
000070d9-f6ca-4aec-82ed-6fdd8461df3f|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 86373|2026-12-04 17:45:55.373+00
|
||||||
|
0000a738-48b6-4079-b568-30f07bd781ea|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 68540|2026-12-04 17:45:55.277+00
|
||||||
|
00011c09-22d8-476b-bbdc-c649baf3c6fc|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 81174|2026-12-04 17:45:55.348+00
|
||||||
|
000167a9-a525-40a5-a5e2-38f1e0e64ead|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 58751|2026-12-04 17:45:55.181+00
|
||||||
|
0001d9f2-4d6b-4baf-bc2e-9d1719f748ab|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 6471|2026-12-04 17:45:54.904+00
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
/lab2study20261204200345-db-1 2026-12-04T17:33:40.865833502Z
|
||||||
|
/lab2study20261204200345-cache-1 2026-12-04T17:33:40.910297061Z
|
||||||
|
/lab2study20261204200345-api-1 2026-12-04T17:33:40.910330464Z
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
/lab2study20261204200345-db-1 2026-12-04T17:13:05.443309776Z
|
||||||
|
/lab2study20261204200345-cache-1 2026-12-04T17:13:05.440414023Z
|
||||||
|
/lab2study20261204200345-api-1 2026-12-04T17:13:08.906507742Z
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
python3 tests/smoke.py --base-url "http://127.0.0.1:8080"
|
||||||
|
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
TAP version 13
|
||||||
|
# Subtest: Basic preserves UTF-8 and colons in the password
|
||||||
|
ok 1 - Basic preserves UTF-8 and colons in the password
|
||||||
|
---
|
||||||
|
duration_ms: 2.656599
|
||||||
|
type: 'test'
|
||||||
|
...
|
||||||
|
# Subtest: malformed Basic and invalid UTF-8 fail before the KDF
|
||||||
|
ok 2 - malformed Basic and invalid UTF-8 fail before the KDF
|
||||||
|
---
|
||||||
|
duration_ms: 0.913669
|
||||||
|
type: 'test'
|
||||||
|
...
|
||||||
|
# Subtest: cursor binds the page to its resource
|
||||||
|
ok 3 - cursor binds the page to its resource
|
||||||
|
---
|
||||||
|
duration_ms: 6.925018
|
||||||
|
type: 'test'
|
||||||
|
...
|
||||||
|
# Subtest: strict query and UUID
|
||||||
|
ok 4 - strict query and UUID
|
||||||
|
---
|
||||||
|
duration_ms: 0.444833
|
||||||
|
type: 'test'
|
||||||
|
...
|
||||||
|
1..4
|
||||||
|
# tests 4
|
||||||
|
# suites 0
|
||||||
|
# pass 4
|
||||||
|
# fail 0
|
||||||
|
# cancelled 0
|
||||||
|
# skipped 0
|
||||||
|
# todo 0
|
||||||
|
# duration_ms 99.552651
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS users(id uuid PRIMARY KEY DEFAULT gen_random_uuid(),username text UNIQUE NOT NULL,display_name text NOT NULL,salt text NOT NULL,hash text NOT NULL,created_at timestamptz(3) NOT NULL DEFAULT clock_timestamp());
|
||||||
|
CREATE TABLE IF NOT EXISTS sessions(token_hash text PRIMARY KEY,user_id uuid NOT NULL REFERENCES users,expires_at timestamptz NOT NULL);
|
||||||
|
CREATE TABLE IF NOT EXISTS chats(id uuid PRIMARY KEY DEFAULT gen_random_uuid(),title text NOT NULL,created_at timestamptz(3) NOT NULL DEFAULT clock_timestamp());
|
||||||
|
CREATE TABLE IF NOT EXISTS members(chat_id uuid REFERENCES chats,user_id uuid REFERENCES users,PRIMARY KEY(chat_id,user_id));
|
||||||
|
CREATE INDEX IF NOT EXISTS members_by_user ON members(user_id,chat_id);
|
||||||
|
CREATE TABLE IF NOT EXISTS messages(id uuid PRIMARY KEY DEFAULT gen_random_uuid(),chat_id uuid NOT NULL REFERENCES chats,sender_id uuid NOT NULL REFERENCES users,text text NOT NULL,created_at timestamptz(3) NOT NULL DEFAULT clock_timestamp());
|
||||||
|
CREATE INDEX IF NOT EXISTS history_key ON messages(chat_id,created_at,id);
|
||||||
Generated
+939
@@ -0,0 +1,939 @@
|
|||||||
|
{
|
||||||
|
"name": "mtusi-messenger-lab2",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "mtusi-messenger-lab2",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"fastify": "5.12.8",
|
||||||
|
"ioredis": "5.8.2",
|
||||||
|
"pg": "8.16.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "24.19.2",
|
||||||
|
"@types/pg": "8.15.6",
|
||||||
|
"typescript": "5.9.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.22.1 <27"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@fastify/ajv-compiler": {
|
||||||
|
"version": "4.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-4.0.8.tgz",
|
||||||
|
"integrity": "sha512-xYcAFYoyP/NELMgj6I7LmMAmiqeXMal0wsM2SgueN9OyMr6bVKHomO9OxuStC7bIAEl4Z3JXBbDPwpXRp59NPQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ajv": "^8.12.0",
|
||||||
|
"ajv-formats": "^3.0.1",
|
||||||
|
"fast-uri": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@fastify/deepmerge": {
|
||||||
|
"version": "3.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-3.2.4.tgz",
|
||||||
|
"integrity": "sha512-kc8GQq5gX9RRhw0rov3DMrN8wS8yRlxJRdDzsYwwdBV/wazuVgc/1K7CKL90tlvu3RlHan6Y0R0aE3nJtBz2eQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@fastify/error": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-mtIdc4R7HnUMOuUDQgnJkEF+Omr2p3JrSSJ44+RME/eAQ5TqdDy5MvXAjze/RyVHhJckuJKkXnMhKfPmFMKqyA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@fastify/fast-json-stringify-compiler": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-LPTVA0w4oPITWHAvox9NgI1rDSrjUnjxX6QN5MCb9FY+HqvDsUmgLucbj9eQakqC8lYwO7UgkDPHEQLJNl9vtg==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"fast-json-stringify": "^7.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@fastify/forwarded": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/forwarded/-/forwarded-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-89WiRG+hW3VQSfCwg4Hb8b43PeyEX15K5+lEfsZ4EUth/FyOjS/lv8HsVuswUNXWiSnxMGNouE/fq/0w3VumHQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@fastify/merge-json-schemas": {
|
||||||
|
"version": "0.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/merge-json-schemas/-/merge-json-schemas-0.2.2.tgz",
|
||||||
|
"integrity": "sha512-d/gx9sRbUCVgGRGzma46wLcwiY8noTqO2Nmjg/vbTARxHRE5bdh5PIL8s97Lt1X7ScRWRW52eVYxwIoPwIdVUA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dequal": "^2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@fastify/proxy-addr": {
|
||||||
|
"version": "5.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/proxy-addr/-/proxy-addr-5.1.3.tgz",
|
||||||
|
"integrity": "sha512-ptgIgB+abBNTs5lsKNvFaKMCauPaTOE6ZIjxJr3FxCLehmYQQKYGg4srwwNICR9QQlFrYw59jWAo+i9GalVCaw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@fastify/forwarded": "^3.0.0",
|
||||||
|
"ipaddr.js": "^2.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@ioredis/commands": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-aFT2yemJJo+TZCmieA7qnYGQooOS7QfNmYrzGtsYd3g9j5iDP8AimYYAesf79ohjbLG12XxC4nG5DyEnC88AsQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@pinojs/redact": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@pinojs/redact/-/redact-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@types/node": {
|
||||||
|
"version": "24.19.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz",
|
||||||
|
"integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"undici-types": ">=7.24.0 <7.24.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/pg": {
|
||||||
|
"version": "8.15.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.6.tgz",
|
||||||
|
"integrity": "sha512-NoaMtzhxOrubeL/7UZuNTrejB4MPAJ0RpxZqXQf2qXuVlTPuG6Y8p4u9dKRaue4yjmC7ZhzVO2/Yyyn25znrPQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*",
|
||||||
|
"pg-protocol": "*",
|
||||||
|
"pg-types": "^2.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/abstract-logging": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/ajv": {
|
||||||
|
"version": "8.20.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
|
||||||
|
"integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"fast-deep-equal": "^3.1.3",
|
||||||
|
"fast-uri": "^3.0.1",
|
||||||
|
"json-schema-traverse": "^1.0.0",
|
||||||
|
"require-from-string": "^2.0.2"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/epoberezkin"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ajv-formats": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ajv": "^8.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"ajv": "^8.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"ajv": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ajv/node_modules/fast-uri": {
|
||||||
|
"version": "3.1.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",
|
||||||
|
"integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "BSD-3-Clause"
|
||||||
|
},
|
||||||
|
"node_modules/atomic-sleep": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/avvio": {
|
||||||
|
"version": "9.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/avvio/-/avvio-9.3.1.tgz",
|
||||||
|
"integrity": "sha512-QyTKW61/qlba+cUQBm/sT9X8lri4UdomqSDwCnrnj1IvLVDRRiXRkz4CgBRWB+/cmfC7SK5WQc8T1vSdGvaUcQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@fastify/error": "^4.0.0",
|
||||||
|
"fastq": "^1.17.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cluster-key-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cookie": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-SL0cVuEdETEp7pN0FuZb01toc3vnODEfVUCooxG1SJN0yIirh7JMb9X9bvfCFf0vzzbT68RdbKDHYTiWy7a7iw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=22"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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/denque": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/dequal": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fast-decode-uri-component": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/fast-deep-equal": {
|
||||||
|
"version": "3.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||||
|
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/fast-json-stringify": {
|
||||||
|
"version": "7.3.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-7.3.10.tgz",
|
||||||
|
"integrity": "sha512-M8P1gBHMWlGzjHgRmZDCjAo+c50yjtG91Ej3CWmG2L8cX8Z5Ast5+vniZWvfyqKjfwrs85AiKisk4ADs6E6SkA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@fastify/merge-json-schemas": "^0.2.0",
|
||||||
|
"ajv": "^8.12.0",
|
||||||
|
"ajv-formats": "^3.0.1",
|
||||||
|
"fast-uri": "^4.0.0",
|
||||||
|
"json-schema-ref-resolver": "^3.0.0",
|
||||||
|
"rfdc": "^1.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fast-querystring": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"fast-decode-uri-component": "^1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fast-uri": {
|
||||||
|
"version": "4.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-4.2.4.tgz",
|
||||||
|
"integrity": "sha512-ARrctoImibWG27hlPe0Gc93d6HwZBYipqd9QhnXyYzS101vKmqx2J/1R8kzhnnYTph0umtJqu9rqIuYtVDaAOg==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "BSD-3-Clause"
|
||||||
|
},
|
||||||
|
"node_modules/fastify": {
|
||||||
|
"version": "5.12.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/fastify/-/fastify-5.12.8.tgz",
|
||||||
|
"integrity": "sha512-moP8exb2sCHLUbJkwp+I6C0padhy4D8lp0SdmzY7HhSdZuqm7O/u3o2aq7u8okaQ//33QDzj3G/u+FsSdB8Qzw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@fastify/ajv-compiler": "^4.0.5",
|
||||||
|
"@fastify/error": "^4.0.0",
|
||||||
|
"@fastify/fast-json-stringify-compiler": "^5.0.0",
|
||||||
|
"@fastify/proxy-addr": "^5.0.0",
|
||||||
|
"abstract-logging": "^2.0.1",
|
||||||
|
"avvio": "^9.0.0",
|
||||||
|
"fast-json-stringify": "^7.0.0",
|
||||||
|
"find-my-way": "^9.10.0",
|
||||||
|
"light-my-request": "^6.0.0",
|
||||||
|
"pino": "^9.14.0 || ^10.1.0",
|
||||||
|
"process-warning": "^5.1.0",
|
||||||
|
"rfdc": "^1.3.1",
|
||||||
|
"secure-json-parse": "^4.0.0",
|
||||||
|
"semver": "^7.6.0",
|
||||||
|
"toad-cache": "^3.7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fastq": {
|
||||||
|
"version": "1.20.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz",
|
||||||
|
"integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"reusify": "^1.0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/find-my-way": {
|
||||||
|
"version": "9.10.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-9.10.2.tgz",
|
||||||
|
"integrity": "sha512-gbLMuTm2FV5QiRh/eM0uhL4nyOvbSqqa2K3mASAtkIqxvY8ZmoLOCLMd2syLWT/SyhrvOR7GPxOKj/kcV6o8bg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"fast-deep-equal": "^3.1.3",
|
||||||
|
"fast-querystring": "^1.0.0",
|
||||||
|
"safe-regex2": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ioredis": {
|
||||||
|
"version": "5.8.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.8.2.tgz",
|
||||||
|
"integrity": "sha512-C6uC+kleiIMmjViJINWk80sOQw5lEzse1ZmvD+S/s8p8CWapftSaC+kocGTx6xrbrJ4WmYQGC08ffHLr6ToR6Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@ioredis/commands": "1.4.0",
|
||||||
|
"cluster-key-slot": "^1.1.0",
|
||||||
|
"debug": "^4.3.4",
|
||||||
|
"denque": "^2.1.0",
|
||||||
|
"lodash.defaults": "^4.2.0",
|
||||||
|
"lodash.isarguments": "^3.1.0",
|
||||||
|
"redis-errors": "^1.2.0",
|
||||||
|
"redis-parser": "^3.0.0",
|
||||||
|
"standard-as-callback": "^2.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.22.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/ioredis"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ipaddr.js": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-aq+t5NAc+cS6rZQQVWC2x98CPqGtKKTMDd4Gaodv0wShnItdKg/51djkGJ1hqH+Oy0ivDftCbSLCQob8zso01w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/json-schema-ref-resolver": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-w+HwgljXpVwZ3IidoUR1qPZxSOQ+NRQWuVe6a5pe8XbHsNZE4UAwVPUvzZagn7yBKbJtt6UJnRFYbNTRPZI45Q==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dequal": "^2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/json-schema-traverse": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/light-my-request": {
|
||||||
|
"version": "6.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-6.8.1.tgz",
|
||||||
|
"integrity": "sha512-20biUK0HAIPG9BZOK3/4s8uVAkAoi1+qW55lciHZCR0puTWipBgyMPEUjqXDWLjsZeqfO6DGsuwW5eyfsTGtyg==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"dependencies": {
|
||||||
|
"@fastify/deepmerge": "^3.1.0",
|
||||||
|
"cookie": "^2.0.0",
|
||||||
|
"process-warning": "^5.0.0",
|
||||||
|
"set-cookie-parser": "^3.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/lodash.defaults": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
|
||||||
|
"integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/lodash.isarguments": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"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/on-exit-leak-free": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pg": {
|
||||||
|
"version": "8.16.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz",
|
||||||
|
"integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"pg-connection-string": "^2.9.1",
|
||||||
|
"pg-pool": "^3.10.1",
|
||||||
|
"pg-protocol": "^1.10.3",
|
||||||
|
"pg-types": "2.2.0",
|
||||||
|
"pgpass": "1.0.5"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 16.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"pg-cloudflare": "^1.2.7"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"pg-native": ">=3.0.1"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"pg-native": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pg-cloudflare": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-6PQbsFWZcp9EmJEwy5cGQ2La+AMWpP46lgbb8X+U/XsHIUweYDNCpeuKck5RxL2MdVFi7krbbEi5nX4Zh7JhrQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"node_modules/pg-connection-string": {
|
||||||
|
"version": "2.14.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.14.1.tgz",
|
||||||
|
"integrity": "sha512-qR3kGNPBLpCNtz0evbKA0Y/MRFXwSSdT+pTJvYp/bXTcReZbvX1kzF0IyTc1QnxqF7AZbOeBhNL8R5mYQZV/MA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/pg-int8": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pg-pool": {
|
||||||
|
"version": "3.14.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.14.0.tgz",
|
||||||
|
"integrity": "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"pg": ">=8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pg-protocol": {
|
||||||
|
"version": "1.16.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.16.1.tgz",
|
||||||
|
"integrity": "sha512-p9VOFMiHB/ZbJATetbg+99PxssTVSQRnyuPSQ67mN1+1KBOjZaZ83ZQzltnxPhJwSsC3nwVjJ10DVJlerbFzLg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/pg-types": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"pg-int8": "1.0.1",
|
||||||
|
"postgres-array": "~2.0.0",
|
||||||
|
"postgres-bytea": "~1.0.0",
|
||||||
|
"postgres-date": "~1.0.4",
|
||||||
|
"postgres-interval": "^1.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pgpass": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"split2": "^4.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pino": {
|
||||||
|
"version": "10.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pino/-/pino-10.4.0.tgz",
|
||||||
|
"integrity": "sha512-bk1ZMTwG/Vymx+zPoa28MhNzucFvXJWp3csrSuxuHPSMeUettaCoQ5Jvg07mtC4JGNpcfTwz41oVCnNgBK9+vA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@pinojs/redact": "^0.4.0",
|
||||||
|
"atomic-sleep": "^1.0.0",
|
||||||
|
"on-exit-leak-free": "^2.1.0",
|
||||||
|
"pino-abstract-transport": "^3.0.0",
|
||||||
|
"pino-std-serializers": "^7.0.0",
|
||||||
|
"process-warning": "^5.0.0",
|
||||||
|
"quick-format-unescaped": "^4.0.3",
|
||||||
|
"real-require": "^1.0.0",
|
||||||
|
"safe-stable-stringify": "^2.3.1",
|
||||||
|
"sonic-boom": "^4.0.1",
|
||||||
|
"thread-stream": "^4.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"pino": "bin.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pino-abstract-transport": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"split2": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/pino-std-serializers": {
|
||||||
|
"version": "7.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.1.0.tgz",
|
||||||
|
"integrity": "sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/postgres-array": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postgres-bytea": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postgres-date": {
|
||||||
|
"version": "1.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
|
||||||
|
"integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postgres-interval": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"xtend": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/process-warning": {
|
||||||
|
"version": "5.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.1.1.tgz",
|
||||||
|
"integrity": "sha512-oCkNVj4OKnKEcocVBcDfiIugN1/cE6rgfT3nCtzeqZPA8+rIxMaQ0xXzIkGP8Gj2qUaP1UR7uhJ1VD8lUCpzCg==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/quick-format-unescaped": {
|
||||||
|
"version": "4.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
|
||||||
|
"integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/real-require": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/real-require/-/real-require-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-P4nbQYQfePJxRSmY+v/KINxVucm4NF3p3s7pJveMTtom52FR4YGltUQLB8idDXwDDWW+eYrWDFbuzUnjoWHF7g==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/redis-errors": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/redis-parser": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"redis-errors": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/require-from-string": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ret": {
|
||||||
|
"version": "0.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ret/-/ret-0.5.1.tgz",
|
||||||
|
"integrity": "sha512-Z/nyvABwcRnRD2mMP7Kz6G1dFZZqX1mNErOnxF42OCQKE07b9k9hK9SQxHL3LFEZUdzQaLM4dId1E/E6Vm4WhA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/reusify": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"iojs": ">=1.0.0",
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/rfdc": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/safe-regex2": {
|
||||||
|
"version": "5.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.1.2.tgz",
|
||||||
|
"integrity": "sha512-tAtCGFPPP02VroDVzp4daGi6bC7jWG+41D47GKf18FeH/ubvKQHT9VmhAkvtjNOmJwqtApzWeUpEhkyEYULvmw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ret": "~0.5.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"safe-regex2": "bin/safe-regex2.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/safe-stable-stringify": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/secure-json-parse": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-lnd81MQEZKjhW/Gd2TQqdd4XP6QYNdDW/EP+I7nTrFHP9y2LmaGPIHk9xsnzcOiEr1c39c/e84xFgGviQKBTRw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "BSD-3-Clause"
|
||||||
|
},
|
||||||
|
"node_modules/semver": {
|
||||||
|
"version": "7.8.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz",
|
||||||
|
"integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"bin": {
|
||||||
|
"semver": "bin/semver.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/set-cookie-parser": {
|
||||||
|
"version": "3.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.2.3.tgz",
|
||||||
|
"integrity": "sha512-bDO7NdAkLprNt3BNl3LAh0oVnOS5+WspzxOxiboo7vRIyTqj2pvFmNWYEFynSGQgpJ+7yG/9nc/aSG20UDBUpg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/sonic-boom": {
|
||||||
|
"version": "4.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.1.tgz",
|
||||||
|
"integrity": "sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"atomic-sleep": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/split2": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
|
||||||
|
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/standard-as-callback": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/thread-stream": {
|
||||||
|
"version": "4.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-4.2.1.tgz",
|
||||||
|
"integrity": "sha512-Stg6edJXC/6/xqGwSXwFokrUhChJ18amEjpKH89WrQQ0oVFDF+pUUcTpiwWhFUrE89Vf16FBOlwhaw+lescxMQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"real-require": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/toad-cache": {
|
||||||
|
"version": "3.7.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.4.tgz",
|
||||||
|
"integrity": "sha512-m1TdR/rvT7kgGJZhspNtXdsdYk0fddFpJJFlG5s+UkPFo6lkLoZ3YLOaovPYjq1R75NP5JfeTlSHaOsE09peCg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/typescript": {
|
||||||
|
"version": "5.9.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||||
|
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/undici-types": {
|
||||||
|
"version": "7.24.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
|
||||||
|
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/xtend": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "mtusi-messenger-lab2",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.22.1 <27"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc -p tsconfig.json",
|
||||||
|
"start": "node dist/server.js",
|
||||||
|
"test": "npm run build && node --test student-tests/*.test.mjs"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"fastify": "5.12.8",
|
||||||
|
"pg": "8.16.3",
|
||||||
|
"ioredis": "5.8.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "24.19.2",
|
||||||
|
"typescript": "5.9.3",
|
||||||
|
"@types/pg": "8.15.6"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
"""Checks the level-four database and cache failure paths on the isolated Compose project."""
|
||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
|
from pathlib import Path
|
||||||
|
import base64,os,subprocess,sys,time,uuid
|
||||||
|
root=Path(__file__).resolve().parents[1];os.chdir(root);sys.path.insert(0,str(root/'tests'))
|
||||||
|
from client import Client
|
||||||
|
def compose(*args,env=None):subprocess.run(['docker','compose',*args],check=True,env=env,stdout=subprocess.DEVNULL)
|
||||||
|
def ready(c):
|
||||||
|
for i in range(60):
|
||||||
|
try:c.call('GET','/health/ready',schema='Health');return
|
||||||
|
except AssertionError:time.sleep(1)
|
||||||
|
raise RuntimeError('readiness deadline')
|
||||||
|
c=Client();a,b,_,chat=c.bootstrap()
|
||||||
|
body={**a['registration'],'username':'race_'+uuid.uuid4().hex[:12]}
|
||||||
|
with ThreadPoolExecutor(8) as pool:
|
||||||
|
codes=list(pool.map(lambda _:Client().call('POST','/api/v1/users',(201,409),body=body)['status'],range(8)))
|
||||||
|
assert sorted(codes)==[201]+[409]*7
|
||||||
|
def count():
|
||||||
|
return subprocess.check_output(['docker','compose','exec','-T','db','psql','-U','lab','-d','lab','-XAtc','SELECT count(*) FROM chats'],text=True)
|
||||||
|
before=count();c.call('POST','/api/v1/chats',400,actor=a,body={'title':'rollback','member_ids':[a['id'],str(uuid.uuid4())]});assert count()==before
|
||||||
|
try:
|
||||||
|
compose('stop','cache');c.call('GET','/api/v1/users/me',actor=a,schema='User');c.call('GET','/api/v1/users/me',401)
|
||||||
|
finally:compose('start','cache')
|
||||||
|
try:
|
||||||
|
compose('stop','db');c.call('GET','/health/live',schema='Health');c.call('GET','/health/ready',503);c.call('GET','/api/v1/users/me',503,actor=a)
|
||||||
|
finally:compose('start','db');ready(c)
|
||||||
|
try:
|
||||||
|
compose('up','-d','--no-deps','api',env={**os.environ,'SESSION_TTL_SECONDS':'2'});ready(c)
|
||||||
|
actor=c.user('expiry');time.sleep(3);c.call('GET','/api/v1/users/me',401,actor=actor)
|
||||||
|
finally:compose('up','-d','--no-deps','api');ready(c)
|
||||||
|
print('Concurrent registration, rollback, cache outage, DB outage and session expiry passed.')
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
umask 077
|
||||||
|
if [ -e .env ]; then echo 'Using existing .env'; exit 0; fi
|
||||||
|
set -C
|
||||||
|
{
|
||||||
|
printf 'PG_PASS=%s\n' "$(openssl rand -hex 24)"
|
||||||
|
printf 'CACHE_PASS=%s\n' "$(openssl rand -hex 24)"
|
||||||
|
} > .env
|
||||||
Executable
+42
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
runid=$(date +%Y%m%d%H%M%S)
|
||||||
|
out=evidence/plans-$runid
|
||||||
|
mkdir -p "$out"
|
||||||
|
src=bench_$runid; restored=restore_$runid
|
||||||
|
pg=(docker compose exec -T db)
|
||||||
|
"${pg[@]}" createdb -U lab "$src"
|
||||||
|
"${pg[@]}" createdb -U lab "$restored"
|
||||||
|
sql=("${pg[@]}" psql -X -U lab -v ON_ERROR_STOP=1 -d "$src")
|
||||||
|
"${sql[@]}" < migrations/001.sql >/dev/null
|
||||||
|
"${sql[@]}" > "$out/plans.txt" <<'SQL'
|
||||||
|
\timing on
|
||||||
|
INSERT INTO users(username,display_name,salt,hash) VALUES('bench','Bench','dummy','dummy');
|
||||||
|
INSERT INTO chats(title) SELECT 'c'||g FROM generate_series(1,10) g;
|
||||||
|
CREATE TEMP TABLE seed AS SELECT c.id chat_id,u.id sender_id,'sample '||g AS text FROM generate_series(1,100000) g JOIN chats c ON c.title='c'||CASE WHEN g<=90000 THEN 1 ELSE 2+g%9 END CROSS JOIN users u;
|
||||||
|
DROP INDEX history_key;
|
||||||
|
CREATE TABLE alternative (LIKE messages INCLUDING ALL);
|
||||||
|
ALTER TABLE alternative ADD FOREIGN KEY(chat_id) REFERENCES chats, ADD FOREIGN KEY(sender_id) REFERENCES users;
|
||||||
|
CREATE INDEX alt_chat ON alternative(chat_id);
|
||||||
|
INSERT INTO alternative(chat_id,sender_id,text) SELECT * FROM seed;
|
||||||
|
CREATE INDEX history_key ON messages(chat_id,created_at,id);
|
||||||
|
INSERT INTO messages(chat_id,sender_id,text) SELECT * FROM seed;
|
||||||
|
ANALYZE messages;
|
||||||
|
ANALYZE alternative;
|
||||||
|
SELECT id AS cid FROM chats WHERE title='c1' \gset
|
||||||
|
EXPLAIN(ANALYZE,BUFFERS) SELECT * FROM alternative WHERE chat_id=:'cid' ORDER BY created_at DESC,id DESC LIMIT 51;
|
||||||
|
EXPLAIN(ANALYZE,BUFFERS) SELECT * FROM messages WHERE chat_id=:'cid' ORDER BY created_at DESC,id DESC LIMIT 51;
|
||||||
|
DROP TABLE alternative;
|
||||||
|
SQL
|
||||||
|
start=$SECONDS
|
||||||
|
"${pg[@]}" pg_dump -Fc -U lab "$src" > "$out/benchmark.dump"
|
||||||
|
echo "dump_seconds=$((SECONDS-start))" > "$out/recovery.txt"
|
||||||
|
start=$SECONDS
|
||||||
|
"${pg[@]}" pg_restore --exit-on-error -U lab -d "$restored" < "$out/benchmark.dump"
|
||||||
|
echo "restore_seconds=$((SECONDS-start))" >> "$out/recovery.txt"
|
||||||
|
for database in "$src" "$restored"; do
|
||||||
|
"${pg[@]}" psql -XAt -U lab -d "$database" -c "SELECT count(*),md5(string_agg(id::text||chat_id::text||sender_id::text||text||created_at::text,'' ORDER BY id)) FROM messages" > "$out/$database.digest"
|
||||||
|
done
|
||||||
|
diff -u "$out/$src.digest" "$out/$restored.digest"
|
||||||
|
echo "Databases retained: $src and $restored"
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
docker compose restart db cache api
|
||||||
+108
@@ -0,0 +1,108 @@
|
|||||||
|
import Fastify, { LogController } from 'fastify';
|
||||||
|
import type { FastifyError, FastifyReply, FastifyRequest } from 'fastify';
|
||||||
|
import { randomUUID } from 'node:crypto';
|
||||||
|
import { ApiError, invalid, notFound } from './errors.js';
|
||||||
|
import type { CreateChat, User } from './models.js';
|
||||||
|
import { bodies, nonBlank, pagination, uuid } from './validation.js';
|
||||||
|
import { chat,list,createChat } from './store.js';
|
||||||
|
import { register,login,identify,bearer } from './auth.js';
|
||||||
|
import { db,cache } from './db.js';
|
||||||
|
|
||||||
|
declare module 'fastify' {
|
||||||
|
interface FastifyRequest { actor: User | null }
|
||||||
|
}
|
||||||
|
|
||||||
|
export function buildApp(options: { logLevel?: string } = {}) {
|
||||||
|
|
||||||
|
const app = Fastify({
|
||||||
|
logger: { level: options.logLevel ?? 'info' },
|
||||||
|
logController: new LogController({ disableRequestLogging: true }),
|
||||||
|
genReqId: () => randomUUID(),
|
||||||
|
requestIdHeader: false,
|
||||||
|
bodyLimit: 65_536,
|
||||||
|
requestTimeout: 10_000,
|
||||||
|
connectionTimeout: 10_000,
|
||||||
|
forceCloseConnections: 'idle',
|
||||||
|
return503OnClosing: false,
|
||||||
|
// Ошибки маршрутизатора возникают ещё до onRequest/setErrorHandler.
|
||||||
|
frameworkErrors: (error: FastifyError, request: FastifyRequest, reply: FastifyReply) => {
|
||||||
|
const badRequest = ['FST_ERR_BAD_URL', 'FST_ERR_MAX_PARAM_LENGTH'].includes(error.code);
|
||||||
|
reply.header('X-Request-Id', request.id).code(badRequest ? 400 : 500).send({
|
||||||
|
error: { code: badRequest ? 'invalid_request' : 'internal_error',
|
||||||
|
message: badRequest ? 'Invalid URL' : 'Internal server error', request_id: request.id },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
ajv: { customOptions: { coerceTypes: false, removeAdditional: false, useDefaults: false } },
|
||||||
|
});
|
||||||
|
// Отвергаем повреждённый UTF-8 вместо молчаливой замены символов на �.
|
||||||
|
// JSON-парсер Fastify сохраняет защиту от __proto__/constructor.
|
||||||
|
const parseJson = app.getDefaultJsonParser('error', 'error');
|
||||||
|
app.removeAllContentTypeParsers();
|
||||||
|
app.addContentTypeParser('application/json', { parseAs: 'buffer' }, (request, body, done) => {
|
||||||
|
try {
|
||||||
|
if (!Buffer.isBuffer(body)) return done(new ApiError(400, 'invalid_request', 'Invalid JSON encoding'));
|
||||||
|
parseJson(request, new TextDecoder('utf-8', { fatal: true }).decode(body), done);
|
||||||
|
} catch {
|
||||||
|
done(new ApiError(400, 'invalid_request', 'Invalid JSON encoding'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let draining = false;
|
||||||
|
app.decorateRequest('actor', null);
|
||||||
|
app.addHook('preClose', async () => { draining = true; });
|
||||||
|
app.addHook('onRequest', async (request, reply) => {
|
||||||
|
reply.header('X-Request-Id', request.id);
|
||||||
|
if (draining) throw new ApiError(503, 'unavailable', 'Server is stopping');
|
||||||
|
});
|
||||||
|
app.addHook('onResponse', async (request, reply) => {
|
||||||
|
// Только метод, шаблон пути и результат. Ни body, ни заголовков, ни query.
|
||||||
|
request.log.info({ method: request.method, route: request.routeOptions.url ?? 'unmatched',
|
||||||
|
status: reply.statusCode, duration_ms: reply.elapsedTime }, 'request completed');
|
||||||
|
});
|
||||||
|
app.setErrorHandler<FastifyError>((error, request, reply) => {
|
||||||
|
let failure: ApiError;
|
||||||
|
if (error instanceof ApiError) failure = error;
|
||||||
|
else if(error.code==='23505') failure=new ApiError(409,'conflict','Already exists');
|
||||||
|
else if (/^(08|53|57P|ECONN|ETIMEDOUT|EPIPE|ENOTFOUND)/.test(error.code??'') || /connection|timeout/i.test(error.message)||'$metadata' in error) failure=new ApiError(503,'unavailable','Dependency unavailable');
|
||||||
|
else if (error.validation || error.statusCode === 400) failure = new ApiError(400, 'invalid_request', 'Invalid request');
|
||||||
|
else if (error.statusCode === 413) failure = new ApiError(413, 'payload_too_large', 'Request body is too large');
|
||||||
|
else if (error.statusCode === 415) failure = new ApiError(415, 'unsupported_media_type', 'Use application/json');
|
||||||
|
else {
|
||||||
|
failure = new ApiError(500, 'internal_error', 'Internal server error');
|
||||||
|
request.log.error({ code: 'internal_error' }, 'unexpected request failure');
|
||||||
|
}
|
||||||
|
if(failure.statusCode===401) reply.header('WWW-Authenticate',request.routeOptions.url==='/api/v1/auth/sessions'?'Basic realm="messenger", charset="UTF-8"':'Bearer realm="messenger"');
|
||||||
|
reply.header('X-Request-Id', request.id).code(failure.statusCode).send({
|
||||||
|
error: { code: failure.code, message: failure.message, request_id: request.id },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
app.setNotFoundHandler(() => notFound());
|
||||||
|
|
||||||
|
app.get('/health/live', async () => ({status:'ok'}));
|
||||||
|
app.get('/health/ready', async () => {await db.query('SELECT 1'); /* STORAGE_HEALTH */ return {status:'ok'};});
|
||||||
|
app.post<{Body:{username:string;display_name:string;password:string}}>('/api/v1/users',{schema:{body:bodies.user}},async(req,res)=>res.code(201).send(await register(req.body)));
|
||||||
|
app.post('/api/v1/auth/sessions',async(req,res)=>{
|
||||||
|
if(req.body!==undefined||Number(req.headers['content-length']??0)>0)invalid('Unexpected body');
|
||||||
|
return res.code(201).send(await login(req.headers.authorization));
|
||||||
|
});
|
||||||
|
app.register(async api=>{
|
||||||
|
api.addHook('onRequest',async req=>{req.actor=await identify(req.headers.authorization);});
|
||||||
|
api.get('/api/v1/users/me',async req=>req.actor!);
|
||||||
|
api.delete('/api/v1/auth/sessions/current',async(req,res)=>{await db.query('DELETE FROM sessions WHERE token_hash=$1',[bearer(req.headers.authorization)]);return res.code(204).send();});
|
||||||
|
api.post<{Body:CreateChat}>('/api/v1/chats',{schema:{body:bodies.chat}},async(req,res)=>res.code(201).send(await createChat(req.body,req.actor!.id)));
|
||||||
|
api.get('/api/v1/chats',async req=>list('chats',req.actor!.id,pagination(req.query)));
|
||||||
|
api.get<{Params:{chat_id:string}}>('/api/v1/chats/:chat_id',async req=>chat(req.params.chat_id,req.actor!.id));
|
||||||
|
api.get<{Params:{chat_id:string}}>('/api/v1/chats/:chat_id/messages',async req=>{
|
||||||
|
await chat(req.params.chat_id,req.actor!.id);return list('messages',uuid(req.params.chat_id),pagination(req.query));
|
||||||
|
});
|
||||||
|
api.post<{Body:{text:string;attachment_ids?:string[]};Params:{chat_id:string}}>('/api/v1/chats/:chat_id/messages',{schema:{body:bodies.message}},async(req,res)=>{
|
||||||
|
const user=req.actor!.id, id=uuid(req.params.chat_id);
|
||||||
|
await chat(id,user);
|
||||||
|
nonBlank(req.body.text);
|
||||||
|
const msg=await db.query('INSERT INTO messages(chat_id,sender_id,text) VALUES($1,$2,$3) RETURNING id,chat_id,sender_id,text,created_at',[id,user,req.body.text]);
|
||||||
|
return res.code(201).send(msg.rows[0]);
|
||||||
|
});
|
||||||
|
// FILE_ROUTES
|
||||||
|
});
|
||||||
|
app.addHook('onClose',async()=>{cache.disconnect();await db.end();});
|
||||||
|
return app;
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
import { randomBytes, createHash, timingSafeEqual, scrypt } from 'node:crypto';
|
||||||
|
import { ApiError, invalid } from './errors.js';
|
||||||
|
import { db, cache } from './db.js';
|
||||||
|
import { nonBlank } from './validation.js';
|
||||||
|
const publicFields='id, username, display_name, created_at';
|
||||||
|
const denied=()=>new ApiError(401,'unauthorized','Invalid credentials');
|
||||||
|
import {basic} from './basic.js';
|
||||||
|
export const digest=(s:string)=>createHash('sha256').update(s).digest('hex');
|
||||||
|
function derive(p:string,s:string):Promise<Buffer>{return new Promise((ok,fail)=>scrypt(p,s,32,(e,b)=>e?fail(e):ok(b)));}
|
||||||
|
export async function register(input:{username:string;display_name:string;password:string}){
|
||||||
|
nonBlank(input.display_name);nonBlank(input.password);
|
||||||
|
if(/[^a-z0-9_]/.test(input.username))invalid();
|
||||||
|
const salt=randomBytes(16).toString('hex');
|
||||||
|
const hash=(await derive(input.password,salt)).toString('hex');
|
||||||
|
return (await db.query('INSERT INTO users(username,display_name,salt,hash) VALUES($1,$2,$3,$4) RETURNING '+publicFields,[input.username,input.display_name,salt,hash])).rows[0];
|
||||||
|
}
|
||||||
|
export async function login(header:string|undefined){
|
||||||
|
const [name,password]=basic(header);
|
||||||
|
if([...password].length<12||[...password].length>128)throw denied();
|
||||||
|
const row=(await db.query('SELECT '+publicFields+', salt, hash FROM users WHERE username=$1',[name])).rows[0];
|
||||||
|
const candidate=await derive(password,row?.salt??'missing-user-salt');
|
||||||
|
if(!row||!timingSafeEqual(candidate,Buffer.from(row.hash,'hex')))throw denied();
|
||||||
|
const {salt,hash,...user}=row;
|
||||||
|
const token=randomBytes(32).toString('base64url');
|
||||||
|
const ttl=Number(process.env.SESSION_TTL_SECONDS??3600);
|
||||||
|
if(!Number.isSafeInteger(ttl)||ttl<1)throw Error('Invalid session TTL');
|
||||||
|
const session=await db.query("INSERT INTO sessions(token_hash,user_id,expires_at) VALUES($1,$2,now()+$3*interval '1 second') RETURNING expires_at",[digest(token),row.id,ttl]);
|
||||||
|
return {token,token_type:'Bearer',expires_at:session.rows[0].expires_at,user};
|
||||||
|
}
|
||||||
|
export function bearer(header:string|undefined){const m=/^Bearer ([\w-]{43})$/i.exec(header??'');if(!m)throw denied();return digest(m[1]!);}
|
||||||
|
export async function identify(header:string|undefined){
|
||||||
|
const session=await db.query('SELECT user_id FROM sessions WHERE token_hash=$1 AND expires_at>now()',[bearer(header)]);
|
||||||
|
if(!session.rowCount)throw denied();
|
||||||
|
const id=session.rows[0].user_id,key='profile:'+id;
|
||||||
|
const cached=await cache.get(key).catch(()=>null);
|
||||||
|
if(cached)return JSON.parse(cached);
|
||||||
|
const user=(await db.query('SELECT '+publicFields+' FROM users WHERE id=$1',[id])).rows[0];
|
||||||
|
await cache.set(key,JSON.stringify(user),'EX',60).catch(()=>{});
|
||||||
|
return user;
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import {ApiError} from './errors.js';
|
||||||
|
const denied=()=>new ApiError(401,'unauthorized','Invalid credentials');
|
||||||
|
export function basic(header:string|undefined){
|
||||||
|
const m=/^Basic ([A-Za-z0-9+/]+=*)$/i.exec(header??'');
|
||||||
|
if(!m)throw denied();
|
||||||
|
const raw=Buffer.from(m[1]!,'base64');if(raw.toString('base64')!==m[1])throw denied();
|
||||||
|
let s:string; try{s=new TextDecoder('utf-8',{fatal:true}).decode(raw);}catch{throw denied();}
|
||||||
|
const i=s.indexOf(':');if(i<3||i>32)throw denied();
|
||||||
|
return [s.slice(0,i),s.slice(i+1)] as const;
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import { invalid } from './errors.js';
|
||||||
|
import type { Key, Page } from './models.js';
|
||||||
|
import type { Pagination } from './validation.js';
|
||||||
|
import { uuidPattern } from './validation.js';
|
||||||
|
|
||||||
|
interface Cursor extends Key { v: 1; resource: string }
|
||||||
|
|
||||||
|
export function compareKeys(a: Key, b: Key): number {
|
||||||
|
// Время генерируется только в одном формате ISO UTC с миллисекундами,
|
||||||
|
// UUID — lowercase. Для них лексикографический порядок совпадает с требуемым.
|
||||||
|
return a.created_at < b.created_at ? -1 : a.created_at > b.created_at ? 1
|
||||||
|
: a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function encode(key: Key, resource: string): string {
|
||||||
|
const cursor: Cursor = { v: 1, resource, created_at: key.created_at, id: key.id };
|
||||||
|
return Buffer.from(JSON.stringify(cursor)).toString('base64url');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function decode(raw: string, resource: string): Key {
|
||||||
|
// Buffer.from сам по себе допускает мусор: сначала проверяем алфавит,
|
||||||
|
// затем обратное кодирование, UTF-8, точный набор полей и их смысл.
|
||||||
|
try {
|
||||||
|
if (raw.length > 1024 || !/^[A-Za-z0-9_-]+$/.test(raw)) invalid('Invalid cursor');
|
||||||
|
const bytes = Buffer.from(raw, 'base64url');
|
||||||
|
if (bytes.toString('base64url') !== raw) invalid('Invalid cursor');
|
||||||
|
const value: unknown = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
|
||||||
|
if (!value || typeof value !== 'object' || Array.isArray(value)) invalid('Invalid cursor');
|
||||||
|
const c = value as Record<string, unknown>;
|
||||||
|
if (Object.keys(c).sort().join(',') !== 'created_at,id,resource,v'
|
||||||
|
|| c.v !== 1 || c.resource !== resource
|
||||||
|
|| typeof c.id !== 'string' || c.id.length !== 36 || !uuidPattern.test(c.id)
|
||||||
|
|| c.id !== c.id.toLowerCase()
|
||||||
|
|| typeof c.created_at !== 'string'
|
||||||
|
|| new Date(c.created_at).toISOString() !== c.created_at) invalid('Invalid cursor');
|
||||||
|
const key = { id: c.id, created_at: c.created_at };
|
||||||
|
// Единая каноническая форма также отвергает дубли JSON-ключей.
|
||||||
|
if (encode(key, resource) !== raw) invalid('Invalid cursor');
|
||||||
|
return key;
|
||||||
|
} catch {
|
||||||
|
return invalid('Invalid cursor');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function lowerBound(items: readonly Key[], target: Key): number {
|
||||||
|
let lo = 0, hi = items.length;
|
||||||
|
while (lo < hi) {
|
||||||
|
const mid = lo + Math.floor((hi - lo) / 2);
|
||||||
|
if (compareKeys(items[mid]!, target) < 0) lo = mid + 1;
|
||||||
|
else hi = mid;
|
||||||
|
}
|
||||||
|
return lo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function page<T extends Key>(items: readonly T[], resource: string, query: Pagination, sorted = false): Page<T> {
|
||||||
|
// Baseline для будущего исследования: сортировка на каждом чтении.
|
||||||
|
const ordered = sorted ? items : [...items].sort(compareKeys);
|
||||||
|
let start = 0;
|
||||||
|
if (query.cursor !== undefined) {
|
||||||
|
const key = decode(query.cursor, resource);
|
||||||
|
const anchor = sorted ? lowerBound(ordered, key) : ordered.findIndex(item => compareKeys(item, key) === 0);
|
||||||
|
if (!ordered[anchor] || compareKeys(ordered[anchor]!, key) !== 0) invalid('Invalid cursor');
|
||||||
|
start = anchor + 1;
|
||||||
|
}
|
||||||
|
const selected = ordered.slice(start, start + query.limit);
|
||||||
|
const last = selected.at(-1);
|
||||||
|
return {
|
||||||
|
items: selected,
|
||||||
|
next_cursor: last && start + selected.length < ordered.length ? encode(last, resource) : null,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import pg from 'pg';
|
||||||
|
import { Redis } from 'ioredis';
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
export function setting(name:string):string {
|
||||||
|
const file=process.env[name+'_FILE'];
|
||||||
|
const value=file?readFileSync(file,'utf8').trim():process.env[name];
|
||||||
|
if(!value) throw Error('Missing configuration: '+name);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
export const db=new pg.Pool({connectionString:setting('DATABASE_URL'),max:Number(process.env.PG_POOL_SIZE??8),connectionTimeoutMillis:2000,statement_timeout:4000});
|
||||||
|
db.on('error', () => {
|
||||||
|
console.warn('PostgreSQL idle connection lost');
|
||||||
|
});
|
||||||
|
export const cache=new Redis(setting('CACHE_URL'),{connectTimeout:800,commandTimeout:600,maxRetriesPerRequest:0,enableOfflineQueue:false});
|
||||||
|
cache.on('error',()=>{}); // Optional cache. PostgreSQL always authorizes the session.
|
||||||
|
export async function transaction<T>(fn:(client:pg.PoolClient)=>Promise<T>):Promise<T>{
|
||||||
|
const c=await db.connect();
|
||||||
|
try {await c.query('BEGIN'); const value=await fn(c); await c.query('COMMIT');return value;}
|
||||||
|
catch(error){await c.query('ROLLBACK').catch(()=>{});throw error;}
|
||||||
|
finally{c.release();}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
export type ErrorCode =
|
||||||
|
| 'invalid_request' | 'unauthorized' | 'not_found' | 'conflict'
|
||||||
|
| 'payload_too_large' | 'unsupported_media_type' | 'unavailable' | 'internal_error';
|
||||||
|
|
||||||
|
export class ApiError extends Error {
|
||||||
|
constructor(readonly statusCode: number, readonly code: ErrorCode, message: string) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function invalid(message = 'Invalid request'): never {
|
||||||
|
throw new ApiError(400, 'invalid_request', message);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function notFound(): never {
|
||||||
|
// Одинаковый ответ для отсутствующего и чужого чата.
|
||||||
|
throw new ApiError(404, 'not_found', 'Object not found');
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { readdir,readFile } from 'node:fs/promises';
|
||||||
|
import {db,cache,transaction} from './db.js';
|
||||||
|
try{
|
||||||
|
await transaction(async c=>{
|
||||||
|
await c.query('SELECT pg_advisory_xact_lock(763921)');
|
||||||
|
await c.query('CREATE TABLE IF NOT EXISTS migrations(name text PRIMARY KEY)');
|
||||||
|
for(const name of (await readdir('migrations')).filter(s=>s.endsWith('.sql')).sort()){
|
||||||
|
if((await c.query('SELECT 1 FROM migrations WHERE name=$1',[name])).rowCount)continue;
|
||||||
|
await c.query(await readFile('migrations/'+name,'utf8'));await c.query('INSERT INTO migrations VALUES($1)',[name]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}finally{cache.disconnect();await db.end();}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
export interface Key { id: string; created_at: string }
|
||||||
|
export interface CreateUser { username: string; display_name: string }
|
||||||
|
export interface User extends Key, CreateUser {}
|
||||||
|
export interface CreateChat { title: string; member_ids: string[] }
|
||||||
|
export interface Chat extends Key, CreateChat {}
|
||||||
|
export interface CreateMessage { text: string }
|
||||||
|
export interface Message extends Key, CreateMessage { chat_id: string; sender_id: string }
|
||||||
|
export interface Page<T> { items: T[]; next_cursor: string | null }
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import { buildApp } from './app.js';
|
||||||
|
|
||||||
|
const host = process.env.APP_HOST ?? '127.0.0.1';
|
||||||
|
const portText = process.env.APP_PORT ?? '8080';
|
||||||
|
const port = Number(portText);
|
||||||
|
const logLevel = process.env.LOG_LEVEL ?? 'info';
|
||||||
|
if (portText.length === 0 || /[^0-9]/.test(portText) || !Number.isInteger(port) || port < 0 || port > 65535
|
||||||
|
|| !['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'].includes(logLevel)) {
|
||||||
|
console.error('Invalid APP_PORT or LOG_LEVEL');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const app = buildApp({ logLevel });
|
||||||
|
let stopping = false;
|
||||||
|
async function shutdown(signal: string) {
|
||||||
|
if (stopping) return;
|
||||||
|
stopping = true;
|
||||||
|
app.log.info({ signal }, 'shutdown started');
|
||||||
|
// Обычные запросы завершаются через close(). Медленный/зависший клиент
|
||||||
|
// не должен держать процесс дольше обещанных 10 секунд.
|
||||||
|
const deadline = setTimeout(() => {
|
||||||
|
app.log.error('shutdown deadline exceeded');
|
||||||
|
app.server.closeAllConnections();
|
||||||
|
process.exit(1);
|
||||||
|
}, 8_000);
|
||||||
|
deadline.unref();
|
||||||
|
try {
|
||||||
|
await app.close();
|
||||||
|
clearTimeout(deadline);
|
||||||
|
app.log.info('shutdown completed');
|
||||||
|
} catch {
|
||||||
|
clearTimeout(deadline);
|
||||||
|
app.log.error('shutdown failed');
|
||||||
|
process.exitCode = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
process.on('SIGTERM', () => { void shutdown('SIGTERM'); });
|
||||||
|
process.on('SIGINT', () => { void shutdown('SIGINT'); });
|
||||||
|
|
||||||
|
try {
|
||||||
|
await app.listen({ host, port });
|
||||||
|
} catch {
|
||||||
|
app.log.error('server startup failed');
|
||||||
|
process.exitCode = 1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import { db, transaction } from './db.js';
|
||||||
|
import { invalid, notFound } from './errors.js';
|
||||||
|
import { uuid, nonBlank } from './validation.js';
|
||||||
|
import type { Pagination } from './validation.js';
|
||||||
|
import { encode, decode } from './cursor.js';
|
||||||
|
const chatColumns='c.id,c.title,c.created_at,(SELECT array_agg(user_id ORDER BY user_id) FROM members WHERE chat_id=c.id) AS member_ids';
|
||||||
|
const msgColumns='m.id,m.chat_id,m.sender_id,m.text,m.created_at'; // ATTACH_COLUMNS
|
||||||
|
export async function chat(id:string,user:string){
|
||||||
|
const r=await db.query('SELECT '+chatColumns+' FROM chats c JOIN members me ON me.chat_id=c.id WHERE c.id=$1 AND me.user_id=$2',[uuid(id),user]);
|
||||||
|
return r.rows[0]??notFound();
|
||||||
|
}
|
||||||
|
export async function createChat(input:{title:string;member_ids:string[]},user:string){
|
||||||
|
nonBlank(input.title);
|
||||||
|
const members=input.member_ids.map(uuid);
|
||||||
|
if(!members.includes(user)||new Set(members).size!==members.length)invalid();
|
||||||
|
return transaction(async c=>{
|
||||||
|
const users=await c.query('SELECT id FROM users WHERE id=ANY($1::uuid[])',[members]);
|
||||||
|
if(users.rowCount!==members.length)invalid('Unknown member');
|
||||||
|
const row=(await c.query('INSERT INTO chats(title) VALUES($1) RETURNING *',[input.title])).rows[0];
|
||||||
|
await c.query('INSERT INTO members SELECT $1, unnest($2::uuid[])',[row.id,members]);
|
||||||
|
return {...row,member_ids:members.sort()};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export async function list(kind:'messages'|'chats',scope:string,q:Pagination){
|
||||||
|
const resource=kind+':'+scope;
|
||||||
|
const key=q.cursor?decode(q.cursor,resource):undefined;
|
||||||
|
const table=kind==='messages'?'messages m':'chats c JOIN members me ON me.chat_id=c.id';
|
||||||
|
const alias=kind==='messages'?'m':'c';
|
||||||
|
const filter=kind==='messages'?'m.chat_id=$1':'me.user_id=$1';
|
||||||
|
const cols=kind==='messages'?msgColumns:chatColumns;
|
||||||
|
const where=' FROM '+table+' WHERE '+filter;
|
||||||
|
const args:(string|number)[]=[scope];
|
||||||
|
let after='';
|
||||||
|
if(key){
|
||||||
|
if(!(await db.query('SELECT 1'+where+' AND '+alias+'.id=$2 AND '+alias+'.created_at=$3',[scope,key.id,key.created_at])).rowCount)invalid('Invalid cursor');
|
||||||
|
args.push(key.created_at,key.id);
|
||||||
|
after=' AND ('+alias+'.created_at,'+alias+'.id)>($2,$3)';
|
||||||
|
}
|
||||||
|
args.push(q.limit+1);
|
||||||
|
const {rows}=await db.query('SELECT '+cols+where+after+' ORDER BY '+alias+'.created_at,'+alias+'.id LIMIT $'+args.length,args);
|
||||||
|
const more=rows.length>q.limit;if(more)rows.pop();
|
||||||
|
const last=rows.at(-1);
|
||||||
|
return {items:rows,next_cursor:more?encode({id:last.id,created_at:last.created_at.toISOString()},resource):null};
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { invalid } from './errors.js';
|
||||||
|
|
||||||
|
// Схемы тел берём непосредственно из неизменённого контракта преподавателя.
|
||||||
|
const contract = JSON.parse(readFileSync(new URL('../contracts/openapi.json', import.meta.url), 'utf8'));
|
||||||
|
export const bodies = {
|
||||||
|
user: contract.components.schemas.CreateUser,
|
||||||
|
chat: contract.components.schemas.CreateChat,
|
||||||
|
message: contract.components.schemas.CreateMessage,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
||||||
|
|
||||||
|
export function uuid(value: unknown): string {
|
||||||
|
if (typeof value !== 'string' || value.length !== 36 || !uuidPattern.test(value)) {
|
||||||
|
invalid('Invalid UUID');
|
||||||
|
}
|
||||||
|
return value.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
export function nonBlank(value: string): void {
|
||||||
|
if (/^[\s\p{White_Space}]*$/u.test(value)) invalid('A required string is blank');
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Pagination { limit: number; cursor: string | undefined }
|
||||||
|
|
||||||
|
export function pagination(query: unknown): Pagination {
|
||||||
|
const values = query as Record<string, unknown>;
|
||||||
|
const rawLimit = values.limit;
|
||||||
|
let limit = 50;
|
||||||
|
if (rawLimit !== undefined) {
|
||||||
|
// Query всегда строки. Не принимаем 1.0, 1e2, пробелы и повторные limit.
|
||||||
|
if (typeof rawLimit !== 'string' || rawLimit.length === 0 || /[^0-9]/.test(rawLimit)) invalid('Invalid limit');
|
||||||
|
limit = Number(rawLimit);
|
||||||
|
if (!Number.isInteger(limit) || limit < 1 || limit > 100) invalid('Invalid limit');
|
||||||
|
}
|
||||||
|
const cursor = values.cursor;
|
||||||
|
if (cursor !== undefined && (typeof cursor !== 'string' || cursor.length === 0)) invalid('Invalid cursor');
|
||||||
|
return { limit, cursor };
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import test from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import {basic} from '../dist/basic.js';
|
||||||
|
test('Basic preserves UTF-8 and colons in the password',()=>{
|
||||||
|
assert.deepEqual(basic('Basic '+Buffer.from('alice:пароль:extra').toString('base64')),['alice','пароль:extra']);
|
||||||
|
});
|
||||||
|
test('malformed Basic and invalid UTF-8 fail before the KDF',()=>{
|
||||||
|
for(const h of [undefined,'Bearer abc','Basic YQ==','Basic YQA=','Basic ////','Basic Zg'])assert.throws(()=>basic(h),e=>e.statusCode===401);
|
||||||
|
});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import {test} from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import {encode,decode} from '../dist/cursor.js';
|
||||||
|
import {pagination,uuid} from '../dist/validation.js';
|
||||||
|
const key={id:'12345678-1234-4234-8123-000000000001',created_at:'2026-01-01T00:00:00.000Z'};
|
||||||
|
test('cursor binds the page to its resource',()=>{
|
||||||
|
const cursor=encode(key,'messages:a');assert.deepEqual(decode(cursor,'messages:a'),key);
|
||||||
|
for(const [c,r] of [[cursor,'messages:b'],[cursor+'!','messages:a']])assert.throws(()=>decode(c,r));
|
||||||
|
});
|
||||||
|
test('strict query and UUID',()=>{assert.throws(()=>pagination({limit:'1.0'}));assert.throws(()=>uuid(key.id+'x'));});
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2023",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"strict": true,
|
||||||
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"exactOptionalPropertyTypes": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"noEmitOnError": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"rootDir": "src",
|
||||||
|
"outDir": "dist",
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user