diff --git a/.env.sample b/.env.sample index a775549..e9357c1 100644 --- a/.env.sample +++ b/.env.sample @@ -1,3 +1,4 @@ # пример заполнения: https://example.com, http://0.0.0.0:80 NEXT_PUBLIC_PLAYER_PARSER_URL= # Домен сервиса player-parsers, требуется для работы встроенного плеера +NEXT_PUBLIC_API_URL= # Домен сервиса api-prox, для использования своего сервера API вместо встроенного middleware # --- \ No newline at end of file diff --git a/.github/workflows/docker-anix-api-prox.yml b/.github/workflows/docker-anix-api-prox.yml new file mode 100644 index 0000000..f417d9c --- /dev/null +++ b/.github/workflows/docker-anix-api-prox.yml @@ -0,0 +1,25 @@ +name: Build and Publish 'anix-api-prox' to Docker Hub + +on: + push: + branches: + - V3 + paths: + - "api-prox/*.ts" + - "!api-prox/hooks/*" + - "!api-prox/episode/*" + - "api-prox/Dockerfile" + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Build Image + run: docker build . -t radiquum/anix-api-prox:dev + - name: Publish Image + run: | + docker login -u radiquum -p ${{ secrets.DOCKERHUB_TOKEN }} + docker push radiquum/anix-api-prox:dev diff --git a/DEPLOYMENT.RU.md b/DEPLOYMENT.RU.md index 6605fc7..ab8cee2 100644 --- a/DEPLOYMENT.RU.md +++ b/DEPLOYMENT.RU.md @@ -26,11 +26,12 @@ ![vercel import button](./docs/deploy/vercel_import.png) -5. (опционально) добавьте переменную для использования своего плеера: +5. (опционально) добавьте переменные для использования своего плеера и\или API прокси: - NEXT_PUBLIC_PLAYER_PARSER_URL + - NEXT_PUBLIC_API_URL - на те которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md) + на те которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md) и/или [anix-api-prox](./api-prox/README.RU.md) ![vercel project settings](./docs/deploy/vercel_project.png) @@ -73,11 +74,12 @@ ![netlify project name](./docs/deploy/netlify_project_name.png) -7. (опционально) добавьте переменную для использования своего плеера: +7. (опционально) добавьте переменную для использования своего плеера и\или API прокси:: - NEXT_PUBLIC_PLAYER_PARSER_URL + - NEXT_PUBLIC_API_URL - на те которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md) + на те которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md) и/или [anix-api-prox](./api-prox/README.RU.md) 1. ![alt text](./docs/deploy/netlify_env_1.png) @@ -120,7 +122,7 @@ - -p - порт контейнера который будет доступен извне. ПОРТ:3000 > [!NOTE] -> для переменных которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md), необходимо использовать `-e ПЕРЕМЕННАЯ=ЗНАЧЕНИЕ` до последнего слова anix +> для переменных которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md) и/или [anix-api-prox](./api-prox/README.RU.md), необходимо использовать `-e ПЕРЕМЕННАЯ=ЗНАЧЕНИЕ` до последнего слова anix [команда docker run](https://docs.docker.com/reference/cli/docker/container/run/) @@ -150,7 +152,7 @@ 1. Клонируйте репозиторий `git clone https://github.com/Radiquum/AniX` 2. Переместитесь в директорию репозитория `cd AniX` 3. Выполните команду `npm install` -4. (опционально) скопируйте .env.sample как .env и заполните его переменными которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md) +4. (опционально) скопируйте .env.sample как .env и заполните его переменными которые вы получили, если развёртывали [anix-player-parsers](./player-parsers/README.RU.md) и/или [anix-api-prox](./api-prox/README.RU.md) 5. Выполните команду `npm run build` 6. создайте новую директорию (далее будем использовать `<имя_новой_директории>` как её имя) 7. переместите в созданную директорию (`<имя_новой_директории>`) diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 2b5dce6..7dd6de8 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -26,11 +26,12 @@ Requirements: ![vercel import button](./docs/deploy/vercel_import.png) -5. (optional) Add variable to use your own player: +5. (optional) Add variable to use your own player and/or api-proxy: - NEXT_PUBLIC_PLAYER_PARSER_URL + - NEXT_PUBLIC_API_URL - Use the ones you received if you deployed [anix-player-parsers](./player-parsers/README.md) + Use the ones you received if you deployed [anix-player-parsers](./player-parsers/README.md) and/or [anix-api-prox](./api-prox/README.md) ![vercel project settings](./docs/deploy/vercel_project.png) @@ -73,11 +74,12 @@ Requirements: ![netlify project name](./docs/deploy/netlify_project_name.png) -7. (optional) Add variables to use your own player: +7. (optional) Add variables to use your own player and/or api-proxy: - NEXT_PUBLIC_PLAYER_PARSER_URL + - NEXT_PUBLIC_API_URL - Use the ones you received if you deployed [anix-player-parsers](./player-parsers/README.md) + Use the ones you received if you deployed [anix-player-parsers](./player-parsers/README.md) and/or [anix-api-prox](./api-prox/README.md) 1. ![alt text](./docs/deploy/netlify_env_1.png) @@ -120,7 +122,7 @@ Additional Requirements: - -p - container port to be exposed externally. PORT:3000 > [!NOTE] -> For variables you received if you deployed [anix-player-parsers](./player-parsers/README.md), you need to use `-e VARIABLE=VALUE` before the last word anix +> For variables you received if you deployed [anix-player-parsers](./player-parsers/README.md) and/or [anix-api-prox](./api-prox/README.md), you need to use `-e VARIABLE=VALUE` before the last word anix [docker run command](https://docs.docker.com/reference/cli/docker/container/run/) @@ -150,7 +152,7 @@ Instructions: 1. Clone the repository `git clone https://github.com/Radiquum/AniX` 2. Navigate to the repository directory `cd AniX` 3. Run the command `npm install` -4. (optional) copy `.env.sample` as `.env` and fill it with variables you received if you deployed [anix-player-parsers](./player-parsers/README.md) +4. (optional) copy `.env.sample` as `.env` and fill it with variables you received if you deployed [anix-player-parsers](./player-parsers/README.md) and/or [anix-api-prox](./api-prox/README.md) 5. Run the command `npm run build` 6. Create a new directory (next we will be refer to its name as ``) 7. Move the following files into the new directory (``): diff --git a/api-prox/.dockerignore b/api-prox/.dockerignore new file mode 100644 index 0000000..5e7b2f7 --- /dev/null +++ b/api-prox/.dockerignore @@ -0,0 +1,5 @@ +episode +hooks +node_modules +README.md +README.RU.md \ No newline at end of file diff --git a/api-prox/Dockerfile b/api-prox/Dockerfile new file mode 100644 index 0000000..de0c3a1 --- /dev/null +++ b/api-prox/Dockerfile @@ -0,0 +1,17 @@ +FROM node:23-alpine + +LABEL org.opencontainers.image.source=https://github.com/radiquum/anix + +WORKDIR /app + +COPY package.json package-lock.json ./ +RUN npm ci + +COPY *.ts ./ +COPY tsconfig.json ./ + +RUN mkdir -p /app/hooks + +EXPOSE 7001 + +CMD ["npm", "run", "serve"] \ No newline at end of file diff --git a/api-prox/README.RU.md b/api-prox/README.RU.md new file mode 100644 index 0000000..079c711 --- /dev/null +++ b/api-prox/README.RU.md @@ -0,0 +1,111 @@ +# AniX - Api Proxy + +Данный под-проект позволяет проксировать запросы к API Anixart и изменять их ответы с помощью хуков + +Он может использоваться как для основного проекта AniX, так и как отдельный сервис для андроид приложения с изменённой ссылкой на API. + +Лицензия: [MIT](../LICENSE) + +## Доступные хуки + +- release.ts: добавляет рейтинг с shikimori в строку доп. информации +- profile.example.ts: меняет ник официального аккаунта anixart (пример работы с хуком) +- profile.sponsor.ts: включает спонсорку (отключает рекламу) после входа в аккаунт в android приложении +- toggles.ts: заменяет ответ конфигурации, если присутствует переменная окружения `HOST_URL` заменяет ссылку веб плеера, на встроенную, при совместном использовании с переменной окружения `PLAYER_PARSER_URL`, включает собственный веб-плеер, как в веб клиенте AniX +- episode.disabled.ts: позволяет изменять/добавлять озвучки, источники и эпизоды с помощью файла json, в папке `episode`. + +## Использование + +В строке веб-браузера необходимо ввести: + +`://<:port>/[?]` + +Ответ: + +- 500: произошла ошибка, подробнее в строке `reason` в теле ответа +- 200: запрос прошёл успешно (если произошла ошибка на стороне API Anixart, смотри строку `code`) + +## Развёртывание + +### Docker + +Требования: + +- [docker](https://docs.docker.com/engine/install/) + +### Пре-билд + +1. выполните команду: + +`docker run -d --name anix-api -p 7001:7001 radiquum/anix-api-prox:latest` + +для использования хуков необходимо создать папку `hooks` и добавить флаг `-v ./hooks:/app/hooks` перед флагом `-p`. +(так-же и для папки `episode`, если требуется) + +### Ручной билд + +Доп. Требования: + +- [git](https://git-scm.com/) + +1. Клонируйте репозиторий `git clone https://github.com/Radiquum/AniX` +2. Переместитесь в директорию репозитория `cd AniX` +3. Переместитесь в директорию сервиса `cd api-prox` +4. Выполните команду `docker build -t anix-api-prox .` +5. После окончания, выполните команду: `docker run -d --restart always --name anix-player -p 7001:7001 anix-api-prox` + +для использования хуков необходимо добавить флаг `-v ./hooks:/app/hooks` перед флагом `-p`. +(так-же и для папки `episode`, если требуется) + +### docker/Обозначения + +- -d - запустить контейнер в фоне +- --restart always - всегда запускать после перезагрузки сервера +- --name - название контейнера +- -p - порт контейнера который будет доступен извне. ПОРТ:7000 +- -v - добавить папку с хоста в контейнер + +### docker/После развёртывания + +Сервис будет доступен по адресу: `http://<ВАШ IP><:ВАШ ПОРТ>/` + +### docker/Примечание + +Для использования своего домена и поддержки протокола HTTPS, вы можете использовать Traefik или другой reverse-proxy, с сертификатом SSL. + +Полезные ссылки: + +- [Конвертер из команды docker run в синтакс для docker compose](https://it-tools.tech/docker-run-to-docker-compose-converter) +- [Как настроить Traefik + свой домен + SSL](https://letmegooglethat.com/?q=how+to+setup+traefik+with+custom+domain+and+ssl+certificate+from+lets+encrypt%3F) + +### pm2 + +Требования: + +- [git](https://git-scm.com/) +- [nodejs 23+ с npm](http://nodejs.org/) +- [pm2](https://pm2.keymetrics.io/) + +Инструкция: + +1. Клонируйте репозиторий `git clone https://github.com/Radiquum/AniX` +2. Переместитесь в директорию репозитория `cd AniX` +3. Переместитесь в директорию сервиса `cd api-prox` +4. Выполните команду `npm install` +5. После окончания и выполните команду `pm2 start index.ts -n anix-api-prox` + +### pm2/Обозначения + +- -n - название сервиса в pm2 + +### pm2/После развёртывания + +Сервис будет доступен по адресу: `http://<ВАШ IP>:7001/` + +### pm2/Примечание + +Для автоматического запуска приложения, рекомендуется настроить pm2 на автозапуск, с помощью команды: `pm2 startup` + +Полезные ссылки: + +- [PM2: подходим к вопросу процесс-менеджмента с умом @ Habr](https://habr.com/ru/articles/480670/) diff --git a/api-prox/README.md b/api-prox/README.md new file mode 100644 index 0000000..20ae469 --- /dev/null +++ b/api-prox/README.md @@ -0,0 +1,112 @@ + +# AniX - Api Proxy + +This sub-project allows proxying requests to the Anixart API and modifying their responses using hooks. + +It can be used both for the main AniX project and as a standalone service for the Android app with a modified API link. + +License: [MIT](../LICENSE) + +## Available Hooks + +- release.ts: adds a rating from Shikimori to the additional info line +- profile.example.ts: changes the nickname of the official Anixart account (an example of using a hook) +- profile.sponsor.ts: enables sponsorship (disables ads) after logging into the account in the Android app +- toggles.ts: replaces the configuration response; if the `HOST_URL` environment variable is present, it replaces the web player link with an embedded one; when used together with the `PLAYER_PARSER_URL` variable, enables the custom web player, as in the AniX web client +- episode.disabled.ts: allows modifying/adding voiceovers, sources, and episodes using a JSON file in the `episode` folder. + +## Usage + +In the web browser address bar, enter: + +`://<:port>/[?]` + +Response: + +- 500: an error occurred, see the `reason` field in the response body for more details +- 200: request was successful (if there was an error on the Anixart API side, see the `code` field) + +## Deployment + +### Docker + +Requirements: + +- [docker](https://docs.docker.com/engine/install/) + +### Pre-built + +1. Run the command: + +`docker run -d --name anix-api -p 7001:7001 radiquum/anix-api-prox:latest` + +To use hooks, create a `hooks` folder and add the flag `-v ./hooks:/app/hooks` before the `-p` flag. +(The same applies to the `episode` folder if needed) + +### Manual Build + +Additional Requirements: + +- [git](https://git-scm.com/) + +1. Clone the repository: `git clone https://github.com/Radiquum/AniX` +2. Navigate to the repository directory: `cd AniX` +3. Navigate to the service directory: `cd api-prox` +4. Run the command: `docker build -t anix-api-prox .` +5. After completion, run: `docker run -d --restart always --name anix-player -p 7001:7001 anix-api-prox` + +To use hooks, add the flag `-v ./hooks:/app/hooks` before the `-p` flag. +(The same applies to the `episode` folder if needed) + +### docker/Flags + +- -d - run the container in background +- --restart always - always start after server reboot +- --name - container name +- -p - container port that will be accessible from outside. PORT:7000 +- -v - mount a folder from host into the container + +### docker/After Deployment + +The service will be available at: `http://<:YOUR PORT>/` + +### docker/Note + +To use your own domain and support HTTPS, you can use Traefik or another reverse proxy with an SSL certificate. + +Useful links: + +- [Converter from docker run command to docker compose syntax](https://it-tools.tech/docker-run-to-docker-compose-converter) +- [How to setup Traefik + custom domain + SSL](https://letmegooglethat.com/?q=how+to+setup+traefik+with+custom+domain+and+ssl+certificate+from+lets+encrypt%3F) + +### pm2 + +Requirements: + +- [git](https://git-scm.com/) +- [nodejs 23+ with npm](http://nodejs.org/) +- [pm2](https://pm2.keymetrics.io/) + +Instructions: + +1. Clone the repository: `git clone https://github.com/Radiquum/AniX` +2. Navigate to the repository directory: `cd AniX` +3. Navigate to the service directory: `cd api-prox` +4. Run: `npm install` +5. After completion, run: `pm2 start index.ts -n anix-api-prox` + +### pm2/Flags + +- -n - service name in pm2 + +### pm2/After Deployment + +The service will be available at: `http://:7001/` + +### pm2/Note + +For automatic app startup, it is recommended to set up pm2 autostart using the command: `pm2 startup` + +Useful links: + +- [PM2: a smart approach to process management @ Habr](https://habr.com/ru/articles/480670/) diff --git a/api-prox/episode/841.example.json b/api-prox/episode/841.example.json new file mode 100644 index 0000000..ac3e51b --- /dev/null +++ b/api-prox/episode/841.example.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://gist.githubusercontent.com/Radiquum/7f33c09be293233b831c841b69f24608/raw/anix-api-prox-custom-episode-schema.json", + "comment": [ + "пример для добавления и изменения озвучек, источников и эпизодов", + "для аниме Initial D - First Stage, ID: 841", + "кстати раздел 'comment' совсем не нужен, так что это буквально коммент" + ], + "types": [ + { + "id": 1, + "name": "NyaniDUB (Заменено с AniDub)", + "sources": [ + { + "id": 1, + "name": "Sibnet", + "episodes": [ + { + "position": 0, + "name": "Первая серия" + } + ] + } + ] + }, + { + "id": 999, + "name": "By Blender Foundation", + "icon": "https://download.blender.org/branding/community/blender_community_badge_white.png", + "episodes_count": 2, + "sources": [ + { + "id": 998, + "name": "Public Test Videos", + "episodes_count": 2, + "episodes": [ + { + "position": 1, + "name": "Big Buck Bunny", + "url": "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", + "is_filler": true + }, + { + "position": 2, + "name": "Elephant Dream", + "url": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4", + "is_filler": true + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/api-prox/hooks/episode.disabled.ts b/api-prox/hooks/episode.disabled.ts new file mode 100644 index 0000000..b483741 --- /dev/null +++ b/api-prox/hooks/episode.disabled.ts @@ -0,0 +1,297 @@ +// хук добавляет ссылки на кастомные источники +// а так-же позволяет добавлять собственные озвучки +// с помощью json (/episode/.json) +// пример находится в файле 841.example.json в папке episode +// +// сами видео файлы эпизодов необходимо хостить отдельно (например с помощью nginx), +// хуку требуется переменная среды HOST_URL, которая ведёт на сервис api-prox + +import { logger } from "../shared"; +import fs from "fs/promises"; + +let HOSTNAME: null | string = null; +if (process.env.HOST_URL) { + HOSTNAME = process.env.HOST_URL; +} + +export function match(path: string): boolean { + // если не установлен хост, не запускаем хук + if (!HOSTNAME) return false; + // используем только страницы с путём /episode/* + const pathRe = /^\/episode\/\d+/; + if (pathRe.test(path)) return true; + return false; +} + +export interface VoiceoverInfo { + "@id": number; + id: number; + name: string; + icon: null | string; + workers: null | string; + is_sub: boolean; + episodes_count: number; + view_count: number; + pinned: boolean; +} + +export interface SourceInfo { + "@id": number; + id: number; + type: number | VoiceoverInfo; + name: string; + episodes_count: number; +} + +export interface EpisodeInfo { + "@id": number; + position: number; + release: number | any; + source: number | SourceInfo; + name: null | string; + url: string; + iframe: boolean; + addedDate: number; + is_filler: boolean; + is_watched: boolean; +} + +export async function get(data: any, url: URL) { + const base = "./episode"; + + let releaseId = null; + let voiceOverId = null; + let sourceId = null; + let info: any = null; + + const path = url.pathname.split("/").filter((item) => { + return !["", "episode"].includes(item); + }); + + logger.consoleHook("debug", `Received request for:`, url.pathname); + logger.consoleHook("debug", `Decoded pathname:`, path); + + releaseId = Number(path[0]); + voiceOverId = Number(path[1]); + sourceId = Number(path[2]); + logger.consoleHook("debug", `Release ID:`, releaseId); + logger.consoleHook("debug", `Voiceover ID:`, voiceOverId); + logger.consoleHook("debug", `Source ID:`, sourceId); + + try { + info = JSON.parse( + await fs.readFile(`${base}/${releaseId}.json`, { + encoding: "utf8", + }) + ); + } catch { + return data; + } + + if (path.length == 1) { + if (!info || !data.hasOwnProperty("types")) { + return data; + } + + for (let i = 0; i < info.types.length; i++) { + const type: VoiceoverInfo = info.types[i]; + const existingType: VoiceoverInfo = data.types.find( + (item: VoiceoverInfo) => item.id == type.id + ); + + if (existingType) { + type.name ? (existingType.name = type.name) : null; + type.icon ? (existingType.icon = type.icon) : null; + type.workers ? (existingType.workers = type.workers) : ""; + type.is_sub ? (existingType.is_sub = type.is_sub) : null; + type.episodes_count ? + (existingType.episodes_count = type.episodes_count) + : null; + } else { + data.types = [ + ...data.types, + { + "@id": data.types.length + 1, + id: type.id, + name: type.name || "Неизвестная Озвучка", + icon: type.icon || "", + workers: type.workers || "", + is_sub: type.is_sub || false, + episodes_count: type.episodes_count || 0, + view_count: 0, + pinned: false, + }, + ]; + } + } + } + + if (path.length == 2) { + if (!info || !data.hasOwnProperty("sources")) { + return data; + } + + const apiResponse = await fetch(`${HOSTNAME}/episode/${releaseId}`); + if (!apiResponse.ok) { + return data; + } + const types = await apiResponse.json(); + const type: VoiceoverInfo = types.types.find( + (item: VoiceoverInfo) => item.id == voiceOverId + ); + type["@id"] = 2; + type.episodes_count = 0; + type.view_count = 0; + + if (data.sources.length > 0) { + data.sources[0].type = type; + } + + const sources = info.types.find( + (item: VoiceoverInfo) => item.id == type.id + ); + if (!sources || !sources.sources || sources.sources.length == 0) { + return data; + } + + for (let i = 0; i < sources.sources.length; i++) { + const source: SourceInfo = sources.sources[i]; + const existingSource: SourceInfo = data.sources.find( + (item: SourceInfo) => item.id == source.id + ); + + if (existingSource) { + source.name ? (existingSource.name = source.name) : null; + source.episodes_count ? + (existingSource.episodes_count = source.episodes_count) + : null; + } else { + data.sources = [ + ...data.sources, + { + "@id": data.sources.length == 0 ? 1 : 2 + data.sources.length, + id: source.id, + type: data.sources.length > 0 ? 2 : type, + name: source.name || "Неизвестный Источник", + episodes_count: source.episodes_count || 0, + }, + ]; + } + } + } + + if (path.length == 3) { + if (!info || !data.hasOwnProperty("episodes")) { + return data; + } + + const apiSourceResponse = await fetch( + `${HOSTNAME}/episode/${releaseId}/${voiceOverId}` + ); + if (!apiSourceResponse.ok) { + return data; + } + const sources = await apiSourceResponse.json(); + const source = sources.sources.find( + (item: SourceInfo) => item.id == sourceId + ); + + source["@id"] = 3; + if (isNaN(source.type["@id"])) { + source.type = sources.sources[0].type; + } + source.type["@id"] = 4; + + const apiReleaseResponse = await fetch(`${HOSTNAME}/release/${releaseId}`); + if (!apiReleaseResponse.ok) { + return data; + } + const release = await apiReleaseResponse.json(); + release.release["@id"] = 2; + release.release.screenshots = []; + release.release.comments = []; + release.release.screenshot_images = []; + release.release.related_releases = []; + release.release.recommended_releases = []; + release.release.video_banners = []; + release.release.your_vote = 0; + release.release.related_count = 0; + release.release.comment_count = 0; + release.release.comments_count = 0; + release.release.collection_count = 0; + release.release.profile_list_status = 0; + + if (data.episodes.length > 0) { + data.episodes[0].release = release.release; + data.episodes[0].source = source; + data.episodes[0].source.episodes_count = 0; + data.episodes[0].source.type.workers ? + null + : (data.episodes[0].source.type.workers = ""); + } + + const ctypes = info.types; + if (!ctypes || ctypes.length == 0) return data; + const ctype = info.types.find( + (item: VoiceoverInfo) => item.id == voiceOverId + ); + if (!ctype) return data; + const csource = ctype.sources.find( + (item: SourceInfo) => item.id == sourceId + ); + if (!csource || !csource.episodes) return data; + const episodes = csource.episodes; + if (!episodes || episodes.length == 0) return data; + + if ( + data.episodes && + data.episodes.length > 0 && + data.episodes[0].source && + data.episodes[0].source.name == "Sibnet" + ) { + data.episodes.forEach((item: EpisodeInfo, index: number) => { + item.name ? null : ( + (data.episodes[index].name = `${item.position + 1} серия`) + ); + }); + } + + for (let i = 0; i < episodes.length; i++) { + const episode: EpisodeInfo = episodes[i]; + const existingEpisode: EpisodeInfo = data.episodes.find( + (item: EpisodeInfo) => item.position == episode.position + ); + + if (existingEpisode) { + episode.position ? (existingEpisode.position = episode.position) : null; + episode.name ? (existingEpisode.name = episode.name) : null; + episode.url ? (existingEpisode.url = episode.url) : null; + episode.iframe !== undefined ? + (existingEpisode.iframe = episode.iframe) + : null; + episode.is_filler !== undefined ? + (existingEpisode.is_filler = episode.is_filler) + : null; + } else { + data.episodes = [ + ...data.episodes, + { + "@id": data.episodes.length == 0 ? 1 : 4 + data.episodes.length, + position: episode.position || data.episodes.length, + release: data.episodes.length > 0 ? 2 : release.release, + source: data.episodes.length > 0 ? 3 : source, + name: episode.name || "Неизвестная Серия", + url: episode.url || "", + iframe: episode.iframe !== undefined ? episode.iframe : true, + addedDate: 0, + is_filler: + episode.is_filler !== undefined ? episode.is_filler : false, + is_watched: false, + }, + ]; + } + } + } + + return data; +} diff --git a/api-prox/hooks/profile.example.ts b/api-prox/hooks/profile.example.ts new file mode 100644 index 0000000..25aa201 --- /dev/null +++ b/api-prox/hooks/profile.example.ts @@ -0,0 +1,28 @@ +// хук меняет юзернейм 'Anixart' на 'Anixartiki' + +import { logger } from "../shared"; + +export function match(path: string): boolean { + // id профиля 1, это профиль Anixart (разработчиков) + if (path == "/profile/1") return true; + return false; +} + +export async function get(data: any, url: URL) { + const newUname = "Anixartiki"; + + // проверяем что есть поле 'profile' и оно не равно 'null', что значит что мы получили данные с апи и можно двигаться дальше + // иначе возвращаем оригинальные данные + if (!data.hasOwnProperty("profile") || !data.profile) return data; + + // выводим сообщение в лог, если уровень логгера 'debug' + logger.debugHook( + `Changed username of '${data["profile"]["login"]}' (${data["profile"]["id"]}) to ${newUname}` + ); + + // меняем поле на новый юзернейм + data["profile"]["login"] = newUname; + + // возвращаем изменённые данные + return data; +} diff --git a/api-prox/hooks/profile.sponsor.ts b/api-prox/hooks/profile.sponsor.ts new file mode 100644 index 0000000..f87ad0d --- /dev/null +++ b/api-prox/hooks/profile.sponsor.ts @@ -0,0 +1,12 @@ +// хук включает "вечную" спонсорку, отключая рекламу после входа в профиль, в официальном приложении + +export function match(path: string): boolean { + if (path == "/profile/info") return true; + return false; +} + +export async function get(data: any, url: URL) { + data["is_sponsor"] = true; + data["sponsorship_expires"] = 2147483647; + return data; +} diff --git a/api-prox/hooks/release.ts b/api-prox/hooks/release.ts new file mode 100644 index 0000000..5ee22f7 --- /dev/null +++ b/api-prox/hooks/release.ts @@ -0,0 +1,41 @@ +// хук добавляет рейтинг шикимори в поле note релиза + +export function match(path: string): boolean { + // используем только страницы с путём /release/ + const pathRe = /\/release\/\d+/ + if (pathRe.test(path)) return true; + return false; +} + +export async function get(data: any, url: URL) { + // проверяем что есть поле 'release' + // иначе возвращаем оригинальные данные + if (!data.hasOwnProperty("release")) return data; + + // ищём аниме на шикимори по названию, т.к. ид аниме аниксарт и шикимори разные и нет никакого референса друг на друга + const shikiIdRes = await fetch( + `https://shikimori.one/api/animes?search=${data["release"]["title_original"]}` + ); + if (!shikiIdRes.ok) return data; // если при поиске произошла ошибка, то возвращаем оригинальные данные + const shikiIdJson = await shikiIdRes.json(); + if (shikiIdJson.length == 0) return data; // если нет результатов, то возвращаем оригинальные данные + + const shikiId = shikiIdJson[0]["id"]; // берём ид от первого результата + + // повторяем процесс, уже с ид от шикимори + const shikiAnimRes = await fetch( + `https://shikimori.one/api/animes/${shikiId}` + ); + if (!shikiAnimRes.ok) return data; + const shikiAnimJson = await shikiAnimRes.json(); + + // пушим строки в список, что-бы было легче их объединить + const noteBuilder = []; + if (data["release"]["note"] != null) noteBuilder.push(`${data.release.note}
---
`); // если в поле note уже что-то есть, разделяем значение и рейтинг + noteBuilder.push(`Рейтинг Shikimori: ${Number(shikiAnimJson.score)}★`); // добавляем рейтинг от шикимори + data["release"]["note"] = noteBuilder.toString(); // заменяем оригинальное поле нашей строкой + data["release"]["id_shikimori"] = shikiId; // добавляем айди шикимори в ответ, потому что почему нет + + // возвращаем изменённые данные + return data; +} diff --git a/api-prox/hooks/toggles.ts b/api-prox/hooks/toggles.ts new file mode 100644 index 0000000..175dffd --- /dev/null +++ b/api-prox/hooks/toggles.ts @@ -0,0 +1,76 @@ +// хук изменяет ответ config/toggles + +export interface Toggles { + minVersionCode: number; + lastVersionCode: number; + whatsNew: string; + downloadLink: string; + minGPVersionCode: number; + lastGPVersionCode: number; + gpWhatsNew: string; + gpDownloadLink: string; + overrideGPVersion: boolean; + inAppUpdates: boolean; + inAppUpdatesImmediate: boolean; + inAppUpdatesFlexibleDelay: number; + impMessageEnabled: boolean; + impMessageText: string; + impMessageBackgroundColor: string; + impMessageTextColor: string; + impMessageLink: string; + adBannerBlockId: string; + adBannerSizeType: number; + adInterstitialBlockId: string; + adBannerDelay: number; + adInterstitialDelay: number; + kodikVideoLinksUrl: string; + kodikIframeAd: boolean; + sibnetRandUserAgent: boolean; + sibnetUserAgent: string; + torlookUrl: string; + baseUrl: string; + apiUrl: string; + apiAltUrl: string; + apiAltAvailable: boolean; + iframeEmbedUrl: string; + kodikAdIframeUrl: string; + sponsorshipPromotion: boolean; + sponsorshipText: string; + sponsorshipAvailable: boolean; + pageNoConnectionUrl: string; + snowfall: boolean; + searchBarIconUrl: string; + searchBarIconTint: string; + searchBarIconAction: string; + searchBarIconValue: string; + min_blog_create_rating_score: number; +} + +export function match(path: string): boolean { + if (path == "/config/toggles") return true; + return false; +} + +export async function get(data: Toggles, url: URL) { + data.lastVersionCode = 25062200; + + data.impMessageEnabled = true; + data.impMessageText = "разработчик AniX / Api-Prox-Service"; + data.impMessageLink = "https://wah.su/radiquum"; + data.impMessageBackgroundColor = "ffb3d0"; + data.impMessageTextColor = "ffffff"; + + data.apiAltAvailable = false; + data.apiAltUrl = ""; + + data.sponsorshipAvailable = false; + data.sponsorshipPromotion = false; + data.kodikIframeAd = false; + data.kodikAdIframeUrl = ""; + + if (process.env.HOST_URL) { + data.iframeEmbedUrl = `${process.env.HOST_URL}/player?url=`; + } + + return data; +} diff --git a/api-prox/iframe.ts b/api-prox/iframe.ts new file mode 100644 index 0000000..b8d9d9e --- /dev/null +++ b/api-prox/iframe.ts @@ -0,0 +1,14 @@ +export const Iframe = (url: string) => { + return ` + + + + Веб-плеер + + + + + + + ` +} diff --git a/api-prox/index.ts b/api-prox/index.ts new file mode 100644 index 0000000..0fdec06 --- /dev/null +++ b/api-prox/index.ts @@ -0,0 +1,362 @@ +import { + ANIXART_API, + ANIXART_HEADERS, + ANIXART_HEADERST, + asJSON, + GetHook, + LoadedHook, + logger, + PostHook, +} from "./shared"; +import express from "express"; +import fs from "fs/promises"; +import { MediaChromeTheme } from "./media-chrome"; +import { Iframe } from "./iframe"; + +const app = express(); +app.use( + express.raw({ inflate: true, limit: "50mb", type: "multipart/form-data" }) +); +app.use(express.json()); +app.use(express.urlencoded({ extended: true })); + +const HOST = process.env.HOST || "0.0.0.0"; +const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 7001; + +let hooks: string[] = []; + +async function loadHooks() { + let hooksDir: string[] = []; + try { + hooksDir = await fs.readdir("./hooks"); + } catch (err) { + logger.error("'hooks' directory not found"); + } + + for (let i = 0; i < hooksDir.length; i++) { + const name = hooksDir[i]; + if ( + !name.endsWith(".ts") || + name.includes("example") || + name.includes("disabled") + ) + continue; + + require(`./hooks/${name}`); + logger.infoHook(`Loaded "./hooks/${name}"`); + hooks.push(name); + + (async () => { + try { + const watcher = fs.watch(`./hooks/${name}`); + for await (const event of watcher) { + if (event.eventType === "change") { + logger.infoHook(`Updated "./hooks/${event.filename}"`); + delete require.cache[require.resolve(`./hooks/${event.filename}`)]; + require(`./hooks/${event.filename}`); + } + } + } catch (err) { + throw err; + } + })(); + } +} + +app.get("/player", async (req, res) => { + let url = req.query.url || null; + + res.status(200); + res.set({ + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS", + "Cache-Control": "no-cache", + "Content-Type": "text/html; charset=utf-8", + }); + if (!url) { + res.send("

No url query found!

"); + return; + } + + let player = ""; + let poster = ""; + + const CUSTOM_PLAYER_DOMAINS = [ + "video.sibnet.ru", + "anixart.libria.fun", + "kodik.info", + "aniqit.com", + "kodik.cc", + "kodik.biz", + ]; + const urlDomain = new URL(url.toString()); + const PLAYER_PARSER_URL = process.env.PLAYER_PARSER_URL || null; + + if (CUSTOM_PLAYER_DOMAINS.includes(urlDomain.hostname)) { + try { + if (!PLAYER_PARSER_URL) throw new Error(); + + if ( + ["kodik.info", "aniqit.com", "kodik.cc", "kodik.biz"].includes( + urlDomain.hostname + ) + ) { + player = "kodik"; + } + if ("anixart.libria.fun" == urlDomain.hostname) { + player = "libria"; + } + if ("video.sibnet.ru" == urlDomain.hostname) { + player = "sibnet"; + } + + const playerParserRes = await fetch( + `${PLAYER_PARSER_URL}?url=${encodeURIComponent(url.toString())}&player=${player}` + ); + + if (!playerParserRes.ok) throw new Error(); + + const playerParserData: { manifest: string; poster: string } = + await playerParserRes.json(); + + poster = playerParserData.poster; + if (playerParserData.manifest.startsWith("#EXTM3U")) { + const playerUrlArray = playerParserData.manifest.split("\n"); + url = playerUrlArray.join("\\n"); + } else { + url = playerParserData.manifest; + } + } catch { + res.send(Iframe(url.toString())); + return; + } + } else if (url.toString().toLowerCase().endsWith("mp4")) { + player = "mp4"; + } else if (url.toString().toLowerCase().endsWith(".m3u8")) { + player = "hls"; + } else { + res.send(Iframe(url.toString())); + return; + } + + res.send(` + + + + Веб-плеер + + + ${["kodik", "libria", "hls"].includes(player) ? '' : ""} + + + + + ${MediaChromeTheme()} + + + ${ + ["kodik", "libria", "hls"].includes(player) ? + `` + : `` + } + + + + `); +}); + +app.get("/*path", async (req, res) => { + if (req.path == "/favicon.ico") return asJSON(res, {}, 404); + + const url = new URL(`${ANIXART_API}${req.url}`); + logger.debug( + `[${req.method}] ${url.protocol}//${url.hostname}${url.pathname}` + ); + // logger.debug(` ↳ [QUERY] ${url.searchParams.toString()}`); + + if ( + url.searchParams.get("API-Version") == "v2" || + req.headers["api-version"] == "v2" + ) { + // logger.debug(` ↳ Force API V2`); + ANIXART_HEADERS["Api-Version"] = "v2"; + url.searchParams.delete("API-Version"); + } + + const apiResponse = await fetch(url.toString(), { + method: "GET", + headers: ANIXART_HEADERS, + }); + + if ( + !apiResponse || + !apiResponse.ok || + apiResponse.headers.get("content-type") != "application/json" + ) { + logger.error( + `Failed to fetch: '${url.protocol}//${url.hostname}${url.pathname}', Path probably doesn't exist` + ); + asJSON( + res, + { + code: 99, + returned_value: { + request_status: apiResponse ? apiResponse.status : null, + request_content_type: + apiResponse ? apiResponse.headers.get("content-type") : null, + }, + reason: "Path probably doesn't exist", + }, + 500 + ); + return; + } + + let data = await apiResponse.json(); + + for (let i = 0; i < hooks.length; i++) { + const name = hooks[i]; + const hook: GetHook = require(`./hooks/${name}`); + if (!hook.hasOwnProperty("match") || !hook.hasOwnProperty("get")) continue; + if (!hook.match(req.path)) continue; + data = await hook.get(data, url); + } + + asJSON(res, data, 200); + return; +}); + +app.post("/*path", async (req, res) => { + const url = new URL(`${ANIXART_API}${req.url}`); + logger.debug( + `[${req.method}] ${url.protocol}//${url.hostname}${url.pathname}` + ); + // logger.debug(` ↳ [QUERY] ${url.searchParams.toString()}`); + + let apiResponse: null | Response = null; + const apiHeaders: ANIXART_HEADERST = { + "User-Agent": ANIXART_HEADERS["User-Agent"], + "Content-Type": req.headers["content-type"] || "application/json", + }; + + if ( + url.searchParams.get("API-Version") == "v2" || + req.headers["api-version"] == "v2" + ) { + // logger.debug(` ↳ Force API V2`); + apiHeaders["Api-Version"] = "v2"; + url.searchParams.delete("API-Version"); + } + + const reqContentType = + req.headers["content-type"] ? + req.headers["content-type"].split(";")[0] + : "application/json"; + + const supportedContentTypes = [ + "application/json", + "application/x-www-form-urlencoded", + "multipart/form-data", + ]; + const isSupported = supportedContentTypes.some((type) => + reqContentType.toLowerCase().startsWith(type) + ); + if (!isSupported) { + res.status(500).json({ + code: 99, + error: "Unsupported Media Type", + reason: `Content-Type '${reqContentType}' is not supported.`, + }); + return; + } + + switch (reqContentType) { + case "multipart/form-data": + apiResponse = await fetch(url.toString(), { + method: "POST", + headers: apiHeaders, + body: req.body, + }); + break; + case "application/x-www-form-urlencoded": + apiResponse = await fetch(url.toString(), { + method: "POST", + headers: apiHeaders, + body: new URLSearchParams(req.body), + }); + break; + case "application/json": + apiResponse = await fetch(url.toString(), { + method: "POST", + headers: apiHeaders, + body: JSON.stringify(req.body), + }); + break; + } + + if ( + !apiResponse || + !apiResponse.ok || + apiResponse.headers.get("content-type") != "application/json" + ) { + logger.error( + `Failed to post: '${url.protocol}//${url.hostname}${url.pathname}', Path probably doesn't exist` + ); + asJSON( + res, + { + code: 99, + returned_value: { + request_status: apiResponse ? apiResponse.status : null, + request_content_type: + apiResponse ? apiResponse.headers.get("content-type") : null, + }, + reason: "Path probably doesn't exist", + }, + 500 + ); + return; + } + let data = await apiResponse.json(); + let hooks: string[] = []; + + try { + hooks = await fs.readdir("./hooks"); + } catch (err) { + logger.error("'hooks' directory not found"); + } + + for (let i = 0; i < hooks.length; i++) { + const name = hooks[i]; + const hook: PostHook = require(`./hooks/${name}`); + if (!hook.hasOwnProperty("match") || !hook.hasOwnProperty("post")) continue; + if (!hook.match(req.path)) continue; + data = await hook.post(data, url); + } + + asJSON(res, data, 200); + return; +}); + +app.listen(PORT, HOST, function () { + loadHooks(); + logger.info(`Server listen: http://${HOST}:${PORT}`); +}); diff --git a/api-prox/media-chrome.ts b/api-prox/media-chrome.ts new file mode 100644 index 0000000..a0c1a7f --- /dev/null +++ b/api-prox/media-chrome.ts @@ -0,0 +1,813 @@ +export const MediaChromeTheme = () => { + return ` + + + + + +` +} \ No newline at end of file diff --git a/api-prox/package-lock.json b/api-prox/package-lock.json new file mode 100644 index 0000000..cf52db9 --- /dev/null +++ b/api-prox/package-lock.json @@ -0,0 +1,1453 @@ +{ + "name": "anix-api-proxy", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "anix-api-proxy", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "express": "^5.1.0", + "tsx": "^4.20.3" + }, + "devDependencies": { + "@types/express": "^5.0.3", + "@types/node": "^24.0.4", + "typescript": "^5.8.3" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.5.tgz", + "integrity": "sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.5.tgz", + "integrity": "sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.5.tgz", + "integrity": "sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.5.tgz", + "integrity": "sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.5.tgz", + "integrity": "sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.5.tgz", + "integrity": "sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.5.tgz", + "integrity": "sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.5.tgz", + "integrity": "sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.5.tgz", + "integrity": "sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.5.tgz", + "integrity": "sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.5.tgz", + "integrity": "sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.5.tgz", + "integrity": "sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.5.tgz", + "integrity": "sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.5.tgz", + "integrity": "sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.5.tgz", + "integrity": "sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.5.tgz", + "integrity": "sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.5.tgz", + "integrity": "sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.5.tgz", + "integrity": "sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.5.tgz", + "integrity": "sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.5.tgz", + "integrity": "sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.5.tgz", + "integrity": "sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.5.tgz", + "integrity": "sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.5.tgz", + "integrity": "sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.5.tgz", + "integrity": "sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.5.tgz", + "integrity": "sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.6", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", + "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.3.tgz", + "integrity": "sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^5.0.0", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", + "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", + "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.0.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.4.tgz", + "integrity": "sha512-ulyqAkrhnuNq9pB76DRBTkcS6YsmDALy6Ua63V8OhrOBgbcYt6IOdzpw5P1+dyRIyMerzLkeYWBeOXPpA9GMAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.8.0" + } + }, + "node_modules/@types/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", + "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", + "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/body-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", + "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.0", + "http-errors": "^2.0.0", + "iconv-lite": "^0.6.3", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.0", + "type-is": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.5.tgz", + "integrity": "sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.5", + "@esbuild/android-arm": "0.25.5", + "@esbuild/android-arm64": "0.25.5", + "@esbuild/android-x64": "0.25.5", + "@esbuild/darwin-arm64": "0.25.5", + "@esbuild/darwin-x64": "0.25.5", + "@esbuild/freebsd-arm64": "0.25.5", + "@esbuild/freebsd-x64": "0.25.5", + "@esbuild/linux-arm": "0.25.5", + "@esbuild/linux-arm64": "0.25.5", + "@esbuild/linux-ia32": "0.25.5", + "@esbuild/linux-loong64": "0.25.5", + "@esbuild/linux-mips64el": "0.25.5", + "@esbuild/linux-ppc64": "0.25.5", + "@esbuild/linux-riscv64": "0.25.5", + "@esbuild/linux-s390x": "0.25.5", + "@esbuild/linux-x64": "0.25.5", + "@esbuild/netbsd-arm64": "0.25.5", + "@esbuild/netbsd-x64": "0.25.5", + "@esbuild/openbsd-arm64": "0.25.5", + "@esbuild/openbsd-x64": "0.25.5", + "@esbuild/sunos-x64": "0.25.5", + "@esbuild/win32-arm64": "0.25.5", + "@esbuild/win32-ia32": "0.25.5", + "@esbuild/win32-x64": "0.25.5" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-tsconfig": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz", + "integrity": "sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==", + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.6.3", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tsx": { + "version": "4.20.3", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.3.tgz", + "integrity": "sha512-qjbnuR9Tr+FJOMBqJCW5ehvIo/buZq7vH7qD7JziU98h6l3qGy0a/yPFjwO+y0/T7GFpNgNAvEcPPVfyT8rrPQ==", + "license": "MIT", + "dependencies": { + "esbuild": "~0.25.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", + "dev": true, + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + } + } +} diff --git a/api-prox/package.json b/api-prox/package.json new file mode 100644 index 0000000..0696b26 --- /dev/null +++ b/api-prox/package.json @@ -0,0 +1,20 @@ +{ + "name": "anix-api-proxy", + "version": "1.0.0", + "description": "Proxy and Hook requests from anix to anixart api", + "main": "index.ts", + "scripts": { + "serve": "npx tsx ./index.ts" + }, + "author": "Radiquum", + "license": "MIT", + "devDependencies": { + "@types/express": "^5.0.3", + "@types/node": "^24.0.4", + "typescript": "^5.8.3" + }, + "dependencies": { + "express": "^5.1.0", + "tsx": "^4.20.3" + } +} diff --git a/api-prox/shared.ts b/api-prox/shared.ts new file mode 100644 index 0000000..3dfdcc3 --- /dev/null +++ b/api-prox/shared.ts @@ -0,0 +1,126 @@ +export const corsHeaders = { + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS", + "Cache-Control": "no-cache", +}; + +export const resHeaders = { + ...corsHeaders, + "Content-Type": "application/json", +}; + +import { Request, Response } from "express"; +export function asJSON(res: Response, object: any, status: number) { + res.status(status); + res.set(resHeaders); + res.send(JSON.stringify(object)); +} + +export const ANIXART_UA = + "AnixartApp/9.0 BETA 5-25062213 (Android 9; SDK 28; arm64-v8a; samsung SM-G975N; en)"; +export const ANIXART_API = "https://api.anixart.app"; + +export type ANIXART_HEADERST = { + "User-Agent": string; + "Content-Type": string; + "Api-Version"?: string; +}; +export const ANIXART_HEADERS: ANIXART_HEADERST = { + "User-Agent": ANIXART_UA, + "Content-Type": "application/json; charset=UTF-8", +}; + +type LogLevel = "debug" | "info" | "warn" | "error" | "disable"; +export class Log { + level: LogLevel; + levelInt = { + debug: 0, + info: 1, + warn: 2, + error: 3, + disable: 4, + }; + + constructor(level: LogLevel = "info") { + this.level = level; + } + + getString(...args: string[]): string { + return args.toString(); + } + + getTime(): string { + const datetime = new Date(); + return `${datetime.getHours().toString().padStart(2, "0")}:${datetime.getMinutes().toString().padStart(2, "0")}:${datetime.getSeconds().toString().padStart(2, "0")}`; + } + + console(logLevel: LogLevel = "info", ...msg: any[]) { + if (this.levelInt[this.level] <= this.levelInt[logLevel]) + console.log(`[${logLevel.toUpperCase()}](${this.getTime()}) -> `, ...msg); + } + debug(...msg: string[]) { + if (this.levelInt[this.level] <= 0) + console.log(`[DEBUG](${this.getTime()}) -> ${this.getString(...msg)}`); + } + info(...msg: string[]) { + if (this.levelInt[this.level] <= 1) + console.log(`[INFO](${this.getTime()}) -> ${this.getString(...msg)}`); + } + warn(...msg: string[]) { + if (this.levelInt[this.level] <= 2) + console.log(`[WARN](${this.getTime()}) -> ${this.getString(...msg)}`); + } + error(...msg: string[]) { + if (this.levelInt[this.level] <= 3) + console.log(`[ERROR](${this.getTime()}) -> ${this.getString(...msg)}`); + } + + consoleHook(logLevel: LogLevel = "info", ...msg: any[]) { + if (this.levelInt[this.level] <= this.levelInt[logLevel]) + console.log( + `[${logLevel.toUpperCase()}|HOOK](${this.getTime()}) -> `, + ...msg + ); + } + debugHook(...msg: string[]) { + if (this.levelInt[this.level] <= 0) + console.log( + `[DEBUG|HOOK](${this.getTime()}) -> ${this.getString(...msg)}` + ); + } + infoHook(...msg: string[]) { + if (this.levelInt[this.level] <= 1) + console.log( + `[INFO|HOOK](${this.getTime()}) -> ${this.getString(...msg)}` + ); + } + warnHook(...msg: string[]) { + if (this.levelInt[this.level] <= 2) + console.log( + `[WARN|HOOK](${this.getTime()}) -> ${this.getString(...msg)}` + ); + } + errorHook(...msg: string[]) { + if (this.levelInt[this.level] <= 3) + console.log( + `[ERROR|HOOK](${this.getTime()}) -> ${this.getString(...msg)}` + ); + } +} + +export const logger = new Log((process.env.LOG_LEVEL as LogLevel) || "info"); + +export interface GetHook { + match: (path: string) => boolean; + get: (data: any, url: URL) => any; +} + +export interface PostHook { + match: (path: string) => boolean; + post: (body: any, url: URL) => any; +} + +export interface LoadedHook { + path: string; + mtime: string; +} diff --git a/api-prox/tsconfig.json b/api-prox/tsconfig.json new file mode 100644 index 0000000..904d43f --- /dev/null +++ b/api-prox/tsconfig.json @@ -0,0 +1,113 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "libReplacement": true, /* Enable lib replacement. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ + // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/app/api/config.ts b/app/api/config.ts index ad32b6f..f797ee0 100644 --- a/app/api/config.ts +++ b/app/api/config.ts @@ -1,7 +1,9 @@ export const CURRENT_APP_VERSION = "3.7.0"; +import { env } from "next-runtime-env"; +const NEXT_PUBLIC_API_URL = env("NEXT_PUBLIC_API_URL") || null; export const API_URL = "https://api.anixart.app"; -export const API_PREFIX = "/api/proxy"; +export const API_PREFIX = NEXT_PUBLIC_API_URL || "/api/proxy"; export const USER_AGENT = "AnixartApp/9.0 BETA 5-25062213 (Android 9; SDK 28; arm64-v8a; samsung SM-G975N; en)"; diff --git a/player-parsers/.dockerignore b/player-parsers/.dockerignore index 4400aea..aab984b 100644 --- a/player-parsers/.dockerignore +++ b/player-parsers/.dockerignore @@ -1,2 +1,3 @@ node_modules -README.md \ No newline at end of file +README.md +README.RU.md \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 8fdb696..46666e4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,5 +33,5 @@ "**/*.tsx", "next.config.js" ], - "exclude": ["node_modules", "player-parsers"] + "exclude": ["node_modules", "player-parsers", "api-prox"] }