diff --git a/justfile b/justfile index 992d925..edc93d5 100644 --- a/justfile +++ b/justfile @@ -7,4 +7,13 @@ # Setup project @run: - poetry run uvicorn server:app --reload --port 8000 + poetry run python main.py + + +# Lint project with ruff linter +@lint: + poetry run ruff . + +# Auto fix lint with ruff +@lint-fix: + poetry run ruff . --fix diff --git a/main.py b/main.py new file mode 100644 index 0000000..5766b7c --- /dev/null +++ b/main.py @@ -0,0 +1,29 @@ +import json +import logging +import uvicorn + +from dotenv import load_dotenv +from fastapi import FastAPI +from fastapi.openapi.utils import get_openapi +from starlette.middleware.cors import CORSMiddleware +from mta_sign_server.router import router as default_router +from mta_sign_server.mta.router import router as mta_router +from mta_sign_server.config.router import router as config_router + +load_dotenv() + +app = FastAPI() +app.add_middleware( + CORSMiddleware, + allow_origins=['*'] +) + +app.include_router(default_router) +app.include_router(mta_router) +app.include_router(config_router) + +logger = logging.getLogger("main") + + +if __name__ == "__main__": + uvicorn.run("main:app", host="0.0.0.0", port=8000, log_level="info", reload=True) diff --git a/mta-sign-ui/.gitignore b/mta-sign-ui/.gitignore index 8f322f0..5f7aff2 100644 --- a/mta-sign-ui/.gitignore +++ b/mta-sign-ui/.gitignore @@ -33,3 +33,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +.yarn diff --git a/mta-sign-ui/.pnp.cjs b/mta-sign-ui/.pnp.cjs index a244377..aeb41a3 100644 --- a/mta-sign-ui/.pnp.cjs +++ b/mta-sign-ui/.pnp.cjs @@ -28,13 +28,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { [null, {\ "packageLocation": "./",\ "packageDependencies": [\ + ["@openapitools/openapi-generator-cli", "npm:2.6.0"],\ ["@types/node", "npm:20.4.1"],\ ["@types/react", "npm:18.2.14"],\ ["@types/react-dom", "npm:18.2.6"],\ ["autoprefixer", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:10.4.14"],\ ["eslint", "npm:8.44.0"],\ ["eslint-config-next", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:13.4.9"],\ - ["follow-redirects", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:1.15.2"],\ + ["follow-redirects", "virtual:dbe3a48aea1dd5649e16abaf23d4ae05582d2149e16141955113766a0f84f681baf358c77ddccfc82eb23e4ccc66c6c912df62a9c01f2a83f1842bf86cc297b1#npm:1.15.2"],\ ["next", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:13.4.9"],\ ["postcss", "npm:8.4.25"],\ ["react", "npm:18.2.0"],\ @@ -243,6 +244,135 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["@lukeed/csprng", [\ + ["npm:1.1.0", {\ + "packageLocation": "./.yarn/cache/@lukeed-csprng-npm-1.1.0-d28ed78cc2-926f5f7fc6.zip/node_modules/@lukeed/csprng/",\ + "packageDependencies": [\ + ["@lukeed/csprng", "npm:1.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@nestjs/axios", [\ + ["npm:0.0.8", {\ + "packageLocation": "./.yarn/cache/@nestjs-axios-npm-0.0.8-ef5705e69d-bc6b18c6e8.zip/node_modules/@nestjs/axios/",\ + "packageDependencies": [\ + ["@nestjs/axios", "npm:0.0.8"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:0.0.8", {\ + "packageLocation": "./.yarn/__virtual__/@nestjs-axios-virtual-62d80659dd/0/cache/@nestjs-axios-npm-0.0.8-ef5705e69d-bc6b18c6e8.zip/node_modules/@nestjs/axios/",\ + "packageDependencies": [\ + ["@nestjs/axios", "virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:0.0.8"],\ + ["@nestjs/common", "virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:9.3.11"],\ + ["@types/nestjs__common", null],\ + ["@types/reflect-metadata", null],\ + ["@types/rxjs", null],\ + ["axios", "npm:0.27.2"],\ + ["reflect-metadata", "npm:0.1.13"],\ + ["rxjs", "npm:7.8.0"]\ + ],\ + "packagePeers": [\ + "@nestjs/common",\ + "@types/nestjs__common",\ + "@types/reflect-metadata",\ + "@types/rxjs",\ + "reflect-metadata",\ + "rxjs"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@nestjs/common", [\ + ["npm:9.3.11", {\ + "packageLocation": "./.yarn/cache/@nestjs-common-npm-9.3.11-2145e21dcc-c39dfa9f02.zip/node_modules/@nestjs/common/",\ + "packageDependencies": [\ + ["@nestjs/common", "npm:9.3.11"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:9.3.11", {\ + "packageLocation": "./.yarn/__virtual__/@nestjs-common-virtual-57d568a72e/0/cache/@nestjs-common-npm-9.3.11-2145e21dcc-c39dfa9f02.zip/node_modules/@nestjs/common/",\ + "packageDependencies": [\ + ["@nestjs/common", "virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:9.3.11"],\ + ["@types/cache-manager", null],\ + ["@types/class-transformer", null],\ + ["@types/class-validator", null],\ + ["@types/reflect-metadata", null],\ + ["@types/rxjs", null],\ + ["cache-manager", null],\ + ["class-transformer", null],\ + ["class-validator", null],\ + ["iterare", "npm:1.2.1"],\ + ["reflect-metadata", "npm:0.1.13"],\ + ["rxjs", "npm:7.8.0"],\ + ["tslib", "npm:2.5.0"],\ + ["uid", "npm:2.0.1"]\ + ],\ + "packagePeers": [\ + "@types/cache-manager",\ + "@types/class-transformer",\ + "@types/class-validator",\ + "@types/reflect-metadata",\ + "@types/rxjs",\ + "cache-manager",\ + "class-transformer",\ + "class-validator",\ + "reflect-metadata",\ + "rxjs"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@nestjs/core", [\ + ["npm:9.3.11", {\ + "packageLocation": "./.yarn/unplugged/@nestjs-core-virtual-1ae8bc94ae/node_modules/@nestjs/core/",\ + "packageDependencies": [\ + ["@nestjs/core", "npm:9.3.11"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:9.3.11", {\ + "packageLocation": "./.yarn/unplugged/@nestjs-core-virtual-1ae8bc94ae/node_modules/@nestjs/core/",\ + "packageDependencies": [\ + ["@nestjs/core", "virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:9.3.11"],\ + ["@nestjs/common", "virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:9.3.11"],\ + ["@nestjs/microservices", null],\ + ["@nestjs/platform-express", null],\ + ["@nestjs/websockets", null],\ + ["@nuxtjs/opencollective", "npm:0.3.2"],\ + ["@types/nestjs__common", null],\ + ["@types/nestjs__microservices", null],\ + ["@types/nestjs__platform-express", null],\ + ["@types/nestjs__websockets", null],\ + ["@types/reflect-metadata", null],\ + ["@types/rxjs", null],\ + ["fast-safe-stringify", "npm:2.1.1"],\ + ["iterare", "npm:1.2.1"],\ + ["path-to-regexp", "npm:3.2.0"],\ + ["reflect-metadata", "npm:0.1.13"],\ + ["rxjs", "npm:7.8.0"],\ + ["tslib", "npm:2.5.0"],\ + ["uid", "npm:2.0.1"]\ + ],\ + "packagePeers": [\ + "@nestjs/common",\ + "@nestjs/microservices",\ + "@nestjs/platform-express",\ + "@nestjs/websockets",\ + "@types/nestjs__common",\ + "@types/nestjs__microservices",\ + "@types/nestjs__platform-express",\ + "@types/nestjs__websockets",\ + "@types/reflect-metadata",\ + "@types/rxjs",\ + "reflect-metadata",\ + "rxjs"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@next/env", [\ ["npm:13.4.9", {\ "packageLocation": "./.yarn/cache/@next-env-npm-13.4.9-5ac46bb714-625f01571a.zip/node_modules/@next/env/",\ @@ -384,6 +514,43 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["@nuxtjs/opencollective", [\ + ["npm:0.3.2", {\ + "packageLocation": "./.yarn/cache/@nuxtjs-opencollective-npm-0.3.2-72db6b3551-fd3737c12e.zip/node_modules/@nuxtjs/opencollective/",\ + "packageDependencies": [\ + ["@nuxtjs/opencollective", "npm:0.3.2"],\ + ["chalk", "npm:4.1.2"],\ + ["consola", "npm:2.15.3"],\ + ["node-fetch", "virtual:72db6b3551c1b46986e711aee96d1643b26ff6991672401c35442adfbef36d10ccd9289b58e518aac04afe4e688ca4b130da9fae9c1c040113a2585b8cfeea9a#npm:2.6.12"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@openapitools/openapi-generator-cli", [\ + ["npm:2.6.0", {\ + "packageLocation": "./.yarn/unplugged/@openapitools-openapi-generator-cli-npm-2.6.0-2470b57c47/node_modules/@openapitools/openapi-generator-cli/",\ + "packageDependencies": [\ + ["@openapitools/openapi-generator-cli", "npm:2.6.0"],\ + ["@nestjs/axios", "virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:0.0.8"],\ + ["@nestjs/common", "virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:9.3.11"],\ + ["@nestjs/core", "virtual:2470b57c47ec39ab3a0c530dd7b990eea92d123eabd1f0c58f197e89f52b7631a92bde6586bc1ef5909cdf579612d31f229e5252b6a27916d4bbc48b189c77f4#npm:9.3.11"],\ + ["@nuxtjs/opencollective", "npm:0.3.2"],\ + ["chalk", "npm:4.1.2"],\ + ["commander", "npm:8.3.0"],\ + ["compare-versions", "npm:4.1.4"],\ + ["concurrently", "npm:6.5.1"],\ + ["console.table", "npm:0.10.0"],\ + ["fs-extra", "npm:10.1.0"],\ + ["glob", "npm:7.1.6"],\ + ["inquirer", "npm:8.2.5"],\ + ["lodash", "npm:4.17.21"],\ + ["reflect-metadata", "npm:0.1.13"],\ + ["rxjs", "npm:7.8.0"],\ + ["tslib", "npm:2.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@pkgjs/parseargs", [\ ["npm:0.11.0", {\ "packageLocation": "./.yarn/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-6ad6a00fc4.zip/node_modules/@pkgjs/parseargs/",\ @@ -670,6 +837,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["ansi-escapes", [\ + ["npm:4.3.2", {\ + "packageLocation": "./.yarn/cache/ansi-escapes-npm-4.3.2-3ad173702f-93111c4218.zip/node_modules/ansi-escapes/",\ + "packageDependencies": [\ + ["ansi-escapes", "npm:4.3.2"],\ + ["type-fest", "npm:0.21.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["ansi-regex", [\ ["npm:5.0.1", {\ "packageLocation": "./.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip/node_modules/ansi-regex/",\ @@ -854,6 +1031,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["asynckit", [\ + ["npm:0.4.0", {\ + "packageLocation": "./.yarn/cache/asynckit-npm-0.4.0-c718858525-7b78c451df.zip/node_modules/asynckit/",\ + "packageDependencies": [\ + ["asynckit", "npm:0.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["autoprefixer", [\ ["npm:10.4.14", {\ "packageLocation": "./.yarn/cache/autoprefixer-npm-10.4.14-1e0b8c34fb-e9f18e664a.zip/node_modules/autoprefixer/",\ @@ -900,6 +1086,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["axios", [\ + ["npm:0.27.2", {\ + "packageLocation": "./.yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip/node_modules/axios/",\ + "packageDependencies": [\ + ["axios", "npm:0.27.2"],\ + ["follow-redirects", "virtual:dbe3a48aea1dd5649e16abaf23d4ae05582d2149e16141955113766a0f84f681baf358c77ddccfc82eb23e4ccc66c6c912df62a9c01f2a83f1842bf86cc297b1#npm:1.15.2"],\ + ["form-data", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["axobject-query", [\ ["npm:3.2.1", {\ "packageLocation": "./.yarn/cache/axobject-query-npm-3.2.1-b147b3f32c-a94047e702.zip/node_modules/axobject-query/",\ @@ -919,6 +1116,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["base64-js", [\ + ["npm:1.5.1", {\ + "packageLocation": "./.yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip/node_modules/base64-js/",\ + "packageDependencies": [\ + ["base64-js", "npm:1.5.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["big-integer", [\ ["npm:1.6.51", {\ "packageLocation": "./.yarn/cache/big-integer-npm-1.6.51-1a244d8e1f-3d444173d1.zip/node_modules/big-integer/",\ @@ -937,6 +1143,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["bl", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/bl-npm-4.1.0-7f94cdcf3f-9e8521fa7e.zip/node_modules/bl/",\ + "packageDependencies": [\ + ["bl", "npm:4.1.0"],\ + ["buffer", "npm:5.7.1"],\ + ["inherits", "npm:2.0.4"],\ + ["readable-stream", "npm:3.6.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["bplist-parser", [\ ["npm:0.2.0", {\ "packageLocation": "./.yarn/cache/bplist-parser-npm-0.2.0-91a681e495-d5339dd16a.zip/node_modules/bplist-parser/",\ @@ -989,6 +1207,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["buffer", [\ + ["npm:5.7.1", {\ + "packageLocation": "./.yarn/cache/buffer-npm-5.7.1-513ef8259e-e2cf8429e1.zip/node_modules/buffer/",\ + "packageDependencies": [\ + ["buffer", "npm:5.7.1"],\ + ["base64-js", "npm:1.5.1"],\ + ["ieee754", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["bundle-name", [\ ["npm:3.0.0", {\ "packageLocation": "./.yarn/cache/bundle-name-npm-3.0.0-d7e52ba2a3-edf2b1fbe6.zip/node_modules/bundle-name/",\ @@ -1079,6 +1308,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["chardet", [\ + ["npm:0.7.0", {\ + "packageLocation": "./.yarn/cache/chardet-npm-0.7.0-27933dd6c7-6fd5da1f5d.zip/node_modules/chardet/",\ + "packageDependencies": [\ + ["chardet", "npm:0.7.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["chokidar", [\ ["npm:3.5.3", {\ "packageLocation": "./.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-b49fcde401.zip/node_modules/chokidar/",\ @@ -1114,6 +1352,34 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["cli-cursor", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/cli-cursor-npm-3.1.0-fee1e46b5e-2692784c6c.zip/node_modules/cli-cursor/",\ + "packageDependencies": [\ + ["cli-cursor", "npm:3.1.0"],\ + ["restore-cursor", "npm:3.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["cli-spinners", [\ + ["npm:2.9.0", {\ + "packageLocation": "./.yarn/cache/cli-spinners-npm-2.9.0-227cd236ed-a9c56e1f44.zip/node_modules/cli-spinners/",\ + "packageDependencies": [\ + ["cli-spinners", "npm:2.9.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["cli-width", [\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/cli-width-npm-3.0.0-387b3f68f9-4c94af3769.zip/node_modules/cli-width/",\ + "packageDependencies": [\ + ["cli-width", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["client-only", [\ ["npm:0.0.1", {\ "packageLocation": "./.yarn/cache/client-only-npm-0.0.1-07d3e9505c-0c16bf660d.zip/node_modules/client-only/",\ @@ -1123,6 +1389,27 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["cliui", [\ + ["npm:7.0.4", {\ + "packageLocation": "./.yarn/cache/cliui-npm-7.0.4-d6b8a9edb6-ce2e8f578a.zip/node_modules/cliui/",\ + "packageDependencies": [\ + ["cliui", "npm:7.0.4"],\ + ["string-width", "npm:4.2.3"],\ + ["strip-ansi", "npm:6.0.1"],\ + ["wrap-ansi", "npm:7.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["clone", [\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/clone-npm-1.0.4-a610fcbcf9-d06418b733.zip/node_modules/clone/",\ + "packageDependencies": [\ + ["clone", "npm:1.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["color-convert", [\ ["npm:2.0.1", {\ "packageLocation": "./.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip/node_modules/color-convert/",\ @@ -1151,6 +1438,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["combined-stream", [\ + ["npm:1.0.8", {\ + "packageLocation": "./.yarn/cache/combined-stream-npm-1.0.8-dc14d4a63a-49fa4aeb49.zip/node_modules/combined-stream/",\ + "packageDependencies": [\ + ["combined-stream", "npm:1.0.8"],\ + ["delayed-stream", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["commander", [\ ["npm:4.1.1", {\ "packageLocation": "./.yarn/cache/commander-npm-4.1.1-22a0fe921b-d7b9913ff9.zip/node_modules/commander/",\ @@ -1158,6 +1455,22 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["commander", "npm:4.1.1"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:8.3.0", {\ + "packageLocation": "./.yarn/cache/commander-npm-8.3.0-c0d18c66d5-0f82321821.zip/node_modules/commander/",\ + "packageDependencies": [\ + ["commander", "npm:8.3.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["compare-versions", [\ + ["npm:4.1.4", {\ + "packageLocation": "./.yarn/cache/compare-versions-npm-4.1.4-7ea14e31a1-c1617544b7.zip/node_modules/compare-versions/",\ + "packageDependencies": [\ + ["compare-versions", "npm:4.1.4"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["concat-map", [\ @@ -1169,6 +1482,32 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["concurrently", [\ + ["npm:6.5.1", {\ + "packageLocation": "./.yarn/cache/concurrently-npm-6.5.1-1c75a74f6e-3f4d89b464.zip/node_modules/concurrently/",\ + "packageDependencies": [\ + ["concurrently", "npm:6.5.1"],\ + ["chalk", "npm:4.1.2"],\ + ["date-fns", "npm:2.30.0"],\ + ["lodash", "npm:4.17.21"],\ + ["rxjs", "npm:6.6.7"],\ + ["spawn-command", "npm:0.0.2"],\ + ["supports-color", "npm:8.1.1"],\ + ["tree-kill", "npm:1.2.2"],\ + ["yargs", "npm:16.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["consola", [\ + ["npm:2.15.3", {\ + "packageLocation": "./.yarn/cache/consola-npm-2.15.3-7b4cf44fed-8ef7a09b70.zip/node_modules/consola/",\ + "packageDependencies": [\ + ["consola", "npm:2.15.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["console-control-strings", [\ ["npm:1.1.0", {\ "packageLocation": "./.yarn/cache/console-control-strings-npm-1.1.0-e3160e5275-8755d76787.zip/node_modules/console-control-strings/",\ @@ -1178,6 +1517,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["console.table", [\ + ["npm:0.10.0", {\ + "packageLocation": "./.yarn/cache/console.table-npm-0.10.0-5e90a14686-4c1460e310.zip/node_modules/console.table/",\ + "packageDependencies": [\ + ["console.table", "npm:0.10.0"],\ + ["easy-table", "npm:1.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["cross-spawn", [\ ["npm:7.0.3", {\ "packageLocation": "./.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip/node_modules/cross-spawn/",\ @@ -1217,6 +1566,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["date-fns", [\ + ["npm:2.30.0", {\ + "packageLocation": "./.yarn/cache/date-fns-npm-2.30.0-895c790e0f-f7be015232.zip/node_modules/date-fns/",\ + "packageDependencies": [\ + ["date-fns", "npm:2.30.0"],\ + ["@babel/runtime", "npm:7.22.6"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["debug", [\ ["npm:3.2.7", {\ "packageLocation": "./.yarn/cache/debug-npm-3.2.7-754e818c7a-b3d8c59407.zip/node_modules/debug/",\ @@ -1294,6 +1653,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["defaults", [\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/defaults-npm-1.0.4-f3fbaf2528-3a88b7a587.zip/node_modules/defaults/",\ + "packageDependencies": [\ + ["defaults", "npm:1.0.4"],\ + ["clone", "npm:1.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["define-lazy-prop", [\ ["npm:3.0.0", {\ "packageLocation": "./.yarn/cache/define-lazy-prop-npm-3.0.0-6bb0fc1510-54884f94ca.zip/node_modules/define-lazy-prop/",\ @@ -1314,6 +1683,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["delayed-stream", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/delayed-stream-npm-1.0.0-c5a4c4cc02-46fe6e83e2.zip/node_modules/delayed-stream/",\ + "packageDependencies": [\ + ["delayed-stream", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["delegates", [\ ["npm:1.0.0", {\ "packageLocation": "./.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip/node_modules/delegates/",\ @@ -1396,6 +1774,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["easy-table", [\ + ["npm:1.1.0", {\ + "packageLocation": "./.yarn/cache/easy-table-npm-1.1.0-540ad6343c-49b960fefe.zip/node_modules/easy-table/",\ + "packageDependencies": [\ + ["easy-table", "npm:1.1.0"],\ + ["wcwidth", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["electron-to-chromium", [\ ["npm:1.4.455", {\ "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.455-a30d8ba834-404901e75c.zip/node_modules/electron-to-chromium/",\ @@ -1547,6 +1935,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["escape-string-regexp", [\ + ["npm:1.0.5", {\ + "packageLocation": "./.yarn/cache/escape-string-regexp-npm-1.0.5-3284de402f-6092fda75c.zip/node_modules/escape-string-regexp/",\ + "packageDependencies": [\ + ["escape-string-regexp", "npm:1.0.5"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/escape-string-regexp-npm-4.0.0-4b531d8d59-98b48897d9.zip/node_modules/escape-string-regexp/",\ "packageDependencies": [\ @@ -2004,6 +2399,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["external-editor", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/external-editor-npm-3.1.0-878e7807af-1c2a616a73.zip/node_modules/external-editor/",\ + "packageDependencies": [\ + ["external-editor", "npm:3.1.0"],\ + ["chardet", "npm:0.7.0"],\ + ["iconv-lite", "npm:0.4.24"],\ + ["tmp", "npm:0.0.33"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["fast-deep-equal", [\ ["npm:3.1.3", {\ "packageLocation": "./.yarn/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip/node_modules/fast-deep-equal/",\ @@ -2045,6 +2452,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["fast-safe-stringify", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/fast-safe-stringify-npm-2.1.1-7ce89033ca-a851cbddc4.zip/node_modules/fast-safe-stringify/",\ + "packageDependencies": [\ + ["fast-safe-stringify", "npm:2.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["fastq", [\ ["npm:1.15.0", {\ "packageLocation": "./.yarn/cache/fastq-npm-1.15.0-1013f6514e-0170e6bfcd.zip/node_modules/fastq/",\ @@ -2055,6 +2471,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["figures", [\ + ["npm:3.2.0", {\ + "packageLocation": "./.yarn/cache/figures-npm-3.2.0-85d357e955-85a6ad29e9.zip/node_modules/figures/",\ + "packageDependencies": [\ + ["figures", "npm:3.2.0"],\ + ["escape-string-regexp", "npm:1.0.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["file-entry-cache", [\ ["npm:6.0.1", {\ "packageLocation": "./.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-f49701feaa.zip/node_modules/file-entry-cache/",\ @@ -2114,10 +2540,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:1.15.2", {\ - "packageLocation": "./.yarn/__virtual__/follow-redirects-virtual-bdb1bc7da2/0/cache/follow-redirects-npm-1.15.2-1ec1dd82be-faa66059b6.zip/node_modules/follow-redirects/",\ + ["virtual:dbe3a48aea1dd5649e16abaf23d4ae05582d2149e16141955113766a0f84f681baf358c77ddccfc82eb23e4ccc66c6c912df62a9c01f2a83f1842bf86cc297b1#npm:1.15.2", {\ + "packageLocation": "./.yarn/__virtual__/follow-redirects-virtual-42073a9d6a/0/cache/follow-redirects-npm-1.15.2-1ec1dd82be-faa66059b6.zip/node_modules/follow-redirects/",\ "packageDependencies": [\ - ["follow-redirects", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:1.15.2"],\ + ["follow-redirects", "virtual:dbe3a48aea1dd5649e16abaf23d4ae05582d2149e16141955113766a0f84f681baf358c77ddccfc82eb23e4ccc66c6c912df62a9c01f2a83f1842bf86cc297b1#npm:1.15.2"],\ ["@types/debug", null],\ ["debug", null]\ ],\ @@ -2149,6 +2575,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["form-data", [\ + ["npm:4.0.0", {\ + "packageLocation": "./.yarn/cache/form-data-npm-4.0.0-916facec2d-01135bf867.zip/node_modules/form-data/",\ + "packageDependencies": [\ + ["form-data", "npm:4.0.0"],\ + ["asynckit", "npm:0.4.0"],\ + ["combined-stream", "npm:1.0.8"],\ + ["mime-types", "npm:2.1.35"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["fraction.js", [\ ["npm:4.2.0", {\ "packageLocation": "./.yarn/cache/fraction.js-npm-4.2.0-28efe4afc7-8c76a6e21d.zip/node_modules/fraction.js/",\ @@ -2158,6 +2596,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["fs-extra", [\ + ["npm:10.1.0", {\ + "packageLocation": "./.yarn/cache/fs-extra-npm-10.1.0-86573680ed-dc94ab3709.zip/node_modules/fs-extra/",\ + "packageDependencies": [\ + ["fs-extra", "npm:10.1.0"],\ + ["graceful-fs", "npm:4.2.11"],\ + ["jsonfile", "npm:6.1.0"],\ + ["universalify", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["fs-minipass", [\ ["npm:2.1.0", {\ "packageLocation": "./.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip/node_modules/fs-minipass/",\ @@ -2243,6 +2693,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["get-caller-file", [\ + ["npm:2.0.5", {\ + "packageLocation": "./.yarn/cache/get-caller-file-npm-2.0.5-80e8a86305-b9769a836d.zip/node_modules/get-caller-file/",\ + "packageDependencies": [\ + ["get-caller-file", "npm:2.0.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["get-intrinsic", [\ ["npm:1.2.1", {\ "packageLocation": "./.yarn/cache/get-intrinsic-npm-1.2.1-ae857fd610-5b61d88552.zip/node_modules/get-intrinsic/",\ @@ -2575,6 +3034,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["iconv-lite", [\ + ["npm:0.4.24", {\ + "packageLocation": "./.yarn/cache/iconv-lite-npm-0.4.24-c5c4ac6695-bd9f120f5a.zip/node_modules/iconv-lite/",\ + "packageDependencies": [\ + ["iconv-lite", "npm:0.4.24"],\ + ["safer-buffer", "npm:2.1.2"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:0.6.3", {\ "packageLocation": "./.yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-3f60d47a5c.zip/node_modules/iconv-lite/",\ "packageDependencies": [\ @@ -2584,6 +3051,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["ieee754", [\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-5144c0c981.zip/node_modules/ieee754/",\ + "packageDependencies": [\ + ["ieee754", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["ignore", [\ ["npm:5.2.4", {\ "packageLocation": "./.yarn/cache/ignore-npm-5.2.4-fbe6e989e5-3d4c309c60.zip/node_modules/ignore/",\ @@ -2642,6 +3118,30 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["inquirer", [\ + ["npm:8.2.5", {\ + "packageLocation": "./.yarn/cache/inquirer-npm-8.2.5-ffce7548f9-f13ee4c444.zip/node_modules/inquirer/",\ + "packageDependencies": [\ + ["inquirer", "npm:8.2.5"],\ + ["ansi-escapes", "npm:4.3.2"],\ + ["chalk", "npm:4.1.2"],\ + ["cli-cursor", "npm:3.1.0"],\ + ["cli-width", "npm:3.0.0"],\ + ["external-editor", "npm:3.1.0"],\ + ["figures", "npm:3.2.0"],\ + ["lodash", "npm:4.17.21"],\ + ["mute-stream", "npm:0.0.8"],\ + ["ora", "npm:5.4.1"],\ + ["run-async", "npm:2.4.1"],\ + ["rxjs", "npm:7.8.1"],\ + ["string-width", "npm:4.2.3"],\ + ["strip-ansi", "npm:6.0.1"],\ + ["through", "npm:2.3.8"],\ + ["wrap-ansi", "npm:7.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["internal-slot", [\ ["npm:1.0.5", {\ "packageLocation": "./.yarn/cache/internal-slot-npm-1.0.5-a2241f3e66-97e84046bf.zip/node_modules/internal-slot/",\ @@ -2789,6 +3289,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["is-interactive", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/is-interactive-npm-1.0.0-7ff7c6e04a-824808776e.zip/node_modules/is-interactive/",\ + "packageDependencies": [\ + ["is-interactive", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["is-lambda", [\ ["npm:1.0.1", {\ "packageLocation": "./.yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip/node_modules/is-lambda/",\ @@ -2906,6 +3415,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["is-unicode-supported", [\ + ["npm:0.1.0", {\ + "packageLocation": "./.yarn/cache/is-unicode-supported-npm-0.1.0-0833e1bbfb-a2aab86ee7.zip/node_modules/is-unicode-supported/",\ + "packageDependencies": [\ + ["is-unicode-supported", "npm:0.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["is-weakref", [\ ["npm:1.0.2", {\ "packageLocation": "./.yarn/cache/is-weakref-npm-1.0.2-ff80e8c314-95bd9a57cd.zip/node_modules/is-weakref/",\ @@ -2935,6 +3453,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["iterare", [\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/",\ + "packageDependencies": [\ + ["iterare", "npm:1.2.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["jackspeak", [\ ["npm:2.2.1", {\ "packageLocation": "./.yarn/cache/jackspeak-npm-2.2.1-0644c98bfe-e29291c0d0.zip/node_modules/jackspeak/",\ @@ -3002,6 +3529,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["jsonfile", [\ + ["npm:6.1.0", {\ + "packageLocation": "./.yarn/cache/jsonfile-npm-6.1.0-20a4796cee-7af3b8e1ac.zip/node_modules/jsonfile/",\ + "packageDependencies": [\ + ["jsonfile", "npm:6.1.0"],\ + ["graceful-fs", "npm:4.2.11"],\ + ["universalify", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["jsx-ast-utils", [\ ["npm:3.3.4", {\ "packageLocation": "./.yarn/cache/jsx-ast-utils-npm-3.3.4-232908e256-a6a00d324e.zip/node_modules/jsx-ast-utils/",\ @@ -3073,6 +3611,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["lodash", [\ + ["npm:4.17.21", {\ + "packageLocation": "./.yarn/cache/lodash-npm-4.17.21-6382451519-eb835a2e51.zip/node_modules/lodash/",\ + "packageDependencies": [\ + ["lodash", "npm:4.17.21"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["lodash.merge", [\ ["npm:4.6.2", {\ "packageLocation": "./.yarn/cache/lodash.merge-npm-4.6.2-77cb4416bf-ad580b4bdb.zip/node_modules/lodash.merge/",\ @@ -3082,6 +3629,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["log-symbols", [\ + ["npm:4.1.0", {\ + "packageLocation": "./.yarn/cache/log-symbols-npm-4.1.0-0a13492d8b-fce1497b31.zip/node_modules/log-symbols/",\ + "packageDependencies": [\ + ["log-symbols", "npm:4.1.0"],\ + ["chalk", "npm:4.1.2"],\ + ["is-unicode-supported", "npm:0.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["loose-envify", [\ ["npm:1.4.0", {\ "packageLocation": "./.yarn/cache/loose-envify-npm-1.4.0-6307b72ccf-6517e24e0c.zip/node_modules/loose-envify/",\ @@ -3169,6 +3727,25 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["mime-db", [\ + ["npm:1.52.0", {\ + "packageLocation": "./.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-0d99a03585.zip/node_modules/mime-db/",\ + "packageDependencies": [\ + ["mime-db", "npm:1.52.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["mime-types", [\ + ["npm:2.1.35", {\ + "packageLocation": "./.yarn/cache/mime-types-npm-2.1.35-dd9ea9f3e2-89a5b7f1de.zip/node_modules/mime-types/",\ + "packageDependencies": [\ + ["mime-types", "npm:2.1.35"],\ + ["mime-db", "npm:1.52.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["mimic-fn", [\ ["npm:2.1.0", {\ "packageLocation": "./.yarn/cache/mimic-fn-npm-2.1.0-4fbeb3abb4-d2421a3444.zip/node_modules/mimic-fn/",\ @@ -3330,13 +3907,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./",\ "packageDependencies": [\ ["mta-sign", "workspace:."],\ + ["@openapitools/openapi-generator-cli", "npm:2.6.0"],\ ["@types/node", "npm:20.4.1"],\ ["@types/react", "npm:18.2.14"],\ ["@types/react-dom", "npm:18.2.6"],\ ["autoprefixer", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:10.4.14"],\ ["eslint", "npm:8.44.0"],\ ["eslint-config-next", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:13.4.9"],\ - ["follow-redirects", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:1.15.2"],\ + ["follow-redirects", "virtual:dbe3a48aea1dd5649e16abaf23d4ae05582d2149e16141955113766a0f84f681baf358c77ddccfc82eb23e4ccc66c6c912df62a9c01f2a83f1842bf86cc297b1#npm:1.15.2"],\ ["next", "virtual:a04f75f675cfa84c1955a959c1d9ef5e29a1810d9a2caa5b4d1b17d98baf86f321b9bd87005e9bb19fe7c0529d585a53e98d5b75d6057c9a074a2dc84071ea79#npm:13.4.9"],\ ["postcss", "npm:8.4.25"],\ ["react", "npm:18.2.0"],\ @@ -3347,6 +3925,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ + ["mute-stream", [\ + ["npm:0.0.8", {\ + "packageLocation": "./.yarn/cache/mute-stream-npm-0.0.8-489a7d6c2b-ff48d251fc.zip/node_modules/mute-stream/",\ + "packageDependencies": [\ + ["mute-stream", "npm:0.0.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["mz", [\ ["npm:2.7.0", {\ "packageLocation": "./.yarn/cache/mz-npm-2.7.0-ec3cef4ec2-8427de0ece.zip/node_modules/mz/",\ @@ -3441,6 +4028,29 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["node-fetch", [\ + ["npm:2.6.12", {\ + "packageLocation": "./.yarn/cache/node-fetch-npm-2.6.12-48619ce9d6-3bc1655203.zip/node_modules/node-fetch/",\ + "packageDependencies": [\ + ["node-fetch", "npm:2.6.12"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:72db6b3551c1b46986e711aee96d1643b26ff6991672401c35442adfbef36d10ccd9289b58e518aac04afe4e688ca4b130da9fae9c1c040113a2585b8cfeea9a#npm:2.6.12", {\ + "packageLocation": "./.yarn/__virtual__/node-fetch-virtual-d848a63a25/0/cache/node-fetch-npm-2.6.12-48619ce9d6-3bc1655203.zip/node_modules/node-fetch/",\ + "packageDependencies": [\ + ["node-fetch", "virtual:72db6b3551c1b46986e711aee96d1643b26ff6991672401c35442adfbef36d10ccd9289b58e518aac04afe4e688ca4b130da9fae9c1c040113a2585b8cfeea9a#npm:2.6.12"],\ + ["@types/encoding", null],\ + ["encoding", null],\ + ["whatwg-url", "npm:5.0.0"]\ + ],\ + "packagePeers": [\ + "@types/encoding",\ + "encoding"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["node-gyp", [\ ["npm:9.4.0", {\ "packageLocation": "./.yarn/unplugged/node-gyp-npm-9.4.0-ebf5f5573e/node_modules/node-gyp/",\ @@ -3681,6 +4291,33 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["ora", [\ + ["npm:5.4.1", {\ + "packageLocation": "./.yarn/cache/ora-npm-5.4.1-4f0343adb7-28d476ee6c.zip/node_modules/ora/",\ + "packageDependencies": [\ + ["ora", "npm:5.4.1"],\ + ["bl", "npm:4.1.0"],\ + ["chalk", "npm:4.1.2"],\ + ["cli-cursor", "npm:3.1.0"],\ + ["cli-spinners", "npm:2.9.0"],\ + ["is-interactive", "npm:1.0.0"],\ + ["is-unicode-supported", "npm:0.1.0"],\ + ["log-symbols", "npm:4.1.0"],\ + ["strip-ansi", "npm:6.0.1"],\ + ["wcwidth", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["os-tmpdir", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/os-tmpdir-npm-1.0.2-e305b0689b-5666560f7b.zip/node_modules/os-tmpdir/",\ + "packageDependencies": [\ + ["os-tmpdir", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["p-limit", [\ ["npm:3.1.0", {\ "packageLocation": "./.yarn/cache/p-limit-npm-3.1.0-05d2ede37f-7c3690c4db.zip/node_modules/p-limit/",\ @@ -3775,6 +4412,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["path-to-regexp", [\ + ["npm:3.2.0", {\ + "packageLocation": "./.yarn/cache/path-to-regexp-npm-3.2.0-daf7bbd038-c3d35cda3b.zip/node_modules/path-to-regexp/",\ + "packageDependencies": [\ + ["path-to-regexp", "npm:3.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["path-type", [\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/path-type-npm-4.0.0-10d47fc86a-5b1e2daa24.zip/node_modules/path-type/",\ @@ -4086,6 +4732,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["reflect-metadata", [\ + ["npm:0.1.13", {\ + "packageLocation": "./.yarn/cache/reflect-metadata-npm-0.1.13-c525998e20-798d379a7b.zip/node_modules/reflect-metadata/",\ + "packageDependencies": [\ + ["reflect-metadata", "npm:0.1.13"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["regenerator-runtime", [\ ["npm:0.13.11", {\ "packageLocation": "./.yarn/cache/regenerator-runtime-npm-0.13.11-90bf536060-27481628d2.zip/node_modules/regenerator-runtime/",\ @@ -4107,6 +4762,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["require-directory", [\ + ["npm:2.1.1", {\ + "packageLocation": "./.yarn/cache/require-directory-npm-2.1.1-8608aee50b-fb47e70bf0.zip/node_modules/require-directory/",\ + "packageDependencies": [\ + ["require-directory", "npm:2.1.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["resolve", [\ ["patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d", {\ "packageLocation": "./.yarn/cache/resolve-patch-bb62d3c3c5-ad59734723.zip/node_modules/resolve/",\ @@ -4147,6 +4811,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["restore-cursor", [\ + ["npm:3.1.0", {\ + "packageLocation": "./.yarn/cache/restore-cursor-npm-3.1.0-52c5a4c98f-f877dd8741.zip/node_modules/restore-cursor/",\ + "packageDependencies": [\ + ["restore-cursor", "npm:3.1.0"],\ + ["onetime", "npm:5.1.2"],\ + ["signal-exit", "npm:3.0.7"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["retry", [\ ["npm:0.12.0", {\ "packageLocation": "./.yarn/cache/retry-npm-0.12.0-72ac7fb4cc-623bd7d2e5.zip/node_modules/retry/",\ @@ -4185,6 +4860,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["run-async", [\ + ["npm:2.4.1", {\ + "packageLocation": "./.yarn/cache/run-async-npm-2.4.1-a94bb90861-a2c88aa15d.zip/node_modules/run-async/",\ + "packageDependencies": [\ + ["run-async", "npm:2.4.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["run-parallel", [\ ["npm:1.2.0", {\ "packageLocation": "./.yarn/cache/run-parallel-npm-1.2.0-3f47ff2034-cb4f97ad25.zip/node_modules/run-parallel/",\ @@ -4195,6 +4879,32 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["rxjs", [\ + ["npm:6.6.7", {\ + "packageLocation": "./.yarn/cache/rxjs-npm-6.6.7-055046ea3c-bc334edef1.zip/node_modules/rxjs/",\ + "packageDependencies": [\ + ["rxjs", "npm:6.6.7"],\ + ["tslib", "npm:1.14.1"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:7.8.0", {\ + "packageLocation": "./.yarn/cache/rxjs-npm-7.8.0-722f1c7172-61b4d4fd32.zip/node_modules/rxjs/",\ + "packageDependencies": [\ + ["rxjs", "npm:7.8.0"],\ + ["tslib", "npm:2.6.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:7.8.1", {\ + "packageLocation": "./.yarn/cache/rxjs-npm-7.8.1-41c443a75b-de4b53db10.zip/node_modules/rxjs/",\ + "packageDependencies": [\ + ["rxjs", "npm:7.8.1"],\ + ["tslib", "npm:2.6.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["safe-buffer", [\ ["npm:5.2.1", {\ "packageLocation": "./.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-b99c4b41fd.zip/node_modules/safe-buffer/",\ @@ -4365,6 +5075,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["spawn-command", [\ + ["npm:0.0.2", {\ + "packageLocation": "./.yarn/cache/spawn-command-npm-0.0.2-014d4d5d9f-e35c5d2817.zip/node_modules/spawn-command/",\ + "packageDependencies": [\ + ["spawn-command", "npm:0.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["ssri", [\ ["npm:10.0.4", {\ "packageLocation": "./.yarn/cache/ssri-npm-10.0.4-f583dafaf3-fb14da9f8a.zip/node_modules/ssri/",\ @@ -4576,6 +5295,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["has-flag", "npm:4.0.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:8.1.1", {\ + "packageLocation": "./.yarn/cache/supports-color-npm-8.1.1-289e937149-c052193a7e.zip/node_modules/supports-color/",\ + "packageDependencies": [\ + ["supports-color", "npm:8.1.1"],\ + ["has-flag", "npm:4.0.0"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["supports-preserve-symlinks-flag", [\ @@ -4683,6 +5410,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["through", [\ + ["npm:2.3.8", {\ + "packageLocation": "./.yarn/cache/through-npm-2.3.8-df5f72a16e-a38c3e0598.zip/node_modules/through/",\ + "packageDependencies": [\ + ["through", "npm:2.3.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["titleize", [\ ["npm:3.0.0", {\ "packageLocation": "./.yarn/cache/titleize-npm-3.0.0-7deac2f3a3-71fbbeabbf.zip/node_modules/titleize/",\ @@ -4692,6 +5428,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["tmp", [\ + ["npm:0.0.33", {\ + "packageLocation": "./.yarn/cache/tmp-npm-0.0.33-bcbf65df2a-902d7aceb7.zip/node_modules/tmp/",\ + "packageDependencies": [\ + ["tmp", "npm:0.0.33"],\ + ["os-tmpdir", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["to-regex-range", [\ ["npm:5.0.1", {\ "packageLocation": "./.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-f76fa01b3d.zip/node_modules/to-regex-range/",\ @@ -4702,6 +5448,24 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["tr46", [\ + ["npm:0.0.3", {\ + "packageLocation": "./.yarn/cache/tr46-npm-0.0.3-de53018915-726321c5ea.zip/node_modules/tr46/",\ + "packageDependencies": [\ + ["tr46", "npm:0.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["tree-kill", [\ + ["npm:1.2.2", {\ + "packageLocation": "./.yarn/cache/tree-kill-npm-1.2.2-3da0e5a759-49117f5f41.zip/node_modules/tree-kill/",\ + "packageDependencies": [\ + ["tree-kill", "npm:1.2.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["ts-interface-checker", [\ ["npm:0.1.13", {\ "packageLocation": "./.yarn/cache/ts-interface-checker-npm-0.1.13-0c7b064494-20c29189c2.zip/node_modules/ts-interface-checker/",\ @@ -4732,6 +5496,20 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ + ["npm:2.0.3", {\ + "packageLocation": "./.yarn/cache/tslib-npm-2.0.3-62a2b3751d-00fcdd1f99.zip/node_modules/tslib/",\ + "packageDependencies": [\ + ["tslib", "npm:2.0.3"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:2.5.0", {\ + "packageLocation": "./.yarn/cache/tslib-npm-2.5.0-bb364efebd-ae3ed5f9ce.zip/node_modules/tslib/",\ + "packageDependencies": [\ + ["tslib", "npm:2.5.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:2.6.0", {\ "packageLocation": "./.yarn/cache/tslib-npm-2.6.0-4d336a6824-c01066038f.zip/node_modules/tslib/",\ "packageDependencies": [\ @@ -4780,6 +5558,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["type-fest", "npm:0.20.2"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:0.21.3", {\ + "packageLocation": "./.yarn/cache/type-fest-npm-0.21.3-5ff2a9c6fd-e6b32a3b38.zip/node_modules/type-fest/",\ + "packageDependencies": [\ + ["type-fest", "npm:0.21.3"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["typed-array-length", [\ @@ -4803,6 +5588,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["uid", [\ + ["npm:2.0.1", {\ + "packageLocation": "./.yarn/cache/uid-npm-2.0.1-e00f01a1a1-0a3c697d8d.zip/node_modules/uid/",\ + "packageDependencies": [\ + ["uid", "npm:2.0.1"],\ + ["@lukeed/csprng", "npm:1.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["unbox-primitive", [\ ["npm:1.0.2", {\ "packageLocation": "./.yarn/cache/unbox-primitive-npm-1.0.2-cb56a05066-b7a1cf5862.zip/node_modules/unbox-primitive/",\ @@ -4836,6 +5631,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["universalify", [\ + ["npm:2.0.0", {\ + "packageLocation": "./.yarn/cache/universalify-npm-2.0.0-03b8b418a8-2406a4edf4.zip/node_modules/universalify/",\ + "packageDependencies": [\ + ["universalify", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["untildify", [\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/untildify-npm-4.0.0-4a8b569825-39ced9c418.zip/node_modules/untildify/",\ @@ -4899,6 +5703,36 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["wcwidth", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/wcwidth-npm-1.0.1-05fa596453-814e9d1ddc.zip/node_modules/wcwidth/",\ + "packageDependencies": [\ + ["wcwidth", "npm:1.0.1"],\ + ["defaults", "npm:1.0.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["webidl-conversions", [\ + ["npm:3.0.1", {\ + "packageLocation": "./.yarn/cache/webidl-conversions-npm-3.0.1-60310f6a2b-c92a0a6ab9.zip/node_modules/webidl-conversions/",\ + "packageDependencies": [\ + ["webidl-conversions", "npm:3.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["whatwg-url", [\ + ["npm:5.0.0", {\ + "packageLocation": "./.yarn/cache/whatwg-url-npm-5.0.0-374fb45e60-b8daed4ad3.zip/node_modules/whatwg-url/",\ + "packageDependencies": [\ + ["whatwg-url", "npm:5.0.0"],\ + ["tr46", "npm:0.0.3"],\ + ["webidl-conversions", "npm:3.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["which", [\ ["npm:2.0.2", {\ "packageLocation": "./.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip/node_modules/which/",\ @@ -4979,6 +5813,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["y18n", [\ + ["npm:5.0.8", {\ + "packageLocation": "./.yarn/cache/y18n-npm-5.0.8-5f3a0a7e62-54f0fb9562.zip/node_modules/y18n/",\ + "packageDependencies": [\ + ["y18n", "npm:5.0.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["yallist", [\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip/node_modules/yallist/",\ @@ -4997,6 +5840,31 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["yargs", [\ + ["npm:16.2.0", {\ + "packageLocation": "./.yarn/cache/yargs-npm-16.2.0-547873d425-b14afbb51e.zip/node_modules/yargs/",\ + "packageDependencies": [\ + ["yargs", "npm:16.2.0"],\ + ["cliui", "npm:7.0.4"],\ + ["escalade", "npm:3.1.1"],\ + ["get-caller-file", "npm:2.0.5"],\ + ["require-directory", "npm:2.1.1"],\ + ["string-width", "npm:4.2.3"],\ + ["y18n", "npm:5.0.8"],\ + ["yargs-parser", "npm:20.2.9"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["yargs-parser", [\ + ["npm:20.2.9", {\ + "packageLocation": "./.yarn/cache/yargs-parser-npm-20.2.9-a1d19e598d-8bb69015f2.zip/node_modules/yargs-parser/",\ + "packageDependencies": [\ + ["yargs-parser", "npm:20.2.9"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["yocto-queue", [\ ["npm:0.1.0", {\ "packageLocation": "./.yarn/cache/yocto-queue-npm-0.1.0-c6c9a7db29-f77b3d8d00.zip/node_modules/yocto-queue/",\ diff --git a/mta-sign-ui/app/page.tsx b/mta-sign-ui/app/page.tsx index 65aba9f..f9dd309 100644 --- a/mta-sign-ui/app/page.tsx +++ b/mta-sign-ui/app/page.tsx @@ -1,34 +1,11 @@ import Image from 'next/image' -import TitleBar from "@/components/header"; +import Header from "@/components/header"; +import Station from "@/components/trains/station"; export default function Home() { return (
- - - {/*
*/} - {/*

*/} - {/* Get started by editing */} - {/* app/page.tsx*/} - {/*

*/} - {/*
*/} - {/* */} - {/* By{' '}*/} - {/* */} - {/* */} - {/*
*/} - {/*
*/} +
+
{ +const Header = () => { const [data, setData] = useState(null); useEffect(() => { @@ -13,7 +14,6 @@ const TitleBar = () => { console.log("CALLING API") const mtaData = await fetchStartDate([""]) setData(mtaData) - } catch (error) { console.error('Error fetching data:', error); } @@ -53,4 +53,4 @@ const TitleBar = () => { ); }; -export default TitleBar; \ No newline at end of file +export default Header; \ No newline at end of file diff --git a/mta-sign-ui/components/trains/depot.tsx b/mta-sign-ui/components/trains/depot.tsx new file mode 100644 index 0000000..e69de29 diff --git a/mta-sign-ui/components/trains/line.tsx b/mta-sign-ui/components/trains/line.tsx new file mode 100644 index 0000000..127f0d4 --- /dev/null +++ b/mta-sign-ui/components/trains/line.tsx @@ -0,0 +1,32 @@ +'use client' +import React, {useEffect, useState} from 'react'; +import {fetchStartDate} from "@/services/mta-api/mta-server"; +import {MtaStartTime} from "@/services/mta-api/types"; +import Image from 'next/image'; + +const Line = () => { + // const [data, setData] = useState(null); + + // useEffect(() => { + // const fetchData = async () => { + // try { + // console.log("CALLING API") + // const mtaData = await fetchStartDate([""]) + // setData(mtaData) + // + // } catch (error) { + // console.error('Error fetching data:', error); + // } + // }; + // + // fetchData(); + // }, []); + + return ( +
+ TRAIN LINE HERE +
+ ); +}; + +export default Line; \ No newline at end of file diff --git a/mta-sign-ui/components/trains/station.tsx b/mta-sign-ui/components/trains/station.tsx new file mode 100644 index 0000000..15075ab --- /dev/null +++ b/mta-sign-ui/components/trains/station.tsx @@ -0,0 +1,43 @@ +'use client' +import React, {useEffect, useState} from 'react'; +import {fetchStationData} from "@/services/mta-api/mta-server"; +import {MtaData,} from "@/services/mta-api/types"; + +const Station = () => { + const [data, setData] = useState(null); + + useEffect(() => { + const fetchData = async () => { + try { + console.log("CALLING API") + const mtaData = await fetchStationData([""]) + setData(mtaData) + + } catch (error) { + console.error('Error fetching data:', error); + } + }; + + fetchData(); + }, []); + + return ( +
+
+
+ + {data ? ( +

Train Line {data.mtaData.toLocaleString()}

+ + ) : ( +

Loading data...

+ )} + +

Updated + At: {new Date().toLocaleString("en-US")}

+
+
+ ); +}; + +export default Station; \ No newline at end of file diff --git a/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator-ignore b/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator/FILES b/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator/FILES new file mode 100644 index 0000000..b45ab4d --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator/FILES @@ -0,0 +1,13 @@ +apis/ConfigApi.ts +apis/MtaDataApi.ts +apis/StartApi.ts +apis/index.ts +index.ts +models/AllStationModel.ts +models/HTTPValidationError.ts +models/Route.ts +models/RouteResponse.ts +models/StationResponse.ts +models/ValidationError.ts +models/index.ts +runtime.ts diff --git a/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator/VERSION b/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator/VERSION new file mode 100644 index 0000000..cd802a1 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/mta-sign-ui/gen-sources/mta-sign-api/apis/ConfigApi.ts b/mta-sign-ui/gen-sources/mta-sign-api/apis/ConfigApi.ts new file mode 100644 index 0000000..a844fb4 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/apis/ConfigApi.ts @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; + +/** + * + */ +export class ConfigApi extends runtime.BaseAPI { + + /** + * Get All + */ + async getAllApiConfigGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/config`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Get All + */ + async getAllApiConfigGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAllApiConfigGetRaw(initOverrides); + return await response.value(); + } + +} diff --git a/mta-sign-ui/gen-sources/mta-sign-api/apis/MtaDataApi.ts b/mta-sign-ui/gen-sources/mta-sign-api/apis/MtaDataApi.ts new file mode 100644 index 0000000..1cb53fc --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/apis/MtaDataApi.ts @@ -0,0 +1,141 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AllStationModel, + HTTPValidationError, + Route, + RouteResponse, + StationResponse, +} from '../models'; +import { + AllStationModelFromJSON, + AllStationModelToJSON, + HTTPValidationErrorFromJSON, + HTTPValidationErrorToJSON, + RouteFromJSON, + RouteToJSON, + RouteResponseFromJSON, + RouteResponseToJSON, + StationResponseFromJSON, + StationResponseToJSON, +} from '../models'; + +export interface GetRouteApiMtaStopIdRoutePostRequest { + stopId: any; + route: Route; +} + +export interface GetStationApiMtaStopIdPostRequest { + stopId: any; +} + +/** + * + */ +export class MtaDataApi extends runtime.BaseAPI { + + /** + * Get All + */ + async getAllApiMtaPostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/mta`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AllStationModelFromJSON(jsonValue)); + } + + /** + * Get All + */ + async getAllApiMtaPost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAllApiMtaPostRaw(initOverrides); + return await response.value(); + } + + /** + * Get Route + */ + async getRouteApiMtaStopIdRoutePostRaw(requestParameters: GetRouteApiMtaStopIdRoutePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.stopId === null || requestParameters.stopId === undefined) { + throw new runtime.RequiredError('stopId','Required parameter requestParameters.stopId was null or undefined when calling getRouteApiMtaStopIdRoutePost.'); + } + + if (requestParameters.route === null || requestParameters.route === undefined) { + throw new runtime.RequiredError('route','Required parameter requestParameters.route was null or undefined when calling getRouteApiMtaStopIdRoutePost.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/mta/{stop_id}/{route}`.replace(`{${"stop_id"}}`, encodeURIComponent(String(requestParameters.stopId))).replace(`{${"route"}}`, encodeURIComponent(String(requestParameters.route))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RouteResponseFromJSON(jsonValue)); + } + + /** + * Get Route + */ + async getRouteApiMtaStopIdRoutePost(requestParameters: GetRouteApiMtaStopIdRoutePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getRouteApiMtaStopIdRoutePostRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get Station + */ + async getStationApiMtaStopIdPostRaw(requestParameters: GetStationApiMtaStopIdPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.stopId === null || requestParameters.stopId === undefined) { + throw new runtime.RequiredError('stopId','Required parameter requestParameters.stopId was null or undefined when calling getStationApiMtaStopIdPost.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/mta/{stop_id}`.replace(`{${"stop_id"}}`, encodeURIComponent(String(requestParameters.stopId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => StationResponseFromJSON(jsonValue)); + } + + /** + * Get Station + */ + async getStationApiMtaStopIdPost(requestParameters: GetStationApiMtaStopIdPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getStationApiMtaStopIdPostRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/mta-sign-ui/gen-sources/mta-sign-api/apis/StartApi.ts b/mta-sign-ui/gen-sources/mta-sign-api/apis/StartApi.ts new file mode 100644 index 0000000..cb59861 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/apis/StartApi.ts @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; + +/** + * + */ +export class StartApi extends runtime.BaseAPI { + + /** + * Get Start Time + */ + async getStartTimeApiStartTimePostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/start_time`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Get Start Time + */ + async getStartTimeApiStartTimePost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getStartTimeApiStartTimePostRaw(initOverrides); + return await response.value(); + } + +} diff --git a/mta-sign-ui/gen-sources/mta-sign-api/apis/index.ts b/mta-sign-ui/gen-sources/mta-sign-api/apis/index.ts new file mode 100644 index 0000000..2b59fad --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/apis/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './ConfigApi'; +export * from './MtaDataApi'; +export * from './StartApi'; diff --git a/mta-sign-ui/gen-sources/mta-sign-api/index.ts b/mta-sign-ui/gen-sources/mta-sign-api/index.ts new file mode 100644 index 0000000..be9d1ed --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis'; +export * from './models'; diff --git a/mta-sign-ui/gen-sources/mta-sign-api/models/AllStationModel.ts b/mta-sign-ui/gen-sources/mta-sign-api/models/AllStationModel.ts new file mode 100644 index 0000000..ea88b36 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/models/AllStationModel.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StationResponse } from './StationResponse'; +import { + StationResponseFromJSON, + StationResponseFromJSONTyped, + StationResponseToJSON, +} from './StationResponse'; + +/** + * + * @export + * @interface AllStationModel + */ +export interface AllStationModel { + /** + * + * @type {{ [key: string]: StationResponse; }} + * @memberof AllStationModel + */ + stations: { [key: string]: StationResponse; } | null; +} + +/** + * Check if a given object implements the AllStationModel interface. + */ +export function instanceOfAllStationModel(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "stations" in value; + + return isInstance; +} + +export function AllStationModelFromJSON(json: any): AllStationModel { + return AllStationModelFromJSONTyped(json, false); +} + +export function AllStationModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): AllStationModel { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'stations': { [key: string]: StationResponse; }FromJSON(json['stations']), + }; +} + +export function AllStationModelToJSON(value?: AllStationModel | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'stations': { [key: string]: StationResponse; }ToJSON(value.stations), + }; +} + diff --git a/mta-sign-ui/gen-sources/mta-sign-api/models/HTTPValidationError.ts b/mta-sign-ui/gen-sources/mta-sign-api/models/HTTPValidationError.ts new file mode 100644 index 0000000..9b84039 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/models/HTTPValidationError.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface HTTPValidationError + */ +export interface HTTPValidationError { + /** + * + * @type {any} + * @memberof HTTPValidationError + */ + detail?: any | null; +} + +/** + * Check if a given object implements the HTTPValidationError interface. + */ +export function instanceOfHTTPValidationError(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function HTTPValidationErrorFromJSON(json: any): HTTPValidationError { + return HTTPValidationErrorFromJSONTyped(json, false); +} + +export function HTTPValidationErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): HTTPValidationError { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'detail': !exists(json, 'detail') ? undefined : json['detail'], + }; +} + +export function HTTPValidationErrorToJSON(value?: HTTPValidationError | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'detail': value.detail, + }; +} + diff --git a/mta-sign-ui/gen-sources/mta-sign-api/models/Route.ts b/mta-sign-ui/gen-sources/mta-sign-api/models/Route.ts new file mode 100644 index 0000000..9dff57e --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/models/Route.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * An enumeration. + * @export + * @interface Route + */ +export interface Route { +} + +/** + * Check if a given object implements the Route interface. + */ +export function instanceOfRoute(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function RouteFromJSON(json: any): Route { + return RouteFromJSONTyped(json, false); +} + +export function RouteFromJSONTyped(json: any, ignoreDiscriminator: boolean): Route { + return json; +} + +export function RouteToJSON(value?: Route | null): any { + return value; +} + diff --git a/mta-sign-ui/gen-sources/mta-sign-api/models/RouteResponse.ts b/mta-sign-ui/gen-sources/mta-sign-api/models/RouteResponse.ts new file mode 100644 index 0000000..81325f1 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/models/RouteResponse.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface RouteResponse + */ +export interface RouteResponse { + /** + * + * @type {any} + * @memberof RouteResponse + */ + arrivalTimes: any | null; +} + +/** + * Check if a given object implements the RouteResponse interface. + */ +export function instanceOfRouteResponse(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "arrivalTimes" in value; + + return isInstance; +} + +export function RouteResponseFromJSON(json: any): RouteResponse { + return RouteResponseFromJSONTyped(json, false); +} + +export function RouteResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RouteResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'arrivalTimes': json['arrival_times'], + }; +} + +export function RouteResponseToJSON(value?: RouteResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'arrival_times': value.arrivalTimes, + }; +} + diff --git a/mta-sign-ui/gen-sources/mta-sign-api/models/StationResponse.ts b/mta-sign-ui/gen-sources/mta-sign-api/models/StationResponse.ts new file mode 100644 index 0000000..8e9467b --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/models/StationResponse.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { RouteResponse } from './RouteResponse'; +import { + RouteResponseFromJSON, + RouteResponseFromJSONTyped, + RouteResponseToJSON, +} from './RouteResponse'; + +/** + * + * @export + * @interface StationResponse + */ +export interface StationResponse { + /** + * + * @type {{ [key: string]: RouteResponse; }} + * @memberof StationResponse + */ + routes: { [key: string]: RouteResponse; } | null; +} + +/** + * Check if a given object implements the StationResponse interface. + */ +export function instanceOfStationResponse(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "routes" in value; + + return isInstance; +} + +export function StationResponseFromJSON(json: any): StationResponse { + return StationResponseFromJSONTyped(json, false); +} + +export function StationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StationResponse { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'routes': { [key: string]: RouteResponse; }FromJSON(json['routes']), + }; +} + +export function StationResponseToJSON(value?: StationResponse | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'routes': { [key: string]: RouteResponse; }ToJSON(value.routes), + }; +} + diff --git a/mta-sign-ui/gen-sources/mta-sign-api/models/ValidationError.ts b/mta-sign-ui/gen-sources/mta-sign-api/models/ValidationError.ts new file mode 100644 index 0000000..7354fda --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/models/ValidationError.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ValidationError + */ +export interface ValidationError { + /** + * + * @type {any} + * @memberof ValidationError + */ + loc: any | null; + /** + * + * @type {any} + * @memberof ValidationError + */ + msg: any | null; + /** + * + * @type {any} + * @memberof ValidationError + */ + type: any | null; +} + +/** + * Check if a given object implements the ValidationError interface. + */ +export function instanceOfValidationError(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "loc" in value; + isInstance = isInstance && "msg" in value; + isInstance = isInstance && "type" in value; + + return isInstance; +} + +export function ValidationErrorFromJSON(json: any): ValidationError { + return ValidationErrorFromJSONTyped(json, false); +} + +export function ValidationErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationError { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'loc': json['loc'], + 'msg': json['msg'], + 'type': json['type'], + }; +} + +export function ValidationErrorToJSON(value?: ValidationError | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'loc': value.loc, + 'msg': value.msg, + 'type': value.type, + }; +} + diff --git a/mta-sign-ui/gen-sources/mta-sign-api/models/index.ts b/mta-sign-ui/gen-sources/mta-sign-api/models/index.ts new file mode 100644 index 0000000..6eb0a22 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/models/index.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AllStationModel'; +export * from './HTTPValidationError'; +export * from './Route'; +export * from './RouteResponse'; +export * from './StationResponse'; +export * from './ValidationError'; diff --git a/mta-sign-ui/gen-sources/mta-sign-api/openapi.json b/mta-sign-ui/gen-sources/mta-sign-api/openapi.json new file mode 100644 index 0000000..5f76ed3 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/openapi.json @@ -0,0 +1,287 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "FastAPI", + "version": "0.1.0" + }, + "paths": { + "/api/start_time": { + "post": { + "tags": [ + "start" + ], + "summary": "Get Start Time", + "operationId": "get_start_time_api_start_time_post", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/api/mta/{stop_id}/{route}": { + "post": { + "tags": [ + "mta-data" + ], + "summary": "Get Route", + "operationId": "get_route_api_mta__stop_id___route__post", + "parameters": [ + { + "required": true, + "schema": { + "type": "string", + "title": "Stop Id" + }, + "name": "stop_id", + "in": "path" + }, + { + "required": true, + "schema": { + "$ref": "#/components/schemas/Route" + }, + "name": "route", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RouteResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/mta/{stop_id}": { + "post": { + "tags": [ + "mta-data" + ], + "summary": "Get Station", + "operationId": "get_station_api_mta__stop_id__post", + "parameters": [ + { + "required": true, + "schema": { + "type": "string", + "title": "Stop Id" + }, + "name": "stop_id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StationResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/mta": { + "post": { + "tags": [ + "mta-data" + ], + "summary": "Get All", + "operationId": "get_all_api_mta_post", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllStationModel" + } + } + } + } + } + } + }, + "/api/config": { + "get": { + "tags": [ + "config" + ], + "summary": "Get All", + "operationId": "get_all_api_config_get", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AllStationModel": { + "properties": { + "stations": { + "additionalProperties": { + "$ref": "#/components/schemas/StationResponse" + }, + "type": "object", + "title": "Stations" + } + }, + "type": "object", + "required": [ + "stations" + ], + "title": "AllStationModel" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "Route": { + "enum": [ + "A", + "C", + "E", + "B", + "D", + "F", + "M", + "G", + "J", + "Z", + "N", + "Q", + "R", + "W", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "L", + "SIR" + ], + "title": "Route", + "description": "An enumeration." + }, + "RouteResponse": { + "properties": { + "arrival_times": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Arrival Times" + } + }, + "type": "object", + "required": [ + "arrival_times" + ], + "title": "RouteResponse" + }, + "StationResponse": { + "properties": { + "routes": { + "additionalProperties": { + "$ref": "#/components/schemas/RouteResponse" + }, + "type": "object", + "title": "Routes" + } + }, + "type": "object", + "required": [ + "routes" + ], + "title": "StationResponse" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + } + } + } +} \ No newline at end of file diff --git a/mta-sign-ui/gen-sources/mta-sign-api/runtime.ts b/mta-sign-ui/gen-sources/mta-sign-api/runtime.ts new file mode 100644 index 0000000..194e250 --- /dev/null +++ b/mta-sign-ui/gen-sources/mta-sign-api/runtime.ts @@ -0,0 +1,425 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | ((name: string) => string); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + const init: RequestInit = { + ...overriddenInit, + body: + isFormData(overriddenInit.body) || + overriddenInit.body instanceof URLSearchParams || + isBlob(overriddenInit.body) + ? overriddenInit.body + : JSON.stringify(overriddenInit.body), + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/mta-sign-ui/openapitools.json b/mta-sign-ui/openapitools.json new file mode 100644 index 0000000..ea9faa0 --- /dev/null +++ b/mta-sign-ui/openapitools.json @@ -0,0 +1,15 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "6.6.0", + "generators": { + "mta-sign-api": { + "generatorName": "typescript-fetch", + "output": "#{cwd}/gen-sources/mta-sign-api/", + "glob": "gen-sources/mta-sign-api/openapi.{json,yaml}", + "additionalProperties": "supportsES6=true,typescriptThreePlus=true" + } + } + } +} diff --git a/mta-sign-ui/package.json b/mta-sign-ui/package.json index 39a9b87..1308a0c 100644 --- a/mta-sign-ui/package.json +++ b/mta-sign-ui/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "gen-apis": "curl localhost:8000/openapi.json -O --output-dir ./gen-sources/mta-sign-api && openapi-generator-cli generate" }, "dependencies": { "@types/node": "20.4.1", @@ -23,5 +24,8 @@ "tailwindcss": "3.3.2", "typescript": "5.1.6" }, - "packageManager": "yarn@3.6.1" + "packageManager": "yarn@3.6.1", + "devDependencies": { + "@openapitools/openapi-generator-cli": "^2.6.0" + } } diff --git a/mta-sign-ui/services/mta-api/mta-server.ts b/mta-sign-ui/services/mta-api/mta-server.ts index ac4dc8f..192f94e 100644 --- a/mta-sign-ui/services/mta-api/mta-server.ts +++ b/mta-sign-ui/services/mta-api/mta-server.ts @@ -1,7 +1,7 @@ import {MtaData, MtaStartTime} from "@/services/mta-api/types"; export const fetchStationData = async (stations: [string]): Promise => { - const res = await fetch("/api/mta_data", {method: "POST"}) + const res = await fetch("/api/mta", {method: "POST"}) const data = await res.json() return { mtaData: data diff --git a/mta-sign-ui/tailwind.config.js b/mta-sign-ui/tailwind.config.js index 8c4d1b2..895faf7 100644 --- a/mta-sign-ui/tailwind.config.js +++ b/mta-sign-ui/tailwind.config.js @@ -3,7 +3,7 @@ module.exports = { content: [ './pages/**/*.{js,ts,jsx,tsx,mdx}', './components/**/*.{js,ts,jsx,tsx,mdx}', - './app/**/*.{js,ts,jsx,tsx,mdx}', + './mta_sign_server/**/*.{js,ts,jsx,tsx,mdx}', ], theme: { extend: { diff --git a/mta-sign-ui/yarn.lock b/mta-sign-ui/yarn.lock index 351ccd6..544f35c 100644 --- a/mta-sign-ui/yarn.lock +++ b/mta-sign-ui/yarn.lock @@ -19,7 +19,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.20.7": +"@babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.21.0": version: 7.22.6 resolution: "@babel/runtime@npm:7.22.6" dependencies: @@ -158,6 +158,78 @@ __metadata: languageName: node linkType: hard +"@lukeed/csprng@npm:^1.0.0": + version: 1.1.0 + resolution: "@lukeed/csprng@npm:1.1.0" + checksum: 926f5f7fc629470ca9a8af355bfcd0271d34535f7be3890f69902432bddc3262029bb5dbe9025542cf6c9883d878692eef2815fc2f3ba5b92e9da1f9eba2e51b + languageName: node + linkType: hard + +"@nestjs/axios@npm:0.0.8": + version: 0.0.8 + resolution: "@nestjs/axios@npm:0.0.8" + dependencies: + axios: 0.27.2 + peerDependencies: + "@nestjs/common": ^7.0.0 || ^8.0.0 + reflect-metadata: ^0.1.12 + rxjs: ^6.0.0 || ^7.0.0 + checksum: bc6b18c6e8bcfab1e8e9371a089cbba293a7b1df6d5de7fa15bb80db1966e6f62ba62d2b30c7378674f7d2272a1a1d0c694e1192c767c269c0aae04b7bdfea9b + languageName: node + linkType: hard + +"@nestjs/common@npm:9.3.11": + version: 9.3.11 + resolution: "@nestjs/common@npm:9.3.11" + dependencies: + iterare: 1.2.1 + tslib: 2.5.0 + uid: 2.0.1 + peerDependencies: + cache-manager: <=5 + class-transformer: "*" + class-validator: "*" + reflect-metadata: ^0.1.12 + rxjs: ^7.1.0 + peerDependenciesMeta: + cache-manager: + optional: true + class-transformer: + optional: true + class-validator: + optional: true + checksum: c39dfa9f02268e3f7fa22c4e9eecff0cfbee39c4d4dd0efc757a52117696dc9aec1f87588252b8b267a18469a6c12987707708b44f97ccbb5c6297396c0d9c00 + languageName: node + linkType: hard + +"@nestjs/core@npm:9.3.11": + version: 9.3.11 + resolution: "@nestjs/core@npm:9.3.11" + dependencies: + "@nuxtjs/opencollective": 0.3.2 + fast-safe-stringify: 2.1.1 + iterare: 1.2.1 + path-to-regexp: 3.2.0 + tslib: 2.5.0 + uid: 2.0.1 + peerDependencies: + "@nestjs/common": ^9.0.0 + "@nestjs/microservices": ^9.0.0 + "@nestjs/platform-express": ^9.0.0 + "@nestjs/websockets": ^9.0.0 + reflect-metadata: ^0.1.12 + rxjs: ^7.1.0 + peerDependenciesMeta: + "@nestjs/microservices": + optional: true + "@nestjs/platform-express": + optional: true + "@nestjs/websockets": + optional: true + checksum: 39d49e5b16cc260887233dd6701dbc53c073dc7522975d592f6c355db1f42fcf31eeaf300b9d03c63943f7330ecee910281cb78bb66d1c2d938d9b13491e70b4 + languageName: node + linkType: hard + "@next/env@npm:13.4.9": version: 13.4.9 resolution: "@next/env@npm:13.4.9" @@ -273,6 +345,45 @@ __metadata: languageName: node linkType: hard +"@nuxtjs/opencollective@npm:0.3.2": + version: 0.3.2 + resolution: "@nuxtjs/opencollective@npm:0.3.2" + dependencies: + chalk: ^4.1.0 + consola: ^2.15.0 + node-fetch: ^2.6.1 + bin: + opencollective: bin/opencollective.js + checksum: fd3737c12edf55b5c2279674664c3ed5e756410ea82e9cd324c3f0e032ed5ccd8df1959ec69ea97f2f1c9c33c884aae3d7a7108a73ea0faa90d74ea47cf364d4 + languageName: node + linkType: hard + +"@openapitools/openapi-generator-cli@npm:^2.6.0": + version: 2.6.0 + resolution: "@openapitools/openapi-generator-cli@npm:2.6.0" + dependencies: + "@nestjs/axios": 0.0.8 + "@nestjs/common": 9.3.11 + "@nestjs/core": 9.3.11 + "@nuxtjs/opencollective": 0.3.2 + chalk: 4.1.2 + commander: 8.3.0 + compare-versions: 4.1.4 + concurrently: 6.5.1 + console.table: 0.10.0 + fs-extra: 10.1.0 + glob: 7.1.6 + inquirer: 8.2.5 + lodash: 4.17.21 + reflect-metadata: 0.1.13 + rxjs: 7.8.0 + tslib: 2.0.3 + bin: + openapi-generator-cli: main.js + checksum: d60711b0fc018f4834faa28be8990a6d019d87be9cd8c8f7f1a2f5dfb863044b1f80bc0841caceffa76f6eec3e756291e3b8e81a00d42ca883974703b616097f + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -494,6 +605,15 @@ __metadata: languageName: node linkType: hard +"ansi-escapes@npm:^4.2.1": + version: 4.3.2 + resolution: "ansi-escapes@npm:4.3.2" + dependencies: + type-fest: ^0.21.3 + checksum: 93111c42189c0a6bed9cdb4d7f2829548e943827ee8479c74d6e0b22ee127b2a21d3f8b5ca57723b8ef78ce011fbfc2784350eb2bde3ccfccf2f575fa8489815 + languageName: node + linkType: hard + "ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" @@ -655,6 +775,13 @@ __metadata: languageName: node linkType: hard +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be + languageName: node + linkType: hard + "autoprefixer@npm:10.4.14": version: 10.4.14 resolution: "autoprefixer@npm:10.4.14" @@ -687,6 +814,16 @@ __metadata: languageName: node linkType: hard +"axios@npm:0.27.2": + version: 0.27.2 + resolution: "axios@npm:0.27.2" + dependencies: + follow-redirects: ^1.14.9 + form-data: ^4.0.0 + checksum: 38cb7540465fe8c4102850c4368053c21683af85c5fdf0ea619f9628abbcb59415d1e22ebc8a6390d2bbc9b58a9806c874f139767389c862ec9b772235f06854 + languageName: node + linkType: hard + "axobject-query@npm:^3.1.1": version: 3.2.1 resolution: "axobject-query@npm:3.2.1" @@ -703,6 +840,13 @@ __metadata: languageName: node linkType: hard +"base64-js@npm:^1.3.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 + languageName: node + linkType: hard + "big-integer@npm:^1.6.44": version: 1.6.51 resolution: "big-integer@npm:1.6.51" @@ -717,6 +861,17 @@ __metadata: languageName: node linkType: hard +"bl@npm:^4.1.0": + version: 4.1.0 + resolution: "bl@npm:4.1.0" + dependencies: + buffer: ^5.5.0 + inherits: ^2.0.4 + readable-stream: ^3.4.0 + checksum: 9e8521fa7e83aa9427c6f8ccdcba6e8167ef30cc9a22df26effcc5ab682ef91d2cbc23a239f945d099289e4bbcfae7a192e9c28c84c6202e710a0dfec3722662 + languageName: node + linkType: hard + "bplist-parser@npm:^0.2.0": version: 0.2.0 resolution: "bplist-parser@npm:0.2.0" @@ -768,6 +923,16 @@ __metadata: languageName: node linkType: hard +"buffer@npm:^5.5.0": + version: 5.7.1 + resolution: "buffer@npm:5.7.1" + dependencies: + base64-js: ^1.3.1 + ieee754: ^1.1.13 + checksum: e2cf8429e1c4c7b8cbd30834ac09bd61da46ce35f5c22a78e6c2f04497d6d25541b16881e30a019c6fd3154150650ccee27a308eff3e26229d788bbdeb08ab84 + languageName: node + linkType: hard + "bundle-name@npm:^3.0.0": version: 3.0.0 resolution: "bundle-name@npm:3.0.0" @@ -837,7 +1002,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^4.0.0": +"chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -847,6 +1012,13 @@ __metadata: languageName: node linkType: hard +"chardet@npm:^0.7.0": + version: 0.7.0 + resolution: "chardet@npm:0.7.0" + checksum: 6fd5da1f5d18ff5712c1e0aed41da200d7c51c28f11b36ee3c7b483f3696dabc08927fc6b227735eb8f0e1215c9a8abd8154637f3eff8cada5959df7f58b024d + languageName: node + linkType: hard + "chokidar@npm:^3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -880,6 +1052,29 @@ __metadata: languageName: node linkType: hard +"cli-cursor@npm:^3.1.0": + version: 3.1.0 + resolution: "cli-cursor@npm:3.1.0" + dependencies: + restore-cursor: ^3.1.0 + checksum: 2692784c6cd2fd85cfdbd11f53aea73a463a6d64a77c3e098b2b4697a20443f430c220629e1ca3b195ea5ac4a97a74c2ee411f3807abf6df2b66211fec0c0a29 + languageName: node + linkType: hard + +"cli-spinners@npm:^2.5.0": + version: 2.9.0 + resolution: "cli-spinners@npm:2.9.0" + checksum: a9c56e1f44457d4a9f4f535364e729cb8726198efa9e98990cfd9eda9e220dfa4ba12f92808d1be5e29029cdfead781db82dc8549b97b31c907d55f96aa9b0e2 + languageName: node + linkType: hard + +"cli-width@npm:^3.0.0": + version: 3.0.0 + resolution: "cli-width@npm:3.0.0" + checksum: 4c94af3769367a70e11ed69aa6095f1c600c0ff510f3921ab4045af961820d57c0233acfa8b6396037391f31b4c397e1f614d234294f979ff61430a6c166c3f6 + languageName: node + linkType: hard + "client-only@npm:0.0.1": version: 0.0.1 resolution: "client-only@npm:0.0.1" @@ -887,6 +1082,24 @@ __metadata: languageName: node linkType: hard +"cliui@npm:^7.0.2": + version: 7.0.4 + resolution: "cliui@npm:7.0.4" + dependencies: + string-width: ^4.2.0 + strip-ansi: ^6.0.0 + wrap-ansi: ^7.0.0 + checksum: ce2e8f578a4813806788ac399b9e866297740eecd4ad1823c27fd344d78b22c5f8597d548adbcc46f0573e43e21e751f39446c5a5e804a12aace402b7a315d7f + languageName: node + linkType: hard + +"clone@npm:^1.0.2": + version: 1.0.4 + resolution: "clone@npm:1.0.4" + checksum: d06418b7335897209e77bdd430d04f882189582e67bd1f75a04565f3f07f5b3f119a9d670c943b6697d0afb100f03b866b3b8a1f91d4d02d72c4ecf2bb64b5dd + languageName: node + linkType: hard + "color-convert@npm:^2.0.1": version: 2.0.1 resolution: "color-convert@npm:2.0.1" @@ -912,6 +1125,22 @@ __metadata: languageName: node linkType: hard +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: ~1.0.0 + checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c + languageName: node + linkType: hard + +"commander@npm:8.3.0": + version: 8.3.0 + resolution: "commander@npm:8.3.0" + checksum: 0f82321821fc27b83bd409510bb9deeebcfa799ff0bf5d102128b500b7af22872c0c92cb6a0ebc5a4cf19c6b550fba9cedfa7329d18c6442a625f851377bacf0 + languageName: node + linkType: hard + "commander@npm:^4.0.0": version: 4.1.1 resolution: "commander@npm:4.1.1" @@ -919,6 +1148,13 @@ __metadata: languageName: node linkType: hard +"compare-versions@npm:4.1.4": + version: 4.1.4 + resolution: "compare-versions@npm:4.1.4" + checksum: c1617544b79c2f36a1d543c50efd0da1a994040294c8923218080bc0df46da83ca414e3378282e93cab073744995124946417d130d8987e8efb5d1a73c0c4ba6 + languageName: node + linkType: hard + "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -926,6 +1162,31 @@ __metadata: languageName: node linkType: hard +"concurrently@npm:6.5.1": + version: 6.5.1 + resolution: "concurrently@npm:6.5.1" + dependencies: + chalk: ^4.1.0 + date-fns: ^2.16.1 + lodash: ^4.17.21 + rxjs: ^6.6.3 + spawn-command: ^0.0.2-1 + supports-color: ^8.1.0 + tree-kill: ^1.2.2 + yargs: ^16.2.0 + bin: + concurrently: bin/concurrently.js + checksum: 3f4d89b464fa5c9fb6f9489b46594c30ba54eff6ff10ab3cb5f30f64b74c83be664623a0f0cc731a3cb3f057a1f4a3292f7d3470c012a292c44aca31f214a3fa + languageName: node + linkType: hard + +"consola@npm:^2.15.0": + version: 2.15.3 + resolution: "consola@npm:2.15.3" + checksum: 8ef7a09b703ec67ac5c389a372a33b6dc97eda6c9876443a60d76a3076eea0259e7f67a4e54fd5a52f97df73690822d090cf8b7e102b5761348afef7c6d03e28 + languageName: node + linkType: hard + "console-control-strings@npm:^1.1.0": version: 1.1.0 resolution: "console-control-strings@npm:1.1.0" @@ -933,6 +1194,15 @@ __metadata: languageName: node linkType: hard +"console.table@npm:0.10.0": + version: 0.10.0 + resolution: "console.table@npm:0.10.0" + dependencies: + easy-table: 1.1.0 + checksum: 4c1460e3105a5f7df5bfa372844104a20e487fc0fccc5821c169a39def3249759554fc132621074ad6695664a1a8d558dd385c0e7f290acb2eaca51466474bb9 + languageName: node + linkType: hard + "cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" @@ -967,6 +1237,15 @@ __metadata: languageName: node linkType: hard +"date-fns@npm:^2.16.1": + version: 2.30.0 + resolution: "date-fns@npm:2.30.0" + dependencies: + "@babel/runtime": ^7.21.0 + checksum: f7be01523282e9bb06c0cd2693d34f245247a29098527d4420628966a2d9aad154bd0e90a6b1cf66d37adcb769cd108cf8a7bd49d76db0fb119af5cdd13644f4 + languageName: node + linkType: hard + "debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -1017,6 +1296,15 @@ __metadata: languageName: node linkType: hard +"defaults@npm:^1.0.3": + version: 1.0.4 + resolution: "defaults@npm:1.0.4" + dependencies: + clone: ^1.0.2 + checksum: 3a88b7a587fc076b84e60affad8b85245c01f60f38fc1d259e7ac1d89eb9ce6abb19e27215de46b98568dd5bc48471730b327637e6f20b0f1bc85cf00440c80a + languageName: node + linkType: hard + "define-lazy-prop@npm:^3.0.0": version: 3.0.0 resolution: "define-lazy-prop@npm:3.0.0" @@ -1034,6 +1322,13 @@ __metadata: languageName: node linkType: hard +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 + languageName: node + linkType: hard + "delegates@npm:^1.0.0": version: 1.0.0 resolution: "delegates@npm:1.0.0" @@ -1103,6 +1398,18 @@ __metadata: languageName: node linkType: hard +"easy-table@npm:1.1.0": + version: 1.1.0 + resolution: "easy-table@npm:1.1.0" + dependencies: + wcwidth: ">=1.0.1" + dependenciesMeta: + wcwidth: + optional: true + checksum: 49b960fefe5670076773824386f22070dce185ebc0a99542035496700cc39a0b9346f65fd4307f5fe3dbbe7e6d9c4b59966e77e32f915e0fe71de71c3d0efcf7 + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.4.431": version: 1.4.455 resolution: "electron-to-chromium@npm:1.4.455" @@ -1237,6 +1544,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^1.0.5": + version: 1.0.5 + resolution: "escape-string-regexp@npm:1.0.5" + checksum: 6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 + languageName: node + linkType: hard + "escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" @@ -1544,6 +1858,17 @@ __metadata: languageName: node linkType: hard +"external-editor@npm:^3.0.3": + version: 3.1.0 + resolution: "external-editor@npm:3.1.0" + dependencies: + chardet: ^0.7.0 + iconv-lite: ^0.4.24 + tmp: ^0.0.33 + checksum: 1c2a616a73f1b3435ce04030261bed0e22d4737e14b090bb48e58865da92529c9f2b05b893de650738d55e692d071819b45e1669259b2b354bc3154d27a698c7 + languageName: node + linkType: hard + "fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -1578,6 +1903,13 @@ __metadata: languageName: node linkType: hard +"fast-safe-stringify@npm:2.1.1": + version: 2.1.1 + resolution: "fast-safe-stringify@npm:2.1.1" + checksum: a851cbddc451745662f8f00ddb622d6766f9bd97642dabfd9a405fb0d646d69fc0b9a1243cbf67f5f18a39f40f6fa821737651ff1bceeba06c9992ca2dc5bd3d + languageName: node + linkType: hard + "fastq@npm:^1.6.0": version: 1.15.0 resolution: "fastq@npm:1.15.0" @@ -1587,6 +1919,15 @@ __metadata: languageName: node linkType: hard +"figures@npm:^3.0.0": + version: 3.2.0 + resolution: "figures@npm:3.2.0" + dependencies: + escape-string-regexp: ^1.0.5 + checksum: 85a6ad29e9aca80b49b817e7c89ecc4716ff14e3779d9835af554db91bac41c0f289c418923519392a1e582b4d10482ad282021330cd045bb7b80c84152f2a2b + languageName: node + linkType: hard + "file-entry-cache@npm:^6.0.1": version: 6.0.1 resolution: "file-entry-cache@npm:6.0.1" @@ -1632,7 +1973,7 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.15.2": +"follow-redirects@npm:^1.14.9, follow-redirects@npm:^1.15.2": version: 1.15.2 resolution: "follow-redirects@npm:1.15.2" peerDependenciesMeta: @@ -1661,6 +2002,17 @@ __metadata: languageName: node linkType: hard +"form-data@npm:^4.0.0": + version: 4.0.0 + resolution: "form-data@npm:4.0.0" + dependencies: + asynckit: ^0.4.0 + combined-stream: ^1.0.8 + mime-types: ^2.1.12 + checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c + languageName: node + linkType: hard + "fraction.js@npm:^4.2.0": version: 4.2.0 resolution: "fraction.js@npm:4.2.0" @@ -1668,6 +2020,17 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:10.1.0": + version: 10.1.0 + resolution: "fs-extra@npm:10.1.0" + dependencies: + graceful-fs: ^4.2.0 + jsonfile: ^6.0.1 + universalify: ^2.0.0 + checksum: dc94ab37096f813cc3ca12f0f1b5ad6744dfed9ed21e953d72530d103cea193c2f81584a39e9dee1bea36de5ee66805678c0dddc048e8af1427ac19c00fffc50 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -1754,6 +2117,13 @@ __metadata: languageName: node linkType: hard +"get-caller-file@npm:^2.0.5": + version: 2.0.5 + resolution: "get-caller-file@npm:2.0.5" + checksum: b9769a836d2a98c3ee734a88ba712e62703f1df31b94b784762c433c27a386dd6029ff55c2a920c392e33657d80191edbf18c61487e198844844516f843496b9 + languageName: node + linkType: hard + "get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0": version: 1.2.1 resolution: "get-intrinsic@npm:1.2.1" @@ -1928,7 +2298,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": +"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 @@ -2055,6 +2425,15 @@ __metadata: languageName: node linkType: hard +"iconv-lite@npm:^0.4.24": + version: 0.4.24 + resolution: "iconv-lite@npm:0.4.24" + dependencies: + safer-buffer: ">= 2.1.2 < 3" + checksum: bd9f120f5a5b306f0bc0b9ae1edeb1577161503f5f8252a20f1a9e56ef8775c9959fd01c55f2d3a39d9a8abaf3e30c1abeb1895f367dcbbe0a8fd1c9ca01c4f6 + languageName: node + linkType: hard + "iconv-lite@npm:^0.6.2": version: 0.6.3 resolution: "iconv-lite@npm:0.6.3" @@ -2064,6 +2443,13 @@ __metadata: languageName: node linkType: hard +"ieee754@npm:^1.1.13": + version: 1.2.1 + resolution: "ieee754@npm:1.2.1" + checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e + languageName: node + linkType: hard + "ignore@npm:^5.2.0, ignore@npm:^5.2.4": version: 5.2.4 resolution: "ignore@npm:5.2.4" @@ -2105,13 +2491,36 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.3": +"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 languageName: node linkType: hard +"inquirer@npm:8.2.5": + version: 8.2.5 + resolution: "inquirer@npm:8.2.5" + dependencies: + ansi-escapes: ^4.2.1 + chalk: ^4.1.1 + cli-cursor: ^3.1.0 + cli-width: ^3.0.0 + external-editor: ^3.0.3 + figures: ^3.0.0 + lodash: ^4.17.21 + mute-stream: 0.0.8 + ora: ^5.4.1 + run-async: ^2.4.0 + rxjs: ^7.5.5 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + through: ^2.3.6 + wrap-ansi: ^7.0.0 + checksum: f13ee4c444187786fb393609dedf6b30870115a57b603f2e6424f29a99abc13446fd45ee22461c33c9c40a92a60a8df62d0d6b25d74fc6676fa4cb211de55b55 + languageName: node + linkType: hard + "internal-slot@npm:^1.0.3, internal-slot@npm:^1.0.5": version: 1.0.5 resolution: "internal-slot@npm:1.0.5" @@ -2246,6 +2655,13 @@ __metadata: languageName: node linkType: hard +"is-interactive@npm:^1.0.0": + version: 1.0.0 + resolution: "is-interactive@npm:1.0.0" + checksum: 824808776e2d468b2916cdd6c16acacebce060d844c35ca6d82267da692e92c3a16fdba624c50b54a63f38bdc4016055b6f443ce57d7147240de4f8cdabaf6f9 + languageName: node + linkType: hard + "is-lambda@npm:^1.0.1": version: 1.0.1 resolution: "is-lambda@npm:1.0.1" @@ -2347,6 +2763,13 @@ __metadata: languageName: node linkType: hard +"is-unicode-supported@npm:^0.1.0": + version: 0.1.0 + resolution: "is-unicode-supported@npm:0.1.0" + checksum: a2aab86ee7712f5c2f999180daaba5f361bdad1efadc9610ff5b8ab5495b86e4f627839d085c6530363c6d6d4ecbde340fb8e54bdb83da4ba8e0865ed5513c52 + languageName: node + linkType: hard + "is-weakref@npm:^1.0.2": version: 1.0.2 resolution: "is-weakref@npm:1.0.2" @@ -2372,6 +2795,13 @@ __metadata: languageName: node linkType: hard +"iterare@npm:1.2.1": + version: 1.2.1 + resolution: "iterare@npm:1.2.1" + checksum: 70bc80038e3718aa9072bc63b3a0135166d7120bde46bfcaf80a88d11005dcef1b2d69cd353849f87a3f58ba8f546a8c6e6983408236ff01fa50b52339ee5223 + languageName: node + linkType: hard + "jackspeak@npm:^2.0.3": version: 2.2.1 resolution: "jackspeak@npm:2.2.1" @@ -2437,6 +2867,19 @@ __metadata: languageName: node linkType: hard +"jsonfile@npm:^6.0.1": + version: 6.1.0 + resolution: "jsonfile@npm:6.1.0" + dependencies: + graceful-fs: ^4.1.6 + universalify: ^2.0.0 + dependenciesMeta: + graceful-fs: + optional: true + checksum: 7af3b8e1ac8fe7f1eccc6263c6ca14e1966fcbc74b618d3c78a0a2075579487547b94f72b7a1114e844a1e15bb00d440e5d1720bfc4612d790a6f285d5ea8354 + languageName: node + linkType: hard + "jsx-ast-utils@npm:^2.4.1 || ^3.0.0, jsx-ast-utils@npm:^3.3.3": version: 3.3.4 resolution: "jsx-ast-utils@npm:3.3.4" @@ -2505,6 +2948,23 @@ __metadata: languageName: node linkType: hard +"lodash@npm:4.17.21, lodash@npm:^4.17.21": + version: 4.17.21 + resolution: "lodash@npm:4.17.21" + checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 + languageName: node + linkType: hard + +"log-symbols@npm:^4.1.0": + version: 4.1.0 + resolution: "log-symbols@npm:4.1.0" + dependencies: + chalk: ^4.1.0 + is-unicode-supported: ^0.1.0 + checksum: fce1497b3135a0198803f9f07464165e9eb83ed02ceb2273930a6f8a508951178d8cf4f0378e9d28300a2ed2bc49050995d2bd5f53ab716bb15ac84d58c6ef74 + languageName: node + linkType: hard + "loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" @@ -2586,6 +3046,22 @@ __metadata: languageName: node linkType: hard +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f + languageName: node + linkType: hard + +"mime-types@npm:^2.1.12": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: 1.52.0 + checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 + languageName: node + linkType: hard + "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -2736,6 +3212,7 @@ __metadata: version: 0.0.0-use.local resolution: "mta-sign@workspace:." dependencies: + "@openapitools/openapi-generator-cli": ^2.6.0 "@types/node": 20.4.1 "@types/react": 18.2.14 "@types/react-dom": 18.2.6 @@ -2752,6 +3229,13 @@ __metadata: languageName: unknown linkType: soft +"mute-stream@npm:0.0.8": + version: 0.0.8 + resolution: "mute-stream@npm:0.0.8" + checksum: ff48d251fc3f827e5b1206cda0ffdaec885e56057ee86a3155e1951bc940fd5f33531774b1cc8414d7668c10a8907f863f6561875ee6e8768931a62121a531a1 + languageName: node + linkType: hard + "mz@npm:^2.7.0": version: 2.7.0 resolution: "mz@npm:2.7.0" @@ -2845,6 +3329,20 @@ __metadata: languageName: node linkType: hard +"node-fetch@npm:^2.6.1": + version: 2.6.12 + resolution: "node-fetch@npm:2.6.12" + dependencies: + whatwg-url: ^5.0.0 + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: 3bc1655203d47ee8e313c0d96664b9673a3d4dd8002740318e9d27d14ef306693a4b2ef8d6525775056fd912a19e23f3ac0d7111ad8925877b7567b29a625592 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 9.4.0 resolution: "node-gyp@npm:9.4.0" @@ -3020,7 +3518,7 @@ __metadata: languageName: node linkType: hard -"onetime@npm:^5.1.2": +"onetime@npm:^5.1.0, onetime@npm:^5.1.2": version: 5.1.2 resolution: "onetime@npm:5.1.2" dependencies: @@ -3064,6 +3562,30 @@ __metadata: languageName: node linkType: hard +"ora@npm:^5.4.1": + version: 5.4.1 + resolution: "ora@npm:5.4.1" + dependencies: + bl: ^4.1.0 + chalk: ^4.1.0 + cli-cursor: ^3.1.0 + cli-spinners: ^2.5.0 + is-interactive: ^1.0.0 + is-unicode-supported: ^0.1.0 + log-symbols: ^4.1.0 + strip-ansi: ^6.0.0 + wcwidth: ^1.0.1 + checksum: 28d476ee6c1049d68368c0dc922e7225e3b5600c3ede88fade8052837f9ed342625fdaa84a6209302587c8ddd9b664f71f0759833cbdb3a4cf81344057e63c63 + languageName: node + linkType: hard + +"os-tmpdir@npm:~1.0.2": + version: 1.0.2 + resolution: "os-tmpdir@npm:1.0.2" + checksum: 5666560f7b9f10182548bf7013883265be33620b1c1b4a4d405c25be2636f970c5488ff3e6c48de75b55d02bde037249fe5dbfbb4c0fb7714953d56aed062e6d + languageName: node + linkType: hard + "p-limit@npm:^3.0.2": version: 3.1.0 resolution: "p-limit@npm:3.1.0" @@ -3145,6 +3667,13 @@ __metadata: languageName: node linkType: hard +"path-to-regexp@npm:3.2.0": + version: 3.2.0 + resolution: "path-to-regexp@npm:3.2.0" + checksum: c3d35cda3b26d9e604d789b9a1764bb9845f53ca8009d5809356b4677a3c064b0f01117a05a5b4b77bafd5ae002a82592e3f3495e885c22961f8b1dab8bd6ae7 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -3351,7 +3880,7 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^3.6.0": +"readable-stream@npm:^3.4.0, readable-stream@npm:^3.6.0": version: 3.6.2 resolution: "readable-stream@npm:3.6.2" dependencies: @@ -3371,6 +3900,13 @@ __metadata: languageName: node linkType: hard +"reflect-metadata@npm:0.1.13": + version: 0.1.13 + resolution: "reflect-metadata@npm:0.1.13" + checksum: 798d379a7b6f6455501145419505c97dd11cbc23857a386add2b9ef15963ccf15a48d9d15507afe01d4cd74116df8a213247200bac00320bd7c11ddeaa5e8fb4 + languageName: node + linkType: hard + "regenerator-runtime@npm:^0.13.11": version: 0.13.11 resolution: "regenerator-runtime@npm:0.13.11" @@ -3389,6 +3925,13 @@ __metadata: languageName: node linkType: hard +"require-directory@npm:^2.1.1": + version: 2.1.1 + resolution: "require-directory@npm:2.1.1" + checksum: fb47e70bf0001fdeabdc0429d431863e9475e7e43ea5f94ad86503d918423c1543361cc5166d713eaa7029dd7a3d34775af04764bebff99ef413111a5af18c80 + languageName: node + linkType: hard + "resolve-from@npm:^4.0.0": version: 4.0.0 resolution: "resolve-from@npm:4.0.0" @@ -3455,6 +3998,16 @@ __metadata: languageName: node linkType: hard +"restore-cursor@npm:^3.1.0": + version: 3.1.0 + resolution: "restore-cursor@npm:3.1.0" + dependencies: + onetime: ^5.1.0 + signal-exit: ^3.0.2 + checksum: f877dd8741796b909f2a82454ec111afb84eb45890eb49ac947d87991379406b3b83ff9673a46012fca0d7844bb989f45cc5b788254cf1a39b6b5a9659de0630 + languageName: node + linkType: hard + "retry@npm:^0.12.0": version: 0.12.0 resolution: "retry@npm:0.12.0" @@ -3489,6 +4042,13 @@ __metadata: languageName: node linkType: hard +"run-async@npm:^2.4.0": + version: 2.4.1 + resolution: "run-async@npm:2.4.1" + checksum: a2c88aa15df176f091a2878eb840e68d0bdee319d8d97bbb89112223259cebecb94bc0defd735662b83c2f7a30bed8cddb7d1674eb48ae7322dc602b22d03797 + languageName: node + linkType: hard + "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -3498,6 +4058,33 @@ __metadata: languageName: node linkType: hard +"rxjs@npm:7.8.0": + version: 7.8.0 + resolution: "rxjs@npm:7.8.0" + dependencies: + tslib: ^2.1.0 + checksum: 61b4d4fd323c1043d8d6ceb91f24183b28bcf5def4f01ca111511d5c6b66755bc5578587fe714ef5d67cf4c9f2e26f4490d4e1d8cabf9bd5967687835e9866a2 + languageName: node + linkType: hard + +"rxjs@npm:^6.6.3": + version: 6.6.7 + resolution: "rxjs@npm:6.6.7" + dependencies: + tslib: ^1.9.0 + checksum: bc334edef1bb8bbf56590b0b25734ba0deaf8825b703256a93714308ea36dff8a11d25533671adf8e104e5e8f256aa6fdfe39b2e248cdbd7a5f90c260acbbd1b + languageName: node + linkType: hard + +"rxjs@npm:^7.5.5": + version: 7.8.1 + resolution: "rxjs@npm:7.8.1" + dependencies: + tslib: ^2.1.0 + checksum: de4b53db1063e618ec2eca0f7965d9137cabe98cf6be9272efe6c86b47c17b987383df8574861bcced18ebd590764125a901d5506082be84a8b8e364bf05f119 + languageName: node + linkType: hard + "safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" @@ -3516,7 +4103,7 @@ __metadata: languageName: node linkType: hard -"safer-buffer@npm:>= 2.1.2 < 3.0.0": +"safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" checksum: cab8f25ae6f1434abee8d80023d7e72b598cf1327164ddab31003c51215526801e40b66c5e65d658a0af1e9d6478cadcb4c745f4bd6751f97d8644786c0978b0 @@ -3586,7 +4173,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": +"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 @@ -3649,6 +4236,13 @@ __metadata: languageName: node linkType: hard +"spawn-command@npm:^0.0.2-1": + version: 0.0.2 + resolution: "spawn-command@npm:0.0.2" + checksum: e35c5d28177b4d461d33c88cc11f6f3a5079e2b132c11e1746453bbb7a0c0b8a634f07541a2a234fa4758239d88203b758def509161b651e81958894c0b4b64b + languageName: node + linkType: hard + "ssri@npm:^10.0.0": version: 10.0.4 resolution: "ssri@npm:10.0.4" @@ -3665,7 +4259,7 @@ __metadata: languageName: node linkType: hard -"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -3834,6 +4428,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:^8.1.0": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" + dependencies: + has-flag: ^4.0.0 + checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 + languageName: node + linkType: hard + "supports-preserve-symlinks-flag@npm:^1.0.0": version: 1.0.0 resolution: "supports-preserve-symlinks-flag@npm:1.0.0" @@ -3931,6 +4534,13 @@ __metadata: languageName: node linkType: hard +"through@npm:^2.3.6": + version: 2.3.8 + resolution: "through@npm:2.3.8" + checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd + languageName: node + linkType: hard + "titleize@npm:^3.0.0": version: 3.0.0 resolution: "titleize@npm:3.0.0" @@ -3938,6 +4548,15 @@ __metadata: languageName: node linkType: hard +"tmp@npm:^0.0.33": + version: 0.0.33 + resolution: "tmp@npm:0.0.33" + dependencies: + os-tmpdir: ~1.0.2 + checksum: 902d7aceb74453ea02abbf58c203f4a8fc1cead89b60b31e354f74ed5b3fb09ea817f94fb310f884a5d16987dd9fa5a735412a7c2dd088dd3d415aa819ae3a28 + languageName: node + linkType: hard + "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -3947,6 +4566,22 @@ __metadata: languageName: node linkType: hard +"tr46@npm:~0.0.3": + version: 0.0.3 + resolution: "tr46@npm:0.0.3" + checksum: 726321c5eaf41b5002e17ffbd1fb7245999a073e8979085dacd47c4b4e8068ff5777142fc6726d6ca1fd2ff16921b48788b87225cbc57c72636f6efa8efbffe3 + languageName: node + linkType: hard + +"tree-kill@npm:^1.2.2": + version: 1.2.2 + resolution: "tree-kill@npm:1.2.2" + bin: + tree-kill: cli.js + checksum: 49117f5f410d19c84b0464d29afb9642c863bc5ba40fcb9a245d474c6d5cc64d1b177a6e6713129eb346b40aebb9d4631d967517f9fbe8251c35b21b13cd96c7 + languageName: node + linkType: hard + "ts-interface-checker@npm:^0.1.9": version: 0.1.13 resolution: "ts-interface-checker@npm:0.1.13" @@ -3966,14 +4601,28 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.8.1": +"tslib@npm:2.0.3": + version: 2.0.3 + resolution: "tslib@npm:2.0.3" + checksum: 00fcdd1f9995c9f8eb6a4a1ad03f55bc95946321b7f55434182dddac259d4e095fedf78a84f73b6e32dd3f881d9281f09cb583123d3159ed4bdac9ad7393ef8b + languageName: node + linkType: hard + +"tslib@npm:2.5.0": + version: 2.5.0 + resolution: "tslib@npm:2.5.0" + checksum: ae3ed5f9ce29932d049908ebfdf21b3a003a85653a9a140d614da6b767a93ef94f460e52c3d787f0e4f383546981713f165037dc2274df212ea9f8a4541004e1 + languageName: node + linkType: hard + +"tslib@npm:^1.8.1, tslib@npm:^1.9.0": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: dbe628ef87f66691d5d2959b3e41b9ca0045c3ee3c7c7b906cc1e328b39f199bb1ad9e671c39025bd56122ac57dfbf7385a94843b1cc07c60a4db74795829acd languageName: node linkType: hard -"tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.6.0": +"tslib@npm:^2.1.0, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.6.0": version: 2.6.0 resolution: "tslib@npm:2.6.0" checksum: c01066038f950016a18106ddeca4649b4d76caa76ec5a31e2a26e10586a59fceb4ee45e96719bf6c715648e7c14085a81fee5c62f7e9ebee68e77a5396e5538f @@ -4007,6 +4656,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^0.21.3": + version: 0.21.3 + resolution: "type-fest@npm:0.21.3" + checksum: e6b32a3b3877f04339bae01c193b273c62ba7bfc9e325b8703c4ee1b32dc8fe4ef5dfa54bf78265e069f7667d058e360ae0f37be5af9f153b22382cd55a9afe0 + languageName: node + linkType: hard + "typed-array-length@npm:^1.0.4": version: 1.0.4 resolution: "typed-array-length@npm:1.0.4" @@ -4038,6 +4694,15 @@ __metadata: languageName: node linkType: hard +"uid@npm:2.0.1": + version: 2.0.1 + resolution: "uid@npm:2.0.1" + dependencies: + "@lukeed/csprng": ^1.0.0 + checksum: 0a3c697d8dd1f3b647afa35c411b11fd8fa2fb6dbd8a49fe109a4aa5214068c2c58781aa6e4516dfd16f0fc524fb7bba0833e9c1dc1ed3f1965b520349be9ad5 + languageName: node + linkType: hard + "unbox-primitive@npm:^1.0.2": version: 1.0.2 resolution: "unbox-primitive@npm:1.0.2" @@ -4068,6 +4733,13 @@ __metadata: languageName: node linkType: hard +"universalify@npm:^2.0.0": + version: 2.0.0 + resolution: "universalify@npm:2.0.0" + checksum: 2406a4edf4a8830aa6813278bab1f953a8e40f2f63a37873ffa9a3bc8f9745d06cc8e88f3572cb899b7e509013f7f6fcc3e37e8a6d914167a5381d8440518c44 + languageName: node + linkType: hard + "untildify@npm:^4.0.0": version: 4.0.0 resolution: "untildify@npm:4.0.0" @@ -4115,6 +4787,32 @@ __metadata: languageName: node linkType: hard +"wcwidth@npm:>=1.0.1, wcwidth@npm:^1.0.1": + version: 1.0.1 + resolution: "wcwidth@npm:1.0.1" + dependencies: + defaults: ^1.0.3 + checksum: 814e9d1ddcc9798f7377ffa448a5a3892232b9275ebb30a41b529607691c0491de47cba426e917a4d08ded3ee7e9ba2f3fe32e62ee3cd9c7d3bafb7754bd553c + languageName: node + linkType: hard + +"webidl-conversions@npm:^3.0.0": + version: 3.0.1 + resolution: "webidl-conversions@npm:3.0.1" + checksum: c92a0a6ab95314bde9c32e1d0a6dfac83b578f8fa5f21e675bc2706ed6981bc26b7eb7e6a1fab158e5ce4adf9caa4a0aee49a52505d4d13c7be545f15021b17c + languageName: node + linkType: hard + +"whatwg-url@npm:^5.0.0": + version: 5.0.0 + resolution: "whatwg-url@npm:5.0.0" + dependencies: + tr46: ~0.0.3 + webidl-conversions: ^3.0.0 + checksum: b8daed4ad3356cc4899048a15b2c143a9aed0dfae1f611ebd55073310c7b910f522ad75d727346ad64203d7e6c79ef25eafd465f4d12775ca44b90fa82ed9e2c + languageName: node + linkType: hard + "which-boxed-primitive@npm:^1.0.2": version: 1.0.2 resolution: "which-boxed-primitive@npm:1.0.2" @@ -4162,7 +4860,7 @@ __metadata: languageName: node linkType: hard -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" dependencies: @@ -4191,6 +4889,13 @@ __metadata: languageName: node linkType: hard +"y18n@npm:^5.0.5": + version: 5.0.8 + resolution: "y18n@npm:5.0.8" + checksum: 54f0fb95621ee60898a38c572c515659e51cc9d9f787fb109cef6fde4befbe1c4602dc999d30110feee37456ad0f1660fa2edcfde6a9a740f86a290999550d30 + languageName: node + linkType: hard + "yallist@npm:^4.0.0": version: 4.0.0 resolution: "yallist@npm:4.0.0" @@ -4205,6 +4910,28 @@ __metadata: languageName: node linkType: hard +"yargs-parser@npm:^20.2.2": + version: 20.2.9 + resolution: "yargs-parser@npm:20.2.9" + checksum: 8bb69015f2b0ff9e17b2c8e6bfe224ab463dd00ca211eece72a4cd8a906224d2703fb8a326d36fdd0e68701e201b2a60ed7cf81ce0fd9b3799f9fe7745977ae3 + languageName: node + linkType: hard + +"yargs@npm:^16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: ^7.0.2 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.0 + y18n: ^5.0.5 + yargs-parser: ^20.2.2 + checksum: b14afbb51e3251a204d81937c86a7e9d4bdbf9a2bcee38226c900d00f522969ab675703bee2a6f99f8e20103f608382936034e64d921b74df82b63c07c5e8f59 + languageName: node + linkType: hard + "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" diff --git a/mta_manager/__init__.py b/mta_api_client/__init__.py similarity index 100% rename from mta_manager/__init__.py rename to mta_api_client/__init__.py diff --git a/mta_manager/feed.py b/mta_api_client/feed.py similarity index 100% rename from mta_manager/feed.py rename to mta_api_client/feed.py diff --git a/mta_manager/mta.py b/mta_api_client/mta.py similarity index 97% rename from mta_manager/mta.py rename to mta_api_client/mta.py index 8512c76..553073c 100644 --- a/mta_manager/mta.py +++ b/mta_api_client/mta.py @@ -1,50 +1,50 @@ -import requests - -from google.transit import gtfs_realtime_pb2 -from .train import Train -from .feed import Feed, ALL_FEEDS -from .route import Route - - -class MTA(object): - def __init__(self, api_key: str, feeds: [Feed] = ALL_FEEDS, stations: [str] = [], - max_arrival_time: int = 30): - self.header = { - "x-api-key": api_key - } - self.feeds = feeds - self.stations = stations - self.max_arrival_time = max_arrival_time - self.trains: [Train] = [] - - def stop_updates(self): - self.is_running = False - - def update_trains(self) -> [Train]: - trains = [] - for feed in self.feeds: - r = requests.get(feed.value, headers=self.header) - feed = gtfs_realtime_pb2.FeedMessage() - feed.ParseFromString(r.content) - trains.extend([train for train in [Train(train) for train in feed.entity] if - train.has_trips()]) - self.trains = trains - return trains - - def get_trains(self) -> [Train]: - return self.trains - - def get_arrival_times(self, route: Route, station: str) -> [int]: - arrival_times = [] - for train in self.trains: - if train.get_route() is route: - arrival = train.get_arrival_at(station) - if arrival is not None and arrival < self.max_arrival_time and arrival > 0: - arrival_times.append(arrival) - return sorted(arrival_times) - - def add_station_id(self, station_id: str): - self.stations.append(station_id) - - def remove_station_id(self, station_id: str): - self.stations.remove(station_id) +import requests + +from google.transit import gtfs_realtime_pb2 +from .train import Train +from .feed import Feed, ALL_FEEDS +from .route import Route + + +class MTA(object): + def __init__(self, api_key: str, feeds: [Feed] = ALL_FEEDS, stations: [str] = [], + max_arrival_time: int = 30): + self.header = { + "x-api-key": api_key + } + self.feeds = feeds + self.stations = stations + self.max_arrival_time = max_arrival_time + self.trains: [Train] = [] + + def stop_updates(self): + self.is_running = False + + def update_trains(self) -> [Train]: + trains = [] + for feed in self.feeds: + r = requests.get(feed.value, headers=self.header) + feed = gtfs_realtime_pb2.FeedMessage() + feed.ParseFromString(r.content) + trains.extend([train for train in [Train(train) for train in feed.entity] if + train.has_trips()]) + self.trains = trains + return trains + + def get_trains(self) -> [Train]: + return self.trains + + def get_arrival_times(self, route: Route, station: str) -> [int]: + arrival_times = [] + for train in self.trains: + if train.get_route() is route: + arrival = train.get_arrival_at(station) + if arrival is not None and arrival < self.max_arrival_time and arrival > 0: + arrival_times.append(arrival) + return sorted(arrival_times) + + def add_station_id(self, station_id: str): + self.stations.append(station_id) + + def remove_station_id(self, station_id: str): + self.stations.remove(station_id) diff --git a/mta_manager/route.py b/mta_api_client/route.py similarity index 100% rename from mta_manager/route.py rename to mta_api_client/route.py diff --git a/mta_manager/stop.py b/mta_api_client/stop.py similarity index 97% rename from mta_manager/stop.py rename to mta_api_client/stop.py index 56ba275..1aface0 100644 --- a/mta_manager/stop.py +++ b/mta_api_client/stop.py @@ -1,7 +1,7 @@ -from datetime import datetime -from google.transit import gtfs_realtime_pb2 -from math import trunc - - -def trip_arrival_in_minutes(stop_time_update: gtfs_realtime_pb2.TripUpdate): - return trunc(((datetime.fromtimestamp(stop_time_update.arrival.time) - datetime.now()).total_seconds()) / 60) +from datetime import datetime +from google.transit import gtfs_realtime_pb2 +from math import trunc + + +def trip_arrival_in_minutes(stop_time_update: gtfs_realtime_pb2.TripUpdate): + return trunc(((datetime.fromtimestamp(stop_time_update.arrival.time) - datetime.now()).total_seconds()) / 60) diff --git a/mta_manager/train.py b/mta_api_client/train.py similarity index 97% rename from mta_manager/train.py rename to mta_api_client/train.py index 76e25ed..c3e57d4 100644 --- a/mta_manager/train.py +++ b/mta_api_client/train.py @@ -1,33 +1,33 @@ -from google.transit import gtfs_realtime_pb2 -from .stop import trip_arrival_in_minutes -from .route import Route, is_valid_route - - -class Train(object): - def __init__(self, train_proto: gtfs_realtime_pb2.FeedEntity): - self.train_proto: gtfs_realtime_pb2.FeedEntity = train_proto - - def get_arrival_at(self, stop_id) -> int | None: - """ - returns the routes stop time at a given stop ID in minutes - if not found, returns None - :param stop_id: stop ID of arrival station - :return: arrival time in minutes - """ - for stop_time_update in self.train_proto.trip_update.stop_time_update: - if stop_time_update.stop_id == stop_id: - return trip_arrival_in_minutes(stop_time_update) - return None - - def _get_route(self) -> str: - return self.train_proto.trip_update.trip.route_id - - def get_route(self) -> Route: - return Route(self.train_proto.trip_update.trip.route_id) - - def has_trips(self) -> bool: - return self.train_proto.trip_update is not None \ - and len(self.train_proto.trip_update.stop_time_update) > 0 and is_valid_route(self._get_route()) - - def __str__(self): - return f"{self.train_proto}" +from google.transit import gtfs_realtime_pb2 +from .stop import trip_arrival_in_minutes +from .route import Route, is_valid_route + + +class Train(object): + def __init__(self, train_proto: gtfs_realtime_pb2.FeedEntity): + self.train_proto: gtfs_realtime_pb2.FeedEntity = train_proto + + def get_arrival_at(self, stop_id) -> int | None: + """ + returns the routes stop time at a given stop ID in minutes + if not found, returns None + :param stop_id: stop ID of arrival station + :return: arrival time in minutes + """ + for stop_time_update in self.train_proto.trip_update.stop_time_update: + if stop_time_update.stop_id == stop_id: + return trip_arrival_in_minutes(stop_time_update) + return None + + def _get_route(self) -> str: + return self.train_proto.trip_update.trip.route_id + + def get_route(self) -> Route: + return Route(self.train_proto.trip_update.trip.route_id) + + def has_trips(self) -> bool: + return self.train_proto.trip_update is not None \ + and len(self.train_proto.trip_update.stop_time_update) > 0 and is_valid_route(self._get_route()) + + def __str__(self): + return f"{self.train_proto}" diff --git a/mta_sign_server/__init__.py b/mta_sign_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mta_sign_server/config/__init__.py b/mta_sign_server/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mta_sign_server/config/router.py b/mta_sign_server/config/router.py new file mode 100644 index 0000000..d363f30 --- /dev/null +++ b/mta_sign_server/config/router.py @@ -0,0 +1,15 @@ +import logging + +from fastapi import APIRouter +from starlette.responses import JSONResponse + +router = APIRouter( + tags=["config"], +) + +logger = logging.getLogger("config_router") + + +@router.get("/api/config") +def get_all(): + return JSONResponse({"config": "goes here"}) diff --git a/mta_sign_server/mta/__init__.py b/mta_sign_server/mta/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mta_sign_server/mta/router.py b/mta_sign_server/mta/router.py new file mode 100644 index 0000000..044fa4d --- /dev/null +++ b/mta_sign_server/mta/router.py @@ -0,0 +1,68 @@ +import logging +import os + +from fastapi import APIRouter, HTTPException +from fastapi_utils.tasks import repeat_every +from starlette import status + +from mta_api_client import Route, MTA, Feed +from mta_sign_server.mta.schemas import StationResponse, RouteResponse, AllStationModel + +router = APIRouter( + tags=["mta-data"], +) + +logger = logging.getLogger("mta") + +api_key = os.getenv('MTA_API_KEY', '') + +mtaController = MTA( + api_key, + feeds=[Feed.ACE, Feed.N1234567] +) + +ROUTES = [Route.A, Route.C, Route.E, Route.N1, Route.N2, Route.N3] +STATION_STOP_IDs = ["127S", "127N", "A27N", "A27S"] + + +@router.post("/api/mta/{stop_id}/{route}", response_model=RouteResponse, status_code=status.HTTP_200_OK) +def get_route(stop_id: str, route: Route): + arrival_times = mtaController.get_arrival_times(route, stop_id) + if len(arrival_times) > 0: + return RouteResponse(arrival_times=arrival_times) + raise HTTPException(status_code=404, detail="no stops found for route and stop id") + + +@router.post("/api/mta/{stop_id}", response_model=StationResponse, status_code=status.HTTP_200_OK) +def get_station(stop_id: str): + routes = {} + for route in ROUTES: + arrival_times = mtaController.get_arrival_times(route, stop_id) + if len(arrival_times) > 0: + routes[route] = RouteResponse(arrival_times=arrival_times) + if routes: + return StationResponse(routes=routes) + raise HTTPException(status_code=404, detail="no trains or routes found for stop id") + + +@router.post("/api/mta", response_model=AllStationModel, status_code=status.HTTP_200_OK) +def get_all(): + print("HELLO WORLD") + all_stations = {} + for stop_id in STATION_STOP_IDs: + routes = {} + for route in ROUTES: + arrival_times = mtaController.get_arrival_times(route, stop_id) + if len(arrival_times) > 0: + routes[route] = RouteResponse(arrival_times=arrival_times) + all_stations[stop_id] = StationResponse(routes=routes) + if all_stations: + return AllStationModel(stations=all_stations) + raise HTTPException(status_code=404, detail="no arriving trains found for all configured routes") + + +@router.on_event("startup") +@repeat_every(seconds=10) +def update_trains(): + logger.info("UPDATING TRAINS") + mtaController.update_trains() diff --git a/mta_sign_server/mta/schemas.py b/mta_sign_server/mta/schemas.py new file mode 100644 index 0000000..e28a142 --- /dev/null +++ b/mta_sign_server/mta/schemas.py @@ -0,0 +1,16 @@ +from pydantic import BaseModel +from typing import List, Dict + +from mta_api_client import Route + + +class RouteResponse(BaseModel): + arrival_times: List[int] + + +class StationResponse(BaseModel): + routes: Dict[Route, RouteResponse] + + +class AllStationModel(BaseModel): + stations: Dict[str, StationResponse] diff --git a/mta_sign_server/router.py b/mta_sign_server/router.py new file mode 100644 index 0000000..463c296 --- /dev/null +++ b/mta_sign_server/router.py @@ -0,0 +1,12 @@ +from datetime import datetime + +from fastapi import APIRouter, status + +router = APIRouter( + tags=["start"], +) + +start_time = datetime.now() +@router.post("/api/start_time", status_code=status.HTTP_200_OK) +def get_start_time(): + return start_time.isoformat() diff --git a/server.py b/server.py deleted file mode 100644 index b2e4c18..0000000 --- a/server.py +++ /dev/null @@ -1,63 +0,0 @@ -import logging -import os - -from datetime import datetime -from fastapi import FastAPI -from fastapi.middleware.cors import CORSMiddleware -from fastapi_utils.tasks import repeat_every - - -# import pandas as pd -from dotenv import load_dotenv -from starlette.responses import JSONResponse - -from mta_manager import MTA, Feed, Route - -load_dotenv() - - -api_key = os.getenv('MTA_API_KEY', '') - -app = FastAPI() -app.add_middleware( - CORSMiddleware, - allow_origins=['*'] -) - -logger = logging.getLogger(__name__) # the __name__ resolve to "main" since we are at the root of the project. - - -start_time = datetime.now() -last_updated = datetime.now() - -mtaController = MTA( - api_key, - feeds=[Feed.ACE, Feed.N1234567] -) - -ROUTES = [Route.A, Route.C, Route.E, Route.N1, Route.N2, Route.N3] -STATION_STOP_IDs = ["127S", "127N", "A27N", "A27S"] - - -@app.post("/api/start_time") -def get_start_time(): - return start_time.isoformat() - -@app.post("/api/mta_data") -async def get_mta_data(): - # if len(mtaController.trains) == 0: - # _ = update_trains() - arrival_by_station_and_route = {} - for stop_id in STATION_STOP_IDs: - arrival_by_station_and_route[stop_id] = {} - for route in ROUTES: - arrival_times = mtaController.get_arrival_times(route, stop_id) - if len(arrival_times) > 0: - arrival_by_station_and_route[stop_id][route.value] = arrival_times - return JSONResponse(arrival_by_station_and_route) - -@app.on_event("startup") -@repeat_every(seconds=5) -async def update_trains(): - logger.info("UPDATING TRAINS") - mtaController.update_trains()