diff --git a/.github/workflows/create-proto.yaml b/.github/workflows/create-proto.yaml index 2aa19e36..f7de4222 100644 --- a/.github/workflows/create-proto.yaml +++ b/.github/workflows/create-proto.yaml @@ -1,4 +1,4 @@ -name: compile_PB +name: compile PB on: push: @@ -18,19 +18,9 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT - working-directory: ./frontend/dashboard - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install --immutable - working-directory: ./frontend/dashboard + - name: Corepack Enable + run: corepack enable + - run: pnpm install --frozen-lockfile - name: Set up Go uses: actions/setup-go@v4 with: diff --git a/backend/auto-operation/.gitignore b/backend/auto-operation/.gitignore new file mode 100644 index 00000000..a9b203a6 --- /dev/null +++ b/backend/auto-operation/.gitignore @@ -0,0 +1 @@ +main.js diff --git a/backend/auto-operation/main.ts b/backend/auto-operation/main.ts index b02d74b1..862bcf7d 100644 --- a/backend/auto-operation/main.ts +++ b/backend/auto-operation/main.ts @@ -1,22 +1,31 @@ import { createPromiseClient } from "@connectrpc/connect"; import { createConnectTransport } from "@connectrpc/connect-node"; -import { StateManagerService } from "./proto/state/v1/state_connectweb.js"; +import { StateManagerService } from "./proto/state/v1/state_connect.js"; import { BlockStateEnum } from "./proto/state/v1/block_pb.js"; import { StopStateEnum } from "./proto/state/v1/stop_pb.js"; import { PointStateEnum } from "./proto/state/v1/point_pb.js"; import { Priority } from "./proto/state/v1/train_pb.js"; -let mapConfig; +type MapConfig = { + stopBlocks: { [key: string]: string }, + stations: { + [key: string]: { + capacity: number, + } + } +} +let mapConfig: MapConfig; +const SERVER_ADDR = process.env['SERVER_ADDR'] ?? 'http://localhost:8080' const transport = createConnectTransport( { httpVersion: "2", - baseUrl: "http://localhost:8080", + baseUrl: SERVER_ADDR, }); const client = createPromiseClient(StateManagerService, transport); async function loadConfig() { - mapConfig = await import("./map/chofufes-2023.json"); + mapConfig = (await import("./map/chofufes-2023.json")).default; } loadConfig(); @@ -27,7 +36,7 @@ async function addTest() { train: { trainId: "test", positionId: "shinjuku_b1", - priority: Priority.PRIORITY_HIGH, + priority: Priority.HIGH, uuid: "test", destination: "hashimoto_up_s1" } @@ -36,7 +45,7 @@ async function addTest() { train: { trainId: "test2", positionId: "shinjuku_s1", - priority: Priority.PRIORITY_LOW, + priority: Priority.LOW, uuid: "test", destination: "hachioji_up_s1" } @@ -84,14 +93,14 @@ async function main() { // 通過待ちができるかどうか const stationName = train.positionId.split("_")[0] + "_" + train.positionId.split("_")[1]; const capacity = mapConfig.stations[stationName]; - if (capacity > 1 && train.Priority === Priority.PRIORITY_LOW) { + if (capacity.capacity > 1 && train.priority === Priority.LOW) { // 通過待ちが可能な駅で、PriorityがLOWの列車はPriorityがHIGHの列車が停車するまで待つ - const highPriorityTrains = trains.filter(t => (t.positionId.includes(stationName)) && t.Priority === Priority.PRIORITY_HIGH); + const highPriorityTrains = trains.filter(t => (t.positionId.includes(stationName)) && t.priority === Priority.HIGH); if (highPriorityTrains.length > 0) continue; } const stop = stops.find(s => s.id === train.positionId); // 問題ないならGOにする - if (stop.state !== StopStateEnum.STOP_STATE_GO) { + if (stop && stop.state !== StopStateEnum.STOP_STATE_GO) { await client.updateStopState({ "state": { "id": stop.id, @@ -108,8 +117,8 @@ async function main() { // 桜上水上りポイント // デフォルトではSTRAIGHTにして、sakurajosui_up_s1がONならREVERSEにする const sakurajosui_up_s1 = stops.find(s => s.id === "sakurajosui_up_s1"); - if (sakurajosui_up_s1.state === StopStateEnum.STOP_STATE_STOP) { - if (point.state !== StopStateEnum.STOP_STATE_REVERSE) { + if (sakurajosui_up_s1 && sakurajosui_up_s1.state === StopStateEnum.STOP_STATE_STOP) { + if (point.state !== PointStateEnum.POINT_STATE_REVERSE) { await client.updatePointState({ "state": { "id": point.id, @@ -118,7 +127,7 @@ async function main() { }) } } else { - if (point.state !== StopStateEnum.STOP_STATE_STRAIGHT) { + if (point.state !== PointStateEnum.POINT_STATE_NORMAL) { await client.updatePointState({ "state": { "id": point.id, @@ -130,7 +139,7 @@ async function main() { } if (point.id === "sakurajosui_down_p1") { const sakurajosui_down_s1 = stops.find(s => s.id === "sakurajosui_down_s1"); - if (sakurajosui_down_s1.state === StopStateEnum.STOP_STATE_STOP) { + if (sakurajosui_down_s1 && sakurajosui_down_s1.state === StopStateEnum.STOP_STATE_STOP) { if (point.state !== PointStateEnum.POINT_STATE_REVERSE) { await client.updatePointState({ "state": { @@ -183,7 +192,9 @@ async function main() { addTest(); -while (true) { - main(); - await new Promise(resolve => setTimeout(resolve, 200)); -} \ No newline at end of file +(async () => { + while (true) { + main(); + await new Promise(resolve => setTimeout(resolve, 200)); + } +})() \ No newline at end of file diff --git a/backend/auto-operation/package.json b/backend/auto-operation/package.json index 6a6207d5..5e38e841 100644 --- a/backend/auto-operation/package.json +++ b/backend/auto-operation/package.json @@ -4,7 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "build": "npx tsc" }, "keywords": [], "author": "", @@ -12,15 +13,18 @@ "license": "ISC", "dependencies": { "@bufbuild/buf": "^1.28.1", - "@bufbuild/connect-web": "^0.13.0", "@bufbuild/protobuf": "^1.4.2", - "@bufbuild/protoc-gen-es": "^1.4.2", "@connectrpc/connect": "^1.1.3", "@connectrpc/connect-node": "^1.1.3", "@connectrpc/connect-web": "^1.1.3", - "@connectrpc/protoc-gen-connect-es": "^1.1.3", - "install": "^0.13.0", + "install": "^0.13.0" + }, + "devDependencies": { + "@types/node": "20.9.5", "tsx": "^4.3.0", - "typescript": "5.2.2" - } + "typescript": "5.2.2", + "@connectrpc/protoc-gen-connect-es": "^1.1.3", + "@bufbuild/protoc-gen-es": "^1.4.2" + }, + "packageManager": "pnpm@8.6.11" } \ No newline at end of file diff --git a/backend/auto-operation/proto/state/v1/state_connectweb.d.ts b/backend/auto-operation/proto/state/v1/state_connect.d.ts similarity index 97% rename from backend/auto-operation/proto/state/v1/state_connectweb.d.ts rename to backend/auto-operation/proto/state/v1/state_connect.d.ts index ce3b0613..f21a07b6 100644 --- a/backend/auto-operation/proto/state/v1/state_connectweb.d.ts +++ b/backend/auto-operation/proto/state/v1/state_connect.d.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-web v0.11.0 with parameter "target=dts+js" +// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=dts+js" // @generated from file state/v1/state.proto (package state.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/backend/auto-operation/proto/state/v1/state_connectweb.js b/backend/auto-operation/proto/state/v1/state_connect.js similarity index 97% rename from backend/auto-operation/proto/state/v1/state_connectweb.js rename to backend/auto-operation/proto/state/v1/state_connect.js index 1f4e198d..8da8b3e1 100644 --- a/backend/auto-operation/proto/state/v1/state_connectweb.js +++ b/backend/auto-operation/proto/state/v1/state_connect.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-web v0.11.0 with parameter "target=dts+js" +// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=dts+js" // @generated from file state/v1/state.proto (package state.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/backend/auto-operation/tsconfig.json b/backend/auto-operation/tsconfig.json index e075f973..424dbd08 100644 --- a/backend/auto-operation/tsconfig.json +++ b/backend/auto-operation/tsconfig.json @@ -11,7 +11,7 @@ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ @@ -25,9 +25,9 @@ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ + "module": "Node16", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + "moduleResolution": "Node16", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ @@ -39,7 +39,7 @@ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ + "resolveJsonModule": true, /* Enable importing .json files. */ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ diff --git a/docker-bake.hcl b/docker-bake.hcl index ac1c8895..73e715c7 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,6 +1,7 @@ group "default" { targets = [ "state-manager", + "autooperation", "dashboard" ] } @@ -29,6 +30,13 @@ target "state-manager" { ] } +target "autooperation" { + dockerfile = "docker/backend/auto-operation/Dockerfile" + tags = [ + GET_TAG("autooperation") + ] +} + target "dashboard" { dockerfile = "docker/frontend/dashboard/Dockerfile" tags = [ diff --git a/docker/backend/auto-operation/Dockerfile b/docker/backend/auto-operation/Dockerfile new file mode 100644 index 00000000..5524583d --- /dev/null +++ b/docker/backend/auto-operation/Dockerfile @@ -0,0 +1,24 @@ +FROM node:20.9-bookworm AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable + +FROM base AS dep-resolver + +WORKDIR /auto-operation +COPY --chown=node:node pnpm-lock.yaml pnpm-workspace.yaml ./ +COPY backend/auto-operation ./backend/auto-operation +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile + +FROM dep-resolver AS auto-operation-builder +RUN pnpm run --filter=./backend/auto-operation -r build +RUN pnpm deploy --filter=./backend/auto-operation --prod dist/auto-operation +RUN cp backend/auto-operation/main.js dist/auto-operation/main.js +WORKDIR /autooperation/dist/auto-operation + + +FROM gcr.io/distroless/nodejs20-debian12:nonroot AS dashboard-runner +COPY --from=auto-operation-builder --chown=nonroot:nonroot /auto-operation/dist/auto-operation /auto-operation +ENV SERVER_ADDR='' +CMD ["/auto-operation/main.js"] + diff --git a/docker/frontend/dashboard/Dockerfile b/docker/frontend/dashboard/Dockerfile index 3dd83c78..43fe71b4 100644 --- a/docker/frontend/dashboard/Dockerfile +++ b/docker/frontend/dashboard/Dockerfile @@ -8,7 +8,7 @@ FROM base AS dep-resolver WORKDIR /dashboard COPY --chown=node:node pnpm-lock.yaml pnpm-workspace.yaml ./ COPY frontend/ ./frontend -RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile +RUN pnpm install --frozen-lockfile --no-optional FROM dep-resolver AS dashboard-builder RUN pnpm run --filter=./frontend/dashboard -r build diff --git a/frontend/dashboard/package.json b/frontend/dashboard/package.json index 35d8a82f..8bd0406f 100644 --- a/frontend/dashboard/package.json +++ b/frontend/dashboard/package.json @@ -9,7 +9,6 @@ "lint": "next lint" }, "dependencies": { - "@bufbuild/connect-web": "^0.13.0", "@bufbuild/protobuf": "^1.4.2", "@connectrpc/connect": "^1.1.3", "@connectrpc/connect-query": "^0.6.0", @@ -22,7 +21,6 @@ }, "devDependencies": { "@bufbuild/buf": "^1.28.1", - "@bufbuild/protoc-gen-connect-web": "^0.11.0", "@bufbuild/protoc-gen-es": "^1.4.2", "@connectrpc/protoc-gen-connect-es": "^1.1.3", "@connectrpc/protoc-gen-connect-query": "^0.6.0", @@ -39,5 +37,6 @@ ".next/standalone", ".next/static", "public" - ] + ], + "packageManager": "pnpm@8.6.11" } \ No newline at end of file diff --git a/frontend/dashboard/src/app/provider.tsx b/frontend/dashboard/src/app/provider.tsx index a25b280b..453bf828 100644 --- a/frontend/dashboard/src/app/provider.tsx +++ b/frontend/dashboard/src/app/provider.tsx @@ -1,6 +1,6 @@ "use client"; -import {createConnectTransport} from "@bufbuild/connect-web"; +import {createConnectTransport} from "@connectrpc/connect-web"; import {TransportProvider} from "@connectrpc/connect-query"; import {QueryClient, QueryClientProvider} from "@tanstack/react-query"; diff --git a/frontend/dashboard/src/app/test/page.tsx b/frontend/dashboard/src/app/test/page.tsx index 1db5e65c..a02691d8 100644 --- a/frontend/dashboard/src/app/test/page.tsx +++ b/frontend/dashboard/src/app/test/page.tsx @@ -1,7 +1,7 @@ "use client"; import { createPromiseClient } from "@connectrpc/connect"; -import { StateManagerService } from "@/proto/state/v1/state_connectweb"; -import { createConnectTransport } from "@bufbuild/connect-web"; +import { StateManagerService } from "@/proto/state/v1/state_connect"; +import { createConnectTransport } from "@connectrpc/connect-web"; import { GetBlockStatesRequest } from "@/proto/state/v1/block_pb"; export default function Test() { diff --git a/frontend/dashboard/src/proto/state/v1/state_connectweb.ts b/frontend/dashboard/src/proto/state/v1/state_connect.ts similarity index 97% rename from frontend/dashboard/src/proto/state/v1/state_connectweb.ts rename to frontend/dashboard/src/proto/state/v1/state_connect.ts index abaa2421..48a431c0 100644 --- a/frontend/dashboard/src/proto/state/v1/state_connectweb.ts +++ b/frontend/dashboard/src/proto/state/v1/state_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-web v0.11.0 with parameter "target=ts,import_extension=none" +// @generated by protoc-gen-connect-es v1.1.3 with parameter "target=ts,import_extension=none" // @generated from file state/v1/state.proto (package state.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/frontend/dashboard/yarn.lock b/frontend/dashboard/yarn.lock index 0ede6640..ea0af22e 100644 --- a/frontend/dashboard/yarn.lock +++ b/frontend/dashboard/yarn.lock @@ -1071,31 +1071,11 @@ "@bufbuild/buf-win32-arm64" "1.28.1" "@bufbuild/buf-win32-x64" "1.28.1" -"@bufbuild/connect-web@^0.13.0": - version "0.13.0" - resolved "https://registry.yarnpkg.com/@bufbuild/connect-web/-/connect-web-0.13.0.tgz#87301c92d49d3c3f9acb99729c2f7505d739aa4a" - integrity sha512-Ys9VFDWYktD9yFQSLOlkpsD42LonDNMCysLCfjXFuxlupYuf4f7qg0zkT5bESyTfqk4xtRDSSGR3xygaj/ONIQ== - dependencies: - "@bufbuild/connect" "0.13.0" - -"@bufbuild/connect@0.13.0": - version "0.13.0" - resolved "https://registry.yarnpkg.com/@bufbuild/connect/-/connect-0.13.0.tgz#97a84a2cac747c7a52d4421a3382d8d165f61c99" - integrity sha512-eZSMbVLyUFtXiZNORgCEvv580xKZeYQdMOWj2i/nxOcpXQcrEzTMTA7SZzWv4k4gveWCOSRoWmYDeOhfWXJv0g== - -"@bufbuild/protobuf@1.4.2", "@bufbuild/protobuf@^1.2.1", "@bufbuild/protobuf@^1.3.3", "@bufbuild/protobuf@^1.4.2": +"@bufbuild/protobuf@1.4.2", "@bufbuild/protobuf@^1.3.3", "@bufbuild/protobuf@^1.4.2": version "1.4.2" resolved "https://registry.yarnpkg.com/@bufbuild/protobuf/-/protobuf-1.4.2.tgz#dc4faf21264a47b71a15806616043cb006e80ac8" integrity sha512-JyEH8Z+OD5Sc2opSg86qMHn1EM1Sa+zj/Tc0ovxdwk56ByVNONJSabuCUbLQp+eKN3rWNfrho0X+3SEqEPXIow== -"@bufbuild/protoc-gen-connect-web@^0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@bufbuild/protoc-gen-connect-web/-/protoc-gen-connect-web-0.11.0.tgz#985e12d0acc804a14033916bd2cebf3d88562dd1" - integrity sha512-7GvYkQjN6LP/ixtosI4JBN8eph2kS5XNju9zFwBuJ6aHqfl1sNRkRWG8LEdtTJtyW2R3QypAUyLfpLQf/ZyRVw== - dependencies: - "@bufbuild/protobuf" "^1.2.1" - "@bufbuild/protoplugin" "^1.2.1" - "@bufbuild/protoc-gen-es@^1.4.2": version "1.4.2" resolved "https://registry.yarnpkg.com/@bufbuild/protoc-gen-es/-/protoc-gen-es-1.4.2.tgz#00c8b09430dd1154e626da7c247fd6425a1cd41d" @@ -1104,7 +1084,7 @@ "@bufbuild/protobuf" "^1.4.2" "@bufbuild/protoplugin" "1.4.2" -"@bufbuild/protoplugin@1.4.2", "@bufbuild/protoplugin@^1.2.1", "@bufbuild/protoplugin@^1.3.3": +"@bufbuild/protoplugin@1.4.2", "@bufbuild/protoplugin@^1.3.3": version "1.4.2" resolved "https://registry.yarnpkg.com/@bufbuild/protoplugin/-/protoplugin-1.4.2.tgz#abf9b0e6a3dc8b52b1d6699d7a1ce5219fa82322" integrity sha512-5IwGC1ZRD2A+KydGXeaSOErwfILLqVtvMH/RkN+cOoHcQd4EYXFStcF7g7aR+yICRDEEjQVi5tQF/qPGBSr9vg== @@ -1120,7 +1100,7 @@ dependencies: stable-hash "^0.0.3" -"@connectrpc/connect-web@^1.1.3": +"@connectrpc/connect-web@^1.1.2": version "1.1.3" resolved "https://registry.yarnpkg.com/@connectrpc/connect-web/-/connect-web-1.1.3.tgz#027922b4f1537ecb1eaaa31ec3a59dd471a65320" integrity sha512-WfShOZt91duJngqivYF4wJFRbeRa4bF/fPMfDVN0MAYSX3VuaTMn8o9qgKN7tsg2H2ZClyOVQwMkZx6IdcP7Zw== diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 63d5ff94..93a561b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,11 +6,45 @@ settings: importers: - frontend/dashboard: + backend/auto-operation: dependencies: - '@bufbuild/connect-web': + '@bufbuild/buf': + specifier: ^1.28.1 + version: 1.28.1 + '@bufbuild/protobuf': + specifier: ^1.4.2 + version: 1.4.2 + '@connectrpc/connect': + specifier: ^1.1.3 + version: 1.1.3(@bufbuild/protobuf@1.4.2) + '@connectrpc/connect-node': + specifier: ^1.1.3 + version: 1.1.3(@bufbuild/protobuf@1.4.2)(@connectrpc/connect@1.1.3) + '@connectrpc/connect-web': + specifier: ^1.1.3 + version: 1.1.3(@bufbuild/protobuf@1.4.2)(@connectrpc/connect@1.1.3) + install: specifier: ^0.13.0 - version: 0.13.0(@bufbuild/protobuf@1.4.2) + version: 0.13.0 + devDependencies: + '@bufbuild/protoc-gen-es': + specifier: ^1.4.2 + version: 1.4.2(@bufbuild/protobuf@1.4.2) + '@connectrpc/protoc-gen-connect-es': + specifier: ^1.1.3 + version: 1.1.3(@bufbuild/protoc-gen-es@1.4.2)(@connectrpc/connect@1.1.3) + '@types/node': + specifier: 20.9.5 + version: 20.9.5 + tsx: + specifier: ^4.3.0 + version: 4.3.0 + typescript: + specifier: 5.2.2 + version: 5.2.2 + + frontend/dashboard: + dependencies: '@bufbuild/protobuf': specifier: ^1.4.2 version: 1.4.2 @@ -42,9 +76,6 @@ importers: '@bufbuild/buf': specifier: ^1.28.1 version: 1.28.1 - '@bufbuild/protoc-gen-connect-web': - specifier: ^0.11.0 - version: 0.11.0(@bufbuild/protoc-gen-es@1.4.2) '@bufbuild/protoc-gen-es': specifier: ^1.4.2 version: 1.4.2(@bufbuild/protobuf@1.4.2) @@ -1416,7 +1447,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@bufbuild/buf-darwin-x64@1.28.1: @@ -1425,7 +1455,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@bufbuild/buf-linux-aarch64@1.28.1: @@ -1434,7 +1463,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@bufbuild/buf-linux-x64@1.28.1: @@ -1443,7 +1471,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@bufbuild/buf-win32-arm64@1.28.1: @@ -1452,7 +1479,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@bufbuild/buf-win32-x64@1.28.1: @@ -1461,7 +1487,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@bufbuild/buf@1.28.1: @@ -1476,51 +1501,10 @@ packages: '@bufbuild/buf-linux-x64': 1.28.1 '@bufbuild/buf-win32-arm64': 1.28.1 '@bufbuild/buf-win32-x64': 1.28.1 - dev: true - - /@bufbuild/connect-web@0.13.0(@bufbuild/protobuf@1.4.2): - resolution: {integrity: sha512-Ys9VFDWYktD9yFQSLOlkpsD42LonDNMCysLCfjXFuxlupYuf4f7qg0zkT5bESyTfqk4xtRDSSGR3xygaj/ONIQ==} - deprecated: Connect has moved to its own org @connectrpc and has a stable v1. Run `npx @connectrpc/connect-migrate@latest` to update. See https://github.com/connectrpc/connect-es/releases/tag/v0.13.1 for details. - peerDependencies: - '@bufbuild/protobuf': ^1.2.1 - dependencies: - '@bufbuild/connect': 0.13.0(@bufbuild/protobuf@1.4.2) - '@bufbuild/protobuf': 1.4.2 - dev: false - - /@bufbuild/connect@0.13.0(@bufbuild/protobuf@1.4.2): - resolution: {integrity: sha512-eZSMbVLyUFtXiZNORgCEvv580xKZeYQdMOWj2i/nxOcpXQcrEzTMTA7SZzWv4k4gveWCOSRoWmYDeOhfWXJv0g==} - deprecated: Connect has moved to its own org @connectrpc and has a stable v1. Run `npx @connectrpc/connect-migrate@latest` to update. See https://github.com/connectrpc/connect-es/releases/tag/v0.13.1 for details. - peerDependencies: - '@bufbuild/protobuf': ^1.2.1 - dependencies: - '@bufbuild/protobuf': 1.4.2 - dev: false /@bufbuild/protobuf@1.4.2: resolution: {integrity: sha512-JyEH8Z+OD5Sc2opSg86qMHn1EM1Sa+zj/Tc0ovxdwk56ByVNONJSabuCUbLQp+eKN3rWNfrho0X+3SEqEPXIow==} - /@bufbuild/protoc-gen-connect-web@0.11.0(@bufbuild/protoc-gen-es@1.4.2): - resolution: {integrity: sha512-7GvYkQjN6LP/ixtosI4JBN8eph2kS5XNju9zFwBuJ6aHqfl1sNRkRWG8LEdtTJtyW2R3QypAUyLfpLQf/ZyRVw==} - engines: {node: '>=16.0.0'} - deprecated: This package is no longer supported. Please switch to use https://www.npmjs.com/package/@bufbuild/protoc-gen-connect-es. Details for switching can be found at https://github.com/bufbuild/connect-es/discussions/647 - hasBin: true - peerDependencies: - '@bufbuild/connect': 0.11.0 - '@bufbuild/protoc-gen-es': ^1.2.1 - peerDependenciesMeta: - '@bufbuild/connect': - optional: true - '@bufbuild/protoc-gen-es': - optional: true - dependencies: - '@bufbuild/protobuf': 1.4.2 - '@bufbuild/protoc-gen-es': 1.4.2(@bufbuild/protobuf@1.4.2) - '@bufbuild/protoplugin': 1.4.2 - transitivePeerDependencies: - - supports-color - dev: true - /@bufbuild/protoc-gen-es@1.4.2(@bufbuild/protobuf@1.4.2): resolution: {integrity: sha512-/It7M2s8H1zTDvUMJu6vhBmtnzeFL2VS6e78RYIY38602pNXDK/vbteKUo4KrG0O07lOPFu87hHZ0Y+w5Ib6iw==} engines: {node: '>=14'} @@ -1547,6 +1531,18 @@ packages: - supports-color dev: true + /@connectrpc/connect-node@1.1.3(@bufbuild/protobuf@1.4.2)(@connectrpc/connect@1.1.3): + resolution: {integrity: sha512-oq7Uk8XlLzC2+eHaxZTX189dhujD0/tK9plizxofsFHUnLquMSmzQQ2GzvTv4u6U05eZYc/crySmf86Sqpi1bA==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@bufbuild/protobuf': ^1.3.3 + '@connectrpc/connect': 1.1.3 + dependencies: + '@bufbuild/protobuf': 1.4.2 + '@connectrpc/connect': 1.1.3(@bufbuild/protobuf@1.4.2) + undici: 5.27.2 + dev: false + /@connectrpc/connect-query@0.6.0(@bufbuild/protobuf@1.4.2)(@connectrpc/connect@1.1.3)(@tanstack/react-query@5.8.4)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-/qqQ1LRfxv+YCfK8DWzzo+sJyxctCwdBmwoTEB6tkNLhKBYn1xD8eGXi1rKCOjfOPWrQXHGCAjsYAJg3WCRl+w==} peerDependencies: @@ -1624,6 +1620,204 @@ packages: engines: {node: '>=10.0.0'} dev: true + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.54.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1661,6 +1855,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@fastify/busboy@2.1.0: + resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==} + engines: {node: '>=14'} + dev: false + /@humanwhocodes/config-array@0.11.13: resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} engines: {node: '>=10.10.0'} @@ -2689,6 +2888,10 @@ packages: /caniuse-lite@1.0.30001563: resolution: {integrity: sha512-na2WUmOxnwIZtwnFI2CZ/3er0wdNzU7hN+cPYz/z2ajHThnkWjNBOpEPP4n+4r2WPM847JaMotaJE3bnfzjyKw==} + /caniuse-lite@1.0.30001564: + resolution: {integrity: sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg==} + dev: false + /canvas@2.11.2: resolution: {integrity: sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==} engines: {node: '>=6'} @@ -3187,6 +3390,36 @@ packages: resolution: {integrity: sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==} dev: true + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 + dev: true + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -3561,6 +3794,12 @@ packages: engines: {node: '>=10'} dev: true + /get-tsconfig@4.7.2: + resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -3806,6 +4045,11 @@ packages: /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + /install@0.13.0: + resolution: {integrity: sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==} + engines: {node: '>= 0.10'} + dev: false + /interpret@3.1.1: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} engines: {node: '>=10.13.0'} @@ -4231,7 +4475,7 @@ packages: '@next/env': 14.0.3 '@swc/helpers': 0.5.2 busboy: 1.6.0 - caniuse-lite: 1.0.30001563 + caniuse-lite: 1.0.30001564 postcss: 8.4.31 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -4712,6 +4956,10 @@ packages: engines: {node: '>=8'} dev: true + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true @@ -5263,6 +5511,17 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + /tsx@4.3.0: + resolution: {integrity: sha512-zalfbBdr7tvYok5sSbnsv4uL+DhT1wRZwbWwuOXjhH8YtJxN2bpl6lpXMxuPThMAKzZ2qgrhuf5ckq/uSsm3CA==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + esbuild: 0.18.20 + get-tsconfig: 4.7.2 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -5305,6 +5564,13 @@ packages: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} dev: true + /undici@5.27.2: + resolution: {integrity: sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==} + engines: {node: '>=14.0'} + dependencies: + '@fastify/busboy': 2.1.0 + dev: false + /unicode-canonical-property-names-ecmascript@2.0.0: resolution: {integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==} engines: {node: '>=4'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3778eca8..aafa9621 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ packages: - 'frontend/*' + - 'backend/auto-operation/' \ No newline at end of file diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index fef570a2..8b658551 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -18,7 +18,7 @@ plugins: opt: - target=ts - plugin: connect-es - path: ../frontend/dashboard/node_modules/.bin/protoc-gen-connect-web + path: ../frontend/dashboard/node_modules/.bin/protoc-gen-connect-es out: ../frontend/dashboard/src/proto opt: - target=ts @@ -35,7 +35,7 @@ plugins: opt: - target=dts+js - plugin: connect-es - path: ../frontend/dashboard/node_modules/.bin/protoc-gen-connect-web + path: ../frontend/dashboard/node_modules/.bin/protoc-gen-connect-es out: ../backend/auto-operation/proto opt: - target=dts+js