diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..8d0d500 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,7 @@ +node_modules +dist +.git +*.log +.DS_Store +Dockerfile +.dockerignore diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/frontend/.impeccable/config.json b/frontend/.impeccable/config.json new file mode 100644 index 0000000..eb4892c --- /dev/null +++ b/frontend/.impeccable/config.json @@ -0,0 +1,17 @@ +{ + "detector": { + "ignoreRules": [], + "ignoreFiles": [], + "ignoreValues": [ + { + "rule": "side-tab", + "value": "*", + "files": [ + "src/a/APages.tsx" + ], + "createdAt": "2026-09-29T13:18:15.447Z", + "reason": "model triage: border-r-4 border-black are cell dividers of the A poster-grid wall (user-chosen A 포스터 그리드), not colored side accents" + } + ] + } +} diff --git a/frontend/.impeccable/hook.cache.json b/frontend/.impeccable/hook.cache.json new file mode 100644 index 0000000..c3d0937 --- /dev/null +++ b/frontend/.impeccable/hook.cache.json @@ -0,0 +1 @@ +{"version":1,"sessions":{"8dca1a79-a5f0-4a96-a6a0-46a1ea37b382":{"updatedAt":1790727492068,"files":{"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/a/APages.tsx":{"editCount":2,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true}},"footerShown":true},"9c398292-16d6-4b79-a132-a0f1dcfae041":{"updatedAt":1790905454036,"files":{"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/b.css":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/ui.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/mock/feed.ts":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}}},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/mock/week.ts":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}}},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/mock/season.ts":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}}},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/data.ts":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}}},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/Sheets.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/svg.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/BLayout.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/Post.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/realPosts.ts":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}}},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/TodayPage.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/GakPage.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/SkyPage.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/WeekPage.tsx":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/b/SeasonPage.tsx":{"editCount":2,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}},"cleanAcked":true},"/Users/minachoi/orca/workspaces/o2o-weather/main-2/frontend/src/api/mutator/custom-fetch.ts":{"editCount":1,"findings":[],"stopBaseline":{"version":1,"engine":"0.1.5","counts":{}}}}}}} \ No newline at end of file diff --git a/frontend/.oxlintrc.json b/frontend/.oxlintrc.json new file mode 100644 index 0000000..6fa991d --- /dev/null +++ b/frontend/.oxlintrc.json @@ -0,0 +1,8 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["react", "typescript", "oxc"], + "rules": { + "react/rules-of-hooks": "error", + "react/only-export-components": ["warn", { "allowConstantExport": true }] + } +} diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..29628fc --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1 + +# ---- deps: package.json이 바뀔 때만 다시 설치 ---- +FROM node:24-alpine AS deps +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci + +# ---- dev: 코드 수정이 바로 반영되는 개발 서버 ---- +FROM deps AS dev +COPY . . +EXPOSE 5173 +CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "5173"] + +# ---- build: 타입체크 후 정적 파일 생성 ---- +FROM deps AS build +COPY . . +RUN npm run build + +# ---- prod: nginx로 정적 파일 제공 ---- +FROM nginx:1.29-alpine AS prod +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/dist /usr/share/nginx/html +EXPOSE 80 +HEALTHCHECK --interval=30s --timeout=3s CMD wget -q -O /dev/null http://127.0.0.1/ || exit 1 diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..d6af7e3 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,32 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) + +## React Compiler + +The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). + +## Expanding the Oxlint configuration + +If you are developing a production application, we recommend enabling type-aware lint rules by installing `oxlint-tsgolint` and editing `.oxlintrc.json`: + +```json +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["react", "typescript", "oxc"], + "options": { + "typeAware": true + }, + "rules": { + "react/rules-of-hooks": "error", + "react/only-export-components": ["warn", { "allowConstantExport": true }] + } +} +``` + +See the [Oxlint rules documentation](https://oxc.rs/docs/guide/usage/linter/rules) for the full list of rules and categories. diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..1607697 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,24 @@ + + + + + + + + 날씨각 + + + + + + +
+ + + diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..b96e8a7 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,28 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + # 폴더 주소로 넘길 때 포트가 빠지지 않게 상대 주소로 보낸다 + absolute_redirect off; + + gzip on; + gzip_types text/css application/javascript image/svg+xml application/json; + + # 해시가 붙은 빌드 파일은 오래 캐시 + location /assets/ { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } + + location /icons/ { + add_header Cache-Control "public, max-age=604800"; + try_files $uri =404; + } + + # SPA: /indices, /sky 같은 주소로 새로고침해도 index.html을 돌려준다 + location / { + add_header Cache-Control "no-cache"; + try_files $uri $uri/ /index.html; + } +} diff --git a/frontend/openapi-ts.config.ts b/frontend/openapi-ts.config.ts new file mode 100644 index 0000000..2a866c2 --- /dev/null +++ b/frontend/openapi-ts.config.ts @@ -0,0 +1,22 @@ +import { defineConfig } from '@hey-api/openapi-ts' + +export default defineConfig({ + input: process.env.OPENAPI_INPUT ?? 'http://localhost:9810/openapi.json', + output: 'src/api/client', + parser: { + patch: { + // FastAPI operationId("get_feed_v1_feed_get")에서 "_v1_" 앞만 camelCase로 → getFeed / getFeedOptions / addCommentMutation + operations: (_method, _path, operation) => { + const id = operation.operationId ?? '' + const base = id.split('_v1_')[0] || id + operation.operationId = base.replace(/_([a-z])/g, (_m, c: string) => c.toUpperCase()) + }, + }, + }, + plugins: [ + { name: '@hey-api/client-fetch', throwOnError: true }, + { name: '@hey-api/typescript', enums: 'javascript' }, + '@hey-api/sdk', + '@tanstack/react-query', + ], +}) diff --git a/frontend/package-lock.json b/frontend/package-lock.json new file mode 100644 index 0000000..7a4b7ec --- /dev/null +++ b/frontend/package-lock.json @@ -0,0 +1,2655 @@ +{ + "name": "frontend", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "frontend", + "version": "0.0.0", + "dependencies": { + "@tailwindcss/vite": "^4.3.3", + "@tanstack/react-query": "^5.104.0", + "react": "^19.2.8", + "react-dom": "^19.2.8", + "react-router": "^8.4.0", + "tailwindcss": "^4.3.3" + }, + "devDependencies": { + "@hey-api/openapi-ts": "0.99.0", + "@types/node": "^24.13.3", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.7", + "@vitejs/plugin-react": "^6.1.1", + "oxlint": "^1.81.0", + "typescript": "~6.0.2", + "vite": "^8.3.0" + } + }, + "node_modules/@hey-api/codegen-core": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@hey-api/codegen-core/-/codegen-core-0.9.1.tgz", + "integrity": "sha512-s97jL1dgTMuiMHv2BZ1X4Tgd99Mf9GOvGdNqNcGwIMmnR+PgYNoraj4Zvp134MKsNCap/m7k0r0vKKnl56pj4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hey-api/types": "0.1.4", + "ansi-colors": "4.1.3", + "c12": "3.3.4", + "color-support": "1.1.3" + }, + "engines": { + "node": ">=22.18.0" + }, + "funding": { + "url": "https://github.com/sponsors/hey-api" + } + }, + "node_modules/@hey-api/json-schema-ref-parser": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.4.4.tgz", + "integrity": "sha512-otmd+zCxbYVBIp/mlMTnGkvlNYLkVKgs3VOIq0kSnenhB1+fRwLPQIeSwyWM6E51oXhUedkYjVsVpkVexeuJOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jsdevtools/ono": "7.1.3", + "@types/json-schema": "7.0.15", + "js-yaml": "4.2.0" + }, + "engines": { + "node": ">=22.18.0" + }, + "funding": { + "url": "https://github.com/sponsors/hey-api" + } + }, + "node_modules/@hey-api/openapi-ts": { + "version": "0.99.0", + "resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.99.0.tgz", + "integrity": "sha512-SePU/5oEWWkvUBYmvzdYRctseoLuskyhs4ET0RvLIcmzc8yLQoA2R+KtBIQ8bPsoSUB0m4E5SmBnl6aGSA0szQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hey-api/codegen-core": "0.9.1", + "@hey-api/json-schema-ref-parser": "1.4.4", + "@hey-api/shared": "0.5.0", + "@hey-api/spec-types": "0.2.0", + "@hey-api/types": "0.1.4", + "@lukeed/ms": "2.0.2", + "ansi-colors": "4.1.3", + "color-support": "1.1.3", + "commander": "15.0.0", + "get-tsconfig": "4.14.0" + }, + "bin": { + "openapi-ts": "bin/run.js" + }, + "engines": { + "node": ">=22.18.0" + }, + "funding": { + "url": "https://github.com/sponsors/hey-api" + }, + "peerDependencies": { + "typescript": ">=5.5.3 || >=6.0.0 || 6.0.1-rc" + } + }, + "node_modules/@hey-api/shared": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@hey-api/shared/-/shared-0.5.0.tgz", + "integrity": "sha512-JN/j4Ebh4cJGYIQ5cwWuqe7GeSUyQoz7oC51WqyhKOcrejK6DKZMDkshc5d1eKTRuRL+rjozuRcoUaZZn2DGPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hey-api/codegen-core": "0.9.1", + "@hey-api/json-schema-ref-parser": "1.4.4", + "@hey-api/spec-types": "0.2.0", + "@hey-api/types": "0.1.4", + "ansi-colors": "4.1.3", + "cross-spawn": "7.0.6", + "open": "11.0.0", + "semver": "7.8.4" + }, + "engines": { + "node": ">=22.18.0" + }, + "funding": { + "url": "https://github.com/sponsors/hey-api" + } + }, + "node_modules/@hey-api/spec-types": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@hey-api/spec-types/-/spec-types-0.2.0.tgz", + "integrity": "sha512-ibQ8Is7evMavzr8GNyJCcTg975d8DpaMUyLmOrQ85UBdy1l6t1KuRAwgChAbesJsIlNV6gjmlXruWyegDX18Fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hey-api/types": "0.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/hey-api" + } + }, + "node_modules/@hey-api/types": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@hey-api/types/-/types-0.1.4.tgz", + "integrity": "sha512-thWfawrDIP7wSI9ioT13I5soaaqB5vAPIiZmgD8PbeEVKNrkonc0N/Sjj97ezl7oQgusZmaNphGdMKipPO6IBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.2.tgz", + "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.151.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.151.0.tgz", + "integrity": "sha512-J1yXrIlNDZVzE3ada310xeAw7nH8yCAyLPuUIsjKatFPmfn5bS1oW+cM+QsGOtVWd5nhSpbwZWx/rue+r5Z+PA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@oxlint/binding-android-arm-eabi": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.86.0.tgz", + "integrity": "sha512-63Ozq6yQn79B2UxjSZ9huJmI+3/ZPI7hxAe6TyFh9oQL447KnIMoffOdtog+h4KILbQr61ZRvFPW5gYbAUgpgQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-android-arm64": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.86.0.tgz", + "integrity": "sha512-JdLGp44phbf/0Du236Dt06yfK6Qw8xhTFeDvHJdjk167r59OfP5+BL31mgMYVnswS8e+j6tFuccSY0QDC/lgCw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-arm64": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.86.0.tgz", + "integrity": "sha512-h+vkOr4ik6KLFCXdtNVEj9xfnXfNUpPoF95QjORdhiSpLqQePzcN81kGHjAgsw1/G7WBWK5KsFKbI2UK8EyzMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-x64": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.86.0.tgz", + "integrity": "sha512-wbglRuH5eKsp68keTOOeKDHU1astWSRYFsh2bwKQTAPb44rD6kVgzYI1ZrAJRTc6/7PH55ZXFCQx0rQXrj0UdA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-freebsd-x64": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.86.0.tgz", + "integrity": "sha512-yTQ7QSOlNfQsrfbeVweTiegQJLKPjUKgXp/JpGiFzza6Hp29S9LAoH77TM3L0RjK39iQRZB5lk5iq2t241Mfag==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-gnueabihf": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.86.0.tgz", + "integrity": "sha512-QYJGy0E2Tv8GAayyBIeHFTwQb8u+zrvrOYrifuDGZDr9ad5XsDhiMScpZymhS9fwWjqrgG2ZUwT4vpY0ISqp4Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-musleabihf": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.86.0.tgz", + "integrity": "sha512-oQo83CafLT8p3qh0AGkN0tSUIh5Hm63mfDsoqUmBQUBnSZLNBAbyRaAftfGY5a0cKZ34dG6jAtMYgcY5kZqt5g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-gnu": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.86.0.tgz", + "integrity": "sha512-EM6wy5c2UM12qPb7iDJDBAZvHyfEJGH6iosFgaFiaRZpirz99//EHcUyD2KAskz07x1TULuiAtsojf4nvWWksw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-musl": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.86.0.tgz", + "integrity": "sha512-vCiUQb9ZNzZalxYRU4mlZwUqT5f+c7Sk9DwUOplWHtik3Dl4r3DVnUB5tBeRuTAUe6MUVCTylNW7TkkN8J1oTw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-ppc64-gnu": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.86.0.tgz", + "integrity": "sha512-T0AzE89yjTYmOhB/hb6i+rWTpe2mYt+xiguBhs9DEPIJTZ1H8OYqsE4VxJHHw2Wlq8Mztwvp2P8NV87ZOuhPRw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-gnu": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.86.0.tgz", + "integrity": "sha512-s49r0K2f5Oc7fJoMUO1WkdhYK5Ob79uYRwWQ/XNoGysaOq3RUGmGUbHSuXiyydTTA+P9xEdDEnnlZVXiaSJhlw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-musl": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.86.0.tgz", + "integrity": "sha512-JIa2tYR8ayb3nvcMSZzn4O/xTy13S7MHllu7cBD+B5qDQXXSRy/Vwk1aNpiTjZmBJGwKCHOy/NvnY5Xcwg27uQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-s390x-gnu": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.86.0.tgz", + "integrity": "sha512-XwXMyBsAuWZkhZU74UNcfQKr1CJJAKnS80dZzOnjl6A4fKcf91IjFgidegQugMHA5SN8ulwDXEDV1yPntjXgQQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-gnu": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.86.0.tgz", + "integrity": "sha512-C1WjukSyMnr66b+w1/tV8RFVv6d9v0MzDf4p9IxVXknqgmTHBgZh1pccN1eHzFr0b9Tbb3OXoPsAAdAuHAQfeA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-musl": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.86.0.tgz", + "integrity": "sha512-ap6KLmvC38c6MdYzsIh25cXQupqYvjd37tMNftzrX1DCtkX1Gcf2B+S2B17dD4lKa5c5gJog7DQJyDo82PBKyw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.86.0.tgz", + "integrity": "sha512-996Q9w/2GLwNyy5Djs39Jt09aFlr4b7TPhoj7dvo5FHmcyiF68nPz73HNc5UAYKIYeK+M9JzPQ4Wg1r1dXvP6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.86.0.tgz", + "integrity": "sha512-9uTCHYTknNkug5+46ViSoUMuOuGWK61D87QnblU6CXaWKJC630Z7dbls61vdHxya/cR2ycQZ6Mm6ckgF6Cag5g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.86.0.tgz", + "integrity": "sha512-a47ga7EKVfMU8rO0i1m3mGwfNRj3FhQyt1d/ukO/E9u1HHF3KpR3tyb3VhuJBGEVPF8uR4exSyHUyx7xbE+uxw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.86.0.tgz", + "integrity": "sha512-az4dzifCRzES1crwu6pDFXzJTIanrdxXFL9TbiJWrx9LKcuacbR83aPvxDA1LKLNswi/RoqitC7Afcflhu3zBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@remix-run/route-pattern": { + "version": "0.22.1", + "resolved": "https://registry.npmjs.org/@remix-run/route-pattern/-/route-pattern-0.22.1.tgz", + "integrity": "sha512-czdGJWh09Lapvcqt7Vb09KlrU2PhRJ8xQaI+AItTuD9aDJ5MAgxnS38lnys6Ll+6RJEqPiaUqTwIQhVLwFvv+w==", + "license": "MIT" + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.11.tgz", + "integrity": "sha512-A5kXfGKvKWWZE0TtPrfsvT+q4Y5d1QG8gGUzpYjGydM+fARM9MuX90PrXYXe0XbsDVgyxxNzHo6giCj90bsFNw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.11.tgz", + "integrity": "sha512-z6cTycz+iJ4PVkuL4HHW4DfTfoeU/2nqYYuSOrTmH7yHK5Y0LCOnA03V4ZNxavyVaU1oOqUgIg2klN/s+USGOA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.11.tgz", + "integrity": "sha512-jShvqNtP6vDC6/A5JOAzbVV+DkgHqhl/ScVCJEbt+TUY6QYz7YnXcrg3sLtFBniro0f/Ld50ZwCWA6f7KYD1nQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.11.tgz", + "integrity": "sha512-f2i2xiNWq1Z1l2++q2fuhZRdLAT3aqxD6vRNm1RAxpUoBcdqNB3C0s1Bt+K+PbEx2F5F4gQp6hqKkphCY/xF9w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.11.tgz", + "integrity": "sha512-4Ir5FSOKIAMr4r0kExpt1s3bMgzJU3rA45AYOHtQpls0oNeqcYBKrWMlckrYH4KCfGLfkfn1tN1dmZPMVsdXow==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.11.tgz", + "integrity": "sha512-/gnRDM+39BROzAN/k1OZjDPnDMcZxB/0EUxKjONO5yVkNEvlsoMDrxGNKgZi/ttFriS2gwlDNzB65pvNbFOXIQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.11.tgz", + "integrity": "sha512-PFaK8HwvAHbaKbBcDNQihjMKYvFnA5hiENx/l5tphTDz1E0WFp32l0A7aq7lyUwGsRw/xSrNIy/gIK4thrSCrw==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.11.tgz", + "integrity": "sha512-AskzJUIKRLPxkruR1wLKewGbOw+EYfU/9lOrBFj4AFrEA8hPpKFnODWNu2WLaNs0QNkEb9QIJufmVZZIL/bJlg==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.11.tgz", + "integrity": "sha512-qlUGAheh2yh8afH7QBgx0PrRHN85hKnNd78x8MeMhXivuevgd8vgf6/CstOzmNKY/lLTHvNTrPy98cLnAugzJw==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.11.tgz", + "integrity": "sha512-secpEad+0vCbSfn8upFySkDskv+bGPk3THSDS9Y89yc4rb4kzqHp8Dmyd9BkQW4SnhNXBZCl/6CrO//hZahNJQ==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.11.tgz", + "integrity": "sha512-mOVBT3dPpkWm8XBWPmU4bf+U6dYDLeMo/9ojUmis4N0L5uu10qra5vOyngZ7/PSdoE4G9KvRt4bloRxNjLas7A==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.11.tgz", + "integrity": "sha512-Is78i9A8Ui4SqcxUwFJ9uMmjDn58IbVTjFWYdQestFEgeuEmHMLGNriXnVJKkwG2YiZjw8cP0zCTyDMdDGtOOg==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.11.tgz", + "integrity": "sha512-dUCXneZ87INUMyQ0D+C0HrEBNUPNXHaPmU5GTjyKTJEiussw9Kaj5Ln8UztPe4epV/ffvgNBEadksdYhmW6xJA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.11.tgz", + "integrity": "sha512-jByxb6qfd+bH1xUd0qnfFnb17i9sWBPY2tOavJ0l3tdr3OTu+Kvtm8cd/JV5nFt657b1VqGltxg9olOEfofXWw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.11.tgz", + "integrity": "sha512-/PzKqzAJ03i19oy2ItPvyvaVjOjBCNnfaJs8yvUdGBKmiESgnrJSQ2awd81QzFbbnAmu7YO9ZnJrDCb9VSJPRA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "license": "MIT" + }, + "node_modules/@tailwindcss/node": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.3.tgz", + "integrity": "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.24.1", + "jiti": "^2.7.0", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.3" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.3.tgz", + "integrity": "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA==", + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.3", + "@tailwindcss/oxide-darwin-arm64": "4.3.3", + "@tailwindcss/oxide-darwin-x64": "4.3.3", + "@tailwindcss/oxide-freebsd-x64": "4.3.3", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.3", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.3", + "@tailwindcss/oxide-linux-x64-musl": "4.3.3", + "@tailwindcss/oxide-wasm32-wasi": "4.3.3", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.3" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.3.tgz", + "integrity": "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.3.tgz", + "integrity": "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.3.tgz", + "integrity": "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.3.tgz", + "integrity": "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.3.tgz", + "integrity": "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.3.tgz", + "integrity": "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.3.tgz", + "integrity": "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.3.tgz", + "integrity": "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.3.tgz", + "integrity": "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.3.tgz", + "integrity": "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.11.1", + "@emnapi/runtime": "^1.11.1", + "@emnapi/wasi-threads": "^1.2.2", + "@napi-rs/wasm-runtime": "^1.1.4", + "@tybys/wasm-util": "^0.10.2", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.3.tgz", + "integrity": "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.3.tgz", + "integrity": "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.3.tgz", + "integrity": "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw==", + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.3.3", + "@tailwindcss/oxide": "4.3.3", + "tailwindcss": "4.3.3" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@tanstack/query-core": { + "version": "5.104.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.104.0.tgz", + "integrity": "sha512-JrC2r/JQlXt7khBSdUpsgxNvybzOg+aITa+ARRMlP2AFo93Y8vIqz077rp+e61mJetSZ0T6AJbwW1JHer1vrPQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.104.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.104.0.tgz", + "integrity": "sha512-e1TZmDCQnWIfiDVryIHeA6Idj+Lfx1hORLOhXS/l5wcgvtVD4yYqbTDl378sGQKIi2cSgb0TEMC9cKK8GGoJEw==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.104.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.19.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.0.tgz", + "integrity": "sha512-zY+5tKxXdhGh1PYI0ac+7juvEu4OI6vWtVVoj5i2m42jxAY1U+zHGt6QCyOFwykdP62sM3MJ9stoYYUw5aCWew==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.1.1.tgz", + "integrity": "sha512-yxLaQV9gkhS8ezJqCM6+ndU7mDY6gqAg75NQ+0IjwEI8IYOmQCgkRwHKVSfWXW076DsqMo0Dk+0FK1U+M5RgFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "oxc-transform-react": "^0.145.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "oxc-transform-react": { + "optional": true + } + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/bundle-name": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.1.tgz", + "integrity": "sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==", + "dev": true, + "license": "MIT", + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/c12": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/c12/-/c12-3.3.4.tgz", + "integrity": "sha512-cM0ApFQSBXuourJejzwv/AuPRvAxordTyParRVcHjjtXirtkzM0uK2L9TTn9s0cXZbG7E55jCivRQzoxYmRAlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^5.0.0", + "confbox": "^0.2.4", + "defu": "^6.1.6", + "dotenv": "^17.3.1", + "exsolve": "^1.0.8", + "giget": "^3.2.0", + "jiti": "^2.6.1", + "ohash": "^2.0.11", + "pathe": "^2.0.3", + "perfect-debounce": "^2.1.0", + "pkg-types": "^2.3.0", + "rc9": "^3.0.1" + }, + "peerDependencies": { + "magicast": "*" + }, + "peerDependenciesMeta": { + "magicast": { + "optional": true + } + } + }, + "node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/commander": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-15.0.0.tgz", + "integrity": "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/confbox": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.4.tgz", + "integrity": "sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie-es": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-3.1.1.tgz", + "integrity": "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==", + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/default-browser": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.1.tgz", + "integrity": "sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz", + "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defu": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", + "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "17.4.2", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz", + "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.25.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.25.1.tgz", + "integrity": "sha512-nGXts5znJzmWPu+mIE9izCOzdg63oJca2mDzGWWTth7sr4aCToKcoyFVBQwN75Ij5Pf6p510EwkTqViTRzDV+w==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/exsolve": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.1.1.tgz", + "integrity": "sha512-9U/jZUgjnSGyntRr6y5Muu1MJcwFl6kPu7k8qLF0IMNfLqvw0NZ4nnVDq0RVoZ0RvCyumib4Ez3KYrVfilrw+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.0.tgz", + "integrity": "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/giget": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/giget/-/giget-3.3.1.tgz", + "integrity": "sha512-r+mvuDjrjMpsdw46Kmeydb8bdHm7wOKw8wNBtTndkjbPjgAp5oUJUxRE76wZFknxIPokfWvep2qSXK37aXE6zg==", + "dev": true, + "license": "MIT", + "bin": { + "giget": "dist/cli.mjs" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-in-ssh": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz", + "integrity": "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-yaml": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/nanoid": { + "version": "3.3.19", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz", + "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/ohash": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.12.tgz", + "integrity": "sha512-65S/5gk9YSsaRjcyf7Nfa6h/d3E8/1gslpXfI4W7Dxn/oap8IKRuNT5VXkLQ1YFKIEg4apRY4Pj6aiwFzrDdmw==", + "dev": true, + "license": "MIT" + }, + "node_modules/open": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz", + "integrity": "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-browser": "^5.4.0", + "define-lazy-prop": "^3.0.0", + "is-in-ssh": "^1.0.0", + "is-inside-container": "^1.0.0", + "powershell-utils": "^0.1.0", + "wsl-utils": "^0.3.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/oxlint": { + "version": "1.86.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.86.0.tgz", + "integrity": "sha512-og0lhgvZfgGF//gOOmZXvtr+GmBbAGEnbEhv/QUg7UW2Wi4wHMnJbnMD+zuHgPdJxdklfgpPupdlAaAySyxrZg==", + "dev": true, + "license": "MIT", + "bin": { + "oxlint": "bin/oxlint" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxlint/binding-android-arm-eabi": "1.86.0", + "@oxlint/binding-android-arm64": "1.86.0", + "@oxlint/binding-darwin-arm64": "1.86.0", + "@oxlint/binding-darwin-x64": "1.86.0", + "@oxlint/binding-freebsd-x64": "1.86.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.86.0", + "@oxlint/binding-linux-arm-musleabihf": "1.86.0", + "@oxlint/binding-linux-arm64-gnu": "1.86.0", + "@oxlint/binding-linux-arm64-musl": "1.86.0", + "@oxlint/binding-linux-ppc64-gnu": "1.86.0", + "@oxlint/binding-linux-riscv64-gnu": "1.86.0", + "@oxlint/binding-linux-riscv64-musl": "1.86.0", + "@oxlint/binding-linux-s390x-gnu": "1.86.0", + "@oxlint/binding-linux-x64-gnu": "1.86.0", + "@oxlint/binding-linux-x64-musl": "1.86.0", + "@oxlint/binding-openharmony-arm64": "1.86.0", + "@oxlint/binding-win32-arm64-msvc": "1.86.0", + "@oxlint/binding-win32-ia32-msvc": "1.86.0", + "@oxlint/binding-win32-x64-msvc": "1.86.0" + }, + "peerDependencies": { + "oxlint-tsgolint": ">=7.0.2003", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "oxlint-tsgolint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/perfect-debounce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-2.1.0.tgz", + "integrity": "sha512-LjgdTytVFXeUgtHZr9WYViYSM/g8MkcTPYDlPa3cDqMirHjKiSZPYd6DoL7pK8AJQr+uWkQvCjHNdiMqsrJs+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-types": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.3.tgz", + "integrity": "sha512-j/lCFdcppV0JxWpCEITdbDltBxPP6cHT+yNJ6Go2OgoSA9518X847X9z0p6LtA4Nc16+eQzCZjRrWanTGvHJ5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.3.1", + "exsolve": "^1.1.1", + "pathe": "^2.0.3" + } + }, + "node_modules/pkg-types/node_modules/confbox": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.3.1.tgz", + "integrity": "sha512-cKUSoKa8YxFZZSmraVi7onONx3amu77ngK3kGpsYHDH7drPwCRkQE1RYMPlLRrMtnciRj274XNRxcHxnKmDSnA==", + "dev": true, + "license": "MIT" + }, + "node_modules/postcss": { + "version": "8.5.28", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz", + "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.18", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/powershell-utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.1.0.tgz", + "integrity": "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rc9": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/rc9/-/rc9-3.1.0.tgz", + "integrity": "sha512-ufjkNVzbRHKcCOmTahZkmVsyc3W+MSk3jY03m+a7tGHkIsdVMG9l10/3HvFbWkkKzY5VFp3pkRsIo/UYgmFL7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "defu": "^6.1.7", + "destr": "^2.0.5" + } + }, + "node_modules/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz", + "integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.0" + } + }, + "node_modules/react-router": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-8.4.0.tgz", + "integrity": "sha512-JtydAkBvU9UTEe5qNC+POhu+ZBNM7rlKY2IegwXc7Idj7xfRG16x5RZrw3mju+XlqBxfvb2ky9P3jUp9WyWC1g==", + "license": "MIT", + "dependencies": { + "@remix-run/route-pattern": "^0.22.1", + "cookie-es": "^3.1.1" + }, + "engines": { + "node": ">=22.22.0" + }, + "peerDependencies": { + "react": ">=19.2.7", + "react-dom": ">=19.2.7" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/readdirp": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", + "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "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==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/rolldown": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.11.tgz", + "integrity": "sha512-qpSwIyz0jHQq5qXBTNxFmE6664rJ7O+4TvPFOiOaBSrz8IOHc1koKKSqTM2H6u1UG1+TveuC6vaDHKXFOvb1Kw==", + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.151.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.11", + "@rolldown/binding-android-arm64": "1.2.11", + "@rolldown/binding-darwin-arm64": "1.2.11", + "@rolldown/binding-darwin-x64": "1.2.11", + "@rolldown/binding-freebsd-x64": "1.2.11", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.11", + "@rolldown/binding-linux-arm64-gnu": "1.2.11", + "@rolldown/binding-linux-arm64-musl": "1.2.11", + "@rolldown/binding-linux-ppc64-gnu": "1.2.11", + "@rolldown/binding-linux-s390x-gnu": "1.2.11", + "@rolldown/binding-linux-x64-gnu": "1.2.11", + "@rolldown/binding-linux-x64-musl": "1.2.11", + "@rolldown/binding-openharmony-arm64": "1.2.11", + "@rolldown/binding-win32-arm64-msvc": "1.2.11", + "@rolldown/binding-win32-x64-msvc": "1.2.11" + } + }, + "node_modules/run-applescript": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", + "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", + "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tailwindcss": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.3.tgz", + "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==", + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.1.tgz", + "integrity": "sha512-/bvH9E9tmCXRGp2uXY3WbOldqpTwFkbha/8ANaEQ6VkxhH60KyqLwgZq6lG2y+4uT55x9+9eUHMpQ7uGnOCKjA==", + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.28", + "rolldown": "~1.2.9", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wsl-utils": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.1.tgz", + "integrity": "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-wsl": "^3.1.0", + "powershell-utils": "^0.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..f363080 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,31 @@ +{ + "name": "frontend", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "oxlint", + "preview": "vite preview", + "api": "openapi-ts" + }, + "dependencies": { + "@tailwindcss/vite": "^4.3.3", + "@tanstack/react-query": "^5.104.0", + "react": "^19.2.8", + "react-dom": "^19.2.8", + "react-router": "^8.4.0", + "tailwindcss": "^4.3.3" + }, + "devDependencies": { + "@hey-api/openapi-ts": "0.99.0", + "@types/node": "^24.13.3", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.7", + "@vitejs/plugin-react": "^6.1.1", + "oxlint": "^1.81.0", + "typescript": "~6.0.2", + "vite": "^8.3.0" + } +} diff --git a/frontend/public/a/icons/LICENSE-openmoji.txt b/frontend/public/a/icons/LICENSE-openmoji.txt new file mode 100644 index 0000000..aff5693 --- /dev/null +++ b/frontend/public/a/icons/LICENSE-openmoji.txt @@ -0,0 +1,2 @@ +Icons in this folder (except rabbit.svg and bear.svg) are from OpenMoji (https://openmoji.org), licensed under CC BY-SA 4.0. +rabbit.svg and bear.svg are original donut characters made for this project. diff --git a/frontend/public/a/icons/bear.svg b/frontend/public/a/icons/bear.svg new file mode 100644 index 0000000..70bce9f --- /dev/null +++ b/frontend/public/a/icons/bear.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/frontend/public/a/icons/bike.svg b/frontend/public/a/icons/bike.svg new file mode 100644 index 0000000..7e9af17 --- /dev/null +++ b/frontend/public/a/icons/bike.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/bronze.svg b/frontend/public/a/icons/bronze.svg new file mode 100644 index 0000000..b0042ee --- /dev/null +++ b/frontend/public/a/icons/bronze.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/camping.svg b/frontend/public/a/icons/camping.svg new file mode 100644 index 0000000..9d5e365 --- /dev/null +++ b/frontend/public/a/icons/camping.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/carwash.svg b/frontend/public/a/icons/carwash.svg new file mode 100644 index 0000000..7778044 --- /dev/null +++ b/frontend/public/a/icons/carwash.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/chimaek.svg b/frontend/public/a/icons/chimaek.svg new file mode 100644 index 0000000..8c1ac1c --- /dev/null +++ b/frontend/public/a/icons/chimaek.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/cloud.svg b/frontend/public/a/icons/cloud.svg new file mode 100644 index 0000000..a9ca8a0 --- /dev/null +++ b/frontend/public/a/icons/cloud.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/frontend/public/a/icons/coldwind.svg b/frontend/public/a/icons/coldwind.svg new file mode 100644 index 0000000..a91845f --- /dev/null +++ b/frontend/public/a/icons/coldwind.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/delivery.svg b/frontend/public/a/icons/delivery.svg new file mode 100644 index 0000000..d78c7db --- /dev/null +++ b/frontend/public/a/icons/delivery.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/dog.svg b/frontend/public/a/icons/dog.svg new file mode 100644 index 0000000..d6dc3d4 --- /dev/null +++ b/frontend/public/a/icons/dog.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/garden.svg b/frontend/public/a/icons/garden.svg new file mode 100644 index 0000000..5f03a37 --- /dev/null +++ b/frontend/public/a/icons/garden.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/glasses.svg b/frontend/public/a/icons/glasses.svg new file mode 100644 index 0000000..c776baa --- /dev/null +++ b/frontend/public/a/icons/glasses.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/gold.svg b/frontend/public/a/icons/gold.svg new file mode 100644 index 0000000..e04788a --- /dev/null +++ b/frontend/public/a/icons/gold.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/hiking.svg b/frontend/public/a/icons/hiking.svg new file mode 100644 index 0000000..7ff4539 --- /dev/null +++ b/frontend/public/a/icons/hiking.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/iced_hot.svg b/frontend/public/a/icons/iced_hot.svg new file mode 100644 index 0000000..347c886 --- /dev/null +++ b/frontend/public/a/icons/iced_hot.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/jjamppong.svg b/frontend/public/a/icons/jjamppong.svg new file mode 100644 index 0000000..e5e36f6 --- /dev/null +++ b/frontend/public/a/icons/jjamppong.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/laundry.svg b/frontend/public/a/icons/laundry.svg new file mode 100644 index 0000000..649ed47 --- /dev/null +++ b/frontend/public/a/icons/laundry.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/letter.svg b/frontend/public/a/icons/letter.svg new file mode 100644 index 0000000..682467f --- /dev/null +++ b/frontend/public/a/icons/letter.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/makeup.svg b/frontend/public/a/icons/makeup.svg new file mode 100644 index 0000000..b599b1c --- /dev/null +++ b/frontend/public/a/icons/makeup.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/makgeolli.svg b/frontend/public/a/icons/makgeolli.svg new file mode 100644 index 0000000..aac7e35 --- /dev/null +++ b/frontend/public/a/icons/makgeolli.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/maple.svg b/frontend/public/a/icons/maple.svg new file mode 100644 index 0000000..f0ce230 --- /dev/null +++ b/frontend/public/a/icons/maple.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/frontend/public/a/icons/moon.svg b/frontend/public/a/icons/moon.svg new file mode 100644 index 0000000..51596eb --- /dev/null +++ b/frontend/public/a/icons/moon.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/frontend/public/a/icons/muggy.svg b/frontend/public/a/icons/muggy.svg new file mode 100644 index 0000000..5a70df5 --- /dev/null +++ b/frontend/public/a/icons/muggy.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/frontend/public/a/icons/naengmyeon.svg b/frontend/public/a/icons/naengmyeon.svg new file mode 100644 index 0000000..48706c3 --- /dev/null +++ b/frontend/public/a/icons/naengmyeon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/photo.svg b/frontend/public/a/icons/photo.svg new file mode 100644 index 0000000..270ac8d --- /dev/null +++ b/frontend/public/a/icons/photo.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/picnic.svg b/frontend/public/a/icons/picnic.svg new file mode 100644 index 0000000..482f211 --- /dev/null +++ b/frontend/public/a/icons/picnic.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/rabbit.svg b/frontend/public/a/icons/rabbit.svg new file mode 100644 index 0000000..f398a6f --- /dev/null +++ b/frontend/public/a/icons/rabbit.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/frontend/public/a/icons/rain.svg b/frontend/public/a/icons/rain.svg new file mode 100644 index 0000000..cde9b3f --- /dev/null +++ b/frontend/public/a/icons/rain.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/running.svg b/frontend/public/a/icons/running.svg new file mode 100644 index 0000000..fa45c6d --- /dev/null +++ b/frontend/public/a/icons/running.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/silver.svg b/frontend/public/a/icons/silver.svg new file mode 100644 index 0000000..8b9b548 --- /dev/null +++ b/frontend/public/a/icons/silver.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/snow.svg b/frontend/public/a/icons/snow.svg new file mode 100644 index 0000000..f7af862 --- /dev/null +++ b/frontend/public/a/icons/snow.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/stars.svg b/frontend/public/a/icons/stars.svg new file mode 100644 index 0000000..7814b63 --- /dev/null +++ b/frontend/public/a/icons/stars.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/sun.svg b/frontend/public/a/icons/sun.svg new file mode 100644 index 0000000..d875b61 --- /dev/null +++ b/frontend/public/a/icons/sun.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/frontend/public/a/icons/sun_cloud.svg b/frontend/public/a/icons/sun_cloud.svg new file mode 100644 index 0000000..5d7af05 --- /dev/null +++ b/frontend/public/a/icons/sun_cloud.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/frontend/public/a/icons/sunset.svg b/frontend/public/a/icons/sunset.svg new file mode 100644 index 0000000..1c1d85e --- /dev/null +++ b/frontend/public/a/icons/sunset.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/taxi.svg b/frontend/public/a/icons/taxi.svg new file mode 100644 index 0000000..841ba9a --- /dev/null +++ b/frontend/public/a/icons/taxi.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/umbrella.svg b/frontend/public/a/icons/umbrella.svg new file mode 100644 index 0000000..a68914e --- /dev/null +++ b/frontend/public/a/icons/umbrella.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/vent.svg b/frontend/public/a/icons/vent.svg new file mode 100644 index 0000000..2d42464 --- /dev/null +++ b/frontend/public/a/icons/vent.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/walk.svg b/frontend/public/a/icons/walk.svg new file mode 100644 index 0000000..b09a29c --- /dev/null +++ b/frontend/public/a/icons/walk.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/a/icons/yajang.svg b/frontend/public/a/icons/yajang.svg new file mode 100644 index 0000000..5025c00 --- /dev/null +++ b/frontend/public/a/icons/yajang.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/b/icons/LICENSE-fluent-emoji.txt b/frontend/public/b/icons/LICENSE-fluent-emoji.txt new file mode 100644 index 0000000..4142304 --- /dev/null +++ b/frontend/public/b/icons/LICENSE-fluent-emoji.txt @@ -0,0 +1 @@ +3D icons in this folder are from Microsoft Fluent Emoji (https://github.com/microsoft/fluentui-emoji), licensed under the MIT License. Copyright (c) Microsoft Corporation. diff --git a/frontend/public/b/icons/bulb.png b/frontend/public/b/icons/bulb.png new file mode 100644 index 0000000..cd953a6 Binary files /dev/null and b/frontend/public/b/icons/bulb.png differ diff --git a/frontend/public/b/icons/calendar.png b/frontend/public/b/icons/calendar.png new file mode 100644 index 0000000..36ce410 Binary files /dev/null and b/frontend/public/b/icons/calendar.png differ diff --git a/frontend/public/b/icons/fireworks.png b/frontend/public/b/icons/fireworks.png new file mode 100644 index 0000000..2d1967e Binary files /dev/null and b/frontend/public/b/icons/fireworks.png differ diff --git a/frontend/public/b/icons/sheaf.png b/frontend/public/b/icons/sheaf.png new file mode 100644 index 0000000..5c401cb Binary files /dev/null and b/frontend/public/b/icons/sheaf.png differ diff --git a/frontend/public/b/icons/thermo.png b/frontend/public/b/icons/thermo.png new file mode 100644 index 0000000..7d56cb1 Binary files /dev/null and b/frontend/public/b/icons/thermo.png differ diff --git a/frontend/public/favicon.svg b/frontend/public/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/frontend/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/public/icons/LICENSE-fluent-emoji.txt b/frontend/public/icons/LICENSE-fluent-emoji.txt new file mode 100644 index 0000000..4142304 --- /dev/null +++ b/frontend/public/icons/LICENSE-fluent-emoji.txt @@ -0,0 +1 @@ +3D icons in this folder are from Microsoft Fluent Emoji (https://github.com/microsoft/fluentui-emoji), licensed under the MIT License. Copyright (c) Microsoft Corporation. diff --git a/frontend/public/icons/bear.png b/frontend/public/icons/bear.png new file mode 100644 index 0000000..38cf9fc Binary files /dev/null and b/frontend/public/icons/bear.png differ diff --git a/frontend/public/icons/bike.png b/frontend/public/icons/bike.png new file mode 100644 index 0000000..3111fce Binary files /dev/null and b/frontend/public/icons/bike.png differ diff --git a/frontend/public/icons/bronze.png b/frontend/public/icons/bronze.png new file mode 100644 index 0000000..71ef87a Binary files /dev/null and b/frontend/public/icons/bronze.png differ diff --git a/frontend/public/icons/camping.png b/frontend/public/icons/camping.png new file mode 100644 index 0000000..eadedaa Binary files /dev/null and b/frontend/public/icons/camping.png differ diff --git a/frontend/public/icons/carwash.png b/frontend/public/icons/carwash.png new file mode 100644 index 0000000..60567c8 Binary files /dev/null and b/frontend/public/icons/carwash.png differ diff --git a/frontend/public/icons/chimaek.png b/frontend/public/icons/chimaek.png new file mode 100644 index 0000000..84ef071 Binary files /dev/null and b/frontend/public/icons/chimaek.png differ diff --git a/frontend/public/icons/cloud.png b/frontend/public/icons/cloud.png new file mode 100644 index 0000000..a3a1de1 Binary files /dev/null and b/frontend/public/icons/cloud.png differ diff --git a/frontend/public/icons/coldwind.png b/frontend/public/icons/coldwind.png new file mode 100644 index 0000000..a33a339 Binary files /dev/null and b/frontend/public/icons/coldwind.png differ diff --git a/frontend/public/icons/delivery.png b/frontend/public/icons/delivery.png new file mode 100644 index 0000000..582134f Binary files /dev/null and b/frontend/public/icons/delivery.png differ diff --git a/frontend/public/icons/dog.png b/frontend/public/icons/dog.png new file mode 100644 index 0000000..5b5a22e Binary files /dev/null and b/frontend/public/icons/dog.png differ diff --git a/frontend/public/icons/garden.png b/frontend/public/icons/garden.png new file mode 100644 index 0000000..1bdc4f1 Binary files /dev/null and b/frontend/public/icons/garden.png differ diff --git a/frontend/public/icons/glasses.png b/frontend/public/icons/glasses.png new file mode 100644 index 0000000..1215891 Binary files /dev/null and b/frontend/public/icons/glasses.png differ diff --git a/frontend/public/icons/gold.png b/frontend/public/icons/gold.png new file mode 100644 index 0000000..5cee68e Binary files /dev/null and b/frontend/public/icons/gold.png differ diff --git a/frontend/public/icons/hiking.png b/frontend/public/icons/hiking.png new file mode 100644 index 0000000..686290b Binary files /dev/null and b/frontend/public/icons/hiking.png differ diff --git a/frontend/public/icons/iced_hot.png b/frontend/public/icons/iced_hot.png new file mode 100644 index 0000000..4317ed5 Binary files /dev/null and b/frontend/public/icons/iced_hot.png differ diff --git a/frontend/public/icons/jjamppong.png b/frontend/public/icons/jjamppong.png new file mode 100644 index 0000000..4240eba Binary files /dev/null and b/frontend/public/icons/jjamppong.png differ diff --git a/frontend/public/icons/laundry.png b/frontend/public/icons/laundry.png new file mode 100644 index 0000000..1250453 Binary files /dev/null and b/frontend/public/icons/laundry.png differ diff --git a/frontend/public/icons/letter.png b/frontend/public/icons/letter.png new file mode 100644 index 0000000..3d144e6 Binary files /dev/null and b/frontend/public/icons/letter.png differ diff --git a/frontend/public/icons/makeup.png b/frontend/public/icons/makeup.png new file mode 100644 index 0000000..a03113c Binary files /dev/null and b/frontend/public/icons/makeup.png differ diff --git a/frontend/public/icons/makgeolli.png b/frontend/public/icons/makgeolli.png new file mode 100644 index 0000000..0c8ba2c Binary files /dev/null and b/frontend/public/icons/makgeolli.png differ diff --git a/frontend/public/icons/maple.png b/frontend/public/icons/maple.png new file mode 100644 index 0000000..afab34e Binary files /dev/null and b/frontend/public/icons/maple.png differ diff --git a/frontend/public/icons/moon.png b/frontend/public/icons/moon.png new file mode 100644 index 0000000..83ba8ab Binary files /dev/null and b/frontend/public/icons/moon.png differ diff --git a/frontend/public/icons/muggy.png b/frontend/public/icons/muggy.png new file mode 100644 index 0000000..3cdca0f Binary files /dev/null and b/frontend/public/icons/muggy.png differ diff --git a/frontend/public/icons/naengmyeon.png b/frontend/public/icons/naengmyeon.png new file mode 100644 index 0000000..b694051 Binary files /dev/null and b/frontend/public/icons/naengmyeon.png differ diff --git a/frontend/public/icons/photo.png b/frontend/public/icons/photo.png new file mode 100644 index 0000000..01db410 Binary files /dev/null and b/frontend/public/icons/photo.png differ diff --git a/frontend/public/icons/picnic.png b/frontend/public/icons/picnic.png new file mode 100644 index 0000000..02ed3c7 Binary files /dev/null and b/frontend/public/icons/picnic.png differ diff --git a/frontend/public/icons/rabbit.png b/frontend/public/icons/rabbit.png new file mode 100644 index 0000000..18a04ae Binary files /dev/null and b/frontend/public/icons/rabbit.png differ diff --git a/frontend/public/icons/rain.png b/frontend/public/icons/rain.png new file mode 100644 index 0000000..e9e5392 Binary files /dev/null and b/frontend/public/icons/rain.png differ diff --git a/frontend/public/icons/running.png b/frontend/public/icons/running.png new file mode 100644 index 0000000..964ea0f Binary files /dev/null and b/frontend/public/icons/running.png differ diff --git a/frontend/public/icons/silver.png b/frontend/public/icons/silver.png new file mode 100644 index 0000000..c1605f3 Binary files /dev/null and b/frontend/public/icons/silver.png differ diff --git a/frontend/public/icons/snow.png b/frontend/public/icons/snow.png new file mode 100644 index 0000000..f080c72 Binary files /dev/null and b/frontend/public/icons/snow.png differ diff --git a/frontend/public/icons/stars.png b/frontend/public/icons/stars.png new file mode 100644 index 0000000..6801f2c Binary files /dev/null and b/frontend/public/icons/stars.png differ diff --git a/frontend/public/icons/sun.png b/frontend/public/icons/sun.png new file mode 100644 index 0000000..26258a0 Binary files /dev/null and b/frontend/public/icons/sun.png differ diff --git a/frontend/public/icons/sun_cloud.png b/frontend/public/icons/sun_cloud.png new file mode 100644 index 0000000..5d1c789 Binary files /dev/null and b/frontend/public/icons/sun_cloud.png differ diff --git a/frontend/public/icons/sunset.png b/frontend/public/icons/sunset.png new file mode 100644 index 0000000..e67963d Binary files /dev/null and b/frontend/public/icons/sunset.png differ diff --git a/frontend/public/icons/taxi.png b/frontend/public/icons/taxi.png new file mode 100644 index 0000000..edcbac2 Binary files /dev/null and b/frontend/public/icons/taxi.png differ diff --git a/frontend/public/icons/umbrella.png b/frontend/public/icons/umbrella.png new file mode 100644 index 0000000..c0f4598 Binary files /dev/null and b/frontend/public/icons/umbrella.png differ diff --git a/frontend/public/icons/vent.png b/frontend/public/icons/vent.png new file mode 100644 index 0000000..4d585dc Binary files /dev/null and b/frontend/public/icons/vent.png differ diff --git a/frontend/public/icons/walk.png b/frontend/public/icons/walk.png new file mode 100644 index 0000000..1720b55 Binary files /dev/null and b/frontend/public/icons/walk.png differ diff --git a/frontend/public/icons/yajang.png b/frontend/public/icons/yajang.png new file mode 100644 index 0000000..cdc3e75 Binary files /dev/null and b/frontend/public/icons/yajang.png differ diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx new file mode 100644 index 0000000..d241960 --- /dev/null +++ b/frontend/src/App.tsx @@ -0,0 +1,24 @@ +import { BrowserRouter, Route, Routes } from 'react-router' +import { BLayout } from './b/BLayout' +import { GakPage } from './b/GakPage' +import { SeasonPage } from './b/SeasonPage' +import { SkyPage } from './b/SkyPage' +import { TodayPage } from './b/TodayPage' +import { WeekPage } from './b/WeekPage' + +export default function App() { + return ( + + + }> + } /> + } /> + } /> + } /> + } /> + } /> + + + + ) +} diff --git a/frontend/src/api/auth.ts b/frontend/src/api/auth.ts new file mode 100644 index 0000000..fae36d4 --- /dev/null +++ b/frontend/src/api/auth.ts @@ -0,0 +1,56 @@ +// 로그인 토큰 저장소: localStorage + 메모리, 바뀌면 구독자에게 알린다 +const ACCESS_KEY = 'nalssigak.accessToken' +const REFRESH_KEY = 'nalssigak.refreshToken' + +function readStored(key: string): string | null { + try { + return localStorage.getItem(key) + } catch { + // 사파리 프라이빗 모드 등에서 저장소 접근이 막히면 로그인 안 한 상태로 시작한다 + return null + } +} + +function writeStored(key: string, value: string | null) { + try { + if (value) localStorage.setItem(key, value) + else localStorage.removeItem(key) + } catch { + // 저장이 막혀도 이번 방문 동안은 메모리 토큰으로 계속 쓴다 + return + } +} + +let accessToken = readStored(ACCESS_KEY) +const listeners = new Set<(reason: 'change' | 'required') => void>() + +/** 토큰이 바뀌거나(로그인·로그아웃) 로그인이 필요할 때 알림을 받는다 */ +export function subscribeAuth(fn: (reason: 'change' | 'required') => void) { + listeners.add(fn) + return () => { + listeners.delete(fn) + } +} + +const emit = (reason: 'change' | 'required') => listeners.forEach((fn) => fn(reason)) + +export function getAccessToken() { + return accessToken +} + +export function setTokens(access: string | null, refreshToken?: string | null) { + accessToken = access + writeStored(ACCESS_KEY, access) + if (refreshToken !== undefined) writeStored(REFRESH_KEY, refreshToken) + emit('change') +} + +export function clearTokens() { + setTokens(null, null) +} + +export function getRefreshToken() { + return readStored(REFRESH_KEY) +} + +export const emitAuthRequired = () => emit('required') diff --git a/frontend/src/api/client/@tanstack/react-query.gen.ts b/frontend/src/api/client/@tanstack/react-query.gen.ts new file mode 100644 index 0000000..469ddc3 --- /dev/null +++ b/frontend/src/api/client/@tanstack/react-query.gen.ts @@ -0,0 +1,676 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions } from '@tanstack/react-query'; + +import { client } from '../client.gen'; +import { addComment, deleteComment, getArticle, getFeed, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getWeatherNow, getWeatherToday, getWeek, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, me, nearestRegion, type Options, refresh, savePost, signup, unlikeComment, unlikePost, unsavePost } from '../sdk.gen'; +import type { AddCommentData, AddCommentError, AddCommentResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, GetArticleData, GetArticleError, GetArticleResponse, GetFeedData, GetFeedError, GetFeedResponse, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, LoginData, LoginError, LoginResponse, MeData, MeError, MeResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, RefreshData, RefreshError, RefreshResponse, SavePostData, SavePostError, SavePostResponse, SignupData, SignupError, SignupResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnsavePostData, UnsavePostError, UnsavePostResponse } from '../types.gen'; + +export type QueryKey = [ + Pick & { + _id: string; + _infinite?: boolean; + tags?: ReadonlyArray; + } +]; + +const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ + QueryKey[0] +] => { + const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; + if (infinite) { + params._infinite = infinite; + } + if (tags) { + params.tags = tags; + } + if (options?.body) { + params.body = options.body; + } + if (options?.headers) { + params.headers = options.headers; + } + if (options?.path) { + params.path = options.path; + } + if (options?.query) { + params.query = options.query; + } + return [params]; +}; + +export const listRegionsQueryKey = (options?: Options) => createQueryKey('listRegions', options); + +/** + * 구 목록 + */ +export const listRegionsOptions = (options?: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await listRegions({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: listRegionsQueryKey(options) +}); + +export const nearestRegionQueryKey = (options: Options) => createQueryKey('nearestRegion', options); + +/** + * 위치에서 가장 가까운 구 + */ +export const nearestRegionOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await nearestRegion({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: nearestRegionQueryKey(options) +}); + +export const getWeatherTodayQueryKey = (options: Options) => createQueryKey('getWeatherToday', options); + +/** + * 오늘 3시간 칸 날씨 + */ +export const getWeatherTodayOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getWeatherToday({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getWeatherTodayQueryKey(options) +}); + +export const getWeatherNowQueryKey = (options: Options) => createQueryKey('getWeatherNow', options); + +/** + * 지금 비 올까: 2시간 비, 내일 출퇴근, 미세먼지, 특보 + */ +export const getWeatherNowOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getWeatherNow({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getWeatherNowQueryKey(options) +}); + +export const getSkyQueryKey = (options: Options) => createQueryKey('getSky', options); + +/** + * 노을·일출 점수, 3컷, 가까운 명소, 앞으로 3일 + */ +export const getSkyOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getSky({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getSkyQueryKey(options) +}); + +export const getSkyRankingQueryKey = (options?: Options) => createQueryKey('getSkyRanking', options); + +/** + * 전국 노을 순위 (대표 30곳) + */ +export const getSkyRankingOptions = (options?: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getSkyRanking({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getSkyRankingQueryKey(options) +}); + +export const listIndicesQueryKey = (options: Options) => createQueryKey('listIndices', options); + +/** + * 지수 목록 (점수순, 1~3위, 오늘 날씨 점수) + */ +export const listIndicesOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await listIndices({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: listIndicesQueryKey(options) +}); + +export const getIndexQueryKey = (options: Options) => createQueryKey('getIndex', options); + +/** + * 지수 계산 근거 + */ +export const getIndexOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getIndex({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getIndexQueryKey(options) +}); + +export const getWeekQueryKey = (options: Options) => createQueryKey('getWeek', options); + +/** + * 7일 날씨와 그날 추천 + */ +export const getWeekOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getWeek({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getWeekQueryKey(options) +}); + +export const listPlacesQueryKey = (options: Options) => createQueryKey('listPlaces', options); + +/** + * 날씨 맞춤 데이트 명소 + */ +export const listPlacesOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await listPlaces({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: listPlacesQueryKey(options) +}); + +export const listEventsQueryKey = (options: Options) => createQueryKey('listEvents', options); + +/** + * 앞으로 30일 축제·행사 + */ +export const listEventsOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await listEvents({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: listEventsQueryKey(options) +}); + +export const getSeasonWeekQueryKey = (options?: Options) => createQueryKey('getSeasonWeek', options); + +/** + * 이번 주 계절 책: 시, 절기, 계절 소식 + */ +export const getSeasonWeekOptions = (options?: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getSeasonWeek({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getSeasonWeekQueryKey(options) +}); + +export const listArticlesQueryKey = (options?: Options) => createQueryKey('listArticles', options); + +/** + * 읽을거리 목록 + */ +export const listArticlesOptions = (options?: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await listArticles({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: listArticlesQueryKey(options) +}); + +export const getArticleQueryKey = (options: Options) => createQueryKey('getArticle', options); + +/** + * 읽을거리 본문 + */ +export const getArticleOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getArticle({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getArticleQueryKey(options) +}); + +export const getFeedQueryKey = (options: Options) => createQueryKey('getFeed', options); + +/** + * 메인 피드: 하늘 영역, 오늘의 각, 오늘 포스트 전부, 띠 + */ +export const getFeedOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getFeed({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getFeedQueryKey(options) +}); + +export const getPostQueryKey = (options: Options) => createQueryKey('getPost', options); + +/** + * 포스트 하나 (공유 링크로 들어왔을 때) + */ +export const getPostOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await getPost({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: getPostQueryKey(options) +}); + +/** + * 회원가입 (아이디 영문 소문자·숫자·_ 4~20자, 비밀번호 8자 이상, 닉네임 2~12자) + */ +export const signupMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await signup({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +/** + * 로그인 + */ +export const loginMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await login({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +/** + * 토큰 재발급 + */ +export const refreshMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await refresh({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const meQueryKey = (options?: Options) => createQueryKey('me', options); + +/** + * 내 정보 + */ +export const meOptions = (options?: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await me({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: meQueryKey(options) +}); + +/** + * 좋아요 취소 + */ +export const unlikePostMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await unlikePost({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +/** + * 좋아요 + */ +export const likePostMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await likePost({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +/** + * 저장 취소 + */ +export const unsavePostMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await unsavePost({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +/** + * 저장 + */ +export const savePostMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await savePost({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const listSavedQueryKey = (options?: Options) => createQueryKey('listSaved', options); + +/** + * 내가 저장한 포스트 + */ +export const listSavedOptions = (options?: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await listSaved({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: listSavedQueryKey(options) +}); + +const createInfiniteParams = [0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey, page: K) => { + const params = { ...queryKey[0] }; + if (page.body) { + params.body = { + ...queryKey[0].body as any, + ...page.body as any + }; + } + if (page.headers) { + params.headers = { + ...queryKey[0].headers, + ...page.headers + }; + } + if (page.path) { + params.path = { + ...queryKey[0].path as any, + ...page.path as any + }; + } + if (page.query) { + params.query = { + ...queryKey[0].query as any, + ...page.query as any + }; + } + return params as unknown as typeof page; +}; + +export const listSavedInfiniteQueryKey = (options?: Options): QueryKey> => createQueryKey('listSaved', options, true); + +/** + * 내가 저장한 포스트 + */ +export const listSavedInfiniteOptions = (options?: Options) => { + const opts = infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await listSaved({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: listSavedInfiniteQueryKey(options) + }); + return opts as Omit; +}; + +export const listCommentsQueryKey = (options: Options) => createQueryKey('listComments', options); + +/** + * 댓글 목록 (로그인 없이 보기) + */ +export const listCommentsOptions = (options: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await listComments({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: listCommentsQueryKey(options) +}); + +export const listCommentsInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('listComments', options, true); + +/** + * 댓글 목록 (로그인 없이 보기) + */ +export const listCommentsInfiniteOptions = (options: Options) => { + const opts = infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey, signal }) => { + // @ts-ignore + const page: Pick>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : { + query: { + cursor: pageParam + } + }; + const params = createInfiniteParams(queryKey, page); + const { data } = await listComments({ + ...options, + ...params, + signal, + throwOnError: true + }); + return data; + }, + queryKey: listCommentsInfiniteQueryKey(options) + }); + return opts as Omit; +}; + +/** + * 댓글 쓰기 (60자) + */ +export const addCommentMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await addComment({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +/** + * 내 댓글 지우기 + */ +export const deleteCommentMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await deleteComment({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +/** + * 댓글 좋아요 취소 + */ +export const unlikeCommentMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await unlikeComment({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +/** + * 댓글 좋아요 + */ +export const likeCommentMutation = (options?: Partial>): UseMutationOptions> => { + const mutationOptions: UseMutationOptions> = { + mutationFn: async (fnOptions) => { + const { data } = await likeComment({ + ...options, + ...fnOptions, + throwOnError: true + }); + return data; + } + }; + return mutationOptions; +}; + +export const healthzHealthzGetQueryKey = (options?: Options) => createQueryKey('healthzHealthzGet', options); + +/** + * 헬스체크 + */ +export const healthzHealthzGetOptions = (options?: Options) => queryOptions>({ + queryFn: async ({ queryKey, signal }) => { + const { data } = await healthzHealthzGet({ + ...options, + ...queryKey[0], + signal, + throwOnError: true + }); + return data; + }, + queryKey: healthzHealthzGetQueryKey(options) +}); diff --git a/frontend/src/api/client/client.gen.ts b/frontend/src/api/client/client.gen.ts new file mode 100644 index 0000000..ae3d1b8 --- /dev/null +++ b/frontend/src/api/client/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Client, type ClientOptions, type Config, createClient, createConfig } from './client'; +import type { ClientOptions as ClientOptions2 } from './types.gen'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client: Client = createClient(createConfig({ baseUrl: 'http://localhost:9810', throwOnError: true })); diff --git a/frontend/src/api/client/client/client.gen.ts b/frontend/src/api/client/client/client.gen.ts new file mode 100644 index 0000000..fc3f037 --- /dev/null +++ b/frontend/src/api/client/client/client.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { createSseClient } from '../core/serverSentEvents.gen'; +import type { HttpMethod } from '../core/types.gen'; +import { getValidRequestBody } from '../core/utils.gen'; +import type { Client, Config, RequestOptions, ResolvedRequestOptions } from './types.gen'; +import { + buildUrl, + createConfig, + createInterceptors, + getParseAs, + mergeConfigs, + mergeHeaders, + setAuthParams, +} from './utils.gen'; + +type ReqInit = Omit & { + body?: any; + headers: ReturnType; +}; + +export const createClient = (config: Config = {}): Client => { + let _config = mergeConfigs(createConfig(), config); + + const getConfig = (): Config => ({ ..._config }); + + const setConfig = (config: Config): Config => { + _config = mergeConfigs(_config, config); + return getConfig(); + }; + + const interceptors = createInterceptors(); + + const beforeRequest = async < + TData = unknown, + TResponseStyle extends 'data' | 'fields' = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, + >( + options: RequestOptions, + ) => { + const opts = { + ..._config, + ...options, + fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, + headers: mergeHeaders(_config.headers, options.headers), + serializedBody: undefined as string | undefined, + }; + + if (opts.security) { + await setAuthParams(opts); + } + + if (opts.requestValidator) { + await opts.requestValidator(opts); + } + + if (opts.body !== undefined && opts.bodySerializer) { + opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined; + } + + // remove Content-Type header if body is empty to avoid sending invalid requests + if (opts.body === undefined || opts.serializedBody === '') { + opts.headers.delete('Content-Type'); + } + + const resolvedOpts = opts as typeof opts & + ResolvedRequestOptions; + const url = buildUrl(resolvedOpts); + + return { opts: resolvedOpts, url }; + }; + + const request: Client['request'] = async (options) => { + const throwOnError = options.throwOnError ?? _config.throwOnError; + const responseStyle = options.responseStyle ?? _config.responseStyle; + + let request: Request | undefined; + let response: Response | undefined; + + try { + const { opts, url } = await beforeRequest(options); + const requestInit: ReqInit = { + redirect: 'follow', + ...opts, + body: getValidRequestBody(opts), + }; + + request = new Request(url, requestInit); + + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = opts.fetch!; + + response = await _fetch(request); + + for (const fn of interceptors.response.fns) { + if (fn) { + response = await fn(response, request, opts); + } + } + + const result = { + request, + response, + }; + + if (response.ok) { + const parseAs = + (opts.parseAs === 'auto' + ? getParseAs(response.headers.get('Content-Type')) + : opts.parseAs) ?? 'json'; + + if (response.status === 204 || response.headers.get('Content-Length') === '0') { + let emptyData: any; + switch (parseAs) { + case 'arrayBuffer': + case 'blob': + case 'text': + emptyData = await response[parseAs](); + break; + case 'formData': + emptyData = new FormData(); + break; + case 'stream': + emptyData = response.body; + break; + case 'json': + default: + emptyData = {}; + break; + } + return opts.responseStyle === 'data' + ? emptyData + : { + data: emptyData, + ...result, + }; + } + + let data: any; + switch (parseAs) { + case 'arrayBuffer': + case 'blob': + case 'formData': + case 'text': + data = await response[parseAs](); + break; + case 'json': { + // Some servers return 200 with no Content-Length and empty body. + // response.json() would throw; read as text and parse if non-empty. + const text = await response.text(); + data = text ? JSON.parse(text) : {}; + break; + } + case 'stream': + return opts.responseStyle === 'data' + ? response.body + : { + data: response.body, + ...result, + }; + } + + if (parseAs === 'json') { + if (opts.responseValidator) { + await opts.responseValidator(data); + } + + if (opts.responseTransformer) { + data = await opts.responseTransformer(data); + } + } + + return opts.responseStyle === 'data' + ? data + : { + data, + ...result, + }; + } + + const textError = await response.text(); + let jsonError: unknown; + + try { + jsonError = JSON.parse(textError); + } catch { + // noop + } + + throw jsonError ?? textError; + } catch (error) { + let finalError = error; + + for (const fn of interceptors.error.fns) { + if (fn) { + finalError = await fn(finalError, response, request, options as ResolvedRequestOptions); + } + } + + finalError = finalError || {}; + + if (throwOnError) { + throw finalError; + } + + // TODO: we probably want to return error and improve types + return responseStyle === 'data' + ? undefined + : { + error: finalError, + request, + response, + }; + } + }; + + const makeMethodFn = (method: Uppercase) => (options: RequestOptions) => + request({ ...options, method }); + + const makeSseFn = (method: Uppercase) => async (options: RequestOptions) => { + const { opts, url } = await beforeRequest(options); + return createSseClient({ + ...opts, + body: opts.body as BodyInit | null | undefined, + method, + onRequest: async (url, init) => { + let request = new Request(url, init); + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + return request; + }, + serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined, + url, + }); + }; + + const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options }); + + return { + buildUrl: _buildUrl, + connect: makeMethodFn('CONNECT'), + delete: makeMethodFn('DELETE'), + get: makeMethodFn('GET'), + getConfig, + head: makeMethodFn('HEAD'), + interceptors, + options: makeMethodFn('OPTIONS'), + patch: makeMethodFn('PATCH'), + post: makeMethodFn('POST'), + put: makeMethodFn('PUT'), + request, + setConfig, + sse: { + connect: makeSseFn('CONNECT'), + delete: makeSseFn('DELETE'), + get: makeSseFn('GET'), + head: makeSseFn('HEAD'), + options: makeSseFn('OPTIONS'), + patch: makeSseFn('PATCH'), + post: makeSseFn('POST'), + put: makeSseFn('PUT'), + trace: makeSseFn('TRACE'), + }, + trace: makeMethodFn('TRACE'), + } as Client; +}; diff --git a/frontend/src/api/client/client/index.ts b/frontend/src/api/client/client/index.ts new file mode 100644 index 0000000..8c69331 --- /dev/null +++ b/frontend/src/api/client/client/index.ts @@ -0,0 +1,27 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type { Auth } from '../core/auth.gen'; +export type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +export { + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from '../core/bodySerializer.gen'; +export { buildClientParams } from '../core/params.gen'; +export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen'; +export type { ServerSentEventsResult } from '../core/serverSentEvents.gen'; +export type { ClientMeta } from '../core/types.gen'; +export { createClient } from './client.gen'; +export type { + Client, + ClientOptions, + Config, + CreateClientConfig, + Options, + RequestOptions, + RequestResult, + ResolvedRequestOptions, + ResponseStyle, + TDataShape, +} from './types.gen'; +export { createConfig, mergeHeaders } from './utils.gen'; diff --git a/frontend/src/api/client/client/types.gen.ts b/frontend/src/api/client/client/types.gen.ts new file mode 100644 index 0000000..193646c --- /dev/null +++ b/frontend/src/api/client/client/types.gen.ts @@ -0,0 +1,218 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth } from '../core/auth.gen'; +import type { + ServerSentEventsOptions, + ServerSentEventsResult, +} from '../core/serverSentEvents.gen'; +import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen'; +import type { Middleware } from './utils.gen'; + +export type ResponseStyle = 'data' | 'fields'; + +export interface Config + extends Omit, CoreConfig { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Please don't use the Fetch client for Next.js applications. The `next` + * options won't have any effect. + * + * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. + */ + next?: never; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text'; + /** + * Should we return only data or multiple fields (data, error, response, etc.)? + * + * @default 'fields' + */ + responseStyle?: ResponseStyle; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} + +export interface RequestOptions< + TData = unknown, + TResponseStyle extends ResponseStyle = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, +> + extends + Config<{ + responseStyle: TResponseStyle; + throwOnError: ThrowOnError; + }>, + Pick< + ServerSentEventsOptions, + | 'onRequest' + | 'onSseError' + | 'onSseEvent' + | 'sseDefaultRetryDelay' + | 'sseMaxRetryAttempts' + | 'sseMaxRetryDelay' + > { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} + +export interface ResolvedRequestOptions< + TResponseStyle extends ResponseStyle = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, +> extends RequestOptions { + headers: Headers; + serializedBody?: string; +} + +export type RequestResult< + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = boolean, + TResponseStyle extends ResponseStyle = 'fields', +> = ThrowOnError extends true + ? Promise< + TResponseStyle extends 'data' + ? TData extends Record + ? TData[keyof TData] + : TData + : { + data: TData extends Record ? TData[keyof TData] : TData; + request: Request; + response: Response; + } + > + : Promise< + TResponseStyle extends 'data' + ? (TData extends Record ? TData[keyof TData] : TData) | undefined + : ( + | { + data: TData extends Record ? TData[keyof TData] : TData; + error: undefined; + } + | { + data: undefined; + error: TError extends Record ? TError[keyof TError] : TError; + } + ) & { + /** request may be undefined, because error may be from building the request object itself */ + request?: Request; + /** response may be undefined, because error may be from building the request object itself or from a network error */ + response?: Response; + } + >; + +export interface ClientOptions { + baseUrl?: string; + responseStyle?: ResponseStyle; + throwOnError?: boolean; +} + +type MethodFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'>, +) => RequestResult; + +type SseFn = < + TData = unknown, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'>, +) => Promise>; + +type RequestFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'> & + Pick>, 'method'>, +) => RequestResult; + +type BuildUrlFn = < + TData extends { + body?: unknown; + path?: Record; + query?: Record; + url: string; + }, +>( + options: TData & Options, +) => string; + +export type Client = CoreClient & { + interceptors: Middleware; +}; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config, +) => Config & T>; + +export interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} + +type OmitKeys = Pick>; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, + TResponseStyle extends ResponseStyle = 'fields', +> = OmitKeys< + RequestOptions, + 'body' | 'path' | 'query' | 'url' +> & + ([TData] extends [never] ? unknown : Omit); diff --git a/frontend/src/api/client/client/utils.gen.ts b/frontend/src/api/client/client/utils.gen.ts new file mode 100644 index 0000000..d4a7284 --- /dev/null +++ b/frontend/src/api/client/client/utils.gen.ts @@ -0,0 +1,316 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { getAuthToken } from '../core/auth.gen'; +import type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +import { jsonBodySerializer } from '../core/bodySerializer.gen'; +import { + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from '../core/pathSerializer.gen'; +import { getUrl } from '../core/utils.gen'; +import type { Client, ClientOptions, Config, RequestOptions } from './types.gen'; + +export const createQuerySerializer = ({ + parameters = {}, + ...args +}: QuerySerializerOptions = {}): ((queryParams: T) => string) => { + const querySerializer = (queryParams: T): string => { + const search: string[] = []; + if (queryParams && typeof queryParams === 'object') { + for (const name in queryParams) { + const value = queryParams[name]; + + if (value === undefined || value === null) { + continue; + } + + const options = parameters[name] || args; + + if (Array.isArray(value)) { + const serializedArray = serializeArrayParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'form', + value, + ...options.array, + }); + if (serializedArray) search.push(serializedArray); + } else if (typeof value === 'object') { + const serializedObject = serializeObjectParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'deepObject', + value: value as Record, + ...options.object, + }); + if (serializedObject) search.push(serializedObject); + } else { + const serializedPrimitive = serializePrimitiveParam({ + allowReserved: options.allowReserved, + name, + value: value as string, + }); + if (serializedPrimitive) search.push(serializedPrimitive); + } + } + } + return search.join('&'); + }; + return querySerializer; +}; + +/** + * Infers parseAs value from provided Content-Type header. + */ +export const getParseAs = (contentType: string | null): Exclude => { + if (!contentType) { + // If no Content-Type header is provided, the best we can do is return the raw response body, + // which is effectively the same as the 'stream' option. + return 'stream'; + } + + const cleanContent = contentType.split(';')[0]?.trim(); + + if (!cleanContent) { + return; + } + + if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) { + return 'json'; + } + + if (cleanContent === 'multipart/form-data') { + return 'formData'; + } + + if ( + ['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type)) + ) { + return 'blob'; + } + + if (cleanContent.startsWith('text/')) { + return 'text'; + } + + return; +}; + +const checkForExistence = ( + options: Pick & { + headers: Headers; + }, + name?: string, +): boolean => { + if (!name) { + return false; + } + if ( + options.headers.has(name) || + options.query?.[name] || + options.headers.get('Cookie')?.includes(`${name}=`) + ) { + return true; + } + return false; +}; + +export async function setAuthParams( + options: Pick & { + headers: Headers; + }, +): Promise { + for (const auth of options.security ?? []) { + if (checkForExistence(options, auth.name)) { + continue; + } + + const token = await getAuthToken(auth, options.auth); + + if (!token) { + continue; + } + + const name = auth.name ?? 'Authorization'; + + switch (auth.in) { + case 'query': + if (!options.query) { + options.query = {}; + } + options.query[name] = token; + break; + case 'cookie': + options.headers.append('Cookie', `${name}=${token}`); + break; + case 'header': + default: + options.headers.set(name, token); + break; + } + } +} + +export const buildUrl: Client['buildUrl'] = (options) => + getUrl({ + baseUrl: options.baseUrl as string, + path: options.path, + query: options.query, + querySerializer: + typeof options.querySerializer === 'function' + ? options.querySerializer + : createQuerySerializer(options.querySerializer), + url: options.url, + }); + +export const mergeConfigs = (a: Config, b: Config): Config => { + const config = { ...a, ...b }; + if (config.baseUrl?.endsWith('/')) { + config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); + } + config.headers = mergeHeaders(a.headers, b.headers); + return config; +}; + +const headersEntries = (headers: Headers): Array<[string, string]> => { + const entries: Array<[string, string]> = []; + headers.forEach((value, key) => { + entries.push([key, value]); + }); + return entries; +}; + +export const mergeHeaders = ( + ...headers: Array['headers'] | undefined> +): Headers => { + const mergedHeaders = new Headers(); + for (const header of headers) { + if (!header) { + continue; + } + + const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header); + + for (const [key, value] of iterator) { + if (value === null) { + mergedHeaders.delete(key); + } else if (Array.isArray(value)) { + for (const v of value) { + mergedHeaders.append(key, v as string); + } + } else if (value !== undefined) { + // assume object headers are meant to be JSON stringified, i.e., their + // content value in OpenAPI specification is 'application/json' + mergedHeaders.set( + key, + typeof value === 'object' ? JSON.stringify(value) : (value as string), + ); + } + } + } + return mergedHeaders; +}; + +type ErrInterceptor = ( + error: Err, + /** response may be undefined due to a network error where no response object is produced */ + response: Res | undefined, + /** request may be undefined, because error may be from building the request object itself */ + request: Req | undefined, + options: Options, +) => Err | Promise; + +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; + +type ResInterceptor = ( + response: Res, + request: Req, + options: Options, +) => Res | Promise; + +class Interceptors { + fns: Array = []; + + clear(): void { + this.fns = []; + } + + eject(id: number | Interceptor): void { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = null; + } + } + + exists(id: number | Interceptor): boolean { + const index = this.getInterceptorIndex(id); + return Boolean(this.fns[index]); + } + + getInterceptorIndex(id: number | Interceptor): number { + if (typeof id === 'number') { + return this.fns[id] ? id : -1; + } + return this.fns.indexOf(id); + } + + update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = fn; + return id; + } + return false; + } + + use(fn: Interceptor): number { + this.fns.push(fn); + return this.fns.length - 1; + } +} + +export interface Middleware { + error: Interceptors>; + request: Interceptors>; + response: Interceptors>; +} + +export const createInterceptors = (): Middleware< + Req, + Res, + Err, + Options +> => ({ + error: new Interceptors>(), + request: new Interceptors>(), + response: new Interceptors>(), +}); + +const defaultQuerySerializer = createQuerySerializer({ + allowReserved: false, + array: { + explode: true, + style: 'form', + }, + object: { + explode: true, + style: 'deepObject', + }, +}); + +const defaultHeaders = { + 'Content-Type': 'application/json', +}; + +export const createConfig = ( + override: Config & T> = {}, +): Config & T> => ({ + ...jsonBodySerializer, + headers: defaultHeaders, + parseAs: 'auto', + querySerializer: defaultQuerySerializer, + ...override, +}); diff --git a/frontend/src/api/client/core/auth.gen.ts b/frontend/src/api/client/core/auth.gen.ts new file mode 100644 index 0000000..c663664 --- /dev/null +++ b/frontend/src/api/client/core/auth.gen.ts @@ -0,0 +1,48 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type AuthToken = string | undefined; + +export interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * A unique identifier for the security scheme. + * + * Defined only when there are multiple security schemes whose `Auth` + * shape would otherwise be identical. + */ + key?: string; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} + +export const getAuthToken = async ( + auth: Auth, + callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, +): Promise => { + const token = typeof callback === 'function' ? await callback(auth) : callback; + + if (!token) { + return; + } + + if (auth.scheme === 'bearer') { + return `Bearer ${token}`; + } + + if (auth.scheme === 'basic') { + return `Basic ${btoa(token)}`; + } + + return token; +}; diff --git a/frontend/src/api/client/core/bodySerializer.gen.ts b/frontend/src/api/client/core/bodySerializer.gen.ts new file mode 100644 index 0000000..67daca6 --- /dev/null +++ b/frontend/src/api/client/core/bodySerializer.gen.ts @@ -0,0 +1,82 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen'; + +export type QuerySerializer = (query: Record) => string; + +export type BodySerializer = (body: unknown) => unknown; + +type QuerySerializerOptionsObject = { + allowReserved?: boolean; + array?: Partial>; + object?: Partial>; +}; + +export type QuerySerializerOptions = QuerySerializerOptionsObject & { + /** + * Per-parameter serialization overrides. When provided, these settings + * override the global array/object settings for specific parameter names. + */ + parameters?: Record; +}; + +const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => { + if (typeof value === 'string' || value instanceof Blob) { + data.append(key, value); + } else if (value instanceof Date) { + data.append(key, value.toISOString()); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => { + if (typeof value === 'string') { + data.append(key, value); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +export const formDataBodySerializer = { + bodySerializer: (body: unknown): FormData => { + const data = new FormData(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeFormDataPair(data, key, v)); + } else { + serializeFormDataPair(data, key, value); + } + }); + + return data; + }, +}; + +export const jsonBodySerializer = { + bodySerializer: (body: unknown): string => + JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)), +}; + +export const urlSearchParamsBodySerializer = { + bodySerializer: (body: unknown): string => { + const data = new URLSearchParams(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)); + } else { + serializeUrlSearchParamsPair(data, key, value); + } + }); + + return data.toString(); + }, +}; diff --git a/frontend/src/api/client/core/params.gen.ts b/frontend/src/api/client/core/params.gen.ts new file mode 100644 index 0000000..5e8908f --- /dev/null +++ b/frontend/src/api/client/core/params.gen.ts @@ -0,0 +1,178 @@ +// This file is auto-generated by @hey-api/openapi-ts + +type Slot = 'body' | 'headers' | 'path' | 'query'; + +export type Field = + | { + in: Exclude; + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If omitted, we use the same value as `key`. + */ + map?: string; + } + | { + in: Extract; + /** + * Key isn't required for bodies. + */ + key?: string; + map?: string; + } + | { + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If `in` is omitted, `map` aliases `key` to the transport layer. + */ + map: Slot; + }; + +export interface Fields { + allowExtra?: Partial>; + args?: ReadonlyArray; +} + +export type FieldsConfig = ReadonlyArray; + +const extraPrefixesMap: Record = { + $body_: 'body', + $headers_: 'headers', + $path_: 'path', + $query_: 'query', +}; +const extraPrefixes = Object.entries(extraPrefixesMap); + +type KeyMap = Map< + string, + | { + in: Slot; + map?: string; + } + | { + in?: never; + map: Slot; + } +>; + +function buildKeyMap(fields: FieldsConfig, map?: KeyMap): KeyMap { + if (!map) { + map = new Map(); + } + + for (const config of fields) { + if ('in' in config) { + if (config.key) { + map.set(config.key, { + in: config.in, + map: config.map, + }); + } + } else if ('key' in config) { + map.set(config.key, { + map: config.map, + }); + } else if (config.args) { + buildKeyMap(config.args, map); + } + } + + return map; +} + +interface Params { + body?: unknown; + headers: Record; + path: Record; + query: Record; +} + +function stripEmptySlots(params: Params): void { + for (const [slot, value] of Object.entries(params)) { + if (slot === 'body') continue; + if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) { + delete params[slot as Slot]; + } + } +} + +export function buildClientParams(args: ReadonlyArray, fields: FieldsConfig): Params { + const params: Params = { + headers: Object.create(null), + path: Object.create(null), + query: Object.create(null), + }; + + const map = buildKeyMap(fields); + + function writeSlot(slot: Slot, key: string, value: unknown): void { + let record = params[slot] as Record | undefined; + if (record === undefined) { + record = Object.create(null) as Record; + params[slot] = record; + } + record[key] = value; + } + + let config: FieldsConfig[number] | undefined; + + for (const [index, arg] of args.entries()) { + if (fields[index]) { + config = fields[index]; + } + + if (!config) { + continue; + } + + if ('in' in config) { + if (config.key) { + const field = map.get(config.key)!; + const name = field.map || config.key; + if (field.in) { + writeSlot(field.in, name, arg); + } + } else { + params.body = arg; + } + } else { + for (const [key, value] of Object.entries(arg ?? {})) { + const field = map.get(key); + + if (field) { + if (field.in) { + const name = field.map || key; + writeSlot(field.in, name, value); + } else { + params[field.map] = value; + } + } else { + const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)); + + if (extra) { + const [prefix, slot] = extra; + writeSlot(slot, key.slice(prefix.length), value); + } else if ('allowExtra' in config && config.allowExtra) { + for (const [slot, allowed] of Object.entries(config.allowExtra)) { + if (allowed) { + writeSlot(slot as Slot, key, value); + break; + } + } + } + } + } + } + } + + stripEmptySlots(params); + + return params; +} diff --git a/frontend/src/api/client/core/pathSerializer.gen.ts b/frontend/src/api/client/core/pathSerializer.gen.ts new file mode 100644 index 0000000..fab1ed4 --- /dev/null +++ b/frontend/src/api/client/core/pathSerializer.gen.ts @@ -0,0 +1,171 @@ +// This file is auto-generated by @hey-api/openapi-ts + +interface SerializeOptions extends SerializePrimitiveOptions, SerializerOptions {} + +interface SerializePrimitiveOptions { + allowReserved?: boolean; + name: string; +} + +export interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} + +export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +export type ArraySeparatorStyle = ArrayStyle | MatrixStyle; +type MatrixStyle = 'label' | 'matrix' | 'simple'; +export type ObjectStyle = 'form' | 'deepObject'; +type ObjectSeparatorStyle = ObjectStyle | MatrixStyle; + +interface SerializePrimitiveParam extends SerializePrimitiveOptions { + value: string; +} + +export const separatorArrayExplode = (style: ArraySeparatorStyle): '.' | ';' | ',' | '&' => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const separatorArrayNoExplode = (style: ArraySeparatorStyle): ',' | '|' | '%20' => { + switch (style) { + case 'form': + return ','; + case 'pipeDelimited': + return '|'; + case 'spaceDelimited': + return '%20'; + default: + return ','; + } +}; + +export const separatorObjectExplode = (style: ObjectSeparatorStyle): '.' | ';' | ',' | '&' => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const serializeArrayParam = ({ + allowReserved, + explode, + name, + style, + value, +}: SerializeOptions & { + value: unknown[]; +}): string => { + if (!explode) { + const joinedValues = ( + allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) + ).join(separatorArrayNoExplode(style)); + switch (style) { + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + case 'simple': + return joinedValues; + default: + return `${name}=${joinedValues}`; + } + } + + const separator = separatorArrayExplode(style); + const joinedValues = value + .map((v) => { + if (style === 'label' || style === 'simple') { + return allowReserved ? v : encodeURIComponent(v as string); + } + + return serializePrimitiveParam({ + allowReserved, + name, + value: v as string, + }); + }) + .join(separator); + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; +}; + +export const serializePrimitiveParam = ({ + allowReserved, + name, + value, +}: SerializePrimitiveParam): string => { + if (value === undefined || value === null) { + return ''; + } + + if (typeof value === 'object') { + throw new Error( + 'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.', + ); + } + + return `${name}=${allowReserved ? value : encodeURIComponent(value)}`; +}; + +export const serializeObjectParam = ({ + allowReserved, + explode, + name, + style, + value, + valueOnly, +}: SerializeOptions & { + value: Record | Date; + valueOnly?: boolean; +}): string => { + if (value instanceof Date) { + return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`; + } + + if (style !== 'deepObject' && !explode) { + let values: string[] = []; + Object.entries(value).forEach(([key, v]) => { + values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)]; + }); + const joinedValues = values.join(','); + switch (style) { + case 'form': + return `${name}=${joinedValues}`; + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + default: + return joinedValues; + } + } + + const separator = separatorObjectExplode(style); + const joinedValues = Object.entries(value) + .map(([key, v]) => + serializePrimitiveParam({ + allowReserved, + name: style === 'deepObject' ? `${name}[${key}]` : key, + value: v as string, + }), + ) + .join(separator); + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; +}; diff --git a/frontend/src/api/client/core/queryKeySerializer.gen.ts b/frontend/src/api/client/core/queryKeySerializer.gen.ts new file mode 100644 index 0000000..773b065 --- /dev/null +++ b/frontend/src/api/client/core/queryKeySerializer.gen.ts @@ -0,0 +1,117 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * JSON-friendly union that mirrors what Pinia Colada can hash. + */ +export type JsonValue = + | null + | string + | number + | boolean + | JsonValue[] + | { [key: string]: JsonValue }; + +/** + * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. + */ +export const queryKeyJsonReplacer = (_key: string, value: unknown): unknown | undefined => { + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { + return undefined; + } + if (typeof value === 'bigint') { + return value.toString(); + } + if (value instanceof Date) { + return value.toISOString(); + } + return value; +}; + +/** + * Safely stringifies a value and parses it back into a JsonValue. + */ +export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => { + try { + const json = JSON.stringify(input, queryKeyJsonReplacer); + if (json === undefined) { + return undefined; + } + return JSON.parse(json) as JsonValue; + } catch { + return undefined; + } +}; + +/** + * Detects plain objects (including objects with a null prototype). + */ +const isPlainObject = (value: unknown): value is Record => { + if (value === null || typeof value !== 'object') { + return false; + } + const prototype = Object.getPrototypeOf(value as object); + return prototype === Object.prototype || prototype === null; +}; + +/** + * Turns URLSearchParams into a sorted JSON object for deterministic keys. + */ +const serializeSearchParams = (params: URLSearchParams): JsonValue => { + const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b)); + const result: Record = {}; + + for (const [key, value] of entries) { + const existing = result[key]; + if (existing === undefined) { + result[key] = value; + continue; + } + + if (Array.isArray(existing)) { + (existing as string[]).push(value); + } else { + result[key] = [existing, value]; + } + } + + return result; +}; + +/** + * Normalizes any accepted value into a JSON-friendly shape for query keys. + */ +export const serializeQueryKeyValue = (value: unknown): JsonValue | undefined => { + if (value === null) { + return null; + } + + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return value; + } + + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { + return undefined; + } + + if (typeof value === 'bigint') { + return value.toString(); + } + + if (value instanceof Date) { + return value.toISOString(); + } + + if (Array.isArray(value)) { + return stringifyToJsonValue(value); + } + + if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) { + return serializeSearchParams(value); + } + + if (isPlainObject(value)) { + return stringifyToJsonValue(value); + } + + return undefined; +}; diff --git a/frontend/src/api/client/core/serverSentEvents.gen.ts b/frontend/src/api/client/core/serverSentEvents.gen.ts new file mode 100644 index 0000000..ddf3c4d --- /dev/null +++ b/frontend/src/api/client/core/serverSentEvents.gen.ts @@ -0,0 +1,242 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Config } from './types.gen'; + +export type ServerSentEventsOptions = Omit & + Pick & { + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Implementing clients can call request interceptors inside this hook. + */ + onRequest?: (url: string, init: RequestInit) => Promise; + /** + * Callback invoked when a network or parsing error occurs during streaming. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param error The error that occurred. + */ + onSseError?: (error: unknown) => void; + /** + * Callback invoked when an event is streamed from the server. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param event Event streamed from the server. + * @returns Nothing (void). + */ + onSseEvent?: (event: StreamEvent) => void; + serializedBody?: RequestInit['body']; + /** + * Default retry delay in milliseconds. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 3000 + */ + sseDefaultRetryDelay?: number; + /** + * Maximum number of retry attempts before giving up. + */ + sseMaxRetryAttempts?: number; + /** + * Maximum retry delay in milliseconds. + * + * Applies only when exponential backoff is used. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 30000 + */ + sseMaxRetryDelay?: number; + /** + * Optional sleep function for retry backoff. + * + * Defaults to using `setTimeout`. + */ + sseSleepFn?: (ms: number) => Promise; + url: string; + }; + +export interface StreamEvent { + data: TData; + event?: string; + id?: string; + retry?: number; +} + +export type ServerSentEventsResult = { + stream: AsyncGenerator< + TData extends Record ? TData[keyof TData] : TData, + TReturn, + TNext + >; +}; + +export function createSseClient({ + onRequest, + onSseError, + onSseEvent, + responseTransformer, + responseValidator, + sseDefaultRetryDelay, + sseMaxRetryAttempts, + sseMaxRetryDelay, + sseSleepFn, + url, + ...options +}: ServerSentEventsOptions): ServerSentEventsResult { + let lastEventId: string | undefined; + + const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))); + + const createStream = async function* () { + let retryDelay: number = sseDefaultRetryDelay ?? 3000; + let attempt = 0; + const signal = options.signal ?? new AbortController().signal; + + while (true) { + if (signal.aborted) break; + + attempt++; + + const headers = + options.headers instanceof Headers + ? options.headers + : new Headers(options.headers as Record | undefined); + + if (lastEventId !== undefined) { + headers.set('Last-Event-ID', lastEventId); + } + + try { + const requestInit: RequestInit = { + redirect: 'follow', + ...options, + body: options.serializedBody, + headers, + signal, + }; + let request = new Request(url, requestInit); + if (onRequest) { + request = await onRequest(url, requestInit); + } + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = options.fetch ?? globalThis.fetch; + const response = await _fetch(request); + + if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`); + + if (!response.body) throw new Error('No body in SSE response'); + + const reader = response.body.pipeThrough(new TextDecoderStream()).getReader(); + + let buffer = ''; + + const abortHandler = () => { + try { + reader.cancel(); + } catch { + // noop + } + }; + + signal.addEventListener('abort', abortHandler); + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + buffer += value; + buffer = buffer.replace(/\r\n?/g, '\n'); // normalize line endings + + const chunks = buffer.split('\n\n'); + buffer = chunks.pop() ?? ''; + + for (const chunk of chunks) { + const lines = chunk.split('\n'); + const dataLines: Array = []; + let eventName: string | undefined; + + for (const line of lines) { + if (line.startsWith('data:')) { + dataLines.push(line.replace(/^data:\s*/, '')); + } else if (line.startsWith('event:')) { + eventName = line.replace(/^event:\s*/, ''); + } else if (line.startsWith('id:')) { + lastEventId = line.replace(/^id:\s*/, ''); + } else if (line.startsWith('retry:')) { + const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10); + if (!Number.isNaN(parsed)) { + retryDelay = parsed; + } + } + } + + let data: unknown; + let parsedJson = false; + + if (dataLines.length) { + const rawData = dataLines.join('\n'); + try { + data = JSON.parse(rawData); + parsedJson = true; + } catch { + data = rawData; + } + } + + if (parsedJson) { + if (responseValidator) { + await responseValidator(data); + } + + if (responseTransformer) { + data = await responseTransformer(data); + } + } + + onSseEvent?.({ + data, + event: eventName, + id: lastEventId, + retry: retryDelay, + }); + + if (dataLines.length) { + yield data as any; + } + } + } + } finally { + signal.removeEventListener('abort', abortHandler); + reader.releaseLock(); + } + + break; // exit loop on normal completion + } catch (error) { + // connection failed or aborted; retry after delay + onSseError?.(error); + + if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) { + break; // stop after firing error + } + + // exponential backoff: double retry each attempt, cap at 30s + const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000); + await sleep(backoff); + } + } + }; + + const stream = createStream(); + + return { stream }; +} diff --git a/frontend/src/api/client/core/types.gen.ts b/frontend/src/api/client/core/types.gen.ts new file mode 100644 index 0000000..c657c85 --- /dev/null +++ b/frontend/src/api/client/core/types.gen.ts @@ -0,0 +1,110 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth, AuthToken } from './auth.gen'; +import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen'; + +export type HttpMethod = + | 'connect' + | 'delete' + | 'get' + | 'head' + | 'options' + | 'patch' + | 'post' + | 'put' + | 'trace'; + +export type Client< + RequestFn = never, + Config = unknown, + MethodFn = never, + BuildUrlFn = never, + SseFn = never, +> = { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + getConfig: () => Config; + request: RequestFn; + setConfig: (config: Config) => Config; +} & { + [K in HttpMethod]: MethodFn; +} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } }); + +export interface Config { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: + | RequestInit['headers'] + | Record< + string, + string | number | boolean | (string | number | boolean)[] | null | undefined | unknown + >; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: Uppercase; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function validating request data. This is useful if you want to ensure + * the request conforms to the desired shape, so it can be safely sent to + * the server. + */ + requestValidator?: (data: unknown) => Promise; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g., converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +/** + * Arbitrary metadata passed through the `meta` request option. + */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface ClientMeta {} + +type IsExactlyNeverOrNeverUndefined = [T] extends [never] + ? true + : [T] extends [never | undefined] + ? [undefined] extends [T] + ? false + : true + : false; + +export type OmitNever> = { + [K in keyof T as IsExactlyNeverOrNeverUndefined extends true ? never : K]: T[K]; +}; diff --git a/frontend/src/api/client/core/utils.gen.ts b/frontend/src/api/client/core/utils.gen.ts new file mode 100644 index 0000000..af56e07 --- /dev/null +++ b/frontend/src/api/client/core/utils.gen.ts @@ -0,0 +1,140 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { BodySerializer, QuerySerializer } from './bodySerializer.gen'; +import { + type ArraySeparatorStyle, + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from './pathSerializer.gen'; + +export interface PathSerializer { + path: Record; + url: string; +} + +export const PATH_PARAM_RE: RegExp = /\{[^{}]+\}/g; + +export const defaultPathSerializer = ({ path, url: _url }: PathSerializer): string => { + let url = _url; + const matches = _url.match(PATH_PARAM_RE); + if (matches) { + for (const match of matches) { + let explode = false; + let name = match.substring(1, match.length - 1); + let style: ArraySeparatorStyle = 'simple'; + + if (name.endsWith('*')) { + explode = true; + name = name.substring(0, name.length - 1); + } + + if (name.startsWith('.')) { + name = name.substring(1); + style = 'label'; + } else if (name.startsWith(';')) { + name = name.substring(1); + style = 'matrix'; + } + + const value = path[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + url = url.replace(match, serializeArrayParam({ explode, name, style, value })); + continue; + } + + if (typeof value === 'object') { + url = url.replace( + match, + serializeObjectParam({ + explode, + name, + style, + value: value as Record, + valueOnly: true, + }), + ); + continue; + } + + if (style === 'matrix') { + url = url.replace( + match, + `;${serializePrimitiveParam({ + name, + value: value as string, + })}`, + ); + continue; + } + + const replaceValue = encodeURIComponent( + style === 'label' ? `.${value as string}` : (value as string), + ); + url = url.replace(match, replaceValue); + } + } + return url; +}; + +export const getUrl = ({ + baseUrl, + path, + query, + querySerializer, + url: _url, +}: { + baseUrl?: string; + path?: Record; + query?: Record; + querySerializer: QuerySerializer; + url: string; +}): string => { + const pathUrl = _url.startsWith('/') ? _url : `/${_url}`; + let url = (baseUrl ?? '') + pathUrl; + if (path) { + url = defaultPathSerializer({ path, url }); + } + let search = query ? querySerializer(query) : ''; + if (search.startsWith('?')) { + search = search.substring(1); + } + if (search) { + url += `?${search}`; + } + return url; +}; + +export function getValidRequestBody(options: { + body?: unknown; + bodySerializer?: BodySerializer | null; + serializedBody?: unknown; +}): unknown { + const hasBody = options.body !== undefined; + const isSerializedBody = hasBody && options.bodySerializer; + + if (isSerializedBody) { + if ('serializedBody' in options) { + const hasSerializedBody = + options.serializedBody !== undefined && options.serializedBody !== ''; + + return hasSerializedBody ? options.serializedBody : null; + } + + // not all clients implement a serializedBody property (i.e., client-axios) + return options.body !== '' ? options.body : null; + } + + // plain/text body + if (hasBody) { + return options.body; + } + + // no body was provided + return undefined; +} diff --git a/frontend/src/api/client/index.ts b/frontend/src/api/client/index.ts new file mode 100644 index 0000000..cd23abf --- /dev/null +++ b/frontend/src/api/client/index.ts @@ -0,0 +1,4 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export { addComment, deleteComment, getArticle, getFeed, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getWeatherNow, getWeatherToday, getWeek, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, me, nearestRegion, type Options, refresh, savePost, signup, unlikeComment, unlikePost, unsavePost } from './sdk.gen'; +export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, type ClientOptions, type CommentData, type CommuteData, Confidence, type Cut, type DayData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type ErrorInfo, type EventData, type Factor, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekResponse, type GetWeekResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HourCell, type HoursSlide, type HttpValidationError, IndexCategory, type IndexSummary, type LikeCommentData, type LikeCommentError, type LikeCommentErrors, type LikeCommentResponse, type LikeCommentResponses, type LikePostData, type LikePostError, type LikePostErrors, type LikePostResponse, type LikePostResponses, type ListArticlesData, type ListArticlesError, type ListArticlesErrors, type ListArticlesResponse, type ListArticlesResponses, type ListCommentsData, type ListCommentsError, type ListCommentsErrors, type ListCommentsResponse, type ListCommentsResponses, type ListEventsData, type ListEventsError, type ListEventsErrors, type ListEventsResponse, type ListEventsResponses, type ListIndicesData, type ListIndicesError, type ListIndicesErrors, type ListIndicesResponse, type ListIndicesResponses, type ListPlacesData, type ListPlacesError, type ListPlacesErrors, type ListPlacesResponse, type ListPlacesResponses, type ListRegionsData, type ListRegionsError, type ListRegionsErrors, type ListRegionsResponse, type ListRegionsResponses, type ListSavedData, type ListSavedError, type ListSavedErrors, type ListSavedResponse, type ListSavedResponses, type LoginData, type LoginError, type LoginErrors, type LoginResponse, type LoginResponses, type Me, type MeData, type MeError, type MeErrors, type MeResponse, type MeResponses, type NearestRegionData, type NearestRegionError, type NearestRegionErrors, type NearestRegionResponse, type NearestRegionResponses, type PlaceData, type PostData, PostType, type Rain2h, type RainHourData, RainType, type RankData, type RefreshData, type RefreshError, type RefreshErrors, type RefreshResponse, type RefreshResponses, type RegionData, type ReqComment, type ReqLogin, type ReqRefresh, type ReqSignup, type ResArticle, type ResArticleList, type ResAuth, type ResComment, type ResCommentLike, type ResCommentList, type ResEventList, type ResFeed, type ResHealth, type ResIndexDetail, type ResIndexList, type ResMe, type ResPlaceList, type ResPost, type ResPostLike, type ResPostSave, type ResRegion, type ResRegionList, type ResSavedList, type ResSeasonWeek, type ResSky, type ResSkyRanking, type ResWeatherNow, type ResWeatherToday, type ResWebPacketProtocol, type ResWeek, type Row, type RowsSlide, type SavedPost, type SavePostData, type SavePostError, type SavePostErrors, type SavePostResponse, type SavePostResponses, type SignupData, type SignupError, type SignupErrors, type SignupResponse, type SignupResponses, Sky, SkyGrade, type SkyScoreData, SkyType, SlotTone, type SpotData, type SunsetSlide, type TermData, type Tomorrow, type TopIndex, type TrendPoint, type UnlikeCommentData, type UnlikeCommentError, type UnlikeCommentErrors, type UnlikeCommentResponse, type UnlikeCommentResponses, type UnlikePostData, type UnlikePostError, type UnlikePostErrors, type UnlikePostResponse, type UnlikePostResponses, type UnsavePostData, type UnsavePostError, type UnsavePostErrors, type UnsavePostResponse, type UnsavePostResponses, type ValidationError, type WarningData, WarningLevel, WarningType, type WeatherSlot, type WeekDay, type WeekSlide } from './types.gen'; diff --git a/frontend/src/api/client/sdk.gen.ts b/frontend/src/api/client/sdk.gen.ts new file mode 100644 index 0000000..aa377db --- /dev/null +++ b/frontend/src/api/client/sdk.gen.ts @@ -0,0 +1,202 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client'; +import { client } from './client.gen'; +import type { AddCommentData, AddCommentErrors, AddCommentResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, GetArticleData, GetArticleErrors, GetArticleResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetIndexData, GetIndexErrors, GetIndexResponses, GetPostData, GetPostErrors, GetPostResponses, GetSeasonWeekData, GetSeasonWeekResponses, GetSkyData, GetSkyErrors, GetSkyRankingData, GetSkyRankingResponses, GetSkyResponses, GetWeatherNowData, GetWeatherNowErrors, GetWeatherNowResponses, GetWeatherTodayData, GetWeatherTodayErrors, GetWeatherTodayResponses, GetWeekData, GetWeekErrors, GetWeekResponses, HealthzHealthzGetData, HealthzHealthzGetResponses, LikeCommentData, LikeCommentErrors, LikeCommentResponses, LikePostData, LikePostErrors, LikePostResponses, ListArticlesData, ListArticlesErrors, ListArticlesResponses, ListCommentsData, ListCommentsErrors, ListCommentsResponses, ListEventsData, ListEventsErrors, ListEventsResponses, ListIndicesData, ListIndicesErrors, ListIndicesResponses, ListPlacesData, ListPlacesErrors, ListPlacesResponses, ListRegionsData, ListRegionsErrors, ListRegionsResponses, ListSavedData, ListSavedErrors, ListSavedResponses, LoginData, LoginErrors, LoginResponses, MeData, MeErrors, MeResponses, NearestRegionData, NearestRegionErrors, NearestRegionResponses, RefreshData, RefreshErrors, RefreshResponses, SavePostData, SavePostErrors, SavePostResponses, SignupData, SignupErrors, SignupResponses, UnlikeCommentData, UnlikeCommentErrors, UnlikeCommentResponses, UnlikePostData, UnlikePostErrors, UnlikePostResponses, UnsavePostData, UnsavePostErrors, UnsavePostResponses } from './types.gen'; + +export type Options = Options2 & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: keyof ClientMeta extends never ? Record : ClientMeta; +}; + +/** + * 구 목록 + */ +export const listRegions = (options?: Options): RequestResult => (options?.client ?? client).get({ url: '/v1/region/list', ...options }); + +/** + * 위치에서 가장 가까운 구 + */ +export const nearestRegion = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/region/nearest', ...options }); + +/** + * 오늘 3시간 칸 날씨 + */ +export const getWeatherToday = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/weather/today', ...options }); + +/** + * 지금 비 올까: 2시간 비, 내일 출퇴근, 미세먼지, 특보 + */ +export const getWeatherNow = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/weather/now', ...options }); + +/** + * 노을·일출 점수, 3컷, 가까운 명소, 앞으로 3일 + */ +export const getSky = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/sky', ...options }); + +/** + * 전국 노을 순위 (대표 30곳) + */ +export const getSkyRanking = (options?: Options): RequestResult => (options?.client ?? client).get({ url: '/v1/sky/ranking', ...options }); + +/** + * 지수 목록 (점수순, 1~3위, 오늘 날씨 점수) + */ +export const listIndices = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/index/list', ...options }); + +/** + * 지수 계산 근거 + */ +export const getIndex = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/index/{index_id}', ...options }); + +/** + * 7일 날씨와 그날 추천 + */ +export const getWeek = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/week', ...options }); + +/** + * 날씨 맞춤 데이트 명소 + */ +export const listPlaces = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/week/place/list', ...options }); + +/** + * 앞으로 30일 축제·행사 + */ +export const listEvents = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/week/event/list', ...options }); + +/** + * 이번 주 계절 책: 시, 절기, 계절 소식 + */ +export const getSeasonWeek = (options?: Options): RequestResult => (options?.client ?? client).get({ url: '/v1/season/week', ...options }); + +/** + * 읽을거리 목록 + */ +export const listArticles = (options?: Options): RequestResult => (options?.client ?? client).get({ url: '/v1/season/article/list', ...options }); + +/** + * 읽을거리 본문 + */ +export const getArticle = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/season/article/{article_id}', ...options }); + +/** + * 메인 피드: 하늘 영역, 오늘의 각, 오늘 포스트 전부, 띠 + */ +export const getFeed = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/feed', ...options }); + +/** + * 포스트 하나 (공유 링크로 들어왔을 때) + */ +export const getPost = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/feed/post/{post_id}', ...options }); + +/** + * 회원가입 (아이디 영문 소문자·숫자·_ 4~20자, 비밀번호 8자 이상, 닉네임 2~12자) + */ +export const signup = (options: Options): RequestResult => (options.client ?? client).post({ + url: '/v1/auth/signup', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * 로그인 + */ +export const login = (options: Options): RequestResult => (options.client ?? client).post({ + url: '/v1/auth/login', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * 토큰 재발급 + */ +export const refresh = (options: Options): RequestResult => (options.client ?? client).post({ + url: '/v1/auth/refresh', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * 내 정보 + */ +export const me = (options?: Options): RequestResult => (options?.client ?? client).get({ url: '/v1/auth/me', ...options }); + +/** + * 좋아요 취소 + */ +export const unlikePost = (options: Options): RequestResult => (options.client ?? client).delete({ url: '/v1/reaction/post/{post_id}/like', ...options }); + +/** + * 좋아요 + */ +export const likePost = (options: Options): RequestResult => (options.client ?? client).post({ url: '/v1/reaction/post/{post_id}/like', ...options }); + +/** + * 저장 취소 + */ +export const unsavePost = (options: Options): RequestResult => (options.client ?? client).delete({ url: '/v1/reaction/post/{post_id}/save', ...options }); + +/** + * 저장 + */ +export const savePost = (options: Options): RequestResult => (options.client ?? client).post({ url: '/v1/reaction/post/{post_id}/save', ...options }); + +/** + * 내가 저장한 포스트 + */ +export const listSaved = (options?: Options): RequestResult => (options?.client ?? client).get({ url: '/v1/reaction/save/list', ...options }); + +/** + * 댓글 목록 (로그인 없이 보기) + */ +export const listComments = (options: Options): RequestResult => (options.client ?? client).get({ url: '/v1/reaction/post/{post_id}/comment/list', ...options }); + +/** + * 댓글 쓰기 (60자) + */ +export const addComment = (options: Options): RequestResult => (options.client ?? client).post({ + url: '/v1/reaction/post/{post_id}/comment', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * 내 댓글 지우기 + */ +export const deleteComment = (options: Options): RequestResult => (options.client ?? client).delete({ url: '/v1/reaction/comment/{comment_id}', ...options }); + +/** + * 댓글 좋아요 취소 + */ +export const unlikeComment = (options: Options): RequestResult => (options.client ?? client).delete({ url: '/v1/reaction/comment/{comment_id}/like', ...options }); + +/** + * 댓글 좋아요 + */ +export const likeComment = (options: Options): RequestResult => (options.client ?? client).post({ url: '/v1/reaction/comment/{comment_id}/like', ...options }); + +/** + * 헬스체크 + */ +export const healthzHealthzGet = (options?: Options): RequestResult => (options?.client ?? client).get({ url: '/healthz', ...options }); diff --git a/frontend/src/api/client/types.gen.ts b/frontend/src/api/client/types.gen.ts new file mode 100644 index 0000000..fce97fc --- /dev/null +++ b/frontend/src/api/client/types.gen.ts @@ -0,0 +1,3026 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type ClientOptions = { + baseUrl: 'http://localhost:9810' | (string & {}); +}; + +/** + * AirData + */ +export type AirData = { + /** + * Station Name + */ + station_name: string; + /** + * Pm25 + */ + pm25?: number | null; + /** + * Pm10 + */ + pm10?: number | null; + grade?: AirGrade | null; + /** + * Measured At + */ + measured_at: string; + /** + * Text + */ + text?: string | null; +}; + +/** + * AirGrade + */ +export const AirGrade = { + /** + * GOOD + */ + GOOD: 1, + /** + * NORMAL + */ + NORMAL: 2, + /** + * BAD + */ + BAD: 3, + /** + * VERY_BAD + */ + VERY_BAD: 4 +} as const; + +/** + * AirGrade + */ +export type AirGrade = typeof AirGrade[keyof typeof AirGrade]; + +/** + * ArticleCategory + */ +export const ArticleCategory = { + /** + * SEASON + */ + SEASON: 1, + /** + * TIP + */ + TIP: 2, + /** + * GAK + */ + GAK: 3 +} as const; + +/** + * ArticleCategory + */ +export type ArticleCategory = typeof ArticleCategory[keyof typeof ArticleCategory]; + +/** + * ArticleSummary + */ +export type ArticleSummary = { + /** + * Article Id + */ + article_id: number; + /** + * Code + */ + code: string; + category: ArticleCategory; + /** + * Title + */ + title: string; + /** + * Read Minutes + */ + read_minutes: number; + /** + * Icon + */ + icon: string; +}; + +/** + * AuthProvider + */ +export const AuthProvider = { /** + * LOCAL + */ + LOCAL: 1, /** + * GOOGLE + */ + GOOGLE: 2 } as const; + +/** + * AuthProvider + */ +export type AuthProvider = typeof AuthProvider[keyof typeof AuthProvider]; + +/** + * BandArticle + */ +export type BandArticle = { + /** + * Article Id + */ + article_id: number; + /** + * Title + */ + title: string; + /** + * Meta + */ + meta: string; + /** + * Icon + */ + icon: string; +}; + +/** + * BandEvent + */ +export type BandEvent = { + /** + * Event Id + */ + event_id: number; + /** + * Name + */ + name: string; + /** + * Status Label + */ + status_label: string; + /** + * Icon + */ + icon: string; +}; + +/** + * Bands + */ +export type Bands = { + /** + * Events + */ + events?: Array; + /** + * Top5 + */ + top5?: Array; + /** + * Season + */ + season?: Array; +}; + +/** + * BestTime + */ +export type BestTime = { + /** + * At + */ + at: string; + /** + * Kind + */ + kind: string; + /** + * Label + */ + label: string; +}; + +/** + * CommentData + */ +export type CommentData = { + /** + * Comment Id + */ + comment_id: number; + /** + * Nickname + */ + nickname: string; + /** + * Body + */ + body: string; + /** + * Like Count + */ + like_count: number; + /** + * Liked + */ + liked: boolean; + /** + * Mine + */ + mine: boolean; + /** + * Created At + */ + created_at: string; +}; + +/** + * CommuteData + */ +export type CommuteData = { + /** + * Label + */ + label: string; + /** + * At + */ + at: string; + /** + * Icon + */ + icon: string; + /** + * Temp C + */ + temp_c?: number | null; + /** + * Text + */ + text: string; +}; + +/** + * Confidence + */ +export const Confidence = { + /** + * HIGH + */ + HIGH: 1, + /** + * NORMAL + */ + NORMAL: 2, + /** + * LOW + */ + LOW: 3 +} as const; + +/** + * Confidence + */ +export type Confidence = typeof Confidence[keyof typeof Confidence]; + +/** + * Cut + */ +export type Cut = { + /** + * At + */ + at: string; + /** + * Kind + */ + kind: string; + /** + * Label + */ + label: string; +}; + +/** + * DayData + */ +export type DayData = { + /** + * Day + */ + day: string; + /** + * Weekday + */ + weekday: string; + /** + * Holiday + */ + holiday?: string | null; + /** + * Icon + */ + icon: string; + /** + * Temp Min C + */ + temp_min_c?: number | null; + /** + * Temp Max C + */ + temp_max_c?: number | null; + /** + * Headline + */ + headline: string; + /** + * Summary + */ + summary: string; + /** + * Pick + */ + pick: string; + /** + * Rain Hours + */ + rain_hours?: Array | null; + /** + * Is Rainy + */ + is_rainy: boolean; +}; + +/** + * ErrorInfo + */ +export type ErrorInfo = { + /** + * Success + */ + success?: boolean; + /** + * Code + */ + code?: number; + /** + * Desc + */ + desc?: string; +}; + +/** + * EventData + */ +export type EventData = { + /** + * Event Id + */ + event_id: number; + /** + * Name + */ + name: string; + /** + * Place Name + */ + place_name: string; + /** + * Icon + */ + icon: string; + /** + * Start Date + */ + start_date: string; + /** + * End Date + */ + end_date: string; + /** + * Is Confirmed + */ + is_confirmed: boolean; + /** + * Status + */ + status: string; + /** + * Status Label + */ + status_label: string; + /** + * Fit + */ + fit?: string | null; +}; + +/** + * Factor + */ +export type Factor = { + /** + * Axis + */ + axis: string; + /** + * Label + */ + label: string; + /** + * Value + */ + value: number; + /** + * Weight + */ + weight: number; + /** + * Note + */ + note: string; +}; + +/** + * GakSlide + */ +export type GakSlide = { + /** + * Kind + */ + kind: 'gak'; + /** + * Index Id + */ + index_id: number; + /** + * Code + */ + code: string; + /** + * Name + */ + name: string; + /** + * Rank + */ + rank: number; + /** + * Score + */ + score: number; + /** + * Line + */ + line: string; + /** + * Summary + */ + summary: string; +}; + +/** + * HTTPValidationError + */ +export type HttpValidationError = { + /** + * Detail + */ + detail?: Array; +}; + +/** + * Hero + */ +export type Hero = { + /** + * Now At + */ + now_at: string; + /** + * Sky Mode + */ + sky_mode: 'morning' | 'day' | 'sunset' | 'night'; + /** + * Temp C + */ + temp_c?: number | null; + /** + * Feels C + */ + feels_c?: number | null; + /** + * Discomfort + */ + discomfort?: number | null; + /** + * Discomfort Label + */ + discomfort_label?: string | null; + /** + * Rain 2H Text + */ + rain_2h_text?: string | null; + /** + * Will Rain 2H + */ + will_rain_2h?: boolean | null; + /** + * Weather Score + */ + weather_score?: number | null; + /** + * Top3 + */ + top3?: Array; + /** + * Bubble + */ + bubble?: string | null; +}; + +/** + * HourCell + */ +export type HourCell = { + /** + * Label + */ + label: string; + /** + * Icon + */ + icon: string; + /** + * Temp C + */ + temp_c?: number | null; + tone: SlotTone; +}; + +/** + * HoursSlide + */ +export type HoursSlide = { + /** + * Kind + */ + kind: 'hours'; + /** + * Eyebrow + */ + eyebrow: string; + /** + * Line + */ + line: string; + /** + * Hours + */ + hours: Array; +}; + +/** + * IndexCategory + */ +export const IndexCategory = { + /** + * OUTSIDE + */ + OUTSIDE: 1, + /** + * FOOD + */ + FOOD: 2, + /** + * HOME + */ + HOME: 3, + /** + * LIFE + */ + LIFE: 4 +} as const; + +/** + * IndexCategory + */ +export type IndexCategory = typeof IndexCategory[keyof typeof IndexCategory]; + +/** + * IndexSummary + */ +export type IndexSummary = { + /** + * Index Id + */ + index_id: number; + /** + * Code + */ + code: string; + /** + * Name + */ + name: string; + /** + * Icon + */ + icon: string; + category: IndexCategory; + /** + * Is Fun + */ + is_fun: boolean; + /** + * Is Core + */ + is_core: boolean; + /** + * Score + */ + score: number; + /** + * Rank + */ + rank: number; + /** + * Summary + */ + summary: string; + /** + * Trend + */ + trend?: Array; +}; + +/** + * Me + */ +export type Me = { + /** + * Login Id + */ + login_id: string; + /** + * Nickname + */ + nickname: string; + provider: AuthProvider; +}; + +/** + * PlaceData + */ +export type PlaceData = { + /** + * Place Id + */ + place_id: number; + /** + * Area + */ + area: string; + /** + * Name + */ + name: string; + /** + * Is Outdoor + */ + is_outdoor: boolean; + /** + * Icon + */ + icon: string; + /** + * Reason + */ + reason: string; + /** + * Best Time + */ + best_time: string; + /** + * Is Good + */ + is_good: boolean; +}; + +/** + * PostData + */ +export type PostData = { + /** + * Post Id + */ + post_id: number; + post_type: PostType; + /** + * Title + */ + title: string; + /** + * Icon + */ + icon: string; + /** + * Caption + */ + caption: string; + /** + * Slides + */ + slides: Array; + /** + * Share Messages + */ + share_messages?: Array; + /** + * Like Count + */ + like_count: number; + /** + * Comment Count + */ + comment_count: number; + /** + * Published At + */ + published_at: string; + /** + * Liked + */ + liked?: boolean | null; + /** + * Saved + */ + saved?: boolean | null; +}; + +/** + * PostType + */ +export const PostType = { + /** + * WEATHER + */ + WEATHER: 1, + /** + * GAK + */ + GAK: 2, + /** + * SUNSET + */ + SUNSET: 3, + /** + * SEASON + */ + SEASON: 4, + /** + * EVENT + */ + EVENT: 5, + /** + * TIP + */ + TIP: 6, + /** + * WEEK + */ + WEEK: 7 +} as const; + +/** + * PostType + */ +export type PostType = typeof PostType[keyof typeof PostType]; + +/** + * Rain2h + */ +export type Rain2h = { + /** + * Will Rain + */ + will_rain: boolean; + /** + * Text + */ + text: string; + /** + * Hours + */ + hours?: Array; +}; + +/** + * RainHourData + */ +export type RainHourData = { + /** + * At + */ + at: string; + rain_type: RainType; + /** + * Rain Mm + */ + rain_mm: number; +}; + +/** + * RainType + */ +export const RainType = { + /** + * NONE + */ + NONE: 1, + /** + * RAIN + */ + RAIN: 2, + /** + * SLEET + */ + SLEET: 3, + /** + * SNOW + */ + SNOW: 4, + /** + * SHOWER + */ + SHOWER: 5 +} as const; + +/** + * RainType + */ +export type RainType = typeof RainType[keyof typeof RainType]; + +/** + * RankData + */ +export type RankData = { + /** + * Rank + */ + rank: number; + /** + * Region Code + */ + region_code: string; + /** + * Name + */ + name: string; + /** + * Note + */ + note?: string | null; + /** + * Score + */ + score: number; + grade: SkyGrade; +}; + +/** + * RegionData + */ +export type RegionData = { + /** + * Code + */ + code: string; + /** + * Name + */ + name: string; + /** + * Short Name + */ + short_name: string; + /** + * Lat + */ + lat: number; + /** + * Lon + */ + lon: number; +}; + +/** + * Req_Comment + */ +export type ReqComment = { + /** + * Body + */ + body: string; +}; + +/** + * Req_Login + */ +export type ReqLogin = { + /** + * Login Id + */ + login_id: string; + /** + * Password + */ + password: string; +}; + +/** + * Req_Refresh + */ +export type ReqRefresh = { + /** + * Refresh Token + */ + refresh_token: string; +}; + +/** + * Req_Signup + */ +export type ReqSignup = { + /** + * Login Id + */ + login_id: string; + /** + * Password + */ + password: string; + /** + * Nickname + */ + nickname: string; +}; + +/** + * Res_Article + */ +export type ResArticle = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + article?: ArticleSummary | null; + /** + * Body + */ + body?: Array; +}; + +/** + * Res_ArticleList + */ +export type ResArticleList = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Articles + */ + articles?: Array; +}; + +/** + * Res_Auth + */ +export type ResAuth = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Access Token + */ + access_token?: string | null; + /** + * Refresh Token + */ + refresh_token?: string | null; + me?: Me | null; +}; + +/** + * Res_Comment + */ +export type ResComment = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + comment?: CommentData | null; +}; + +/** + * Res_CommentLike + */ +export type ResCommentLike = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Liked + */ + liked?: boolean | null; + /** + * Like Count + */ + like_count?: number | null; +}; + +/** + * Res_CommentList + */ +export type ResCommentList = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Comments + */ + comments?: Array; + /** + * Next Cursor + */ + next_cursor?: number | null; +}; + +/** + * Res_EventList + */ +export type ResEventList = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Events + */ + events?: Array; +}; + +/** + * Res_Feed + */ +export type ResFeed = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Region Code + */ + region_code?: string | null; + /** + * Region Name + */ + region_name?: string | null; + hero?: Hero | null; + /** + * Stories + */ + stories?: Array; + /** + * Posts + */ + posts?: Array; + bands?: Bands | null; +}; + +/** + * Res_Health + */ +export type ResHealth = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Started At + */ + started_at: string; + /** + * Db + */ + db: boolean; + /** + * Redis + */ + redis: boolean; +}; + +/** + * Res_IndexDetail + */ +export type ResIndexDetail = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + index?: IndexSummary | null; + /** + * Description + */ + description?: string | null; + /** + * Factors + */ + factors?: Array; + /** + * Zero Rules + */ + zero_rules?: string | null; + /** + * Zero Reason + */ + zero_reason?: string | null; + /** + * Limit + */ + limit?: string | null; +}; + +/** + * Res_IndexList + */ +export type ResIndexList = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Region Code + */ + region_code?: string | null; + /** + * Day + */ + day?: string | null; + /** + * Weather Score + */ + weather_score?: number | null; + /** + * Top3 + */ + top3?: Array; + /** + * Items + */ + items?: Array; +}; + +/** + * Res_Me + */ +export type ResMe = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + me?: Me | null; +}; + +/** + * Res_PlaceList + */ +export type ResPlaceList = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Areas + */ + areas?: Array; + /** + * Rainy + */ + rainy?: boolean | null; + /** + * Places + */ + places?: Array; +}; + +/** + * Res_Post + */ +export type ResPost = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + post?: PostData | null; +}; + +/** + * Res_PostLike + */ +export type ResPostLike = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Liked + */ + liked?: boolean | null; + /** + * Like Count + */ + like_count?: number | null; +}; + +/** + * Res_PostSave + */ +export type ResPostSave = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Saved + */ + saved?: boolean | null; +}; + +/** + * Res_Region + */ +export type ResRegion = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + region?: RegionData | null; +}; + +/** + * Res_RegionList + */ +export type ResRegionList = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Regions + */ + regions?: Array; +}; + +/** + * Res_SavedList + */ +export type ResSavedList = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Posts + */ + posts?: Array; + /** + * Next Cursor + */ + next_cursor?: number | null; +}; + +/** + * Res_SeasonWeek + */ +export type ResSeasonWeek = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Year + */ + year?: number | null; + /** + * Week + */ + week?: number | null; + /** + * Start + */ + start?: string | null; + /** + * End + */ + end?: string | null; + /** + * Headline + */ + headline?: string | null; + /** + * Poem Lines + */ + poem_lines?: Array; + /** + * Author + */ + author?: string | null; + term_now?: TermData | null; + term_next?: TermData | null; + /** + * Progress + */ + progress?: number | null; + /** + * News + */ + news?: Array; +}; + +/** + * Res_Sky + */ +export type ResSky = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Region Code + */ + region_code?: string | null; + /** + * Sunset Azimuth + */ + sunset_azimuth?: number | null; + sunset?: SkyScoreData | null; + sunrise?: SkyScoreData | null; + /** + * Days + */ + days?: Array; + /** + * Spots + */ + spots?: Array; +}; + +/** + * Res_SkyRanking + */ +export type ResSkyRanking = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Day + */ + day?: string | null; + /** + * Items + */ + items?: Array; +}; + +/** + * Res_WeatherNow + */ +export type ResWeatherNow = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Region Code + */ + region_code?: string | null; + rain_2h?: Rain2h | null; + tomorrow?: Tomorrow | null; + air?: AirData | null; + /** + * Warnings + */ + warnings?: Array | null; +}; + +/** + * Res_WeatherToday + */ +export type ResWeatherToday = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Region Code + */ + region_code?: string | null; + /** + * Region Name + */ + region_name?: string | null; + /** + * Day + */ + day?: string | null; + /** + * Issued At + */ + issued_at?: string | null; + /** + * Headline + */ + headline?: string | null; + /** + * Slots + */ + slots?: Array; +}; + +/** + * Res_WebPacketProtocol + */ +export type ResWebPacketProtocol = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; +}; + +/** + * Res_Week + */ +export type ResWeek = { + result?: ErrorInfo; + /** + * Msg + */ + msg?: string | null; + /** + * Region Code + */ + region_code?: string | null; + /** + * Days + */ + days?: Array; +}; + +/** + * Row + */ +export type Row = { + /** + * Label + */ + label: string; + /** + * Value + */ + value: string; +}; + +/** + * RowsSlide + * + * 우산·미세먼지·계절 소식·행사·상식처럼 '한 줄 + 표' 모양. + */ +export type RowsSlide = { + /** + * Kind + */ + kind: 'rows'; + /** + * Eyebrow + */ + eyebrow: string; + /** + * Line + */ + line: string; + /** + * Icon + */ + icon: string; + /** + * Rows + */ + rows?: Array; +}; + +/** + * SavedPost + */ +export type SavedPost = { + /** + * Post Id + */ + post_id: number; + post_type: PostType; + /** + * Feed Date + */ + feed_date: string; + /** + * Saved At + */ + saved_at: string; +}; + +/** + * Sky + */ +export const Sky = { + /** + * CLEAR + */ + CLEAR: 1, + /** + * PARTLY + */ + PARTLY: 2, + /** + * CLOUDY + */ + CLOUDY: 3 +} as const; + +/** + * Sky + */ +export type Sky = typeof Sky[keyof typeof Sky]; + +/** + * SkyGrade + */ +export const SkyGrade = { + /** + * GRAY + */ + GRAY: 1, + /** + * SOFT + */ + SOFT: 2, + /** + * GLOW + */ + GLOW: 3, + /** + * RED + */ + RED: 4 +} as const; + +/** + * SkyGrade + */ +export type SkyGrade = typeof SkyGrade[keyof typeof SkyGrade]; + +/** + * SkyScoreData + */ +export type SkyScoreData = { + /** + * Day + */ + day: string; + sky_type: SkyType; + /** + * Score + */ + score: number; + grade: SkyGrade; + /** + * Grade Label + */ + grade_label: string; + confidence: Confidence; + /** + * Best Times + */ + best_times?: Array; +}; + +/** + * SkyType + */ +export const SkyType = { /** + * SUNSET + */ + SUNSET: 1, /** + * SUNRISE + */ + SUNRISE: 2 } as const; + +/** + * SkyType + */ +export type SkyType = typeof SkyType[keyof typeof SkyType]; + +/** + * SlotTone + */ +export const SlotTone = { + /** + * DAY + */ + DAY: 1, + /** + * NIGHT + */ + NIGHT: 2, + /** + * SUNSET + */ + SUNSET: 3 +} as const; + +/** + * SlotTone + */ +export type SlotTone = typeof SlotTone[keyof typeof SlotTone]; + +/** + * SpotData + */ +export type SpotData = { + /** + * No + */ + no: number; + /** + * Name + */ + name: string; + /** + * Description + */ + description: string; + /** + * Lat + */ + lat: number; + /** + * Lon + */ + lon: number; + /** + * Distance Km + */ + distance_km: number; +}; + +/** + * SunsetSlide + */ +export type SunsetSlide = { + /** + * Kind + */ + kind: 'sunset'; + /** + * Eyebrow + */ + eyebrow: string; + /** + * Line + */ + line: string; + /** + * Score + */ + score: number; + /** + * Grade Label + */ + grade_label: string; + /** + * Cuts + */ + cuts: Array; +}; + +/** + * TermData + */ +export type TermData = { + /** + * Name + */ + name: string; + /** + * Day + */ + day: string; +}; + +/** + * Tomorrow + */ +export type Tomorrow = { + /** + * Text + */ + text: string; + /** + * Rain From + */ + rain_from?: string | null; + /** + * Commute + */ + commute?: Array; +}; + +/** + * TopIndex + */ +export type TopIndex = { + /** + * Index Id + */ + index_id: number; + /** + * Code + */ + code: string; + /** + * Name + */ + name: string; + /** + * Icon + */ + icon: string; + /** + * Score + */ + score: number; + /** + * Rank + */ + rank: number; + /** + * Summary + */ + summary?: string | null; +}; + +/** + * TrendPoint + */ +export type TrendPoint = { + /** + * Day + */ + day: string; + /** + * Score + */ + score: number; +}; + +/** + * ValidationError + */ +export type ValidationError = { + /** + * Location + */ + loc: Array; + /** + * Message + */ + msg: string; + /** + * Error Type + */ + type: string; + /** + * Input + */ + input?: unknown; + /** + * Context + */ + ctx?: { + [key: string]: unknown; + }; +}; + +/** + * WarningData + */ +export type WarningData = { + warning_type: WarningType; + level: WarningLevel; + /** + * Text + */ + text: string; +}; + +/** + * WarningLevel + */ +export const WarningLevel = { + /** + * ADVISORY + */ + ADVISORY: 1, + /** + * WARNING + */ + WARNING: 2, + /** + * SEVERE + */ + SEVERE: 3 +} as const; + +/** + * WarningLevel + */ +export type WarningLevel = typeof WarningLevel[keyof typeof WarningLevel]; + +/** + * WarningType + */ +export const WarningType = { + /** + * WIND + */ + WIND: 1, + /** + * RAIN + */ + RAIN: 2, + /** + * COLD + */ + COLD: 3, + /** + * DRY + */ + DRY: 4, + /** + * STORM_SURGE + */ + STORM_SURGE: 5, + /** + * HIGH_SEAS + */ + HIGH_SEAS: 6, + /** + * TYPHOON + */ + TYPHOON: 7, + /** + * SNOW + */ + SNOW: 8, + /** + * YELLOW_DUST + */ + YELLOW_DUST: 9, + /** + * HEAT + */ + HEAT: 12, + /** + * TROPICAL_NIGHT + */ + TROPICAL_NIGHT: 13 +} as const; + +/** + * WarningType + */ +export type WarningType = typeof WarningType[keyof typeof WarningType]; + +/** + * WeatherSlot + */ +export type WeatherSlot = { + /** + * At + */ + at: string; + /** + * Label + */ + label: string; + /** + * Temp C + */ + temp_c?: number | null; + /** + * Feels C + */ + feels_c?: number | null; + sky?: Sky | null; + rain_type?: RainType | null; + /** + * Rain Prob + */ + rain_prob?: number | null; + /** + * Icon + */ + icon: string; + tone: SlotTone; + /** + * Note + */ + note: string; +}; + +/** + * WeekDay + */ +export type WeekDay = { + /** + * Day + */ + day: string; + /** + * Weekday + */ + weekday: string; + /** + * Icon + */ + icon: string; + /** + * Text + */ + text: string; +}; + +/** + * WeekSlide + */ +export type WeekSlide = { + /** + * Kind + */ + kind: 'week'; + /** + * Eyebrow + */ + eyebrow: string; + /** + * Line + */ + line: string; + /** + * Days + */ + days: Array; +}; + +export type ListRegionsData = { + body?: never; + path?: never; + query?: { + /** + * Q + * + * 구 이름 검색어 + */ + q?: string | null; + }; + url: '/v1/region/list'; +}; + +export type ListRegionsErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListRegionsError = ListRegionsErrors[keyof ListRegionsErrors]; + +export type ListRegionsResponses = { + /** + * Successful Response + */ + 200: ResRegionList; +}; + +export type ListRegionsResponse = ListRegionsResponses[keyof ListRegionsResponses]; + +export type NearestRegionData = { + body?: never; + path?: never; + query: { + /** + * Lat + */ + lat: number; + /** + * Lon + */ + lon: number; + }; + url: '/v1/region/nearest'; +}; + +export type NearestRegionErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type NearestRegionError = NearestRegionErrors[keyof NearestRegionErrors]; + +export type NearestRegionResponses = { + /** + * Successful Response + */ + 200: ResRegion; +}; + +export type NearestRegionResponse = NearestRegionResponses[keyof NearestRegionResponses]; + +export type GetWeatherTodayData = { + body?: never; + path?: never; + query: { + /** + * Region + * + * 구 행정코드 + */ + region: string; + }; + url: '/v1/weather/today'; +}; + +export type GetWeatherTodayErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetWeatherTodayError = GetWeatherTodayErrors[keyof GetWeatherTodayErrors]; + +export type GetWeatherTodayResponses = { + /** + * Successful Response + */ + 200: ResWeatherToday; +}; + +export type GetWeatherTodayResponse = GetWeatherTodayResponses[keyof GetWeatherTodayResponses]; + +export type GetWeatherNowData = { + body?: never; + path?: never; + query: { + /** + * Region + * + * 구 행정코드 + */ + region: string; + }; + url: '/v1/weather/now'; +}; + +export type GetWeatherNowErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetWeatherNowError = GetWeatherNowErrors[keyof GetWeatherNowErrors]; + +export type GetWeatherNowResponses = { + /** + * Successful Response + */ + 200: ResWeatherNow; +}; + +export type GetWeatherNowResponse = GetWeatherNowResponses[keyof GetWeatherNowResponses]; + +export type GetSkyData = { + body?: never; + path?: never; + query: { + /** + * Region + * + * 구 행정코드 + */ + region: string; + }; + url: '/v1/sky'; +}; + +export type GetSkyErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetSkyError = GetSkyErrors[keyof GetSkyErrors]; + +export type GetSkyResponses = { + /** + * Successful Response + */ + 200: ResSky; +}; + +export type GetSkyResponse = GetSkyResponses[keyof GetSkyResponses]; + +export type GetSkyRankingData = { + body?: never; + path?: never; + query?: never; + url: '/v1/sky/ranking'; +}; + +export type GetSkyRankingResponses = { + /** + * Successful Response + */ + 200: ResSkyRanking; +}; + +export type GetSkyRankingResponse = GetSkyRankingResponses[keyof GetSkyRankingResponses]; + +export type ListIndicesData = { + body?: never; + path?: never; + query: { + /** + * Region + * + * 구 행정코드 + */ + region: string; + /** + * Category + */ + category?: IndexCategory | null; + /** + * Core + * + * 이번 계절 핵심 지수만 + */ + core?: boolean; + }; + url: '/v1/index/list'; +}; + +export type ListIndicesErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListIndicesError = ListIndicesErrors[keyof ListIndicesErrors]; + +export type ListIndicesResponses = { + /** + * Successful Response + */ + 200: ResIndexList; +}; + +export type ListIndicesResponse = ListIndicesResponses[keyof ListIndicesResponses]; + +export type GetIndexData = { + body?: never; + path: { + /** + * Index Id + */ + index_id: number; + }; + query: { + /** + * Region + * + * 구 행정코드 + */ + region: string; + }; + url: '/v1/index/{index_id}'; +}; + +export type GetIndexErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetIndexError = GetIndexErrors[keyof GetIndexErrors]; + +export type GetIndexResponses = { + /** + * Successful Response + */ + 200: ResIndexDetail; +}; + +export type GetIndexResponse = GetIndexResponses[keyof GetIndexResponses]; + +export type GetWeekData = { + body?: never; + path?: never; + query: { + /** + * Region + * + * 구 행정코드 + */ + region: string; + }; + url: '/v1/week'; +}; + +export type GetWeekErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetWeekError = GetWeekErrors[keyof GetWeekErrors]; + +export type GetWeekResponses = { + /** + * Successful Response + */ + 200: ResWeek; +}; + +export type GetWeekResponse = GetWeekResponses[keyof GetWeekResponses]; + +export type ListPlacesData = { + body?: never; + path?: never; + query: { + /** + * Region + */ + region: string; + /** + * Day + * + * 기본은 오늘 + */ + day?: string | null; + /** + * Area + */ + area?: string | null; + }; + url: '/v1/week/place/list'; +}; + +export type ListPlacesErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListPlacesError = ListPlacesErrors[keyof ListPlacesErrors]; + +export type ListPlacesResponses = { + /** + * Successful Response + */ + 200: ResPlaceList; +}; + +export type ListPlacesResponse = ListPlacesResponses[keyof ListPlacesResponses]; + +export type ListEventsData = { + body?: never; + path?: never; + query: { + /** + * Region + */ + region: string; + /** + * Area + */ + area?: string | null; + }; + url: '/v1/week/event/list'; +}; + +export type ListEventsErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListEventsError = ListEventsErrors[keyof ListEventsErrors]; + +export type ListEventsResponses = { + /** + * Successful Response + */ + 200: ResEventList; +}; + +export type ListEventsResponse = ListEventsResponses[keyof ListEventsResponses]; + +export type GetSeasonWeekData = { + body?: never; + path?: never; + query?: never; + url: '/v1/season/week'; +}; + +export type GetSeasonWeekResponses = { + /** + * Successful Response + */ + 200: ResSeasonWeek; +}; + +export type GetSeasonWeekResponse = GetSeasonWeekResponses[keyof GetSeasonWeekResponses]; + +export type ListArticlesData = { + body?: never; + path?: never; + query?: { + /** + * Category + */ + category?: ArticleCategory | null; + }; + url: '/v1/season/article/list'; +}; + +export type ListArticlesErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListArticlesError = ListArticlesErrors[keyof ListArticlesErrors]; + +export type ListArticlesResponses = { + /** + * Successful Response + */ + 200: ResArticleList; +}; + +export type ListArticlesResponse = ListArticlesResponses[keyof ListArticlesResponses]; + +export type GetArticleData = { + body?: never; + path: { + /** + * Article Id + */ + article_id: number; + }; + query?: never; + url: '/v1/season/article/{article_id}'; +}; + +export type GetArticleErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetArticleError = GetArticleErrors[keyof GetArticleErrors]; + +export type GetArticleResponses = { + /** + * Successful Response + */ + 200: ResArticle; +}; + +export type GetArticleResponse = GetArticleResponses[keyof GetArticleResponses]; + +export type GetFeedData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path?: never; + query: { + /** + * Region + * + * 구 행정코드 + */ + region: string; + }; + url: '/v1/feed'; +}; + +export type GetFeedErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetFeedError = GetFeedErrors[keyof GetFeedErrors]; + +export type GetFeedResponses = { + /** + * Successful Response + */ + 200: ResFeed; +}; + +export type GetFeedResponse = GetFeedResponses[keyof GetFeedResponses]; + +export type GetPostData = { + body?: never; + path: { + /** + * Post Id + */ + post_id: number; + }; + query: { + /** + * Region + */ + region: string; + }; + url: '/v1/feed/post/{post_id}'; +}; + +export type GetPostErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetPostError = GetPostErrors[keyof GetPostErrors]; + +export type GetPostResponses = { + /** + * Successful Response + */ + 200: ResPost; +}; + +export type GetPostResponse = GetPostResponses[keyof GetPostResponses]; + +export type SignupData = { + body: ReqSignup; + path?: never; + query?: never; + url: '/v1/auth/signup'; +}; + +export type SignupErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type SignupError = SignupErrors[keyof SignupErrors]; + +export type SignupResponses = { + /** + * Successful Response + */ + 200: ResAuth; +}; + +export type SignupResponse = SignupResponses[keyof SignupResponses]; + +export type LoginData = { + body: ReqLogin; + path?: never; + query?: never; + url: '/v1/auth/login'; +}; + +export type LoginErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type LoginError = LoginErrors[keyof LoginErrors]; + +export type LoginResponses = { + /** + * Successful Response + */ + 200: ResAuth; +}; + +export type LoginResponse = LoginResponses[keyof LoginResponses]; + +export type RefreshData = { + body: ReqRefresh; + path?: never; + query?: never; + url: '/v1/auth/refresh'; +}; + +export type RefreshErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type RefreshError = RefreshErrors[keyof RefreshErrors]; + +export type RefreshResponses = { + /** + * Successful Response + */ + 200: ResAuth; +}; + +export type RefreshResponse = RefreshResponses[keyof RefreshResponses]; + +export type MeData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path?: never; + query?: never; + url: '/v1/auth/me'; +}; + +export type MeErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type MeError = MeErrors[keyof MeErrors]; + +export type MeResponses = { + /** + * Successful Response + */ + 200: ResMe; +}; + +export type MeResponse = MeResponses[keyof MeResponses]; + +export type UnlikePostData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Post Id + */ + post_id: number; + }; + query?: never; + url: '/v1/reaction/post/{post_id}/like'; +}; + +export type UnlikePostErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type UnlikePostError = UnlikePostErrors[keyof UnlikePostErrors]; + +export type UnlikePostResponses = { + /** + * Successful Response + */ + 200: ResPostLike; +}; + +export type UnlikePostResponse = UnlikePostResponses[keyof UnlikePostResponses]; + +export type LikePostData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Post Id + */ + post_id: number; + }; + query?: never; + url: '/v1/reaction/post/{post_id}/like'; +}; + +export type LikePostErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type LikePostError = LikePostErrors[keyof LikePostErrors]; + +export type LikePostResponses = { + /** + * Successful Response + */ + 200: ResPostLike; +}; + +export type LikePostResponse = LikePostResponses[keyof LikePostResponses]; + +export type UnsavePostData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Post Id + */ + post_id: number; + }; + query?: never; + url: '/v1/reaction/post/{post_id}/save'; +}; + +export type UnsavePostErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type UnsavePostError = UnsavePostErrors[keyof UnsavePostErrors]; + +export type UnsavePostResponses = { + /** + * Successful Response + */ + 200: ResPostSave; +}; + +export type UnsavePostResponse = UnsavePostResponses[keyof UnsavePostResponses]; + +export type SavePostData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Post Id + */ + post_id: number; + }; + query?: never; + url: '/v1/reaction/post/{post_id}/save'; +}; + +export type SavePostErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type SavePostError = SavePostErrors[keyof SavePostErrors]; + +export type SavePostResponses = { + /** + * Successful Response + */ + 200: ResPostSave; +}; + +export type SavePostResponse = SavePostResponses[keyof SavePostResponses]; + +export type ListSavedData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path?: never; + query?: { + /** + * Cursor + */ + cursor?: number | null; + }; + url: '/v1/reaction/save/list'; +}; + +export type ListSavedErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListSavedError = ListSavedErrors[keyof ListSavedErrors]; + +export type ListSavedResponses = { + /** + * Successful Response + */ + 200: ResSavedList; +}; + +export type ListSavedResponse = ListSavedResponses[keyof ListSavedResponses]; + +export type ListCommentsData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Post Id + */ + post_id: number; + }; + query?: { + /** + * Cursor + */ + cursor?: number | null; + }; + url: '/v1/reaction/post/{post_id}/comment/list'; +}; + +export type ListCommentsErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListCommentsError = ListCommentsErrors[keyof ListCommentsErrors]; + +export type ListCommentsResponses = { + /** + * Successful Response + */ + 200: ResCommentList; +}; + +export type ListCommentsResponse = ListCommentsResponses[keyof ListCommentsResponses]; + +export type AddCommentData = { + body: ReqComment; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Post Id + */ + post_id: number; + }; + query?: never; + url: '/v1/reaction/post/{post_id}/comment'; +}; + +export type AddCommentErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type AddCommentError = AddCommentErrors[keyof AddCommentErrors]; + +export type AddCommentResponses = { + /** + * Successful Response + */ + 200: ResComment; +}; + +export type AddCommentResponse = AddCommentResponses[keyof AddCommentResponses]; + +export type DeleteCommentData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Comment Id + */ + comment_id: number; + }; + query?: never; + url: '/v1/reaction/comment/{comment_id}'; +}; + +export type DeleteCommentErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type DeleteCommentError = DeleteCommentErrors[keyof DeleteCommentErrors]; + +export type DeleteCommentResponses = { + /** + * Successful Response + */ + 200: ResWebPacketProtocol; +}; + +export type DeleteCommentResponse = DeleteCommentResponses[keyof DeleteCommentResponses]; + +export type UnlikeCommentData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Comment Id + */ + comment_id: number; + }; + query?: never; + url: '/v1/reaction/comment/{comment_id}/like'; +}; + +export type UnlikeCommentErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type UnlikeCommentError = UnlikeCommentErrors[keyof UnlikeCommentErrors]; + +export type UnlikeCommentResponses = { + /** + * Successful Response + */ + 200: ResCommentLike; +}; + +export type UnlikeCommentResponse = UnlikeCommentResponses[keyof UnlikeCommentResponses]; + +export type LikeCommentData = { + body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; + path: { + /** + * Comment Id + */ + comment_id: number; + }; + query?: never; + url: '/v1/reaction/comment/{comment_id}/like'; +}; + +export type LikeCommentErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type LikeCommentError = LikeCommentErrors[keyof LikeCommentErrors]; + +export type LikeCommentResponses = { + /** + * Successful Response + */ + 200: ResCommentLike; +}; + +export type LikeCommentResponse = LikeCommentResponses[keyof LikeCommentResponses]; + +export type HealthzHealthzGetData = { + body?: never; + path?: never; + query?: never; + url: '/healthz'; +}; + +export type HealthzHealthzGetResponses = { + /** + * Successful Response + */ + 200: ResHealth; +}; + +export type HealthzHealthzGetResponse = HealthzHealthzGetResponses[keyof HealthzHealthzGetResponses]; diff --git a/frontend/src/api/setup.ts b/frontend/src/api/setup.ts new file mode 100644 index 0000000..4234d13 --- /dev/null +++ b/frontend/src/api/setup.ts @@ -0,0 +1,48 @@ +import { client } from './client/client.gen' +import { clearTokens, emitAuthRequired, getAccessToken, getRefreshToken, setTokens } from './auth' + +export const API_BASE_URL: string = import.meta.env.VITE_API_BASE_URL ?? 'http://localhost:9810' + +// 401이 한꺼번에 와도 갱신은 한 번만 +let refreshing: Promise | null = null + +function refreshTokens(): Promise { + refreshing ??= (async () => { + const token = getRefreshToken() + if (!token) return false + const res = await fetch(`${API_BASE_URL}/v1/auth/refresh`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ refresh_token: token }) }) + const body = res.ok ? await res.json() : null + if (!body?.result?.success || !body.access_token) return false + setTokens(body.access_token, body.refresh_token ?? token) + return true + })() + .catch(() => false) + .finally(() => { + refreshing = null + }) + return refreshing +} + +/** 401이면 토큰을 한 번 갱신해 같은 요청을 다시 보내고, 안 되면 토큰을 지우고 로그인 창을 띄운다 */ +async function authFetch(input: RequestInfo | URL, init?: RequestInit): Promise { + const request = input instanceof Request && !init ? input : new Request(input, init) + const retry = request.clone() + const response = await fetch(request) + if (response.status !== 401 || new URL(request.url).pathname.startsWith('/v1/auth/')) return response + if (request.headers.has('Authorization') && (await refreshTokens())) { + retry.headers.set('Authorization', `Bearer ${getAccessToken()}`) + const again = await fetch(retry) + if (again.status !== 401) return again + } + if (getAccessToken()) clearTokens() + emitAuthRequired() + return response +} + +client.setConfig({ baseUrl: API_BASE_URL, throwOnError: true, fetch: authFetch }) + +client.interceptors.request.use((request) => { + const token = getAccessToken() + if (token) request.headers.set('Authorization', `Bearer ${token}`) + return request +}) diff --git a/frontend/src/b/BLayout.tsx b/frontend/src/b/BLayout.tsx new file mode 100644 index 0000000..36d4036 --- /dev/null +++ b/frontend/src/b/BLayout.tsx @@ -0,0 +1,80 @@ +import { useEffect } from 'react' +import { NavLink, Outlet, useLocation } from 'react-router' +import { cx } from '../lib/utils' +import './b.css' +import { AuthProvider } from './auth' +import { RegionProvider } from './region' +import { useRegion } from './regionContext' +import { useSheet } from './sheetContext' +import { SheetProvider } from './Sheets' +import { PinIcon, TabIcon } from './svg' + +const TABS = [ + { to: '/', key: 'today', label: '오늘', title: null }, + { to: '/gak', key: 'gak', label: '각', title: '오늘의 각' }, + { to: '/sky', key: 'sky', label: '노을', title: '노을' }, + { to: '/week', key: 'week', label: '주말·행사', title: '주말·행사' }, + { to: '/season', key: 'season', label: '계절·상식', title: '계절·상식' }, +] as const + +function TopBar() { + const { pathname } = useLocation() + const { region } = useRegion() + const { open } = useSheet() + const tab = TABS.find((t) => t.to !== '/' && pathname.startsWith(t.to)) + + return ( +
+ {tab?.title ?

{tab.title}

:

날씨각

} + +
+ ) +} + +function Shell() { + const { pathname } = useLocation() + useEffect(() => { + window.scrollTo({ top: 0 }) + }, [pathname]) + + return ( +
+
+ +
+ +
+ +
+
+ ) +} + +export function BLayout() { + return ( +
+ + + + + + + +
+ ) +} diff --git a/frontend/src/b/GakPage.tsx b/frontend/src/b/GakPage.tsx new file mode 100644 index 0000000..5d96c4f --- /dev/null +++ b/frontend/src/b/GakPage.tsx @@ -0,0 +1,95 @@ +import { useState } from 'react' +import { useQuery } from '@tanstack/react-query' +import { listArticlesOptions, listIndicesOptions } from '../api/client/@tanstack/react-query.gen' +import { ArticleCategory, IndexCategory } from '../api/client/types.gen' +import { cx } from '../lib/utils' +import { MEDALS } from './lib' +import { useRegion } from './regionContext' +import { useSheet } from './sheetContext' +import { Chips, Ic, Sec, StateBox } from './ui' + +type Cat = 'all' | 'out' | 'food' | 'home' | 'life' | 'core' + +const CATS = [ + ['all', '전체'], + ['out', '밖에서 놀기'], + ['food', '먹고 마시기'], + ['home', '집안일'], + ['life', '생활 고민'], + ['core', '가을 각'], +] as const + +const CAT_PARAM: Partial> = { out: IndexCategory.OUTSIDE, food: IndexCategory.FOOD, home: IndexCategory.HOME, life: IndexCategory.LIFE } + +export function GakPage() { + const { region } = useRegion() + const { open } = useSheet() + const [cat, setCat] = useState('all') + const q = useQuery(listIndicesOptions({ query: { region: region.code, category: CAT_PARAM[cat], core: cat === 'core' ? true : undefined } })) + const top = q.data?.top3 ?? [] + const items = q.data?.items ?? [] + const day = q.data?.day?.split('-').map(Number) + const howto = useQuery(listArticlesOptions({ query: { category: ArticleCategory.GAK } })).data?.articles?.find((a) => a.code === 'howgak') + + return ( +
+ + {top.length === 3 && ( +
+ {[1, 0, 2].map((k) => { + const g = top[k] + return ( + + ) + })} +
+ )} + + q.refetch()} empty={q.isSuccess && !items.length ? '이 분야는 오늘 계산된 각이 없어요.' : undefined} /> +
+ {items.map((g) => { + const trend = g.trend ?? [] + const mx = Math.max(1, ...trend.map((t) => t.score)) + return ( + + ) + })} +
+ {howto && ( + + )} +
+ ) +} diff --git a/frontend/src/b/Post.tsx b/frontend/src/b/Post.tsx new file mode 100644 index 0000000..ba3307d --- /dev/null +++ b/frontend/src/b/Post.tsx @@ -0,0 +1,303 @@ +import { useRef, useState, type MouseEvent, type ReactNode } from 'react' +import { PostType, SlotTone, type GakSlide, type HoursSlide, type PostData, type RowsSlide, type SunsetSlide, type WeekSlide } from '../api/client/types.gen' +import { cx } from '../lib/utils' +import { ago, cardBg, clockShort, fall } from './lib' +import type { SlideBg } from './types' +import { deg } from './weatherText' +import { useMutation } from '@tanstack/react-query' +import { likePostMutation, savePostMutation, unlikePostMutation, unsavePostMutation } from '../api/client/@tanstack/react-query.gen' +import { useAuth } from './authContext' +import { useRegion } from './regionContext' +import { useSheet } from './sheetContext' +import { CommentIcon, HeartIcon, MoreIcon, SaveIcon, SendIcon } from './svg' +import { Ic, Rows } from './ui' + +const ACCOUNTS: Record = { + [PostType.WEATHER]: ['오늘 날씨', 'sun'], + [PostType.GAK]: ['오늘의 각', 'rabbit'], + [PostType.SUNSET]: ['노을', 'sunset'], + [PostType.SEASON]: ['계절 소식', 'maple'], + [PostType.EVENT]: ['행사', 'fireworks'], + [PostType.TIP]: ['날씨 상식', 'bulb'], + [PostType.WEEK]: ['주말 추천', 'calendar'], +} + +type Slide = HoursSlide | RowsSlide | GakSlide | SunsetSlide | WeekSlide + +const GAK_BG: SlideBg[] = ['butter', 'peach', 'lilac'] +const ROW_ICON_BG: Record = { umbrella: 'lilac', vent: 'mint', sunset: 'peach', thermo: 'sky', maple: 'peach' } + +/** 배경색은 API에 없어 글 종류·아이콘으로 고른다 */ +function slideBg(post: PostData, slide: Slide): SlideBg { + if (slide.kind === 'hours') return 'sky' + if (slide.kind === 'sunset') return 'dusk' + if (slide.kind === 'week') return 'mint' + if (slide.kind === 'gak') return GAK_BG[post.post_id % GAK_BG.length] + if (post.post_type === PostType.EVENT) return 'night' + if (post.post_type === PostType.TIP) return 'sky' + return ROW_ICON_BG[slide.icon] ?? cardBg(slide.icon, post.post_id) +} + +const DARK = new Set(['dusk', 'night']) + +function Lines({ text }: { text: string }) { + return text.split('\n').map((t, i) => ( + + {i > 0 &&
} + {t} +
+ )) +} + +function Eyebrow({ children, className }: { children: ReactNode; className?: string }) { + return

{children}

+} + +function Big({ children, className }: { children: ReactNode; className?: string }) { + return

{children}

+} + +function Pic({ name, className }: { name: string; className?: string }) { + return ( + + + + ) +} + +const slideBase = 'relative flex h-full w-full shrink-0 snap-start flex-col px-5 py-[22px]' + +function SlideView({ slide, bg }: { slide: Slide; bg: SlideBg }) { + const { open } = useSheet() + if (slide.kind === 'hours') + return ( +
+ {slide.eyebrow} + + + +
+ {slide.hours.map((h) => ( +
+ {h.label} + + {deg(h.temp_c)} +
+ ))} +
+
+ ) + if (slide.kind === 'gak') + return ( +
+ 오늘의 각 · {slide.rank}위 + {slide.line} + + {slide.score} +

{slide.name}

+ {slide.summary} + +
+ ) + if (slide.kind === 'sunset') + return ( +
+ {slide.eyebrow} + + + + {slide.score} +
+ {slide.cuts.map((c, i) => ( +
+ + {clockShort(c.at)} + {c.label} + +
+ ))} +
+
+ ) + if (slide.kind === 'week') + return ( +
+ {slide.eyebrow} + + + +
+ {slide.days.map((d) => ( +
+ + + {d.weekday} {d.day.split('-').slice(1).map(Number).join('.')} + + {d.text} +
+ ))} +
+
+ ) + return ( +
+ {slide.eyebrow} + + + + + +
+ ) +} + +type PostProps = { post: PostData } + +/** 인스타식 게시물: 옆으로 넘기는 슬라이드, 두 번 눌러 좋아요 */ +export function PostCard({ post }: PostProps) { + const { open } = useSheet() + const { region } = useRegion() + const { loggedIn } = useAuth() + const [liked, setLiked] = useState(!!post.liked) + const [likeCount, setLikeCount] = useState(post.like_count) + const [saved, setSaved] = useState(!!post.saved) + const like = useMutation(likePostMutation()) + const unlike = useMutation(unlikePostMutation()) + const save = useMutation(savePostMutation()) + const unsave = useMutation(unsavePostMutation()) + const [index, setIndex] = useState(0) + const [pop, setPop] = useState(0) + const lastTap = useRef(0) + const [account, avatar] = ACCOUNTS[post.post_type] + const n = post.slides.length + const bgs = post.slides.map((sl) => slideBg(post, sl)) + const accountName = post.post_type === PostType.EVENT ? `${region.name.split(' ')[0]} ${account}` : account + const share = () => open({ type: 'share', share: { title: post.title, icon: post.icon, bg: bgs[0] ?? 'sky', messages: post.share_messages ?? [] } }) + const comments = () => open({ type: 'comments', postId: post.post_id }) + + // 화면을 먼저 바꾸고, 실패하면 되돌린다 + const setLike = (next: boolean) => { + if (!loggedIn) return open({ type: 'login' }) + if (next === liked) return + setLiked(next) + setLikeCount((n) => n + (next ? 1 : -1)) + ;(next ? like : unlike).mutate( + { path: { post_id: post.post_id } }, + { + onSuccess: (res) => { + if (res.liked != null) setLiked(res.liked) + if (res.like_count != null) setLikeCount(res.like_count) + }, + onError: () => { + setLiked(!next) + setLikeCount((n) => n + (next ? -1 : 1)) + }, + }, + ) + } + + const toggleSave = () => { + if (!loggedIn) return open({ type: 'login' }) + const next = !saved + setSaved(next) + ;(next ? save : unsave).mutate( + { path: { post_id: post.post_id } }, + { + onSuccess: (res) => { + if (res.saved != null) setSaved(res.saved) + }, + onError: () => setSaved(!next), + }, + ) + } + + const onTap = (e: MouseEvent) => { + if ((e.target as HTMLElement).closest('button')) return + const now = Date.now() + if (now - lastTap.current < 320) { + setLike(true) + if (loggedIn) setPop((p) => p + 1) + } + lastTap.current = now + } + + return ( +
+
+ + + + + + + 날씨각 + {accountName} + + +
+
+ {n > 1 && ( + + )} +
setIndex(Math.round(e.currentTarget.scrollLeft / e.currentTarget.clientWidth))} + tabIndex={n > 1 ? 0 : undefined} + aria-label={n > 1 ? `슬라이드 ${n}장, 옆으로 넘겨 보세요` : undefined} + role={n > 1 ? 'region' : undefined} + > + {post.slides.map((s, i) => ( + + ))} +
+ {pop > 0 && ( + + )} +
+
+ + + + {n > 1 && ( + + )} + +
+

