diff --git a/alexa-api/.env.example b/alexa-api/.env.example new file mode 100644 index 0000000..217fa3f --- /dev/null +++ b/alexa-api/.env.example @@ -0,0 +1,6 @@ +# alexa-api/.env +# このファイルをコピーして .env を作成し、ALEXA_COOKIE に値を設定する +# .env は Git にコミットしない(.gitignore 参照) + +# Amazon Cookie(auth.js を実行して取得) +ALEXA_COOKIE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx diff --git a/alexa-api/.gitignore b/alexa-api/.gitignore new file mode 100644 index 0000000..713d500 --- /dev/null +++ b/alexa-api/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +.env diff --git a/alexa-api/Dockerfile b/alexa-api/Dockerfile new file mode 100644 index 0000000..263171c --- /dev/null +++ b/alexa-api/Dockerfile @@ -0,0 +1,14 @@ +FROM node:20-alpine + +WORKDIR /app + +# 依存パッケージのみ先にコピー(キャッシュ活用) +COPY package*.json ./ +RUN npm install --omit=dev + +# ソースをコピー +COPY server.js . + +EXPOSE 3500 + +CMD ["node", "server.js"] diff --git a/alexa-api/auth.js b/alexa-api/auth.js new file mode 100644 index 0000000..8c9353f --- /dev/null +++ b/alexa-api/auth.js @@ -0,0 +1,70 @@ +/** + * alexa-api/auth.js + * ローカル PC で実行して Amazon Cookie を取得するスクリプト。 + * + * 使い方: + * cd alexa-api + * npm install alexa-cookie2 + * node auth.js + * + * → ブラウザで http://localhost:3456 を開く + * → Amazon にログイン + * → コンソールに Cookie が表示される + * → その値を Windmill Variable "u/admin/ALEXA_COOKIE" に登録 + */ + +const AlexaCookie = require('alexa-cookie2'); + +const PROXY_PORT = 3456; + +console.log('=============================================='); +console.log(' Alexa Cookie 取得ツール'); +console.log('=============================================='); +console.log(`\n認証プロキシを起動中... (port ${PROXY_PORT})`); +console.log('\n【手順】'); +console.log(` 1. ブラウザで http://localhost:${PROXY_PORT} を開く`); +console.log(' 2. Amazon アカウントにログイン(amazon.co.jp)'); +console.log(' 3. ログイン完了後、このコンソールに Cookie が表示される\n'); + +AlexaCookie.generateAlexaCookie( + '', + { + amazonPage: 'amazon.co.jp', + acceptLanguage: 'ja-JP', + setupProxy: true, + proxyPort: PROXY_PORT, + proxyOwnIp: '127.0.0.1', + proxyListenBind: '0.0.0.0', + logger: (msg) => { + if (!msg.includes('verbose') && !msg.includes('DEBUG')) { + console.log('[auth]', msg); + } + }, + }, + (err, cookie) => { + // alexa-cookie2 はブラウザを開くよう促すメッセージも err として渡してくる + if (err) { + const msg = err.message || String(err); + if (msg.includes('Please open')) { + // これは実際のエラーではなく「ブラウザで開いて」という指示 + console.log('\n>>> ブラウザで http://localhost:3456/ を開いて Amazon にログインしてください <<<\n'); + // プロキシを生かしたまま待機(process.exit しない) + return; + } + console.error('\n[ERROR] 認証失敗:', msg); + process.exit(1); + } + + console.log('\n=============================================='); + console.log(' Cookie 取得成功!'); + console.log('=============================================='); + console.log('\n以下の値を Windmill Variable に登録してください:'); + console.log(' パス: u/admin/ALEXA_COOKIE'); + console.log(' Secret: ON(チェックを入れる)'); + console.log('\n--- Cookie ---'); + console.log(cookie); + console.log('--- ここまで ---\n'); + + process.exit(0); + } +); diff --git a/alexa-api/auth2.js b/alexa-api/auth2.js new file mode 100644 index 0000000..b22c4d5 --- /dev/null +++ b/alexa-api/auth2.js @@ -0,0 +1,76 @@ +/** + * auth2.js - alexa-remote2 自身の認証フローを使う + * alexa-cookie2 より確実(ライブラリ内蔵の OAuth プロキシを使用) + * + * 使い方: + * node auth2.js + * → ブラウザで http://localhost:3001/ を開いて Amazon にログイン + * → 成功するとコンソールに Cookie が出力される → .env に保存 + */ + +const AlexaRemote = require('alexa-remote2'); +const fs = require('fs'); +const path = require('path'); + +const PORT = 3001; + +console.log('=============================================='); +console.log(' Alexa 認証ツール (alexa-remote2 内蔵プロキシ)'); +console.log('=============================================='); +console.log(`\nプロキシ起動中... (port ${PORT})`); +console.log(`\n【手順】ブラウザで http://localhost:${PORT}/ を開いて Amazon にログイン\n`); + +const alexa = new AlexaRemote(); + +alexa.init( + { + cookie: null, + alexaServiceHost: 'alexa.amazon.co.jp', + amazonPage: 'amazon.co.jp', + acceptLanguage: 'ja-JP', + useWsMqtt: false, + setupProxy: true, + proxyOwnIp: '127.0.0.1', + proxyPort: PORT, + proxyListenBind: '0.0.0.0', + logger: console.log, + onSucess: (refreshedCookie) => { + // 認証成功時にリフレッシュされた Cookie を受け取る + console.log('\n[onSucess] Cookie refreshed'); + }, + }, + (err, result) => { + if (err) { + const msg = err.message || String(err); + if (msg.includes('open') && (msg.includes('http://') || msg.includes('localhost'))) { + console.log(`\n>>> ブラウザで http://localhost:${PORT}/ を開いてください <<<\n`); + // プロキシを生かしたまま待機 + return; + } + console.error('\n[ERROR]', msg); + return; + } + + // 認証成功 + console.log('\n=============================================='); + console.log(' 認証成功!'); + console.log('=============================================='); + + // alexa-remote2 内部の Cookie を取得 + const cookie = alexa.cookie || alexa._options?.cookie; + if (cookie) { + const cookieStr = typeof cookie === 'string' ? cookie : JSON.stringify(cookie); + console.log('\n以下を alexa-api/.env の ALEXA_COOKIE に設定してください:\n'); + console.log('ALEXA_COOKIE=' + cookieStr); + + // .env に自動保存 + const envPath = path.join(__dirname, '.env'); + fs.writeFileSync(envPath, 'ALEXA_COOKIE=' + cookieStr + '\n'); + console.log(`\n.env に自動保存しました: ${envPath}`); + } else { + console.log('Cookie を取得できませんでした。alexa オブジェクト:', Object.keys(alexa)); + } + + process.exit(0); + } +); diff --git a/alexa-api/auth3.js b/alexa-api/auth3.js new file mode 100644 index 0000000..30b8b66 --- /dev/null +++ b/alexa-api/auth3.js @@ -0,0 +1,76 @@ +/** + * auth3.js - メール/パスワードで直接認証(2FA なしのアカウント向け) + * + * 使い方: + * AMAZON_EMAIL="xxx@xxx.com" AMAZON_PASSWORD="yourpass" node auth3.js + * + * 成功すると .env を更新して終了します。 + */ + +const AlexaRemote = require('alexa-remote2'); +const fs = require('fs'); +const path = require('path'); + +const email = process.env.AMAZON_EMAIL; +const password = process.env.AMAZON_PASSWORD; + +if (!email || !password) { + console.error('[ERROR] 環境変数 AMAZON_EMAIL と AMAZON_PASSWORD を設定してください'); + console.error(' 例: AMAZON_EMAIL="xxx@xxx.com" AMAZON_PASSWORD="pass" node auth3.js'); + process.exit(1); +} + +console.log(`[INFO] ${email} でログイン試行中...`); + +const alexa = new AlexaRemote(); + +alexa.init( + { + email, + password, + alexaServiceHost: 'alexa.amazon.co.jp', + amazonPage: 'amazon.co.jp', + acceptLanguage: 'ja-JP', + useWsMqtt: false, + setupProxy: false, + logger: (msg) => { + if (!msg.includes('verbose') && !msg.includes('Bearer')) { + console.log('[alexa]', msg); + } + }, + onSucess: (refreshedCookie) => { + saveCookie(refreshedCookie, 'onSucess refresh'); + }, + }, + (err) => { + if (err) { + console.error('[ERROR] 認証失敗(詳細):', err); + console.error('\n考えられる原因:'); + console.error(' - パスワードが違う'); + console.error(' - Amazon が CAPTCHA を要求している(後で再試行)'); + console.error(' - 2FA が実際は有効になっている'); + process.exit(1); + } + + // 認証成功 + const cookie = alexa.cookie; + saveCookie(cookie, 'init success'); + process.exit(0); + } +); + +function saveCookie(cookie, source) { + if (!cookie) { + console.error(`[${source}] Cookie が空です`); + return; + } + const cookieStr = typeof cookie === 'string' ? cookie : JSON.stringify(cookie); + const envPath = path.join(__dirname, '.env'); + fs.writeFileSync(envPath, 'ALEXA_COOKIE=' + cookieStr + '\n'); + + console.log('\n=============================================='); + console.log(' 認証成功!'); + console.log('=============================================='); + console.log('.env を更新しました:', envPath); + console.log('Cookie length:', cookieStr.length); +} diff --git a/alexa-api/auth4.js b/alexa-api/auth4.js new file mode 100644 index 0000000..589c02d --- /dev/null +++ b/alexa-api/auth4.js @@ -0,0 +1,190 @@ +/** + * auth4.js - Amazon Japan OpenID フローを正しく再現するカスタム認証スクリプト + * alexa-cookie2 の古いエンドポイント問題を回避して直接フォームを処理する + */ + +const https = require('https'); +const fs = require('fs'); +const path = require('path'); + +const EMAIL = process.env.AMAZON_EMAIL; +const PASSWORD = process.env.AMAZON_PASSWORD; + +if (!EMAIL || !PASSWORD) { + console.error('[ERROR] 環境変数 AMAZON_EMAIL と AMAZON_PASSWORD を設定してください'); + process.exit(1); +} + +const ALEXA_LOGIN_URL = + 'https://www.amazon.co.jp/ap/signin?' + + new URLSearchParams({ + 'openid.assoc_handle': 'amzn_dp_project_dee_jp', + 'openid.mode': 'checkid_setup', + 'openid.ns': 'http://specs.openid.net/auth/2.0', + 'openid.claimed_id': 'http://specs.openid.net/auth/2.0/identifier_select', + 'openid.identity': 'http://specs.openid.net/auth/2.0/identifier_select', + 'openid.return_to': 'https://alexa.amazon.co.jp/api/apps/v1/token', + 'pageId': 'amzn_dp_project_dee_jp', + }).toString(); + +const USER_AGENT = + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36'; + +let cookieJar = {}; + +function setCookies(setCookieHeaders) { + if (!setCookieHeaders) return; + const headers = Array.isArray(setCookieHeaders) ? setCookieHeaders : [setCookieHeaders]; + for (const h of headers) { + const [kv] = h.split(';'); + const [k, v] = kv.trim().split('='); + if (k && v !== undefined) cookieJar[k.trim()] = v.trim(); + } +} + +function getCookieHeader() { + return Object.entries(cookieJar) + .map(([k, v]) => `${k}=${v}`) + .join('; '); +} + +function request(url, options = {}) { + return new Promise((resolve, reject) => { + const parsed = new URL(url); + const reqOpts = { + hostname: parsed.hostname, + path: parsed.pathname + parsed.search, + method: options.method || 'GET', + headers: { + 'User-Agent': USER_AGENT, + 'Accept-Language': 'ja-JP,ja;q=0.9', + 'Accept': 'text/html,application/xhtml+xml,*/*;q=0.8', + 'Cookie': getCookieHeader(), + ...(options.headers || {}), + }, + }; + + const req = https.request(reqOpts, (res) => { + setCookies(res.headers['set-cookie']); + let body = ''; + res.on('data', (d) => (body += d)); + res.on('end', () => { + resolve({ status: res.statusCode, headers: res.headers, body }); + }); + }); + req.on('error', reject); + if (options.body) req.write(options.body); + req.end(); + }); +} + +// HTML の hidden フィールドを抽出 +function extractHiddenFields(html) { + const fields = {}; + const re = /]+type=["']?hidden["']?[^>]*>/gi; + let match; + while ((match = re.exec(html)) !== null) { + const tag = match[0]; + const name = (tag.match(/name=["']([^"']+)["']/) || [])[1]; + const value = (tag.match(/value=["']([^"']*)["']/) || ['', ''])[1]; + if (name) fields[name] = value; + } + return fields; +} + +// フォームの action URL を抽出 +function extractFormAction(html) { + const m = html.match(/id="ap_login_form"[^>]+action="([^"]+)"/); + if (m) return m[1].replace(/&/g, '&'); + const m2 = html.match(/name="signIn"[^>]+action="([^"]+)"/); + if (m2) return m2[1].replace(/&/g, '&'); + return null; +} + +async function main() { + console.log('[1] ログインページ取得中...'); + const page1 = await request(ALEXA_LOGIN_URL); + console.log(` Status: ${page1.status}, Cookies: ${Object.keys(cookieJar).join(', ')}`); + + if (page1.status !== 200) { + console.error(`[ERROR] ログインページ取得失敗: ${page1.status}`); + process.exit(1); + } + + // フォーム情報を抽出 + const action = extractFormAction(page1.body); + const hidden = extractHiddenFields(page1.body); + + if (!action) { + console.error('[ERROR] ログインフォームが見つかりません。HTMLを確認します:'); + console.error(page1.body.substring(0, 500)); + process.exit(1); + } + + console.log(`[2] フォーム送信先: ${action}`); + console.log(` Hidden fields: ${Object.keys(hidden).join(', ')}`); + + // フォームデータ構築 + const formData = new URLSearchParams({ + ...hidden, + email: EMAIL, + password: PASSWORD, + rememberMe: 'true', + }).toString(); + + console.log('[3] 認証送信中...'); + const page2 = await request(action, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Referer': ALEXA_LOGIN_URL, + }, + body: formData, + }); + console.log(` Status: ${page2.status}`); + console.log(` Location: ${page2.headers.location || '(none)'}`); + console.log(` Cookies after login: ${Object.keys(cookieJar).join(', ')}`); + + // リダイレクトをたどる + let current = page2; + let redirectCount = 0; + while (current.status >= 300 && current.status < 400 && current.headers.location && redirectCount < 10) { + const loc = current.headers.location; + const nextUrl = loc.startsWith('http') ? loc : `https://www.amazon.co.jp${loc}`; + console.log(`[${4 + redirectCount}] Redirect → ${nextUrl.substring(0, 80)}...`); + current = await request(nextUrl); + console.log(` Status: ${current.status}, New Cookies: ${Object.keys(cookieJar).join(', ')}`); + redirectCount++; + } + + // 成功判定: at-acbjp または session-token が含まれているか + const cookie = getCookieHeader(); + const hasAlexaToken = cookie.includes('at-acbjp') || cookie.includes('session-token'); + + if (!hasAlexaToken) { + console.error('[ERROR] 認証に失敗しました。取得できたCookieに認証トークンが含まれていません。'); + console.error('取得済みCookieキー:', Object.keys(cookieJar).join(', ')); + if (current.body.includes('captcha') || current.body.includes('CAPTCHA')) { + console.error('※ CAPTCHA が要求されています。しばらく待ってから再試行してください。'); + } + if (current.body.includes('password') && current.body.includes('error')) { + console.error('※ パスワードが間違っている可能性があります。'); + } + process.exit(1); + } + + // .env に保存 + const envPath = path.join(__dirname, '.env'); + fs.writeFileSync(envPath, `ALEXA_COOKIE=${cookie}\n`); + + console.log('\n=============================================='); + console.log(' 認証成功!'); + console.log('=============================================='); + console.log(`.env を保存しました: ${envPath}`); + console.log(`Cookie 長さ: ${cookie.length} 文字`); +} + +main().catch((err) => { + console.error('[FATAL]', err); + process.exit(1); +}); diff --git a/alexa-api/docker-compose.yml b/alexa-api/docker-compose.yml new file mode 100644 index 0000000..514626b --- /dev/null +++ b/alexa-api/docker-compose.yml @@ -0,0 +1,19 @@ +services: + alexa-api: + build: . + container_name: alexa_api + restart: unless-stopped + env_file: + - .env + environment: + - PORT=3500 + networks: + - windmill_windmill-internal + # 外部には公開しない(Windmill ワーカーから内部ネットワーク経由でのみアクセス) + # デバッグ時は以下のコメントを外す: + # ports: + # - "127.0.0.1:3500:3500" + +networks: + windmill_windmill-internal: + external: true diff --git a/alexa-api/package-lock.json b/alexa-api/package-lock.json new file mode 100644 index 0000000..27335ba --- /dev/null +++ b/alexa-api/package-lock.json @@ -0,0 +1,1257 @@ +{ + "name": "alexa-api", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "alexa-api", + "version": "1.0.0", + "dependencies": { + "alexa-cookie2": "^5.0.3", + "alexa-remote2": "^5.0.0", + "express": "^4.18.0" + } + }, + "node_modules/@types/http-proxy": { + "version": "1.17.17", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.17.tgz", + "integrity": "sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "25.3.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.3.tgz", + "integrity": "sha512-DpzbrH7wIcBaJibpKo9nnSQL0MTRdnWttGyE5haGwK86xgMOkFLp7vEyfQPGLOJh5wNYiJ3V9PmUMDhV9u8kkQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/alexa-cookie2": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/alexa-cookie2/-/alexa-cookie2-5.0.3.tgz", + "integrity": "sha512-z9G32J0+mDgtR/8+3lF49h+yKU5mlX1NwDPR1A67UjX1TjHhK8m552uI/0E4TpL9/6c3VbmNWmbkKRm8imSsRg==", + "license": "MIT", + "dependencies": { + "cookie": "^0.6.0", + "express": "^4.21.2", + "http-proxy-middleware": "^2.0.9", + "http-proxy-response-rewrite": "^0.0.1", + "https": "^1.0.0", + "querystring": "^0.2.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/alexa-remote2": { + "version": "5.10.3", + "resolved": "https://registry.npmjs.org/alexa-remote2/-/alexa-remote2-5.10.3.tgz", + "integrity": "sha512-tAuvMjdN/dXfQ8cAx15LzSvC9NEBY5aabo1suF/FMBr7YTgjllZPjqtUoTRZZrrDUeJTjGsVmkW0baQ1FoGXpQ==", + "license": "MIT", + "dependencies": { + "alexa-cookie2": "^4.1.3", + "extend": "^3.0.2", + "https": "^1.0.0", + "querystring": "^0.2.1", + "uuid": "^9.0.0", + "ws": "^8.13.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/alexa-remote2/node_modules/alexa-cookie2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/alexa-cookie2/-/alexa-cookie2-4.2.0.tgz", + "integrity": "sha512-+mipu5MdvnYuIXRSuWyJw5Fu7KVROtR4jHZwKdYpTvi7khTnBjpkfQVuMk1WkJEKSHmaHHs0duzAvPIefDo1IA==", + "license": "MIT", + "dependencies": { + "cookie": "^0.5.0", + "express": "^4.18.2", + "http-proxy-middleware": "^2.0.6", + "http-proxy-response-rewrite": "^0.0.1", + "https": "^1.0.0", + "querystring": "^0.2.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/alexa-remote2/node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", + "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.14.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/bufferhelper": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/bufferhelper/-/bufferhelper-0.2.1.tgz", + "integrity": "sha512-asncN5SO1YOZLCV3u26XtrbF9QXhSyq01nQOc1TFt9/gfOn7feOGJoVKk5Ewtj7wvFGPH/eGSKZ5qq/A4/PPfw==", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "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/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/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/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/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/express": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", + "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.3", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.12", + "proxy-addr": "~2.0.7", + "qs": "~6.14.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express/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/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/http-proxy-middleware": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.9.tgz", + "integrity": "sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q==", + "license": "MIT", + "dependencies": { + "@types/http-proxy": "^1.17.8", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "@types/express": "^4.17.13" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + } + } + }, + "node_modules/http-proxy-response-rewrite": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-response-rewrite/-/http-proxy-response-rewrite-0.0.1.tgz", + "integrity": "sha512-smtaa2sKgiWrP9c9W+/MFzgjeh3A4zsQOLh1S3rp1NsmNYIVO07AlWUnhoUnMZIuxY6+3v7OS5NlDGX2I2DWBQ==", + "license": "MIT", + "dependencies": { + "bufferhelper": "^0.2.1", + "concat-stream": "^1.5.1" + } + }, + "node_modules/https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz", + "integrity": "sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg==", + "license": "ISC" + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "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": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-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/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", + "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystring": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.1.tgz", + "integrity": "sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "license": "MIT", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "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/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "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/ws": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz", + "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/alexa-api/package.json b/alexa-api/package.json new file mode 100644 index 0000000..1fdcd0c --- /dev/null +++ b/alexa-api/package.json @@ -0,0 +1,16 @@ +{ + "name": "alexa-api", + "version": "1.0.0", + "description": "Alexa TTS API server for Windmill integration", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "express": "^4.18.0" + }, + "devDependencies": { + "alexa-cookie2": "^5.0.3", + "alexa-remote2": "^5.0.0" + } +} diff --git a/alexa-api/server.js b/alexa-api/server.js new file mode 100644 index 0000000..c16e785 --- /dev/null +++ b/alexa-api/server.js @@ -0,0 +1,208 @@ +/** + * alexa-api/server.js + * Windmill から Echo デバイスに TTS を送る API サーバー + * 直接 Alexa API を叩く実装(alexa-remote2 不使用) + * + * Endpoints: + * POST /speak { device: "デバイス名 or serial", text: "しゃべる内容" } + * GET /devices デバイス一覧取得 + * GET /health ヘルスチェック + */ + +const https = require('https'); +const express = require('express'); + +const app = express(); +app.use(express.json()); + +const PORT = process.env.PORT || 3500; +const ALEXA_HOST = 'alexa.amazon.co.jp'; +const ALEXA_COOKIE = process.env.ALEXA_COOKIE; + +if (!ALEXA_COOKIE) { + console.error('[ERROR] ALEXA_COOKIE 環境変数が設定されていません。'); + process.exit(1); +} + +// ---- キャッシュ ---- + +let cachedDevices = null; +let cachedCustomerId = null; +let deviceCacheExpires = 0; + +// ---- HTTP ヘルパー ---- + +function httpsRequest(path, options, extraCookies) { + options = options || {}; + extraCookies = extraCookies || ''; + return new Promise(function(resolve, reject) { + var allCookies = ALEXA_COOKIE + (extraCookies ? '; ' + extraCookies : ''); + var reqOpts = { + hostname: ALEXA_HOST, + path: path, + method: options.method || 'GET', + headers: Object.assign({ + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', + 'Accept': 'application/json, text/plain, */*', + 'Accept-Language': 'ja-JP,ja;q=0.9', + 'Cookie': allCookies, + }, options.headers || {}), + }; + var req = https.request(reqOpts, function(res) { + var body = ''; + res.on('data', function(d) { body += d; }); + res.on('end', function() { resolve({ status: res.statusCode, headers: res.headers, body: body }); }); + }); + req.on('error', reject); + if (options.body) req.write(options.body); + req.end(); + }); +} + +// ---- Alexa API ヘルパー ---- + +async function getCsrfToken() { + var res = await httpsRequest('/api/language'); + var setCookies = res.headers['set-cookie'] || []; + var csrfCookieStr = setCookies.find(function(c) { return c.startsWith('csrf='); }); + if (!csrfCookieStr) throw new Error('CSRF token not found'); + return csrfCookieStr.split('=')[1].split(';')[0]; +} + +async function getCustomerId() { + if (cachedCustomerId) return cachedCustomerId; + var res = await httpsRequest('/api/bootstrap'); + if (res.status !== 200) throw new Error('Bootstrap API failed: ' + res.status); + var data = JSON.parse(res.body); + cachedCustomerId = data.authentication && data.authentication.customerId; + if (!cachedCustomerId) throw new Error('customerId not found'); + return cachedCustomerId; +} + +async function getDevices(force) { + var now = Date.now(); + if (!force && cachedDevices && now < deviceCacheExpires) return cachedDevices; + var res = await httpsRequest('/api/devices-v2/device?cached=false'); + if (res.status !== 200) throw new Error('Devices API failed: ' + res.status); + var data = JSON.parse(res.body); + cachedDevices = data.devices || []; + deviceCacheExpires = now + 5 * 60 * 1000; + return cachedDevices; +} + +function findDevice(devices, nameOrSerial) { + var bySerial = devices.find(function(d) { return d.serialNumber === nameOrSerial; }); + if (bySerial) return bySerial; + var lower = nameOrSerial.toLowerCase(); + var byName = devices.find(function(d) { return d.accountName && d.accountName.toLowerCase() === lower; }); + if (byName) return byName; + return devices.find(function(d) { return d.accountName && d.accountName.toLowerCase().includes(lower); }); +} + +// ---- API エンドポイント ---- + +// POST /speak +app.post('/speak', async function(req, res) { + var body = req.body || {}; + var device = body.device; + var text = body.text; + + if (!device || !text) { + return res.status(400).json({ error: 'device と text は必須です' }); + } + + console.log('[SPEAK] device="' + device + '" text="' + text + '"'); + + try { + var results = await Promise.all([getCsrfToken(), getCustomerId(), getDevices()]); + var csrfToken = results[0]; + var customerId = results[1]; + var devices = results[2]; + + var target = findDevice(devices, device); + if (!target) { + var names = devices.map(function(d) { return d.accountName; }).join(', '); + return res.status(404).json({ error: 'デバイス "' + device + '" が見つかりません', available: names }); + } + + console.log(' -> ' + target.accountName + ' (type=' + target.deviceType + ', serial=' + target.serialNumber + ')'); + + var sequenceObj = { + '@type': 'com.amazon.alexa.behaviors.model.Sequence', + startNode: { + '@type': 'com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode', + type: 'Alexa.Speak', + operationPayload: { + deviceType: target.deviceType, + deviceSerialNumber: target.serialNumber, + customerId: customerId, + locale: 'ja-JP', + textToSpeak: text, + }, + }, + }; + + var bodyStr = JSON.stringify({ + behaviorId: 'PREVIEW', + sequenceJson: JSON.stringify(sequenceObj), + status: 'ENABLED', + }); + + var ttsRes = await httpsRequest('/api/behaviors/preview', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'csrf': csrfToken, + 'Referer': 'https://alexa.amazon.co.jp/spa/index.html', + 'Origin': 'https://alexa.amazon.co.jp', + }, + body: bodyStr, + }, 'csrf=' + csrfToken); + + if (ttsRes.status === 200 || ttsRes.status === 202) { + console.log(' [OK] TTS sent to ' + target.accountName); + res.json({ ok: true, device: target.accountName, text: text }); + } else { + console.error(' [ERROR] TTS failed: ' + ttsRes.status + ' ' + ttsRes.body); + res.status(502).json({ error: 'Alexa API error: ' + ttsRes.status, body: ttsRes.body }); + } + } catch (err) { + console.error('[ERROR] /speak:', err.message); + res.status(500).json({ error: err.message }); + } +}); + +// GET /devices +app.get('/devices', async function(req, res) { + try { + var devices = await getDevices(true); + res.json(devices.map(function(d) { + return { name: d.accountName, type: d.deviceType, serial: d.serialNumber, online: d.online, family: d.deviceFamily }; + })); + } catch (err) { + console.error('[ERROR] /devices:', err.message); + res.status(500).json({ error: err.message }); + } +}); + +// GET /health +app.get('/health', function(req, res) { + res.json({ ok: true, cookieLength: ALEXA_COOKIE.length }); +}); + +// ---- 起動 ---- + +app.listen(PORT, '0.0.0.0', async function() { + console.log('[INFO] alexa-api server listening on port ' + PORT); + try { + var customerId = await getCustomerId(); + console.log('[INFO] Customer ID: ' + customerId); + var devices = await getDevices(); + var echoDevices = devices.filter(function(d) { + return (d.deviceType && (d.deviceType.startsWith('A4ZXE') || d.deviceType.startsWith('ASQZWP'))); + }); + console.log('[INFO] Echo devices: ' + echoDevices.map(function(d) { return d.accountName; }).join(', ')); + } catch (err) { + console.error('[WARN] Startup init failed:', err.message); + } +}); diff --git a/alexa-api/test_tts.js b/alexa-api/test_tts.js new file mode 100644 index 0000000..e758a3e --- /dev/null +++ b/alexa-api/test_tts.js @@ -0,0 +1,119 @@ +/** + * test_tts.js - TTS API テスト + * node test_tts.js + */ +const https = require('https'); +const fs = require('fs'); +const path = require('path'); + +const envContent = fs.readFileSync(path.join(__dirname, '.env'), 'utf8'); +const COOKIE_STR = envContent.match(/ALEXA_COOKIE=(.+)/)[1].trim(); + +function makeRequest(url, options = {}, extraCookies = '') { + return new Promise((resolve, reject) => { + const parsed = new URL(url); + const allCookies = COOKIE_STR + (extraCookies ? '; ' + extraCookies : ''); + const reqOpts = { + hostname: parsed.hostname, + path: parsed.pathname + parsed.search, + method: options.method || 'GET', + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', + 'Accept': 'application/json, text/plain, */*', + 'Accept-Language': 'ja-JP,ja;q=0.9', + 'Cookie': allCookies, + ...(options.headers || {}), + }, + }; + const req = https.request(reqOpts, (res) => { + let body = ''; + res.on('data', d => body += d); + res.on('end', () => resolve({ status: res.statusCode, headers: res.headers, body })); + }); + req.on('error', reject); + if (options.body) req.write(options.body); + req.end(); + }); +} + +async function main() { + // 1. CSRFトークン取得 + console.log('[1] CSRF token取得...'); + const langRes = await makeRequest('https://alexa.amazon.co.jp/api/language'); + const setCookies = langRes.headers['set-cookie'] || []; + const csrfCookieStr = setCookies.find(c => c.startsWith('csrf=')); + const csrfToken = csrfCookieStr ? csrfCookieStr.split('=')[1].split(';')[0] : null; + console.log(' CSRF token:', csrfToken); + console.log(' Status:', langRes.status); + + if (!csrfToken) { console.error('CSRF token not found!'); process.exit(1); } + + // 2. デバイス一覧取得 + console.log('[2] デバイス一覧取得...'); + const devRes = await makeRequest('https://alexa.amazon.co.jp/api/devices-v2/device?cached=false'); + console.log(' Status:', devRes.status); + const devices = JSON.parse(devRes.body).devices || []; + console.log(' Device count:', devices.length); + + // デバイス一覧表示 + devices.filter(d => d.deviceFamily !== 'TABLET').forEach(d => { + console.log(` - ${d.accountName} (type=${d.deviceType}, serial=${d.serialNumber})`); + }); + + // プレハブを探す + const target = devices.find(d => d.serialNumber === 'G0922H085165007R'); + console.log('\nTarget device:', target ? `${target.accountName}` : 'NOT FOUND'); + + if (!target) { process.exit(1); } + + // 2.5. カスタマーIDを取得 + const bootstrapRes = await makeRequest('https://alexa.amazon.co.jp/api/bootstrap'); + const bootstrap = JSON.parse(bootstrapRes.body); + const customerId = bootstrap.authentication?.customerId; + console.log(' Customer ID:', customerId); + + // 3. TTSリクエスト + const sequenceObj = { + '@type': 'com.amazon.alexa.behaviors.model.Sequence', + startNode: { + '@type': 'com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode', + type: 'Alexa.Speak', + operationPayload: { + deviceType: target.deviceType, + deviceSerialNumber: target.serialNumber, + customerId: customerId, + locale: 'ja-JP', + textToSpeak: 'テストです。聞こえますか', + }, + }, + }; + + const bodyObj = { + behaviorId: 'PREVIEW', + sequenceJson: JSON.stringify(sequenceObj), + status: 'ENABLED', + }; + const body = JSON.stringify(bodyObj); + + console.log('\n[3] TTS送信...'); + + const ttsRes = await makeRequest('https://alexa.amazon.co.jp/api/behaviors/preview', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'csrf': csrfToken, + 'Referer': 'https://alexa.amazon.co.jp/spa/index.html', + 'Origin': 'https://alexa.amazon.co.jp', + }, + body, + }, `csrf=${csrfToken}`); + + console.log('TTS status:', ttsRes.status); + console.log('TTS response:', ttsRes.body.substring(0, 500)); + + if (ttsRes.status === 200 || ttsRes.status === 202) { + console.log('\n成功!エコーがしゃべるはずです。'); + } +} + +main().catch(console.error); diff --git a/scripts/alexa_speak.ts b/scripts/alexa_speak.ts new file mode 100644 index 0000000..3e63de4 --- /dev/null +++ b/scripts/alexa_speak.ts @@ -0,0 +1,30 @@ +/** + * alexa_speak.ts + * 指定した Echo デバイスにテキストを読み上げさせる Windmill スクリプト + * + * パラメータ: + * device - デバイス名またはシリアル番号(例: "リビングエコー1", "プレハブ") + * text - 読み上げるテキスト + */ + +export async function main( + device: string, + text: string, +): Promise<{ ok: boolean; device: string; text: string }> { + const ALEXA_API_URL = "http://alexa_api:3500"; + + const res = await fetch(`${ALEXA_API_URL}/speak`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ device, text }), + }); + + if (!res.ok) { + const body = await res.json().catch(() => ({})); + throw new Error( + `alexa-api error ${res.status}: ${JSON.stringify(body)}` + ); + } + + return await res.json(); +}