좋아요 {likeCount.toLocaleString()}개

+

+ 날씨각 + {post.caption} +

+ +

{ago(post.published_at)}

+
+ ) +} diff --git a/frontend/src/b/SeasonPage.tsx b/frontend/src/b/SeasonPage.tsx new file mode 100644 index 0000000..899e9a2 --- /dev/null +++ b/frontend/src/b/SeasonPage.tsx @@ -0,0 +1,84 @@ +import { useState } from 'react' +import { useQuery } from '@tanstack/react-query' +import { getSeasonWeekOptions, listArticlesOptions } from '../api/client/@tanstack/react-query.gen' +import { ArticleCategory } from '../api/client/types.gen' +import { cx } from '../lib/utils' +import { ARTICLE_CAT, cardBg, fall, shortDay } from './lib' +import { useSheet } from './sheetContext' +import { Chips, Ic, StateBox } from './ui' + +const CATS = [ + ['all', '전체'], + ['season', '계절 소식'], + ['tip', '날씨 상식'], + ['gak', '각 원리'], +] as const + +const CAT_PARAM = { season: ArticleCategory.SEASON, tip: ArticleCategory.TIP, gak: ArticleCategory.GAK } as const + +export function SeasonPage() { + const { open } = useSheet() + const [cat, setCat] = useState<(typeof CATS)[number][0]>('all') + const week = useQuery(getSeasonWeekOptions()) + const arts = useQuery(listArticlesOptions(cat === 'all' ? undefined : { query: { category: CAT_PARAM[cat] } })) + const w = week.data + const list = arts.data?.articles ?? [] + const progress = Math.round((w?.progress ?? 0) * 100) + + return ( +
+ {w?.headline ? ( + + ) : ( + week.refetch()} empty="이번 주 특집이 아직 없어요." /> + )} + +
+ arts.refetch()} empty={arts.isSuccess && !list.length ? '읽을거리가 아직 없어요.' : undefined} /> + {list.map((a) => ( + + ))} +
+
+ ) +} diff --git a/frontend/src/b/Sheets.tsx b/frontend/src/b/Sheets.tsx new file mode 100644 index 0000000..2d4bb06 --- /dev/null +++ b/frontend/src/b/Sheets.tsx @@ -0,0 +1,612 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' +import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState, type FormEvent, type ReactNode } from 'react' +import { setTokens, subscribeAuth } from '../api/auth' +import { + addCommentMutation, + deleteCommentMutation, + getArticleOptions, + getFeedQueryKey, + getIndexOptions, + getSeasonWeekOptions, + likeCommentMutation, + listCommentsQueryKey, + listCommentsOptions, + listRegionsOptions, + loginMutation, + signupMutation, + unlikeCommentMutation, +} from '../api/client/@tanstack/react-query.gen' +import type { CommentData, Factor, ResAuth, ResIndexDetail } from '../api/client/types.gen' +import { cx } from '../lib/utils' +import { useAuth } from './authContext' +import { ago, ARTICLE_CAT, articleMeta, cardBg, dayLabel, shortDay } from './lib' +import { useRegion } from './regionContext' +import { SheetContext, useSheet, type SharePayload, type SheetState } from './sheetContext' +import { HeartIcon } from './svg' +import { Ic, StateBox } from './ui' + +export function SheetProvider({ children }: { children: ReactNode }) { + const [state, setState] = useState(null) + const open = useCallback((s: Exclude) => setState(s), []) + const close = useCallback(() => setState(null), []) + const api = useMemo(() => ({ open, close }), [open, close]) + + // 로그인이 필요한 요청이 401을 받으면 로그인 창을 띄운다 + useEffect(() => subscribeAuth((reason) => reason === 'required' && setState({ type: 'login' })), []) + + return ( + + {children} + + + ) +} + +const TITLES = { article: '읽을거리', seasonWeek: '이번 주 특집', share: '보내기', comments: '댓글', login: '로그인', region: '지역 바꾸기' } as const + +/** 아래에서 올라오는 창: 네이티브 라 ESC·포커스 가두기·포커스 되돌리기가 기본으로 된다 */ +function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void }) { + const ref = useRef(null) + const [gakTitle, setGakTitle] = useState('') + const [articleTitle, setArticleTitle] = useState('') + + useEffect(() => { + const el = ref.current + if (!el) return + if (state && !el.open) el.showModal() + if (!state && el.open) el.close() + }, [state]) + + const title = !state ? '' : state.type === 'gak' ? gakTitle : state.type === 'article' ? articleTitle || TITLES.article : TITLES[state.type] + + return ( + { + if (e.target === e.currentTarget) onClose() + }} + className="b-sheet-dialog b-app fixed inset-x-0 top-auto bottom-0 m-0 mx-auto max-h-[86dvh] w-full max-w-[440px] overflow-visible bg-transparent p-0 text-(--ink)" + > + {state && ( +
+
+ + {state.type === 'gak' && } + {state.type === 'article' && } + {state.type === 'seasonWeek' && } + {state.type === 'share' && } + {state.type === 'comments' && } + {state.type === 'login' && } + {state.type === 'region' && } +
+ )} +
+ ) +} + +function Body({ children, className }: { children: ReactNode; className?: string }) { + return
{children}
+} + +/* ---------- 각 계산 근거 ---------- */ +function Radar({ name, factors, size = 250 }: { name: string; factors: Factor[]; size?: number }) { + const c = size / 2 + const r = size / 2 - 34 + const n = factors.length + const pt = (i: number, v: number) => { + const a = -Math.PI / 2 + (i * 2 * Math.PI) / n + return [c + Math.cos(a) * r * v, c + Math.sin(a) * r * v] as const + } + const ring = (v: number) => factors.map((_, i) => pt(i, v).join(',')).join(' ') + return ( + + {[0.25, 0.5, 0.75, 1].map((v) => ( + + ))} + {factors.map((f, i) => ( + + ))} + pt(i, f.value / 100).join(',')).join(' ')} fill="rgb(255 122 69 / .38)" stroke="#ff7a45" strokeWidth="3" strokeLinejoin="round" /> + {factors.map((f, i) => ( + + ))} + {factors.map((f, i) => ( + + {f.label} + + ))} + + ) +} + +function GakSheet({ indexId, onTitle }: { indexId: number; onTitle: (t: string) => void }) { + const { region } = useRegion() + const q = useQuery(getIndexOptions({ path: { index_id: indexId }, query: { region: region.code } })) + const d: ResIndexDetail | undefined = q.data + const g = d?.index + + useEffect(() => { + onTitle(g ? `${g.rank}위 ${g.name}` : '계산 근거') + }, [g, onTitle]) + + if (!g) return { q.refetch()} empty="이 각의 계산 근거가 아직 없어요." className="mx-0" />} + const factors = d.factors ?? [] + return ( + +
+ +
+

{g.name}

+ {d.description &&

{d.description}

} +
+ {g.score} +
+ {factors.length > 2 && } + {g.trend && g.trend.length > 0 && ( +
+ {g.trend.map((t, j) => ( +
+ {dayLabel(t.day, j)} + {t.score} +
+ ))} +
+ )} +
+ {factors.map((f) => ( +
+ {f.label} + + + + 비중 {f.weight}% +

{f.note}

+
+ ))} +
+
+ {d.zero_reason && ( + + 오늘 0점인 이유: {d.zero_reason} + + )} + {d.zero_rules && ( + + 바로 0점: {d.zero_rules} + + )} + {d.limit && ( + + 반영 못 한 것: {d.limit} + + )} +
+ + ) +} + +/* ---------- 읽을거리 ---------- */ +function ArticleSheet({ articleId, onTitle }: { articleId: number; onTitle: (t: string) => void }) { + const q = useQuery(getArticleOptions({ path: { article_id: articleId } })) + const a = q.data?.article + + useEffect(() => { + onTitle(a ? (ARTICLE_CAT[a.category]?.[0] ?? '') : '') + }, [a, onTitle]) + + if (!a) return { q.refetch()} empty="글을 찾지 못했어요." className="mx-0" />} + return ( + +
+ +
+

{articleMeta(a)}

+

{a.title}

+ {(q.data?.body ?? []).map((t) => ( +

+ {t} +

+ ))} + + ) +} + +/* ---------- 이번 주 특집 ---------- */ +function SeasonWeekSheet() { + const { open } = useSheet() + const q = useQuery(getSeasonWeekOptions()) + const w = q.data + if (!w?.headline) return { q.refetch()} empty="이번 주 특집이 아직 없어요." className="mx-0" />} + return ( + +
+ +
+

이번 주 특집 · {w.week}번째 주

+

{w.headline}

+ {(w.poem_lines ?? []).length > 0 && ( +

+ {w.poem_lines?.join(' ')} + {w.author && {w.author}} +

+ )} + {w.term_now && w.term_next && ( +

+ 지금 절기는 {w.term_now.name}({shortDay(w.term_now.day)}), 다음 절기는 {w.term_next.name}({shortDay(w.term_next.day)})예요. +

+ )} + {(w.news ?? []).map((n) => ( + + ))} + + ) +} + +/* ---------- 보내기 ---------- */ +function ShareSheet({ share }: { share: SharePayload }) { + const { region } = useRegion() + const opts = [...share.messages, '직접 쓰기'] + const [pick, setPick] = useState(0) + const [mine, setMine] = useState('') + const [toast, setToast] = useState('') + const isMine = pick === opts.length - 1 + const msg = isMine ? mine : opts[pick] + + const url = window.location.origin + const text = `${msg} — ${share.title} · 날씨각` + + // 휴대폰 기본 공유창. 없거나 실패하면 링크 복사로 대신한다. + const shareNative = () => { + if (!navigator.share) { + copy() + return + } + navigator.share({ title: share.title, text, url }).then( + () => setToast('보냈어요'), + (e: unknown) => { + if (e instanceof DOMException && e.name === 'AbortError') return + copy() + }, + ) + } + + const copy = () => { + if (!navigator.clipboard) { + setToast('복사가 막혀 있어요') + return + } + navigator.clipboard.writeText(`${text} ${url}`).then( + () => setToast('보낼 말과 링크를 복사했어요'), + () => setToast('복사가 막혀 있어요. 길게 눌러 복사해 주세요'), + ) + } + + return ( + +
+ +
+ {share.title} + 날씨각 · {region.name} +
+
+
+ {opts.map((o, k) => ( + + ))} +
+ {isMine && ( +