diff --git a/meshexplorer/buf.gen.yaml b/meshexplorer/buf.gen.yaml new file mode 100644 index 0000000..3a7dd8a --- /dev/null +++ b/meshexplorer/buf.gen.yaml @@ -0,0 +1,8 @@ +version: v2 +clean: true +plugins: + - local: protoc-gen-es + out: src/gen + opt: + - target=ts + - import_extension=none diff --git a/meshexplorer/buf.lock b/meshexplorer/buf.lock new file mode 100644 index 0000000..709ae02 --- /dev/null +++ b/meshexplorer/buf.lock @@ -0,0 +1,6 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/bufbuild/protovalidate + commit: 50325440f8f24053b047484a6bf60b76 + digest: b5:74cb6f5c0853c3c10aafc701614194bbd63326bdb8ef4068214454b8894b03ba4113e04b3a33a8321cdf05336e37db4dc14a5e2495db8462566914f36086ba31 diff --git a/meshexplorer/buf.yaml b/meshexplorer/buf.yaml new file mode 100644 index 0000000..eaa5d2e --- /dev/null +++ b/meshexplorer/buf.yaml @@ -0,0 +1,11 @@ +version: v2 +modules: + - path: proto +deps: + - buf.build/bufbuild/protovalidate +lint: + use: + - STANDARD +breaking: + use: + - FILE diff --git a/meshexplorer/package-lock.json b/meshexplorer/package-lock.json index 7084c47..31e2e2e 100644 --- a/meshexplorer/package-lock.json +++ b/meshexplorer/package-lock.json @@ -8,7 +8,13 @@ "name": "meshexplorer", "version": "0.1.0", "dependencies": { + "@bufbuild/protobuf": "^2.9.0", + "@bufbuild/protovalidate": "^1.2.0", "@clickhouse/client": "^1.11.2", + "@connectrpc/connect": "^2.1.0", + "@connectrpc/connect-next": "^2.1.0", + "@connectrpc/connect-query": "^2.1.0", + "@connectrpc/connect-web": "^2.1.0", "@headlessui/react": "^2.2.4", "@heroicons/react": "^2.2.0", "@tanstack/react-query": "^5.87.1", @@ -35,6 +41,8 @@ "tailwind-merge": "^3.3.1" }, "devDependencies": { + "@bufbuild/buf": "^1.50.0", + "@bufbuild/protoc-gen-es": "^2.9.0", "@eslint/eslintrc": "^3", "@tailwindcss/postcss": "^4", "@types/aes-js": "^3.1.4", @@ -99,6 +107,240 @@ "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/@bufbuild/buf": { + "version": "1.70.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.70.0.tgz", + "integrity": "sha512-oJWGqltlu8F7VVNHLoJ3pFXhjfiGpbh7+/mXW0y+VMPWFGxc9YDv4de1UcX7zhhjV6MbE4SiEGo5Gs5jhpVg5A==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "buf": "bin/buf", + "protoc-gen-buf-breaking": "bin/protoc-gen-buf-breaking", + "protoc-gen-buf-lint": "bin/protoc-gen-buf-lint" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@bufbuild/buf-darwin-arm64": "1.70.0", + "@bufbuild/buf-darwin-x64": "1.70.0", + "@bufbuild/buf-linux-aarch64": "1.70.0", + "@bufbuild/buf-linux-armv7": "1.70.0", + "@bufbuild/buf-linux-x64": "1.70.0", + "@bufbuild/buf-win32-arm64": "1.70.0", + "@bufbuild/buf-win32-x64": "1.70.0" + } + }, + "node_modules/@bufbuild/buf-darwin-arm64": { + "version": "1.70.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.70.0.tgz", + "integrity": "sha512-c7owUswBbMmwfHPH9JRBEJu09mrXYGC33V2JQCgraWCBm74Z95AOkhDua50qiBrQnysvJkJ0p/z4MWxJqcpnIA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-darwin-x64": { + "version": "1.70.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.70.0.tgz", + "integrity": "sha512-sucV3lQXVuOqYs3+ToulkUh2tZuMnl286DKb44imp3PnexVhAVOP7d3ybYe98HNGwysEdjNP2WIOGb0uKuRCIQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-aarch64": { + "version": "1.70.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.70.0.tgz", + "integrity": "sha512-4viSYqbhIusd6LR+JayDex8S1rLUL+hTUMYUgSPl75EC93FpJM4vkk2RhoAhyjQqWF/JQLcyWV8kjRRiIwygdg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-armv7": { + "version": "1.70.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-armv7/-/buf-linux-armv7-1.70.0.tgz", + "integrity": "sha512-GqujpTX4MXtYiUkxd6oI1g0JaCX3L6koT16Gl0D0HIQ/V2mptH7x4UW8nK3tAURMjrHsEEhcSJRtmfINTTKnsg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-x64": { + "version": "1.70.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.70.0.tgz", + "integrity": "sha512-5WHGUIb5iLFXcnqV33TDejqaPgx0CWFaYW7b4wh12wT0w3DR+ghFq6S6RmYyZLbTuhS4ZFsf+xyk5m+HViKxrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-arm64": { + "version": "1.70.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.70.0.tgz", + "integrity": "sha512-dU1qh7iD08/1avCHwIOoGsatQctE6uGwgOue9GOaThi8/Rdy1x9CC/eFdyFSeCMwbUg9ABQvMGUocylfUe6xDw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-x64": { + "version": "1.70.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.70.0.tgz", + "integrity": "sha512-iKYbjTbEk0ppkv2SrsPFhYus93kj/aMN8aRsrpuo91ZVqXg8JcH4XXbgFpwiFAsiABjqKICFfnDomrFvv49UOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/cel": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@bufbuild/cel/-/cel-0.4.0.tgz", + "integrity": "sha512-CdW/JgiTJCYXqnwuaJRo7NcoYhR37AaF58MMiog0/t8nudn86ZyLXYaA1f2yGhm2U17h8pKGZNksTHVSTcpmAw==", + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/cel-spec": "0.4.0" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^2.6.2" + } + }, + "node_modules/@bufbuild/cel-spec": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@bufbuild/cel-spec/-/cel-spec-0.4.0.tgz", + "integrity": "sha512-dUS6f2fNt6KEumsYGE7YFxERZE5ZuyME1hQmGjtO8tkZhR6ow6/ne3v4Gik9cfdb9lSLK3AJ+vDxCdGWmDbWvA==", + "license": "Apache-2.0", + "peerDependencies": { + "@bufbuild/protobuf": "^2.6.2" + } + }, + "node_modules/@bufbuild/protobuf": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.12.0.tgz", + "integrity": "sha512-B/XlCaFIP8LOwzo+bz5uFzATYokcwCKQcghqnlfwSmM5eX/qTkvDBnDPs+gXtX/RyjxJ4DRikECcPJbyALA8FA==", + "license": "(Apache-2.0 AND BSD-3-Clause)" + }, + "node_modules/@bufbuild/protoc-gen-es": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-es/-/protoc-gen-es-2.12.0.tgz", + "integrity": "sha512-d9htF6jEkSwPbp9d/vSmZOBF7eeG18AvTMKmVg4I23afnrQOxL2w3WOXa9TaufMCyu24QakEUb4vux8apI5e7A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/protobuf": "2.12.0", + "@bufbuild/protoplugin": "2.12.0" + }, + "bin": { + "protoc-gen-es": "bin/protoc-gen-es" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@bufbuild/protobuf": "2.12.0" + }, + "peerDependenciesMeta": { + "@bufbuild/protobuf": { + "optional": true + } + } + }, + "node_modules/@bufbuild/protoplugin": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-2.12.0.tgz", + "integrity": "sha512-ORlDITp8AFUXzIhLRoMCG+ud+D3MPKWb5HQXBoskMMnjeyEjE1H1qLonVNPyOr8lkx3xSfYUo8a0dvOZJVAzow==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/protobuf": "2.12.0", + "@typescript/vfs": "^1.6.2", + "typescript": "5.4.5" + } + }, + "node_modules/@bufbuild/protoplugin/node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@bufbuild/protovalidate": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protovalidate/-/protovalidate-1.2.0.tgz", + "integrity": "sha512-tD08DwGrHIV88khLz1Kdz9DYUwEo1TsoepaIg7/B/zd//AymaTx67kvCS1jlkcG/+vgQaSOl6f0HCE3sL8vI7w==", + "license": "Apache-2.0", + "dependencies": { + "@bufbuild/cel": "0.4.0" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^2.8.0" + } + }, "node_modules/@clickhouse/client": { "version": "1.11.2", "resolved": "https://registry.npmjs.org/@clickhouse/client/-/client-1.11.2.tgz", @@ -115,6 +357,81 @@ "resolved": "https://registry.npmjs.org/@clickhouse/client-common/-/client-common-1.11.2.tgz", "integrity": "sha512-H4ECHqaipzMgiZKqpb1Z4N3Ofq+lVTCn8I59XsSynqrsfR4jWZD3PipXVvIzMpDmTMvrlJWrOwAdm0DMNiMQbA==" }, + "node_modules/@connectrpc/connect": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-2.1.1.tgz", + "integrity": "sha512-JzhkaTvM73m2K1URT6tv53k2RwngSmCXLZJgK580qNQOXRzZRR/BCMfZw3h+90JpnG6XksP5bYT+cz0rpUzUWQ==", + "license": "Apache-2.0", + "peerDependencies": { + "@bufbuild/protobuf": "^2.7.0" + } + }, + "node_modules/@connectrpc/connect-next": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-next/-/connect-next-2.1.1.tgz", + "integrity": "sha512-Ch3CmGas7QngT5P2DzS/8xUolZPaN2/EHdfl8F+Bsf6KVi9TZ3wIIVw2879e669xEB3ck7SYv6zVLZ9fkUOa0Q==", + "license": "Apache-2.0", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^2.7.0", + "@connectrpc/connect": "2.1.1", + "@connectrpc/connect-node": "2.1.1", + "next": "^13.2.4 || ^14.2.5 || ^15.0.2" + } + }, + "node_modules/@connectrpc/connect-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-node/-/connect-node-2.1.1.tgz", + "integrity": "sha512-s3TfsI1XF+n+1z6MBS9rTnFsxxR4Rw5wmdEnkQINli81ESGxcsfaEet8duzq8LVuuCupmhUsgpRo0Nv9pZkufg==", + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^2.7.0", + "@connectrpc/connect": "2.1.1" + } + }, + "node_modules/@connectrpc/connect-query": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-query/-/connect-query-2.2.0.tgz", + "integrity": "sha512-oQ+coXOwBmfl4/t6EOrTfzW0zdoGDe3kvUYqZHrbzORkRFd693Cz8PxuDBjRCjmBPhDRCQMxFhR1jn2+SbgEKQ==", + "license": "Apache-2.0", + "dependencies": { + "@connectrpc/connect-query-core": "^2.2.0" + }, + "peerDependencies": { + "@bufbuild/protobuf": "2.x", + "@connectrpc/connect": "^2.0.1", + "@tanstack/react-query": ">=5.62.0", + "react": "^18 || ^19", + "react-dom": "^18 || ^19" + } + }, + "node_modules/@connectrpc/connect-query-core": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-query-core/-/connect-query-core-2.2.0.tgz", + "integrity": "sha512-t/CuxW/vP84y2iyS+PnbAnBwgOTYMzHXTSoBUKC1vIn706aNiZP40Y6mGJybglyH63RhAPcOdUgzG7DjzaAHCw==", + "license": "Apache-2.0", + "peerDependencies": { + "@bufbuild/protobuf": "2.x", + "@connectrpc/connect": "^2.0.1", + "@tanstack/query-core": ">=5.62.0" + } + }, + "node_modules/@connectrpc/connect-web": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-web/-/connect-web-2.1.1.tgz", + "integrity": "sha512-J8317Q2MaFRCT1jzVR1o06bZhDIBmU0UAzWx6xOIXzOq8+k71/+k7MUF7AwcBUX+34WIvbm5syRgC5HXQA8fOg==", + "license": "Apache-2.0", + "peerDependencies": { + "@bufbuild/protobuf": "^2.7.0", + "@connectrpc/connect": "2.1.1" + } + }, "node_modules/@emnapi/core": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.3.tgz", @@ -2266,6 +2583,19 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript/vfs": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.4.tgz", + "integrity": "sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.4.3" + }, + "peerDependencies": { + "typescript": "*" + } + }, "node_modules/@unrs/resolver-binding-android-arm-eabi": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.10.1.tgz", @@ -3325,10 +3655,11 @@ } }, "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, diff --git a/meshexplorer/package.json b/meshexplorer/package.json index 8fc4802..0e1bfac 100644 --- a/meshexplorer/package.json +++ b/meshexplorer/package.json @@ -7,11 +7,18 @@ "build": "next build", "start": "next start", "lint": "next lint", + "generate": "buf generate --include-imports", "discord-bot": "tsx scripts/discord-bot.ts", "discord-bot:dev": "tsx watch scripts/discord-bot.ts" }, "dependencies": { + "@bufbuild/protobuf": "^2.9.0", + "@bufbuild/protovalidate": "^1.2.0", "@clickhouse/client": "^1.11.2", + "@connectrpc/connect": "^2.1.0", + "@connectrpc/connect-next": "^2.1.0", + "@connectrpc/connect-query": "^2.1.0", + "@connectrpc/connect-web": "^2.1.0", "@headlessui/react": "^2.2.4", "@heroicons/react": "^2.2.0", "@tanstack/react-query": "^5.87.1", @@ -38,6 +45,8 @@ "tailwind-merge": "^3.3.1" }, "devDependencies": { + "@bufbuild/buf": "^1.50.0", + "@bufbuild/protoc-gen-es": "^2.9.0", "@eslint/eslintrc": "^3", "@tailwindcss/postcss": "^4", "@types/aes-js": "^3.1.4", diff --git a/meshexplorer/proto/meshexplorer/v1/chat.proto b/meshexplorer/proto/meshexplorer/v1/chat.proto new file mode 100644 index 0000000..8d69789 --- /dev/null +++ b/meshexplorer/proto/meshexplorer/v1/chat.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; + +package meshexplorer.v1; + +import "buf/validate/validate.proto"; + +// One (origin, origin_pubkey, path, broker, topic) reception tuple. +message OriginPathInfo { + string origin = 1; + string origin_pubkey = 2; + string path = 3; + string broker = 4; + string topic = 5; +} + +// A parsed/decrypted public-channel message (parseMeshcoreGroupMessage). +message DecryptedChat { + double timestamp = 1; + int32 msg_type = 2; + string sender = 3; + string text = 4; + string raw_text = 5; +} + +message ChatMessage { + string ingest_timestamp = 1; + string mesh_timestamp = 2; + string channel_hash = 3; + string mac = 4; + // Hex-encoded ciphertext. + string encrypted_message = 5; + int32 message_count = 6; + repeated OriginPathInfo origin_path_info = 7; + string message_id = 8; + // Present only when decrypt was requested and decryption succeeded. + optional DecryptedChat decrypted = 9; +} + +message GetChatRequest { + optional int32 limit = 1 [(buf.validate.field).int32 = {gte: 1, lte: 1000}]; + optional string before = 2; + optional string after = 3; + optional string channel_id = 4 [(buf.validate.field).string.pattern = "^[0-9A-Fa-f]+$"]; + optional string region = 5; + bool decrypt = 6; + repeated string private_keys = 7; +} + +message GetChatResponse { + repeated ChatMessage messages = 1; +} + +message StreamChatRequest { + optional string channel_id = 1 [(buf.validate.field).string.pattern = "^[0-9A-Fa-f]+$"]; + optional string region = 2; + bool decrypt = 3; + repeated string private_keys = 4; + // Poll interval in ms (clamped 100..10000, default 1000). + optional int32 poll_interval = 5 [(buf.validate.field).int32 = {gte: 100, lte: 10000}]; + // Max rows per poll (clamped 10..1000, default 500). + optional int32 max_rows = 6 [(buf.validate.field).int32 = {gte: 10, lte: 1000}]; + bool skip_initial_messages = 7; +} + +service ChatService { + rpc GetChat(GetChatRequest) returns (GetChatResponse); + rpc StreamChat(StreamChatRequest) returns (stream ChatMessage); +} diff --git a/meshexplorer/proto/meshexplorer/v1/common.proto b/meshexplorer/proto/meshexplorer/v1/common.proto new file mode 100644 index 0000000..2065751 --- /dev/null +++ b/meshexplorer/proto/meshexplorer/v1/common.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package meshexplorer.v1; + +// A directed edge in the neighbor graph between two located nodes. +// Shared by MapService.GetMap (when includeNeighbors=true) and +// NeighborsService.GetAllNeighbors. Mirrors meshcore_all_neighbor_edges. +message NeighborEdge { + string source_node = 1; + string target_node = 2; + string connection_type = 3; + int32 packet_count = 4; + string source_name = 5; + double source_latitude = 6; + double source_longitude = 7; + int32 source_has_location = 8; + string target_name = 9; + double target_latitude = 10; + double target_longitude = 11; + int32 target_has_location = 12; +} diff --git a/meshexplorer/proto/meshexplorer/v1/map.proto b/meshexplorer/proto/meshexplorer/v1/map.proto new file mode 100644 index 0000000..4246841 --- /dev/null +++ b/meshexplorer/proto/meshexplorer/v1/map.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package meshexplorer.v1; + +import "buf/validate/validate.proto"; +import "meshexplorer/v1/common.proto"; + +// Latest known position of a node. Mirrors unified_latest_nodeinfo rows +// returned by getNodePositions(). +message NodePosition { + string node_id = 1; + optional string name = 2; + optional string short_name = 3; + double latitude = 4; + double longitude = 5; + string last_seen = 6; + optional string first_seen = 7; + string type = 8; +} + +message GetMapRequest { + // Bounding box (decimal degrees). Unset fields mean "unbounded" on that edge. + optional double min_lat = 1 [(buf.validate.field).double = {gte: -90, lte: 90}]; + optional double max_lat = 2 [(buf.validate.field).double = {gte: -90, lte: 90}]; + optional double min_lng = 3 [(buf.validate.field).double = {gte: -180, lte: 180}]; + optional double max_lng = 4 [(buf.validate.field).double = {gte: -180, lte: 180}]; + repeated string node_types = 5; + // Only include nodes seen within this many seconds. + optional int32 last_seen = 6 [(buf.validate.field).int32.gte = 0]; + optional string region = 7; + // When true, also compute and return the neighbor edge graph. + bool include_neighbors = 8; +} + +message GetMapResponse { + repeated NodePosition nodes = 1; + // Populated only when include_neighbors was set on the request. + repeated NeighborEdge neighbors = 2; +} + +service MapService { + rpc GetMap(GetMapRequest) returns (GetMapResponse); +} diff --git a/meshexplorer/proto/meshexplorer/v1/neighbors.proto b/meshexplorer/proto/meshexplorer/v1/neighbors.proto new file mode 100644 index 0000000..b2fbb12 --- /dev/null +++ b/meshexplorer/proto/meshexplorer/v1/neighbors.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package meshexplorer.v1; + +import "buf/validate/validate.proto"; +import "meshexplorer/v1/common.proto"; + +message GetAllNeighborsRequest { + optional double min_lat = 1 [(buf.validate.field).double = {gte: -90, lte: 90}]; + optional double max_lat = 2 [(buf.validate.field).double = {gte: -90, lte: 90}]; + optional double min_lng = 3 [(buf.validate.field).double = {gte: -180, lte: 180}]; + optional double max_lng = 4 [(buf.validate.field).double = {gte: -180, lte: 180}]; + repeated string node_types = 5; + optional int32 last_seen = 6 [(buf.validate.field).int32.gte = 0]; + optional string region = 7; +} + +message GetAllNeighborsResponse { + repeated NeighborEdge neighbors = 1; +} + +service NeighborsService { + rpc GetAllNeighbors(GetAllNeighborsRequest) returns (GetAllNeighborsResponse); +} diff --git a/meshexplorer/proto/meshexplorer/v1/node.proto b/meshexplorer/proto/meshexplorer/v1/node.proto new file mode 100644 index 0000000..053492d --- /dev/null +++ b/meshexplorer/proto/meshexplorer/v1/node.proto @@ -0,0 +1,147 @@ +syntax = "proto3"; + +package meshexplorer.v1; + +import "buf/validate/validate.proto"; + +// Basic node identity/capabilities from the latest advert (getMeshcoreNodeInfo). +message NodeInfo { + string public_key = 1; + string node_name = 2; + optional double latitude = 3; + optional double longitude = 4; + int32 has_location = 5; + int32 is_repeater = 6; + int32 is_chat_node = 7; + int32 is_room_server = 8; + int32 has_name = 9; + optional string broker = 10; + optional string topic = 11; + string first_seen = 12; + string last_seen = 13; +} + +// One (origin, path, origin_pubkey) tuple from an advert's reception paths. +message OriginPathPubkeyTuple { + string origin = 1; + string path = 2; + string origin_pubkey = 3; +} + +// An advert grouped by packet_hash, with all the paths it was heard over. +message Advert { + string adv_timestamp = 1; + repeated OriginPathPubkeyTuple origin_path_pubkey_tuples = 2; + int32 advert_count = 3; + string earliest_timestamp = 4; + string latest_timestamp = 5; + optional double latitude = 6; + optional double longitude = 7; + int32 is_repeater = 8; + int32 is_chat_node = 9; + int32 is_room_server = 10; + int32 has_location = 11; + string packet_hash = 12; +} + +message LocationHistory { + string mesh_timestamp = 1; + double latitude = 2; + double longitude = 3; +} + +message MqttTopic { + string topic = 1; + string broker = 2; + string last_packet_time = 3; + bool is_recent = 4; +} + +message MqttInfo { + bool is_uplinked = 1; + bool has_packets = 2; + repeated MqttTopic topics = 3; +} + +message GetNodeRequest { + string public_key = 1 [(buf.validate.field).string.min_len = 10]; + // Max number of recent adverts to return (default 50). + optional int32 limit = 2 [(buf.validate.field).int32 = {gte: 1, lte: 1000}]; +} + +message GetNodeResponse { + NodeInfo node = 1; + repeated Advert recent_adverts = 2; + repeated LocationHistory location_history = 3; + MqttInfo mqtt = 4; + optional string region = 5; +} + +// Direct neighbor of a node (meshcore_node_direct_neighbors). +message Neighbor { + string public_key = 1; + string node_name = 2; + optional double latitude = 3; + optional double longitude = 4; + int32 has_location = 5; + int32 is_repeater = 6; + int32 is_chat_node = 7; + int32 is_room_server = 8; + int32 has_name = 9; + repeated string directions = 10; +} + +message GetNodeNeighborsRequest { + string public_key = 1 [(buf.validate.field).string.min_len = 10]; + optional int32 last_seen = 2 [(buf.validate.field).int32.gte = 0]; +} + +message GetNodeNeighborsResponse { + repeated Neighbor neighbors = 1; +} + +// One search request within a (possibly batched) SearchNodes call. +message SearchQuery { + optional string query = 1 [(buf.validate.field).string.max_len = 100]; + optional string region = 2; + optional int32 last_seen = 3 [(buf.validate.field).int32.gte = 0]; + optional int32 limit = 4 [(buf.validate.field).int32 = {gte: 1, lte: 200}]; + optional bool exact = 5; + optional bool is_repeater = 6; +} + +message SearchResult { + string public_key = 1; + string node_name = 2; + optional double latitude = 3; + optional double longitude = 4; + int32 has_location = 5; + int32 is_repeater = 6; + int32 is_chat_node = 7; + int32 is_room_server = 8; + int32 has_name = 9; + string first_heard = 10; + string last_seen = 11; + string broker = 12; + string topic = 13; +} + +// Results for a single query in the batch (preserves per-query grouping). +message SearchResultList { + repeated SearchResult results = 1; +} + +message SearchNodesRequest { + repeated SearchQuery queries = 1 [(buf.validate.field).repeated.max_items = 500]; +} + +message SearchNodesResponse { + // One entry per input query, in the same order. + repeated SearchResultList results = 1; +} + +service NodeService { + rpc GetNode(GetNodeRequest) returns (GetNodeResponse); + rpc GetNodeNeighbors(GetNodeNeighborsRequest) returns (GetNodeNeighborsResponse); + rpc SearchNodes(SearchNodesRequest) returns (SearchNodesResponse); +} diff --git a/meshexplorer/proto/meshexplorer/v1/packets.proto b/meshexplorer/proto/meshexplorer/v1/packets.proto new file mode 100644 index 0000000..846ebe3 --- /dev/null +++ b/meshexplorer/proto/meshexplorer/v1/packets.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package meshexplorer.v1; + +import "buf/validate/validate.proto"; + +// A raw mesh packet (meshcore_packets), hex fields kept as hex strings. +message Packet { + string ingest_timestamp = 1; + string mesh_timestamp = 2; + string broker = 3; + string topic = 4; + string packet = 5; + int32 path_len = 6; + string path = 7; + int32 route_type = 8; + int32 payload_type = 9; + int32 payload_version = 10; + int32 header = 11; + string origin_pubkey = 12; +} + +message StreamPacketsRequest { + optional string region = 1; + // Payload type filter (0..15). + optional int32 payload_type = 2 [(buf.validate.field).int32 = {gte: 0, lte: 15}]; + // Route type filter (0..3). + optional int32 route_type = 3 [(buf.validate.field).int32 = {gte: 0, lte: 3}]; + optional string origin_pubkey = 4 [(buf.validate.field).string.pattern = "^[0-9A-Fa-f]+$"]; + // Poll interval in ms (clamped 100..10000, default 500). + optional int32 poll_interval = 5 [(buf.validate.field).int32 = {gte: 100, lte: 10000}]; + // Max rows per poll (clamped 10..10000, default 10). + optional int32 max_rows = 6 [(buf.validate.field).int32 = {gte: 10, lte: 10000}]; +} + +service PacketsService { + rpc StreamPackets(StreamPacketsRequest) returns (stream Packet); +} diff --git a/meshexplorer/proto/meshexplorer/v1/stats.proto b/meshexplorer/proto/meshexplorer/v1/stats.proto new file mode 100644 index 0000000..6b5ae28 --- /dev/null +++ b/meshexplorer/proto/meshexplorer/v1/stats.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; + +package meshexplorer.v1; + +message StatsRequest { + optional string region = 1; +} + +message GetTotalNodesResponse { + int32 total_nodes = 1; +} + +message NodesOverTimeRow { + string day = 1; + int32 cumulative_unique_nodes = 2; + int32 nodes_with_location = 3; + int32 nodes_without_location = 4; + int32 repeaters = 5; + int32 room_servers = 6; +} + +message GetNodesOverTimeResponse { + repeated NodesOverTimeRow data = 1; +} + +message PopularChannelRow { + string channel_hash = 1; + int32 message_count = 2; +} + +message GetPopularChannelsResponse { + repeated PopularChannelRow data = 1; +} + +message RepeaterPrefixRow { + string prefix = 1; + repeated string node_names = 2; +} + +message GetRepeaterPrefixesResponse { + repeated RepeaterPrefixRow data = 1; +} + +service StatsService { + rpc GetTotalNodes(StatsRequest) returns (GetTotalNodesResponse); + rpc GetNodesOverTime(StatsRequest) returns (GetNodesOverTimeResponse); + rpc GetPopularChannels(StatsRequest) returns (GetPopularChannelsResponse); + rpc GetRepeaterPrefixes(StatsRequest) returns (GetRepeaterPrefixesResponse); +} diff --git a/meshexplorer/src/app/(app)/meshcore/node/[publicKey]/page.tsx b/meshexplorer/src/app/(app)/meshcore/node/[publicKey]/page.tsx index 6f420ff..d63e1aa 100644 --- a/meshexplorer/src/app/(app)/meshcore/node/[publicKey]/page.tsx +++ b/meshexplorer/src/app/(app)/meshcore/node/[publicKey]/page.tsx @@ -25,7 +25,7 @@ function getNodeType(node: NodeInfo): number { export default function MeshcoreNodePage() { const params = useParams(); - const publicKey = params.publicKey as string; + const publicKey = params?.publicKey as string; const { config } = useConfig(); // Use TanStack Query for node data diff --git a/meshexplorer/src/components/MapView.tsx b/meshexplorer/src/components/MapView.tsx index 6a4f694..d02a800 100644 --- a/meshexplorer/src/components/MapView.tsx +++ b/meshexplorer/src/components/MapView.tsx @@ -13,7 +13,8 @@ import MapLayerSettingsComponent from "@/components/MapLayerSettings"; import { type MapLayerSettings } from "@/hooks/useMapLayerSettings"; import { NodeMarker, ClusterMarker, PopupContent } from "./MapIcons"; import { renderToString } from "react-dom/server"; -import { buildApiUrl } from "@/lib/api"; +import { Code, ConnectError } from "@connectrpc/connect"; +import { mapClient } from "@/lib/connect/client"; import { NodePosition } from "@/types/map"; import { useNeighbors, type Neighbor } from "@/hooks/useNeighbors"; import { type AllNeighborsConnection } from "@/hooks/useAllNeighbors"; @@ -572,65 +573,75 @@ export default function MapView({ target = '_self' }: MapViewProps = {}) { setAllNeighborsLoading(true); } - let url = "/api/map"; - const params = []; - if (bounds) { - const [[minLat, minLng], [maxLat, maxLng]] = bounds; - params.push(`minLat=${minLat}`); - params.push(`maxLat=${maxLat}`); - params.push(`minLng=${minLng}`); - params.push(`maxLng=${maxLng}`); - } - if (mapLayerSettings.nodeTypes && mapLayerSettings.nodeTypes.length > 0) { - for (const type of mapLayerSettings.nodeTypes) { - params.push(`nodeTypes=${encodeURIComponent(type)}`); - } - } - if (config?.lastSeen !== null && config?.lastSeen !== undefined) { - params.push(`lastSeen=${config.lastSeen}`); - } - if (config?.selectedRegion) { - params.push(`region=${encodeURIComponent(config.selectedRegion)}`); - } - if (includeNeighbors) { - params.push('includeNeighbors=true'); - } - if (params.length > 0) { - url += `?${params.join("&")}`; - } - - fetch(buildApiUrl(url), { signal: controller.signal }) - .then((res) => res.json()) - .then((data) => { - if (Array.isArray(data)) { - // Backward compatibility: just nodes array - setNodePositions(data); - setLastResultCount(data.length); - if (includeNeighbors) { - // If we expected neighbors but got just nodes, clear neighbors - setAllNeighborConnections([]); - } - } else if (data && data.nodes && Array.isArray(data.nodes)) { - // New format: object with nodes and neighbors - setNodePositions(data.nodes); - setLastResultCount(data.nodes.length); - if (data.neighbors && Array.isArray(data.neighbors)) { - setAllNeighborConnections(data.neighbors); - } else { - setAllNeighborConnections([]); - } + // Clamp to valid lat/lng ranges so the protovalidate bounds rules accept the + // (buffered) viewport; node coordinates never fall outside these ranges. + const clampLat = (v: number) => Math.max(-90, Math.min(90, v)); + const clampLng = (v: number) => Math.max(-180, Math.min(180, v)); + + const request = { + minLat: bounds ? clampLat(bounds[0][0]) : undefined, + minLng: bounds ? clampLng(bounds[0][1]) : undefined, + maxLat: bounds ? clampLat(bounds[1][0]) : undefined, + maxLng: bounds ? clampLng(bounds[1][1]) : undefined, + nodeTypes: + mapLayerSettings.nodeTypes && mapLayerSettings.nodeTypes.length > 0 + ? mapLayerSettings.nodeTypes + : [], + lastSeen: + config?.lastSeen !== null && config?.lastSeen !== undefined + ? config.lastSeen + : undefined, + region: config?.selectedRegion || undefined, + includeNeighbors, + }; + + mapClient + .getMap(request, { signal: controller.signal }) + .then((res) => { + setNodePositions( + res.nodes.map((n) => ({ + node_id: n.nodeId, + latitude: n.latitude, + longitude: n.longitude, + last_seen: n.lastSeen, + first_seen: n.firstSeen, + type: n.type, + short_name: n.shortName, + name: n.name ?? null, + })), + ); + setLastResultCount(res.nodes.length); + if (includeNeighbors) { + setAllNeighborConnections( + res.neighbors.map((e) => ({ + source_node: e.sourceNode, + target_node: e.targetNode, + connection_type: e.connectionType, + packet_count: e.packetCount, + source_name: e.sourceName, + source_latitude: e.sourceLatitude, + source_longitude: e.sourceLongitude, + source_has_location: e.sourceHasLocation, + target_name: e.targetName, + target_latitude: e.targetLatitude, + target_longitude: e.targetLongitude, + target_has_location: e.targetHasLocation, + })), + ); } else { - setNodePositions([]); setAllNeighborConnections([]); } - + if (fetchController.current === controller) { setLoading(false); setAllNeighborsLoading(false); } }) .catch((err) => { - if (err.name !== "AbortError") { + const canceled = + controller.signal.aborted || + (err instanceof ConnectError && err.code === Code.Canceled); + if (!canceled) { setNodePositions([]); setAllNeighborConnections([]); } diff --git a/meshexplorer/src/components/QueryProvider.tsx b/meshexplorer/src/components/QueryProvider.tsx index 43f2a82..a64363d 100644 --- a/meshexplorer/src/components/QueryProvider.tsx +++ b/meshexplorer/src/components/QueryProvider.tsx @@ -1,7 +1,9 @@ "use client"; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { TransportProvider } from '@connectrpc/connect-query'; import { ReactNode, useState } from 'react'; +import { transport } from '@/lib/connect/transport'; export function QueryProvider({ children }: { children: ReactNode }) { const [queryClient] = useState(() => new QueryClient({ @@ -16,8 +18,10 @@ export function QueryProvider({ children }: { children: ReactNode }) { })); return ( - - {children} - + + + {children} + + ); } diff --git a/meshexplorer/src/gen/buf/validate/validate_pb.ts b/meshexplorer/src/gen/buf/validate/validate_pb.ts new file mode 100644 index 0000000..94c02e4 --- /dev/null +++ b/meshexplorer/src/gen/buf/validate/validate_pb.ts @@ -0,0 +1,5028 @@ +// Copyright 2023-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v2.12.0 with parameter "target=ts,import_extension=none" +// @generated from file buf/validate/validate.proto (package buf.validate, syntax proto2) +/* eslint-disable */ + +// [Protovalidate](https://protovalidate.com/) is the semantic validation library for Protobuf. +// It provides standard annotations to validate common rules on messages and fields, as well as the ability to use [CEL](https://cel.dev) to write custom rules. +// It's the next generation of [protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate). +// +// This package provides the options, messages, and enums that power Protovalidate. +// Apply its options to messages, fields, and oneofs in your Protobuf schemas to add validation rules: +// +// ```proto +// message User { +// string id = 1 [(buf.validate.field).string.uuid = true]; +// string first_name = 2 [(buf.validate.field).string.max_len = 64]; +// string last_name = 3 [(buf.validate.field).string.max_len = 64]; +// +// option (buf.validate.message).cel = { +// id: "first_name_requires_last_name" +// message: "last_name must be present if first_name is present" +// expression: "!has(this.first_name) || has(this.last_name)" +// }; +// } +// ``` +// +// These rules are enforced at runtime by language-specific libraries. +// See the [developer quickstart](https://protovalidate.com/quickstart/) to get started, or go directly to the runtime library for your language: +// [Go](https://github.com/bufbuild/protovalidate-go), +// [JavaScript/TypeScript](https://github.com/bufbuild/protovalidate-es), +// [Java](https://github.com/bufbuild/protovalidate-java), +// [Python](https://github.com/bufbuild/protovalidate-python), +// or [C++](https://github.com/bufbuild/protovalidate-cc). + +import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Duration, FieldDescriptorProto_Type, FieldMask, FieldOptions, MessageOptions, OneofOptions, Timestamp } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_field_mask, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file buf/validate/validate.proto. + */ +export const file_buf_validate_validate: GenFile = /*@__PURE__*/ + fileDesc("ChtidWYvdmFsaWRhdGUvdmFsaWRhdGUucHJvdG8SDGJ1Zi52YWxpZGF0ZSI3CgRSdWxlEgoKAmlk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Z29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucxiHCSABKAsyGC5idWYudmFsaWRhdGUuRmllbGRSdWxlc1IFZmllbGQ6XQoKcHJlZGVmaW5lZBIdLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMYiAkgASgLMh0uYnVmLnZhbGlkYXRlLlByZWRlZmluZWRSdWxlc1IKcHJlZGVmaW5lZEJuChJidWlsZC5idWYudmFsaWRhdGVCDVZhbGlkYXRlUHJvdG9QAVpHYnVmLmJ1aWxkL2dlbi9nby9idWZidWlsZC9wcm90b3ZhbGlkYXRlL3Byb3RvY29sYnVmZmVycy9nby9idWYvdmFsaWRhdGU", [file_google_protobuf_descriptor, file_google_protobuf_duration, file_google_protobuf_field_mask, file_google_protobuf_timestamp]); + +/** + * `Rule` represents a validation rule written in the Common Expression + * Language (CEL) syntax. Each Rule includes a unique identifier, an + * optional error message, and the CEL expression to evaluate. For more + * information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + * + * ```proto + * message Foo { + * option (buf.validate.message).cel = { + * id: "foo.bar" + * message: "bar must be greater than 0" + * expression: "this.bar > 0" + * }; + * int32 bar = 1; + * } + * ``` + * + * @generated from message buf.validate.Rule + */ +export type Rule = Message<"buf.validate.Rule"> & { + /** + * `id` is a string that serves as a machine-readable name for this Rule. + * It should be unique within its scope, which could be either a message or a field. + * + * @generated from field: optional string id = 1; + */ + id: string; + + /** + * `message` is an optional field that provides a human-readable error message + * for this Rule when the CEL expression evaluates to false. If a + * non-empty message is provided, any strings resulting from the CEL + * expression evaluation are ignored. + * + * @generated from field: optional string message = 2; + */ + message: string; + + /** + * `expression` is the actual CEL expression that will be evaluated for + * validation. This string must resolve to either a boolean or a string + * value. If the expression evaluates to false or a non-empty string, the + * validation is considered failed, and the message is rejected. + * + * @generated from field: optional string expression = 3; + */ + expression: string; +}; + +/** + * Describes the message buf.validate.Rule. + * Use `create(RuleSchema)` to create a new message. + */ +export const RuleSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 0); + +/** + * MessageRules represents validation rules that are applied to the entire message. + * It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules. + * + * @generated from message buf.validate.MessageRules + */ +export type MessageRules = Message<"buf.validate.MessageRules"> & { + /** + * `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + * rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + * + * This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + * simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + * be same as the `expression`. + * + * For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + * + * ```proto + * message MyMessage { + * // The field `foo` must be greater than 42. + * option (buf.validate.message).cel_expression = "this.foo > 42"; + * // The field `foo` must be less than 84. + * option (buf.validate.message).cel_expression = "this.foo < 84"; + * optional int32 foo = 1; + * } + * ``` + * + * @generated from field: repeated string cel_expression = 5; + */ + celExpression: string[]; + + /** + * `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message. + * These rules are written in Common Expression Language (CEL) syntax. For more information, + * [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + * + * + * ```proto + * message MyMessage { + * // The field `foo` must be greater than 42. + * option (buf.validate.message).cel = { + * id: "my_message.value", + * message: "must be greater than 42", + * expression: "this.foo > 42", + * }; + * optional int32 foo = 1; + * } + * ``` + * + * @generated from field: repeated buf.validate.Rule cel = 3; + */ + cel: Rule[]; + + /** + * `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields + * of which at most one can be present. If `required` is also specified, then exactly one + * of the specified fields _must_ be present. + * + * This will enforce oneof-like constraints with a few features not provided by + * actual Protobuf oneof declarations: + * 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof, + * only scalar fields are allowed. + * 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member + * fields have explicit presence. This means that, for the purpose of determining + * how many fields are set, explicitly setting such a field to its zero value is + * effectively the same as not setting it at all. + * 3. This will always generate validation errors for a message unmarshalled from + * serialized data that sets more than one field. With a Protobuf oneof, when + * multiple fields are present in the serialized form, earlier values are usually + * silently ignored when unmarshalling, with only the last field being set when + * unmarshalling completes. + * + * Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means + * only the field that is set will be validated and the unset fields are not validated according to the field rules. + * This behavior can be overridden by setting `ignore` against a field. + * + * ```proto + * message MyMessage { + * // Only one of `field1` or `field2` _can_ be present in this message. + * option (buf.validate.message).oneof = { fields: ["field1", "field2"] }; + * // Exactly one of `field3` or `field4` _must_ be present in this message. + * option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true }; + * string field1 = 1; + * bytes field2 = 2; + * bool field3 = 3; + * int32 field4 = 4; + * } + * ``` + * + * @generated from field: repeated buf.validate.MessageOneofRule oneof = 4; + */ + oneof: MessageOneofRule[]; +}; + +/** + * Describes the message buf.validate.MessageRules. + * Use `create(MessageRulesSchema)` to create a new message. + */ +export const MessageRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 1); + +/** + * @generated from message buf.validate.MessageOneofRule + */ +export type MessageOneofRule = Message<"buf.validate.MessageOneofRule"> & { + /** + * A list of field names to include in the oneof. All field names must be + * defined in the message. At least one field must be specified, and + * duplicates are not permitted. + * + * @generated from field: repeated string fields = 1; + */ + fields: string[]; + + /** + * If true, one of the fields specified _must_ be set. + * + * @generated from field: optional bool required = 2; + */ + required: boolean; +}; + +/** + * Describes the message buf.validate.MessageOneofRule. + * Use `create(MessageOneofRuleSchema)` to create a new message. + */ +export const MessageOneofRuleSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 2); + +/** + * The `OneofRules` message type enables you to manage rules for + * oneof fields in your protobuf messages. + * + * @generated from message buf.validate.OneofRules + */ +export type OneofRules = Message<"buf.validate.OneofRules"> & { + /** + * If `required` is true, exactly one field of the oneof must be set. A + * validation error is returned if no fields in the oneof are set. Further rules + * should be placed on the fields themselves to ensure they are valid values, + * such as `min_len` or `gt`. + * + * ```proto + * message MyMessage { + * oneof value { + * // Either `a` or `b` must be set. If `a` is set, it must also be + * // non-empty; whereas if `b` is set, it can still be an empty string. + * option (buf.validate.oneof).required = true; + * string a = 1 [(buf.validate.field).string.min_len = 1]; + * string b = 2; + * } + * } + * ``` + * + * @generated from field: optional bool required = 1; + */ + required: boolean; +}; + +/** + * Describes the message buf.validate.OneofRules. + * Use `create(OneofRulesSchema)` to create a new message. + */ +export const OneofRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 3); + +/** + * FieldRules encapsulates the rules for each type of field. Depending on + * the field, the correct set should be used to ensure proper validations. + * + * @generated from message buf.validate.FieldRules + */ +export type FieldRules = Message<"buf.validate.FieldRules"> & { + /** + * `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + * rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + * + * This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + * simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + * be same as the `expression`. + * + * For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + * + * ```proto + * message MyMessage { + * // The field `value` must be greater than 42. + * optional int32 value = 1 [(buf.validate.field).cel_expression = "this > 42"]; + * } + * ``` + * + * @generated from field: repeated string cel_expression = 29; + */ + celExpression: string[]; + + /** + * `cel` is a repeated field used to represent a textual expression + * in the Common Expression Language (CEL) syntax. For more information, + * [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + * + * ```proto + * message MyMessage { + * // The field `value` must be greater than 42. + * optional int32 value = 1 [(buf.validate.field).cel = { + * id: "my_message.value", + * message: "must be greater than 42", + * expression: "this > 42", + * }]; + * } + * ``` + * + * @generated from field: repeated buf.validate.Rule cel = 23; + */ + cel: Rule[]; + + /** + * If `required` is true, the field must be set. A validation error is returned + * if the field is not set. + * + * ```proto + * syntax="proto3"; + * + * message FieldsWithPresence { + * // Requires any string to be set, including the empty string. + * optional string link = 1 [ + * (buf.validate.field).required = true + * ]; + * // Requires true or false to be set. + * optional bool disabled = 2 [ + * (buf.validate.field).required = true + * ]; + * // Requires a message to be set, including the empty message. + * SomeMessage msg = 4 [ + * (buf.validate.field).required = true + * ]; + * } + * ``` + * + * All fields in the example above track presence. By default, Protovalidate + * ignores rules on those fields if no value is set. `required` ensures that + * the fields are set and valid. + * + * Fields that don't track presence are always validated by Protovalidate, + * whether they are set or not. It is not necessary to add `required`. It + * can be added to indicate that the field cannot be the zero value. + * + * ```proto + * syntax="proto3"; + * + * message FieldsWithoutPresence { + * // `string.email` always applies, even to an empty string. + * string link = 1 [ + * (buf.validate.field).string.email = true + * ]; + * // `repeated.min_items` always applies, even to an empty list. + * repeated string labels = 2 [ + * (buf.validate.field).repeated.min_items = 1 + * ]; + * // `required`, for fields that don't track presence, indicates + * // the value of the field can't be the zero value. + * int32 zero_value_not_allowed = 3 [ + * (buf.validate.field).required = true + * ]; + * } + * ``` + * + * To learn which fields track presence, see the + * [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + * + * Note: While field rules can be applied to repeated items, map keys, and map + * values, the elements are always considered to be set. Consequently, + * specifying `repeated.items.required` is redundant. + * + * @generated from field: optional bool required = 25; + */ + required: boolean; + + /** + * Ignore validation rules on the field if its value matches the specified + * criteria. See the `Ignore` enum for details. + * + * ```proto + * message UpdateRequest { + * // The uri rule only applies if the field is not an empty string. + * string url = 1 [ + * (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE, + * (buf.validate.field).string.uri = true + * ]; + * } + * ``` + * + * @generated from field: optional buf.validate.Ignore ignore = 27; + */ + ignore: Ignore; + + /** + * @generated from oneof buf.validate.FieldRules.type + */ + type: { + /** + * Scalar Field Types + * + * @generated from field: buf.validate.FloatRules float = 1; + */ + value: FloatRules; + case: "float"; + } | { + /** + * @generated from field: buf.validate.DoubleRules double = 2; + */ + value: DoubleRules; + case: "double"; + } | { + /** + * @generated from field: buf.validate.Int32Rules int32 = 3; + */ + value: Int32Rules; + case: "int32"; + } | { + /** + * @generated from field: buf.validate.Int64Rules int64 = 4; + */ + value: Int64Rules; + case: "int64"; + } | { + /** + * @generated from field: buf.validate.UInt32Rules uint32 = 5; + */ + value: UInt32Rules; + case: "uint32"; + } | { + /** + * @generated from field: buf.validate.UInt64Rules uint64 = 6; + */ + value: UInt64Rules; + case: "uint64"; + } | { + /** + * @generated from field: buf.validate.SInt32Rules sint32 = 7; + */ + value: SInt32Rules; + case: "sint32"; + } | { + /** + * @generated from field: buf.validate.SInt64Rules sint64 = 8; + */ + value: SInt64Rules; + case: "sint64"; + } | { + /** + * @generated from field: buf.validate.Fixed32Rules fixed32 = 9; + */ + value: Fixed32Rules; + case: "fixed32"; + } | { + /** + * @generated from field: buf.validate.Fixed64Rules fixed64 = 10; + */ + value: Fixed64Rules; + case: "fixed64"; + } | { + /** + * @generated from field: buf.validate.SFixed32Rules sfixed32 = 11; + */ + value: SFixed32Rules; + case: "sfixed32"; + } | { + /** + * @generated from field: buf.validate.SFixed64Rules sfixed64 = 12; + */ + value: SFixed64Rules; + case: "sfixed64"; + } | { + /** + * @generated from field: buf.validate.BoolRules bool = 13; + */ + value: BoolRules; + case: "bool"; + } | { + /** + * @generated from field: buf.validate.StringRules string = 14; + */ + value: StringRules; + case: "string"; + } | { + /** + * @generated from field: buf.validate.BytesRules bytes = 15; + */ + value: BytesRules; + case: "bytes"; + } | { + /** + * Complex Field Types + * + * @generated from field: buf.validate.EnumRules enum = 16; + */ + value: EnumRules; + case: "enum"; + } | { + /** + * @generated from field: buf.validate.RepeatedRules repeated = 18; + */ + value: RepeatedRules; + case: "repeated"; + } | { + /** + * @generated from field: buf.validate.MapRules map = 19; + */ + value: MapRules; + case: "map"; + } | { + /** + * Well-Known Field Types + * + * @generated from field: buf.validate.AnyRules any = 20; + */ + value: AnyRules; + case: "any"; + } | { + /** + * @generated from field: buf.validate.DurationRules duration = 21; + */ + value: DurationRules; + case: "duration"; + } | { + /** + * @generated from field: buf.validate.FieldMaskRules field_mask = 28; + */ + value: FieldMaskRules; + case: "fieldMask"; + } | { + /** + * @generated from field: buf.validate.TimestampRules timestamp = 22; + */ + value: TimestampRules; + case: "timestamp"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message buf.validate.FieldRules. + * Use `create(FieldRulesSchema)` to create a new message. + */ +export const FieldRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 4); + +/** + * PredefinedRules are custom rules that can be re-used with + * multiple fields. + * + * @generated from message buf.validate.PredefinedRules + */ +export type PredefinedRules = Message<"buf.validate.PredefinedRules"> & { + /** + * `cel` is a repeated field used to represent a textual expression + * in the Common Expression Language (CEL) syntax. For more information, + * [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/). + * + * ```proto + * message MyMessage { + * // The field `value` must be greater than 42. + * optional int32 value = 1 [(buf.validate.predefined).cel = { + * id: "my_message.value", + * message: "must be greater than 42", + * expression: "this > 42", + * }]; + * } + * ``` + * + * @generated from field: repeated buf.validate.Rule cel = 1; + */ + cel: Rule[]; +}; + +/** + * Describes the message buf.validate.PredefinedRules. + * Use `create(PredefinedRulesSchema)` to create a new message. + */ +export const PredefinedRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 5); + +/** + * FloatRules describes the rules applied to `float` values. These + * rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type. + * + * @generated from message buf.validate.FloatRules + */ +export type FloatRules = Message<"buf.validate.FloatRules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MyFloat { + * // value must equal 42.0 + * float value = 1 [(buf.validate.field).float.const = 42.0]; + * } + * ``` + * + * @generated from field: optional float const = 1; + */ + const: number; + + /** + * @generated from oneof buf.validate.FloatRules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified value, + * an error message is generated. + * + * ```proto + * message MyFloat { + * // must be less than 10.0 + * float value = 1 [(buf.validate.field).float.lt = 10.0]; + * } + * ``` + * + * @generated from field: float lt = 2; + */ + value: number; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyFloat { + * // must be less than or equal to 10.0 + * float value = 1 [(buf.validate.field).float.lte = 10.0]; + * } + * ``` + * + * @generated from field: float lte = 3; + */ + value: number; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.FloatRules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyFloat { + * // must be greater than 5.0 [float.gt] + * float value = 1 [(buf.validate.field).float.gt = 5.0]; + * + * // must be greater than 5 and less than 10.0 [float.gt_lt] + * float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }]; + * + * // must be greater than 10 or less than 5.0 [float.gt_lt_exclusive] + * float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }]; + * } + * ``` + * + * @generated from field: float gt = 4; + */ + value: number; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyFloat { + * // must be greater than or equal to 5.0 [float.gte] + * float value = 1 [(buf.validate.field).float.gte = 5.0]; + * + * // must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt] + * float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }]; + * + * // must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive] + * float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }]; + * } + * ``` + * + * @generated from field: float gte = 5; + */ + value: number; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message + * is generated. + * + * ```proto + * message MyFloat { + * // must be in list [1.0, 2.0, 3.0] + * float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }]; + * } + * ``` + * + * @generated from field: repeated float in = 6; + */ + in: number[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MyFloat { + * // value must not be in list [1.0, 2.0, 3.0] + * float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }]; + * } + * ``` + * + * @generated from field: repeated float not_in = 7; + */ + notIn: number[]; + + /** + * `finite` requires the field value to be finite. If the field value is + * infinite or NaN, an error message is generated. + * + * @generated from field: optional bool finite = 8; + */ + finite: boolean; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyFloat { + * float value = 1 [ + * (buf.validate.field).float.example = 1.0, + * (buf.validate.field).float.example = inf + * ]; + * } + * ``` + * + * @generated from field: repeated float example = 9; + */ + example: number[]; +}; + +/** + * Describes the message buf.validate.FloatRules. + * Use `create(FloatRulesSchema)` to create a new message. + */ +export const FloatRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 6); + +/** + * DoubleRules describes the rules applied to `double` values. These + * rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type. + * + * @generated from message buf.validate.DoubleRules + */ +export type DoubleRules = Message<"buf.validate.DoubleRules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MyDouble { + * // value must equal 42.0 + * double value = 1 [(buf.validate.field).double.const = 42.0]; + * } + * ``` + * + * @generated from field: optional double const = 1; + */ + const: number; + + /** + * @generated from oneof buf.validate.DoubleRules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyDouble { + * // must be less than 10.0 + * double value = 1 [(buf.validate.field).double.lt = 10.0]; + * } + * ``` + * + * @generated from field: double lt = 2; + */ + value: number; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified value + * (field <= value). If the field value is greater than the specified value, + * an error message is generated. + * + * ```proto + * message MyDouble { + * // must be less than or equal to 10.0 + * double value = 1 [(buf.validate.field).double.lte = 10.0]; + * } + * ``` + * + * @generated from field: double lte = 3; + */ + value: number; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.DoubleRules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`, + * the range is reversed, and the field value must be outside the specified + * range. If the field value doesn't meet the required conditions, an error + * message is generated. + * + * ```proto + * message MyDouble { + * // must be greater than 5.0 [double.gt] + * double value = 1 [(buf.validate.field).double.gt = 5.0]; + * + * // must be greater than 5 and less than 10.0 [double.gt_lt] + * double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }]; + * + * // must be greater than 10 or less than 5.0 [double.gt_lt_exclusive] + * double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }]; + * } + * ``` + * + * @generated from field: double gt = 4; + */ + value: number; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyDouble { + * // must be greater than or equal to 5.0 [double.gte] + * double value = 1 [(buf.validate.field).double.gte = 5.0]; + * + * // must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt] + * double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }]; + * + * // must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive] + * double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }]; + * } + * ``` + * + * @generated from field: double gte = 5; + */ + value: number; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MyDouble { + * // must be in list [1.0, 2.0, 3.0] + * double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }]; + * } + * ``` + * + * @generated from field: repeated double in = 6; + */ + in: number[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MyDouble { + * // value must not be in list [1.0, 2.0, 3.0] + * double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }]; + * } + * ``` + * + * @generated from field: repeated double not_in = 7; + */ + notIn: number[]; + + /** + * `finite` requires the field value to be finite. If the field value is + * infinite or NaN, an error message is generated. + * + * @generated from field: optional bool finite = 8; + */ + finite: boolean; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyDouble { + * double value = 1 [ + * (buf.validate.field).double.example = 1.0, + * (buf.validate.field).double.example = inf + * ]; + * } + * ``` + * + * @generated from field: repeated double example = 9; + */ + example: number[]; +}; + +/** + * Describes the message buf.validate.DoubleRules. + * Use `create(DoubleRulesSchema)` to create a new message. + */ +export const DoubleRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 7); + +/** + * Int32Rules describes the rules applied to `int32` values. These + * rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type. + * + * @generated from message buf.validate.Int32Rules + */ +export type Int32Rules = Message<"buf.validate.Int32Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MyInt32 { + * // value must equal 42 + * int32 value = 1 [(buf.validate.field).int32.const = 42]; + * } + * ``` + * + * @generated from field: optional int32 const = 1; + */ + const: number; + + /** + * @generated from oneof buf.validate.Int32Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field + * < value). If the field value is equal to or greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyInt32 { + * // must be less than 10 + * int32 value = 1 [(buf.validate.field).int32.lt = 10]; + * } + * ``` + * + * @generated from field: int32 lt = 2; + */ + value: number; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyInt32 { + * // must be less than or equal to 10 + * int32 value = 1 [(buf.validate.field).int32.lte = 10]; + * } + * ``` + * + * @generated from field: int32 lte = 3; + */ + value: number; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.Int32Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyInt32 { + * // must be greater than 5 [int32.gt] + * int32 value = 1 [(buf.validate.field).int32.gt = 5]; + * + * // must be greater than 5 and less than 10 [int32.gt_lt] + * int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [int32.gt_lt_exclusive] + * int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: int32 gt = 4; + */ + value: number; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified value + * (exclusive). If the value of `gte` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyInt32 { + * // must be greater than or equal to 5 [int32.gte] + * int32 value = 1 [(buf.validate.field).int32.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [int32.gte_lt] + * int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive] + * int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: int32 gte = 5; + */ + value: number; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MyInt32 { + * // must be in list [1, 2, 3] + * int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated int32 in = 6; + */ + in: number[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error message + * is generated. + * + * ```proto + * message MyInt32 { + * // value must not be in list [1, 2, 3] + * int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated int32 not_in = 7; + */ + notIn: number[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyInt32 { + * int32 value = 1 [ + * (buf.validate.field).int32.example = 1, + * (buf.validate.field).int32.example = -10 + * ]; + * } + * ``` + * + * @generated from field: repeated int32 example = 8; + */ + example: number[]; +}; + +/** + * Describes the message buf.validate.Int32Rules. + * Use `create(Int32RulesSchema)` to create a new message. + */ +export const Int32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 8); + +/** + * Int64Rules describes the rules applied to `int64` values. These + * rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type. + * + * @generated from message buf.validate.Int64Rules + */ +export type Int64Rules = Message<"buf.validate.Int64Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MyInt64 { + * // value must equal 42 + * int64 value = 1 [(buf.validate.field).int64.const = 42]; + * } + * ``` + * + * @generated from field: optional int64 const = 1; + */ + const: bigint; + + /** + * @generated from oneof buf.validate.Int64Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified value, + * an error message is generated. + * + * ```proto + * message MyInt64 { + * // must be less than 10 + * int64 value = 1 [(buf.validate.field).int64.lt = 10]; + * } + * ``` + * + * @generated from field: int64 lt = 2; + */ + value: bigint; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyInt64 { + * // must be less than or equal to 10 + * int64 value = 1 [(buf.validate.field).int64.lte = 10]; + * } + * ``` + * + * @generated from field: int64 lte = 3; + */ + value: bigint; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.Int64Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyInt64 { + * // must be greater than 5 [int64.gt] + * int64 value = 1 [(buf.validate.field).int64.gt = 5]; + * + * // must be greater than 5 and less than 10 [int64.gt_lt] + * int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [int64.gt_lt_exclusive] + * int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: int64 gt = 4; + */ + value: bigint; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyInt64 { + * // must be greater than or equal to 5 [int64.gte] + * int64 value = 1 [(buf.validate.field).int64.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [int64.gte_lt] + * int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive] + * int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: int64 gte = 5; + */ + value: bigint; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MyInt64 { + * // must be in list [1, 2, 3] + * int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated int64 in = 6; + */ + in: bigint[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MyInt64 { + * // value must not be in list [1, 2, 3] + * int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated int64 not_in = 7; + */ + notIn: bigint[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyInt64 { + * int64 value = 1 [ + * (buf.validate.field).int64.example = 1, + * (buf.validate.field).int64.example = -10 + * ]; + * } + * ``` + * + * @generated from field: repeated int64 example = 9; + */ + example: bigint[]; +}; + +/** + * Describes the message buf.validate.Int64Rules. + * Use `create(Int64RulesSchema)` to create a new message. + */ +export const Int64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 9); + +/** + * UInt32Rules describes the rules applied to `uint32` values. These + * rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type. + * + * @generated from message buf.validate.UInt32Rules + */ +export type UInt32Rules = Message<"buf.validate.UInt32Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MyUInt32 { + * // value must equal 42 + * uint32 value = 1 [(buf.validate.field).uint32.const = 42]; + * } + * ``` + * + * @generated from field: optional uint32 const = 1; + */ + const: number; + + /** + * @generated from oneof buf.validate.UInt32Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified value, + * an error message is generated. + * + * ```proto + * message MyUInt32 { + * // must be less than 10 + * uint32 value = 1 [(buf.validate.field).uint32.lt = 10]; + * } + * ``` + * + * @generated from field: uint32 lt = 2; + */ + value: number; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyUInt32 { + * // must be less than or equal to 10 + * uint32 value = 1 [(buf.validate.field).uint32.lte = 10]; + * } + * ``` + * + * @generated from field: uint32 lte = 3; + */ + value: number; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.UInt32Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyUInt32 { + * // must be greater than 5 [uint32.gt] + * uint32 value = 1 [(buf.validate.field).uint32.gt = 5]; + * + * // must be greater than 5 and less than 10 [uint32.gt_lt] + * uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [uint32.gt_lt_exclusive] + * uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: uint32 gt = 4; + */ + value: number; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyUInt32 { + * // must be greater than or equal to 5 [uint32.gte] + * uint32 value = 1 [(buf.validate.field).uint32.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [uint32.gte_lt] + * uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive] + * uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: uint32 gte = 5; + */ + value: number; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MyUInt32 { + * // must be in list [1, 2, 3] + * uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated uint32 in = 6; + */ + in: number[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MyUInt32 { + * // value must not be in list [1, 2, 3] + * uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated uint32 not_in = 7; + */ + notIn: number[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyUInt32 { + * uint32 value = 1 [ + * (buf.validate.field).uint32.example = 1, + * (buf.validate.field).uint32.example = 10 + * ]; + * } + * ``` + * + * @generated from field: repeated uint32 example = 8; + */ + example: number[]; +}; + +/** + * Describes the message buf.validate.UInt32Rules. + * Use `create(UInt32RulesSchema)` to create a new message. + */ +export const UInt32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 10); + +/** + * UInt64Rules describes the rules applied to `uint64` values. These + * rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type. + * + * @generated from message buf.validate.UInt64Rules + */ +export type UInt64Rules = Message<"buf.validate.UInt64Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MyUInt64 { + * // value must equal 42 + * uint64 value = 1 [(buf.validate.field).uint64.const = 42]; + * } + * ``` + * + * @generated from field: optional uint64 const = 1; + */ + const: bigint; + + /** + * @generated from oneof buf.validate.UInt64Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified value, + * an error message is generated. + * + * ```proto + * message MyUInt64 { + * // must be less than 10 + * uint64 value = 1 [(buf.validate.field).uint64.lt = 10]; + * } + * ``` + * + * @generated from field: uint64 lt = 2; + */ + value: bigint; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyUInt64 { + * // must be less than or equal to 10 + * uint64 value = 1 [(buf.validate.field).uint64.lte = 10]; + * } + * ``` + * + * @generated from field: uint64 lte = 3; + */ + value: bigint; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.UInt64Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyUInt64 { + * // must be greater than 5 [uint64.gt] + * uint64 value = 1 [(buf.validate.field).uint64.gt = 5]; + * + * // must be greater than 5 and less than 10 [uint64.gt_lt] + * uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [uint64.gt_lt_exclusive] + * uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: uint64 gt = 4; + */ + value: bigint; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyUInt64 { + * // must be greater than or equal to 5 [uint64.gte] + * uint64 value = 1 [(buf.validate.field).uint64.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [uint64.gte_lt] + * uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive] + * uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: uint64 gte = 5; + */ + value: bigint; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MyUInt64 { + * // must be in list [1, 2, 3] + * uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated uint64 in = 6; + */ + in: bigint[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MyUInt64 { + * // value must not be in list [1, 2, 3] + * uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated uint64 not_in = 7; + */ + notIn: bigint[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyUInt64 { + * uint64 value = 1 [ + * (buf.validate.field).uint64.example = 1, + * (buf.validate.field).uint64.example = -10 + * ]; + * } + * ``` + * + * @generated from field: repeated uint64 example = 8; + */ + example: bigint[]; +}; + +/** + * Describes the message buf.validate.UInt64Rules. + * Use `create(UInt64RulesSchema)` to create a new message. + */ +export const UInt64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 11); + +/** + * SInt32Rules describes the rules applied to `sint32` values. + * + * @generated from message buf.validate.SInt32Rules + */ +export type SInt32Rules = Message<"buf.validate.SInt32Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MySInt32 { + * // value must equal 42 + * sint32 value = 1 [(buf.validate.field).sint32.const = 42]; + * } + * ``` + * + * @generated from field: optional sint32 const = 1; + */ + const: number; + + /** + * @generated from oneof buf.validate.SInt32Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field + * < value). If the field value is equal to or greater than the specified + * value, an error message is generated. + * + * ```proto + * message MySInt32 { + * // must be less than 10 + * sint32 value = 1 [(buf.validate.field).sint32.lt = 10]; + * } + * ``` + * + * @generated from field: sint32 lt = 2; + */ + value: number; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MySInt32 { + * // must be less than or equal to 10 + * sint32 value = 1 [(buf.validate.field).sint32.lte = 10]; + * } + * ``` + * + * @generated from field: sint32 lte = 3; + */ + value: number; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.SInt32Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MySInt32 { + * // must be greater than 5 [sint32.gt] + * sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + * + * // must be greater than 5 and less than 10 [sint32.gt_lt] + * sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + * sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: sint32 gt = 4; + */ + value: number; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MySInt32 { + * // must be greater than or equal to 5 [sint32.gte] + * sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [sint32.gte_lt] + * sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] + * sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: sint32 gte = 5; + */ + value: number; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MySInt32 { + * // must be in list [1, 2, 3] + * sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated sint32 in = 6; + */ + in: number[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MySInt32 { + * // value must not be in list [1, 2, 3] + * sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated sint32 not_in = 7; + */ + notIn: number[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MySInt32 { + * sint32 value = 1 [ + * (buf.validate.field).sint32.example = 1, + * (buf.validate.field).sint32.example = -10 + * ]; + * } + * ``` + * + * @generated from field: repeated sint32 example = 8; + */ + example: number[]; +}; + +/** + * Describes the message buf.validate.SInt32Rules. + * Use `create(SInt32RulesSchema)` to create a new message. + */ +export const SInt32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 12); + +/** + * SInt64Rules describes the rules applied to `sint64` values. + * + * @generated from message buf.validate.SInt64Rules + */ +export type SInt64Rules = Message<"buf.validate.SInt64Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MySInt64 { + * // value must equal 42 + * sint64 value = 1 [(buf.validate.field).sint64.const = 42]; + * } + * ``` + * + * @generated from field: optional sint64 const = 1; + */ + const: bigint; + + /** + * @generated from oneof buf.validate.SInt64Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field + * < value). If the field value is equal to or greater than the specified + * value, an error message is generated. + * + * ```proto + * message MySInt64 { + * // must be less than 10 + * sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; + * } + * ``` + * + * @generated from field: sint64 lt = 2; + */ + value: bigint; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MySInt64 { + * // must be less than or equal to 10 + * sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; + * } + * ``` + * + * @generated from field: sint64 lte = 3; + */ + value: bigint; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.SInt64Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MySInt64 { + * // must be greater than 5 [sint64.gt] + * sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + * + * // must be greater than 5 and less than 10 [sint64.gt_lt] + * sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + * sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: sint64 gt = 4; + */ + value: bigint; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MySInt64 { + * // must be greater than or equal to 5 [sint64.gte] + * sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + * sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + * sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: sint64 gte = 5; + */ + value: bigint; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message + * is generated. + * + * ```proto + * message MySInt64 { + * // must be in list [1, 2, 3] + * sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated sint64 in = 6; + */ + in: bigint[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MySInt64 { + * // value must not be in list [1, 2, 3] + * sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated sint64 not_in = 7; + */ + notIn: bigint[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MySInt64 { + * sint64 value = 1 [ + * (buf.validate.field).sint64.example = 1, + * (buf.validate.field).sint64.example = -10 + * ]; + * } + * ``` + * + * @generated from field: repeated sint64 example = 8; + */ + example: bigint[]; +}; + +/** + * Describes the message buf.validate.SInt64Rules. + * Use `create(SInt64RulesSchema)` to create a new message. + */ +export const SInt64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 13); + +/** + * Fixed32Rules describes the rules applied to `fixed32` values. + * + * @generated from message buf.validate.Fixed32Rules + */ +export type Fixed32Rules = Message<"buf.validate.Fixed32Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. + * If the field value doesn't match, an error message is generated. + * + * ```proto + * message MyFixed32 { + * // value must equal 42 + * fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; + * } + * ``` + * + * @generated from field: optional fixed32 const = 1; + */ + const: number; + + /** + * @generated from oneof buf.validate.Fixed32Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified value, + * an error message is generated. + * + * ```proto + * message MyFixed32 { + * // must be less than 10 + * fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; + * } + * ``` + * + * @generated from field: fixed32 lt = 2; + */ + value: number; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyFixed32 { + * // must be less than or equal to 10 + * fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; + * } + * ``` + * + * @generated from field: fixed32 lte = 3; + */ + value: number; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.Fixed32Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyFixed32 { + * // must be greater than 5 [fixed32.gt] + * fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + * + * // must be greater than 5 and less than 10 [fixed32.gt_lt] + * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: fixed32 gt = 4; + */ + value: number; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyFixed32 { + * // must be greater than or equal to 5 [fixed32.gte] + * fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: fixed32 gte = 5; + */ + value: number; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message + * is generated. + * + * ```proto + * message MyFixed32 { + * // must be in list [1, 2, 3] + * fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated fixed32 in = 6; + */ + in: number[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MyFixed32 { + * // value must not be in list [1, 2, 3] + * fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated fixed32 not_in = 7; + */ + notIn: number[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyFixed32 { + * fixed32 value = 1 [ + * (buf.validate.field).fixed32.example = 1, + * (buf.validate.field).fixed32.example = 2 + * ]; + * } + * ``` + * + * @generated from field: repeated fixed32 example = 8; + */ + example: number[]; +}; + +/** + * Describes the message buf.validate.Fixed32Rules. + * Use `create(Fixed32RulesSchema)` to create a new message. + */ +export const Fixed32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 14); + +/** + * Fixed64Rules describes the rules applied to `fixed64` values. + * + * @generated from message buf.validate.Fixed64Rules + */ +export type Fixed64Rules = Message<"buf.validate.Fixed64Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MyFixed64 { + * // value must equal 42 + * fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; + * } + * ``` + * + * @generated from field: optional fixed64 const = 1; + */ + const: bigint; + + /** + * @generated from oneof buf.validate.Fixed64Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified value, + * an error message is generated. + * + * ```proto + * message MyFixed64 { + * // must be less than 10 + * fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; + * } + * ``` + * + * @generated from field: fixed64 lt = 2; + */ + value: bigint; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MyFixed64 { + * // must be less than or equal to 10 + * fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; + * } + * ``` + * + * @generated from field: fixed64 lte = 3; + */ + value: bigint; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.Fixed64Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyFixed64 { + * // must be greater than 5 [fixed64.gt] + * fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + * + * // must be greater than 5 and less than 10 [fixed64.gt_lt] + * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: fixed64 gt = 4; + */ + value: bigint; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyFixed64 { + * // must be greater than or equal to 5 [fixed64.gte] + * fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: fixed64 gte = 5; + */ + value: bigint; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MyFixed64 { + * // must be in list [1, 2, 3] + * fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated fixed64 in = 6; + */ + in: bigint[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MyFixed64 { + * // value must not be in list [1, 2, 3] + * fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated fixed64 not_in = 7; + */ + notIn: bigint[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyFixed64 { + * fixed64 value = 1 [ + * (buf.validate.field).fixed64.example = 1, + * (buf.validate.field).fixed64.example = 2 + * ]; + * } + * ``` + * + * @generated from field: repeated fixed64 example = 8; + */ + example: bigint[]; +}; + +/** + * Describes the message buf.validate.Fixed64Rules. + * Use `create(Fixed64RulesSchema)` to create a new message. + */ +export const Fixed64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 15); + +/** + * SFixed32Rules describes the rules applied to `fixed32` values. + * + * @generated from message buf.validate.SFixed32Rules + */ +export type SFixed32Rules = Message<"buf.validate.SFixed32Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MySFixed32 { + * // value must equal 42 + * sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; + * } + * ``` + * + * @generated from field: optional sfixed32 const = 1; + */ + const: number; + + /** + * @generated from oneof buf.validate.SFixed32Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified value, + * an error message is generated. + * + * ```proto + * message MySFixed32 { + * // must be less than 10 + * sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; + * } + * ``` + * + * @generated from field: sfixed32 lt = 2; + */ + value: number; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MySFixed32 { + * // must be less than or equal to 10 + * sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; + * } + * ``` + * + * @generated from field: sfixed32 lte = 3; + */ + value: number; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.SFixed32Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MySFixed32 { + * // must be greater than 5 [sfixed32.gt] + * sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + * + * // must be greater than 5 and less than 10 [sfixed32.gt_lt] + * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: sfixed32 gt = 4; + */ + value: number; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MySFixed32 { + * // must be greater than or equal to 5 [sfixed32.gte] + * sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: sfixed32 gte = 5; + */ + value: number; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MySFixed32 { + * // must be in list [1, 2, 3] + * sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated sfixed32 in = 6; + */ + in: number[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MySFixed32 { + * // value must not be in list [1, 2, 3] + * sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated sfixed32 not_in = 7; + */ + notIn: number[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MySFixed32 { + * sfixed32 value = 1 [ + * (buf.validate.field).sfixed32.example = 1, + * (buf.validate.field).sfixed32.example = 2 + * ]; + * } + * ``` + * + * @generated from field: repeated sfixed32 example = 8; + */ + example: number[]; +}; + +/** + * Describes the message buf.validate.SFixed32Rules. + * Use `create(SFixed32RulesSchema)` to create a new message. + */ +export const SFixed32RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 16); + +/** + * SFixed64Rules describes the rules applied to `fixed64` values. + * + * @generated from message buf.validate.SFixed64Rules + */ +export type SFixed64Rules = Message<"buf.validate.SFixed64Rules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MySFixed64 { + * // value must equal 42 + * sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; + * } + * ``` + * + * @generated from field: optional sfixed64 const = 1; + */ + const: bigint; + + /** + * @generated from oneof buf.validate.SFixed64Rules.less_than + */ + lessThan: { + /** + * `lt` requires the field value to be less than the specified value (field < + * value). If the field value is equal to or greater than the specified value, + * an error message is generated. + * + * ```proto + * message MySFixed64 { + * // must be less than 10 + * sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; + * } + * ``` + * + * @generated from field: sfixed64 lt = 2; + */ + value: bigint; + case: "lt"; + } | { + /** + * `lte` requires the field value to be less than or equal to the specified + * value (field <= value). If the field value is greater than the specified + * value, an error message is generated. + * + * ```proto + * message MySFixed64 { + * // must be less than or equal to 10 + * sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; + * } + * ``` + * + * @generated from field: sfixed64 lte = 3; + */ + value: bigint; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.SFixed64Rules.greater_than + */ + greaterThan: { + /** + * `gt` requires the field value to be greater than the specified value + * (exclusive). If the value of `gt` is larger than a specified `lt` or + * `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MySFixed64 { + * // must be greater than 5 [sfixed64.gt] + * sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + * + * // must be greater than 5 and less than 10 [sfixed64.gt_lt] + * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + * + * // must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: sfixed64 gt = 4; + */ + value: bigint; + case: "gt"; + } | { + /** + * `gte` requires the field value to be greater than or equal to the specified + * value (exclusive). If the value of `gte` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MySFixed64 { + * // must be greater than or equal to 5 [sfixed64.gte] + * sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + * + * // must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + * + * // must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + * } + * ``` + * + * @generated from field: sfixed64 gte = 5; + */ + value: bigint; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` requires the field value to be equal to one of the specified values. + * If the field value isn't one of the specified values, an error message is + * generated. + * + * ```proto + * message MySFixed64 { + * // must be in list [1, 2, 3] + * sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated sfixed64 in = 6; + */ + in: bigint[]; + + /** + * `not_in` requires the field value to not be equal to any of the specified + * values. If the field value is one of the specified values, an error + * message is generated. + * + * ```proto + * message MySFixed64 { + * // value must not be in list [1, 2, 3] + * sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }]; + * } + * ``` + * + * @generated from field: repeated sfixed64 not_in = 7; + */ + notIn: bigint[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MySFixed64 { + * sfixed64 value = 1 [ + * (buf.validate.field).sfixed64.example = 1, + * (buf.validate.field).sfixed64.example = 2 + * ]; + * } + * ``` + * + * @generated from field: repeated sfixed64 example = 8; + */ + example: bigint[]; +}; + +/** + * Describes the message buf.validate.SFixed64Rules. + * Use `create(SFixed64RulesSchema)` to create a new message. + */ +export const SFixed64RulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 17); + +/** + * BoolRules describes the rules applied to `bool` values. These rules + * may also be applied to the `google.protobuf.BoolValue` Well-Known-Type. + * + * @generated from message buf.validate.BoolRules + */ +export type BoolRules = Message<"buf.validate.BoolRules"> & { + /** + * `const` requires the field value to exactly match the specified boolean value. + * If the field value doesn't match, an error message is generated. + * + * ```proto + * message MyBool { + * // value must equal true + * bool value = 1 [(buf.validate.field).bool.const = true]; + * } + * ``` + * + * @generated from field: optional bool const = 1; + */ + const: boolean; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyBool { + * bool value = 1 [ + * (buf.validate.field).bool.example = 1, + * (buf.validate.field).bool.example = 2 + * ]; + * } + * ``` + * + * @generated from field: repeated bool example = 2; + */ + example: boolean[]; +}; + +/** + * Describes the message buf.validate.BoolRules. + * Use `create(BoolRulesSchema)` to create a new message. + */ +export const BoolRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 18); + +/** + * StringRules describes the rules applied to `string` values These + * rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type. + * + * @generated from message buf.validate.StringRules + */ +export type StringRules = Message<"buf.validate.StringRules"> & { + /** + * `const` requires the field value to exactly match the specified value. If + * the field value doesn't match, an error message is generated. + * + * ```proto + * message MyString { + * // value must equal `hello` + * string value = 1 [(buf.validate.field).string.const = "hello"]; + * } + * ``` + * + * @generated from field: optional string const = 1; + */ + const: string; + + /** + * `len` dictates that the field value must have the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value does not meet the specified + * length, an error message will be generated. + * + * ```proto + * message MyString { + * // value length must be 5 characters + * string value = 1 [(buf.validate.field).string.len = 5]; + * } + * ``` + * + * @generated from field: optional uint64 len = 19; + */ + len: bigint; + + /** + * `min_len` specifies that the field value must have at least the specified + * number of characters (Unicode code points), which may differ from the number + * of bytes in the string. If the field value contains fewer characters, an error + * message will be generated. + * + * ```proto + * message MyString { + * // value length must be at least 3 characters + * string value = 1 [(buf.validate.field).string.min_len = 3]; + * } + * ``` + * + * @generated from field: optional uint64 min_len = 2; + */ + minLen: bigint; + + /** + * `max_len` specifies that the field value must have no more than the specified + * number of characters (Unicode code points), which may differ from the + * number of bytes in the string. If the field value contains more characters, + * an error message will be generated. + * + * ```proto + * message MyString { + * // value length must be at most 10 characters + * string value = 1 [(buf.validate.field).string.max_len = 10]; + * } + * ``` + * + * @generated from field: optional uint64 max_len = 3; + */ + maxLen: bigint; + + /** + * `len_bytes` dictates that the field value must have the specified number of + * bytes. If the field value does not match the specified length in bytes, + * an error message will be generated. + * + * ```proto + * message MyString { + * // value length must be 6 bytes + * string value = 1 [(buf.validate.field).string.len_bytes = 6]; + * } + * ``` + * + * @generated from field: optional uint64 len_bytes = 20; + */ + lenBytes: bigint; + + /** + * `min_bytes` specifies that the field value must have at least the specified + * number of bytes. If the field value contains fewer bytes, an error message + * will be generated. + * + * ```proto + * message MyString { + * // value length must be at least 4 bytes + * string value = 1 [(buf.validate.field).string.min_bytes = 4]; + * } + * + * ``` + * + * @generated from field: optional uint64 min_bytes = 4; + */ + minBytes: bigint; + + /** + * `max_bytes` specifies that the field value must have no more than the + * specified number of bytes. If the field value contains more bytes, an + * error message will be generated. + * + * ```proto + * message MyString { + * // value length must be at most 8 bytes + * string value = 1 [(buf.validate.field).string.max_bytes = 8]; + * } + * ``` + * + * @generated from field: optional uint64 max_bytes = 5; + */ + maxBytes: bigint; + + /** + * `pattern` specifies that the field value must match the specified + * regular expression (RE2 syntax), with the expression provided without any + * delimiters. If the field value doesn't match the regular expression, an + * error message will be generated. + * + * ```proto + * message MyString { + * // value does not match regex pattern `^[a-zA-Z]//$` + * string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; + * } + * ``` + * + * @generated from field: optional string pattern = 6; + */ + pattern: string; + + /** + * `prefix` specifies that the field value must have the + * specified substring at the beginning of the string. If the field value + * doesn't start with the specified prefix, an error message will be + * generated. + * + * ```proto + * message MyString { + * // value does not have prefix `pre` + * string value = 1 [(buf.validate.field).string.prefix = "pre"]; + * } + * ``` + * + * @generated from field: optional string prefix = 7; + */ + prefix: string; + + /** + * `suffix` specifies that the field value must have the + * specified substring at the end of the string. If the field value doesn't + * end with the specified suffix, an error message will be generated. + * + * ```proto + * message MyString { + * // value does not have suffix `post` + * string value = 1 [(buf.validate.field).string.suffix = "post"]; + * } + * ``` + * + * @generated from field: optional string suffix = 8; + */ + suffix: string; + + /** + * `contains` specifies that the field value must have the + * specified substring anywhere in the string. If the field value doesn't + * contain the specified substring, an error message will be generated. + * + * ```proto + * message MyString { + * // value does not contain substring `inside`. + * string value = 1 [(buf.validate.field).string.contains = "inside"]; + * } + * ``` + * + * @generated from field: optional string contains = 9; + */ + contains: string; + + /** + * `not_contains` specifies that the field value must not have the + * specified substring anywhere in the string. If the field value contains + * the specified substring, an error message will be generated. + * + * ```proto + * message MyString { + * // value contains substring `inside`. + * string value = 1 [(buf.validate.field).string.not_contains = "inside"]; + * } + * ``` + * + * @generated from field: optional string not_contains = 23; + */ + notContains: string; + + /** + * `in` specifies that the field value must be equal to one of the specified + * values. If the field value isn't one of the specified values, an error + * message will be generated. + * + * ```proto + * message MyString { + * // must be in list ["apple", "banana"] + * string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + * } + * ``` + * + * @generated from field: repeated string in = 10; + */ + in: string[]; + + /** + * `not_in` specifies that the field value cannot be equal to any + * of the specified values. If the field value is one of the specified values, + * an error message will be generated. + * ```proto + * message MyString { + * // value must not be in list ["orange", "grape"] + * string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + * } + * ``` + * + * @generated from field: repeated string not_in = 11; + */ + notIn: string[]; + + /** + * `WellKnown` rules provide advanced rules against common string + * patterns. + * + * @generated from oneof buf.validate.StringRules.well_known + */ + wellKnown: { + /** + * `email` specifies that the field value must be a valid email address, for + * example "foo@example.com". + * + * Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address). + * Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322), + * which allows many unexpected forms of email addresses and will easily match + * a typographical error. + * + * If the field value isn't a valid email address, an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid email address + * string value = 1 [(buf.validate.field).string.email = true]; + * } + * ``` + * + * @generated from field: bool email = 12; + */ + value: boolean; + case: "email"; + } | { + /** + * `hostname` specifies that the field value must be a valid hostname, for + * example "foo.example.com". + * + * A valid hostname follows the rules below: + * - The name consists of one or more labels, separated by a dot ("."). + * - Each label can be 1 to 63 alphanumeric characters. + * - A label can contain hyphens ("-"), but must not start or end with a hyphen. + * - The right-most label must not be digits only. + * - The name can have a trailing dot—for example, "foo.example.com.". + * - The name can be 253 characters at most, excluding the optional trailing dot. + * + * If the field value isn't a valid hostname, an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid hostname + * string value = 1 [(buf.validate.field).string.hostname = true]; + * } + * ``` + * + * @generated from field: bool hostname = 13; + */ + value: boolean; + case: "hostname"; + } | { + /** + * `ip` specifies that the field value must be a valid IP (v4 or v6) address. + * + * IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21". + * IPv6 addresses are expected in their text representation—for example, "::1", + * or "2001:0DB8:ABCD:0012::0". + * + * Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + * Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported. + * + * If the field value isn't a valid IP address, an error message will be + * generated. + * + * ```proto + * message MyString { + * // must be a valid IP address + * string value = 1 [(buf.validate.field).string.ip = true]; + * } + * ``` + * + * @generated from field: bool ip = 14; + */ + value: boolean; + case: "ip"; + } | { + /** + * `ipv4` specifies that the field value must be a valid IPv4 address—for + * example "192.168.5.21". If the field value isn't a valid IPv4 address, an + * error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid IPv4 address + * string value = 1 [(buf.validate.field).string.ipv4 = true]; + * } + * ``` + * + * @generated from field: bool ipv4 = 15; + */ + value: boolean; + case: "ipv4"; + } | { + /** + * `ipv6` specifies that the field value must be a valid IPv6 address—for + * example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field + * value is not a valid IPv6 address, an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid IPv6 address + * string value = 1 [(buf.validate.field).string.ipv6 = true]; + * } + * ``` + * + * @generated from field: bool ipv6 = 16; + */ + value: boolean; + case: "ipv6"; + } | { + /** + * `uri` specifies that the field value must be a valid URI, for example + * "https://example.com/foo/bar?baz=quux#frag". + * + * URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + * Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + * + * If the field value isn't a valid URI, an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid URI + * string value = 1 [(buf.validate.field).string.uri = true]; + * } + * ``` + * + * @generated from field: bool uri = 17; + */ + value: boolean; + case: "uri"; + } | { + /** + * `uri_ref` specifies that the field value must be a valid URI Reference—either + * a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative + * Reference such as "./foo/bar?query". + * + * URI, URI Reference, and Relative Reference are defined in the internet + * standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone + * Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + * + * If the field value isn't a valid URI Reference, an error message will be + * generated. + * + * ```proto + * message MyString { + * // must be a valid URI Reference + * string value = 1 [(buf.validate.field).string.uri_ref = true]; + * } + * ``` + * + * @generated from field: bool uri_ref = 18; + */ + value: boolean; + case: "uriRef"; + } | { + /** + * `address` specifies that the field value must be either a valid hostname + * (for example, "example.com"), or a valid IP (v4 or v6) address (for example, + * "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP, + * an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid hostname, or ip address + * string value = 1 [(buf.validate.field).string.address = true]; + * } + * ``` + * + * @generated from field: bool address = 21; + */ + value: boolean; + case: "address"; + } | { + /** + * `uuid` specifies that the field value must be a valid UUID as defined by + * [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the + * field value isn't a valid UUID, an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid UUID + * string value = 1 [(buf.validate.field).string.uuid = true]; + * } + * ``` + * + * @generated from field: bool uuid = 22; + */ + value: boolean; + case: "uuid"; + } | { + /** + * `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as + * defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes + * omitted. If the field value isn't a valid UUID without dashes, an error message + * will be generated. + * + * ```proto + * message MyString { + * // must be a valid trimmed UUID + * string value = 1 [(buf.validate.field).string.tuuid = true]; + * } + * ``` + * + * @generated from field: bool tuuid = 33; + */ + value: boolean; + case: "tuuid"; + } | { + /** + * `ip_with_prefixlen` specifies that the field value must be a valid IP + * (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or + * "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with + * prefix length, an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid IP with prefix length + * string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + * } + * ``` + * + * @generated from field: bool ip_with_prefixlen = 26; + */ + value: boolean; + case: "ipWithPrefixlen"; + } | { + /** + * `ipv4_with_prefixlen` specifies that the field value must be a valid + * IPv4 address with prefix length—for example, "192.168.5.21/16". If the + * field value isn't a valid IPv4 address with prefix length, an error + * message will be generated. + * + * ```proto + * message MyString { + * // must be a valid IPv4 address with prefix length + * string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + * } + * ``` + * + * @generated from field: bool ipv4_with_prefixlen = 27; + */ + value: boolean; + case: "ipv4WithPrefixlen"; + } | { + /** + * `ipv6_with_prefixlen` specifies that the field value must be a valid + * IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64". + * If the field value is not a valid IPv6 address with prefix length, + * an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid IPv6 address prefix length + * string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + * } + * ``` + * + * @generated from field: bool ipv6_with_prefixlen = 28; + */ + value: boolean; + case: "ipv6WithPrefixlen"; + } | { + /** + * `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) + * prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64". + * + * The prefix must have all zeros for the unmasked bits. For example, + * "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + * prefix, and the remaining 64 bits must be zero. + * + * If the field value isn't a valid IP prefix, an error message will be + * generated. + * + * ```proto + * message MyString { + * // must be a valid IP prefix + * string value = 1 [(buf.validate.field).string.ip_prefix = true]; + * } + * ``` + * + * @generated from field: bool ip_prefix = 29; + */ + value: boolean; + case: "ipPrefix"; + } | { + /** + * `ipv4_prefix` specifies that the field value must be a valid IPv4 + * prefix, for example "192.168.0.0/16". + * + * The prefix must have all zeros for the unmasked bits. For example, + * "192.168.0.0/16" designates the left-most 16 bits for the prefix, + * and the remaining 16 bits must be zero. + * + * If the field value isn't a valid IPv4 prefix, an error message + * will be generated. + * + * ```proto + * message MyString { + * // must be a valid IPv4 prefix + * string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + * } + * ``` + * + * @generated from field: bool ipv4_prefix = 30; + */ + value: boolean; + case: "ipv4Prefix"; + } | { + /** + * `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for + * example, "2001:0DB8:ABCD:0012::0/64". + * + * The prefix must have all zeros for the unmasked bits. For example, + * "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + * prefix, and the remaining 64 bits must be zero. + * + * If the field value is not a valid IPv6 prefix, an error message will be + * generated. + * + * ```proto + * message MyString { + * // must be a valid IPv6 prefix + * string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + * } + * ``` + * + * @generated from field: bool ipv6_prefix = 31; + */ + value: boolean; + case: "ipv6Prefix"; + } | { + /** + * `host_and_port` specifies that the field value must be a valid host/port + * pair—for example, "example.com:8080". + * + * The host can be one of: + * - An IPv4 address in dotted decimal format—for example, "192.168.5.21". + * - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]". + * - A hostname—for example, "example.com". + * + * The port is separated by a colon. It must be non-empty, with a decimal number + * in the range of 0-65535, inclusive. + * + * @generated from field: bool host_and_port = 32; + */ + value: boolean; + case: "hostAndPort"; + } | { + /** + * `ulid` specifies that the field value must be a valid ULID (Universally Unique + * Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec). + * If the field value isn't a valid ULID, an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid ULID + * string value = 1 [(buf.validate.field).string.ulid = true]; + * } + * ``` + * + * @generated from field: bool ulid = 35; + */ + value: boolean; + case: "ulid"; + } | { + /** + * `protobuf_fqn` specifies that the field value must be a valid fully-qualified + * Protobuf name as defined by the [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + * + * A fully-qualified Protobuf name is a dot-separated list of Protobuf identifiers, + * where each identifier starts with a letter or underscore and is followed by zero or + * more letters, underscores, or digits. + * + * Examples: "buf.validate", "google.protobuf.Timestamp", "my_package.MyMessage". + * + * Note: historically, fully-qualified Protobuf names were represented with a leading + * dot (for example, ".buf.validate.StringRules"). Modern Protobuf does not use the + * leading dot, and most fully-qualified names are represented without it. Use + * `protobuf_dot_fqn` if a leading dot is required. + * + * If the field value isn't a valid fully-qualified Protobuf name, an error message + * will be generated. + * + * ```proto + * message MyString { + * // value must be a valid fully-qualified Protobuf name + * string value = 1 [(buf.validate.field).string.protobuf_fqn = true]; + * } + * ``` + * + * @generated from field: bool protobuf_fqn = 37; + */ + value: boolean; + case: "protobufFqn"; + } | { + /** + * `protobuf_dot_fqn` specifies that the field value must be a valid fully-qualified + * Protobuf name with a leading dot, as defined by the + * [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + * + * A fully-qualified Protobuf name with a leading dot is a dot followed by a + * dot-separated list of Protobuf identifiers, where each identifier starts with a + * letter or underscore and is followed by zero or more letters, underscores, or + * digits. + * + * Examples: ".buf.validate", ".google.protobuf.Timestamp", ".my_package.MyMessage". + * + * Note: this is the historical representation of fully-qualified Protobuf names, + * where a leading dot denotes an absolute reference. Modern Protobuf does not use + * the leading dot, and most fully-qualified names are represented without it. Most + * users will want to use `protobuf_fqn` instead. + * + * If the field value isn't a valid fully-qualified Protobuf name with a leading dot, + * an error message will be generated. + * + * ```proto + * message MyString { + * // value must be a valid fully-qualified Protobuf name with a leading dot + * string value = 1 [(buf.validate.field).string.protobuf_dot_fqn = true]; + * } + * ``` + * + * @generated from field: bool protobuf_dot_fqn = 38; + */ + value: boolean; + case: "protobufDotFqn"; + } | { + /** + * `well_known_regex` specifies a common well-known pattern + * defined as a regex. If the field value doesn't match the well-known + * regex, an error message will be generated. + * + * ```proto + * message MyString { + * // must be a valid HTTP header value + * string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; + * } + * ``` + * + * #### KnownRegex + * + * `well_known_regex` contains some well-known patterns. + * + * | Name | Number | Description | + * |-------------------------------|--------|-------------------------------------------| + * | KNOWN_REGEX_UNSPECIFIED | 0 | | + * | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) | + * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) | + * + * @generated from field: buf.validate.KnownRegex well_known_regex = 24; + */ + value: KnownRegex; + case: "wellKnownRegex"; + } | { case: undefined; value?: undefined }; + + /** + * This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + * enable strict header validation. By default, this is true, and HTTP header + * validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser + * validations that only disallow `\r\n\0` characters, which can be used to + * bypass header matching rules. + * + * ```proto + * message MyString { + * // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. + * string value = 1 [(buf.validate.field).string.strict = false]; + * } + * ``` + * + * @generated from field: optional bool strict = 25; + */ + strict: boolean; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyString { + * string value = 1 [ + * (buf.validate.field).string.example = "hello", + * (buf.validate.field).string.example = "world" + * ]; + * } + * ``` + * + * @generated from field: repeated string example = 34; + */ + example: string[]; +}; + +/** + * Describes the message buf.validate.StringRules. + * Use `create(StringRulesSchema)` to create a new message. + */ +export const StringRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 19); + +/** + * BytesRules describe the rules applied to `bytes` values. These rules + * may also be applied to the `google.protobuf.BytesValue` Well-Known-Type. + * + * @generated from message buf.validate.BytesRules + */ +export type BytesRules = Message<"buf.validate.BytesRules"> & { + /** + * `const` requires the field value to exactly match the specified bytes + * value. If the field value doesn't match, an error message is generated. + * + * ```proto + * message MyBytes { + * // must be "\x01\x02\x03\x04" + * bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; + * } + * ``` + * + * @generated from field: optional bytes const = 1; + */ + const: Uint8Array; + + /** + * `len` requires the field value to have the specified length in bytes. + * If the field value doesn't match, an error message is generated. + * + * ```proto + * message MyBytes { + * // value length must be 4 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + * } + * ``` + * + * @generated from field: optional uint64 len = 13; + */ + len: bigint; + + /** + * `min_len` requires the field value to have at least the specified minimum + * length in bytes. + * If the field value doesn't meet the requirement, an error message is generated. + * + * ```proto + * message MyBytes { + * // value length must be at least 2 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + * } + * ``` + * + * @generated from field: optional uint64 min_len = 2; + */ + minLen: bigint; + + /** + * `max_len` requires the field value to have at most the specified maximum + * length in bytes. + * If the field value exceeds the requirement, an error message is generated. + * + * ```proto + * message MyBytes { + * // must be at most 6 bytes. + * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + * } + * ``` + * + * @generated from field: optional uint64 max_len = 3; + */ + maxLen: bigint; + + /** + * `pattern` requires the field value to match the specified regular + * expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + * The value of the field must be valid UTF-8 or validation will fail with a + * runtime error. + * If the field value doesn't match the pattern, an error message is generated. + * + * ```proto + * message MyBytes { + * // value must match regex pattern "^[a-zA-Z0-9]+$". + * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + * } + * ``` + * + * @generated from field: optional string pattern = 4; + */ + pattern: string; + + /** + * `prefix` requires the field value to have the specified bytes at the + * beginning of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * + * ```proto + * message MyBytes { + * // value does not have prefix \x01\x02 + * optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + * } + * ``` + * + * @generated from field: optional bytes prefix = 5; + */ + prefix: Uint8Array; + + /** + * `suffix` requires the field value to have the specified bytes at the end + * of the string. + * If the field value doesn't meet the requirement, an error message is generated. + * + * ```proto + * message MyBytes { + * // value does not have suffix \x03\x04 + * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + * } + * ``` + * + * @generated from field: optional bytes suffix = 6; + */ + suffix: Uint8Array; + + /** + * `contains` requires the field value to have the specified bytes anywhere in + * the string. + * If the field value doesn't meet the requirement, an error message is generated. + * + * ```proto + * message MyBytes { + * // value does not contain \x02\x03 + * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + * } + * ``` + * + * @generated from field: optional bytes contains = 7; + */ + contains: Uint8Array; + + /** + * `in` requires the field value to be equal to one of the specified + * values. If the field value doesn't match any of the specified values, an + * error message is generated. + * + * ```proto + * message MyBytes { + * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` + * + * @generated from field: repeated bytes in = 8; + */ + in: Uint8Array[]; + + /** + * `not_in` requires the field value to be not equal to any of the specified + * values. + * If the field value matches any of the specified values, an error message is + * generated. + * + * ```proto + * message MyBytes { + * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * } + * ``` + * + * @generated from field: repeated bytes not_in = 9; + */ + notIn: Uint8Array[]; + + /** + * WellKnown rules provide advanced rules against common byte + * patterns + * + * @generated from oneof buf.validate.BytesRules.well_known + */ + wellKnown: { + /** + * `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + * If the field value doesn't meet this rule, an error message is generated. + * + * ```proto + * message MyBytes { + * // must be a valid IP address + * optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + * } + * ``` + * + * @generated from field: bool ip = 10; + */ + value: boolean; + case: "ip"; + } | { + /** + * `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + * If the field value doesn't meet this rule, an error message is generated. + * + * ```proto + * message MyBytes { + * // must be a valid IPv4 address + * optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + * } + * ``` + * + * @generated from field: bool ipv4 = 11; + */ + value: boolean; + case: "ipv4"; + } | { + /** + * `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + * If the field value doesn't meet this rule, an error message is generated. + * ```proto + * message MyBytes { + * // must be a valid IPv6 address + * optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + * } + * ``` + * + * @generated from field: bool ipv6 = 12; + */ + value: boolean; + case: "ipv6"; + } | { + /** + * `uuid` ensures that the field value encodes 128-bit UUID data as defined + * by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). + * The field must contain exactly 16 bytes representing the UUID. If the + * field value isn't a valid UUID, an error message will be generated. + * + * ```proto + * message MyBytes { + * // must be a valid UUID + * optional bytes value = 1 [(buf.validate.field).bytes.uuid = true]; + * } + * ``` + * + * @generated from field: bool uuid = 15; + */ + value: boolean; + case: "uuid"; + } | { case: undefined; value?: undefined }; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyBytes { + * bytes value = 1 [ + * (buf.validate.field).bytes.example = "\x01\x02", + * (buf.validate.field).bytes.example = "\x02\x03" + * ]; + * } + * ``` + * + * @generated from field: repeated bytes example = 14; + */ + example: Uint8Array[]; +}; + +/** + * Describes the message buf.validate.BytesRules. + * Use `create(BytesRulesSchema)` to create a new message. + */ +export const BytesRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 20); + +/** + * EnumRules describe the rules applied to `enum` values. + * + * @generated from message buf.validate.EnumRules + */ +export type EnumRules = Message<"buf.validate.EnumRules"> & { + /** + * `const` requires the field value to exactly match the specified enum value. + * If the field value doesn't match, an error message is generated. + * + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * + * message MyMessage { + * // The field `value` must be exactly MY_ENUM_VALUE1. + * MyEnum value = 1 [(buf.validate.field).enum.const = 1]; + * } + * ``` + * + * @generated from field: optional int32 const = 1; + */ + const: number; + + /** + * `defined_only` requires the field value to be one of the defined values for + * this enum, failing on any undefined value. + * + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * + * message MyMessage { + * // The field `value` must be a defined value of MyEnum. + * MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; + * } + * ``` + * + * @generated from field: optional bool defined_only = 2; + */ + definedOnly: boolean; + + /** + * `in` requires the field value to be equal to one of the + * specified enum values. If the field value doesn't match any of the + * specified values, an error message is generated. + * + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * + * message MyMessage { + * // The field `value` must be equal to one of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + * } + * ``` + * + * @generated from field: repeated int32 in = 3; + */ + in: number[]; + + /** + * `not_in` requires the field value to be not equal to any of the + * specified enum values. If the field value matches one of the specified + * values, an error message is generated. + * + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * + * message MyMessage { + * // The field `value` must not be equal to any of the specified values. + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + * } + * ``` + * + * @generated from field: repeated int32 not_in = 4; + */ + notIn: number[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * enum MyEnum { + * MY_ENUM_UNSPECIFIED = 0; + * MY_ENUM_VALUE1 = 1; + * MY_ENUM_VALUE2 = 2; + * } + * + * message MyMessage { + * (buf.validate.field).enum.example = 1, + * (buf.validate.field).enum.example = 2 + * } + * ``` + * + * @generated from field: repeated int32 example = 5; + */ + example: number[]; +}; + +/** + * Describes the message buf.validate.EnumRules. + * Use `create(EnumRulesSchema)` to create a new message. + */ +export const EnumRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 21); + +/** + * RepeatedRules describe the rules applied to `repeated` values. + * + * @generated from message buf.validate.RepeatedRules + */ +export type RepeatedRules = Message<"buf.validate.RepeatedRules"> & { + /** + * `min_items` requires that this field must contain at least the specified + * minimum number of items. + * + * Note that `min_items = 1` is equivalent to setting a field as `required`. + * + * ```proto + * message MyRepeated { + * // value must contain at least 2 items + * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + * } + * ``` + * + * @generated from field: optional uint64 min_items = 1; + */ + minItems: bigint; + + /** + * `max_items` denotes that this field must not exceed a + * certain number of items as the upper limit. If the field contains more + * items than specified, an error message will be generated, requiring the + * field to maintain no more than the specified number of items. + * + * ```proto + * message MyRepeated { + * // value must contain no more than 3 item(s) + * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + * } + * ``` + * + * @generated from field: optional uint64 max_items = 2; + */ + maxItems: bigint; + + /** + * `unique` indicates that all elements in this field must + * be unique. This rule is strictly applicable to scalar and enum + * types, with message types not being supported. + * + * ```proto + * message MyRepeated { + * // repeated value must contain unique items + * repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + * } + * ``` + * + * @generated from field: optional bool unique = 3; + */ + unique: boolean; + + /** + * `items` details the rules to be applied to each item + * in the field. Even for repeated message fields, validation is executed + * against each item unless `ignore` is specified. + * + * ```proto + * message MyRepeated { + * // The items in the field `value` must follow the specified rules. + * repeated string value = 1 [(buf.validate.field).repeated.items = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` + * + * Note that the `required` rule does not apply. Repeated items + * cannot be unset. + * + * @generated from field: optional buf.validate.FieldRules items = 4; + */ + items?: FieldRules | undefined; +}; + +/** + * Describes the message buf.validate.RepeatedRules. + * Use `create(RepeatedRulesSchema)` to create a new message. + */ +export const RepeatedRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 22); + +/** + * MapRules describe the rules applied to `map` values. + * + * @generated from message buf.validate.MapRules + */ +export type MapRules = Message<"buf.validate.MapRules"> & { + /** + * Specifies the minimum number of key-value pairs allowed. If the field has + * fewer key-value pairs than specified, an error message is generated. + * + * ```proto + * message MyMap { + * // The field `value` must have at least 2 key-value pairs. + * map value = 1 [(buf.validate.field).map.min_pairs = 2]; + * } + * ``` + * + * @generated from field: optional uint64 min_pairs = 1; + */ + minPairs: bigint; + + /** + * Specifies the maximum number of key-value pairs allowed. If the field has + * more key-value pairs than specified, an error message is generated. + * + * ```proto + * message MyMap { + * // The field `value` must have at most 3 key-value pairs. + * map value = 1 [(buf.validate.field).map.max_pairs = 3]; + * } + * ``` + * + * @generated from field: optional uint64 max_pairs = 2; + */ + maxPairs: bigint; + + /** + * Specifies the rules to be applied to each key in the field. + * + * ```proto + * message MyMap { + * // The keys in the field `value` must follow the specified rules. + * map value = 1 [(buf.validate.field).map.keys = { + * string: { + * min_len: 3 + * max_len: 10 + * } + * }]; + * } + * ``` + * + * Note that the `required` rule does not apply. Map keys cannot be unset. + * + * @generated from field: optional buf.validate.FieldRules keys = 4; + */ + keys?: FieldRules | undefined; + + /** + * Specifies the rules to be applied to the value of each key in the + * field. Message values will still have their validations evaluated unless + * `ignore` is specified. + * + * ```proto + * message MyMap { + * // The values in the field `value` must follow the specified rules. + * map value = 1 [(buf.validate.field).map.values = { + * string: { + * min_len: 5 + * max_len: 20 + * } + * }]; + * } + * ``` + * Note that the `required` rule does not apply. Map values cannot be unset. + * + * @generated from field: optional buf.validate.FieldRules values = 5; + */ + values?: FieldRules | undefined; +}; + +/** + * Describes the message buf.validate.MapRules. + * Use `create(MapRulesSchema)` to create a new message. + */ +export const MapRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 23); + +/** + * AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type. + * + * @generated from message buf.validate.AnyRules + */ +export type AnyRules = Message<"buf.validate.AnyRules"> & { + /** + * `in` requires the field's `type_url` to be equal to one of the + * specified values. If it doesn't match any of the specified values, an error + * message is generated. + * + * ```proto + * message MyAny { + * // The `value` field must have a `type_url` equal to one of the specified values. + * google.protobuf.Any value = 1 [(buf.validate.field).any = { + * in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"] + * }]; + * } + * ``` + * + * @generated from field: repeated string in = 2; + */ + in: string[]; + + /** + * `not_in` requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated. + * + * ```proto + * message MyAny { + * // The `value` field must not have a `type_url` equal to any of the specified values. + * google.protobuf.Any value = 1 [(buf.validate.field).any = { + * not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"] + * }]; + * } + * ``` + * + * @generated from field: repeated string not_in = 3; + */ + notIn: string[]; +}; + +/** + * Describes the message buf.validate.AnyRules. + * Use `create(AnyRulesSchema)` to create a new message. + */ +export const AnyRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 24); + +/** + * DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type. + * + * @generated from message buf.validate.DurationRules + */ +export type DurationRules = Message<"buf.validate.DurationRules"> & { + /** + * `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + * If the field's value deviates from the specified value, an error message + * will be generated. + * + * ```proto + * message MyDuration { + * // value must equal 5s + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; + * } + * ``` + * + * @generated from field: optional google.protobuf.Duration const = 2; + */ + const?: Duration | undefined; + + /** + * @generated from oneof buf.validate.DurationRules.less_than + */ + lessThan: { + /** + * `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + * exclusive. If the field's value is greater than or equal to the specified + * value, an error message will be generated. + * + * ```proto + * message MyDuration { + * // must be less than 5s + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; + * } + * ``` + * + * @generated from field: google.protobuf.Duration lt = 3; + */ + value: Duration; + case: "lt"; + } | { + /** + * `lte` indicates that the field must be less than or equal to the specified + * value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + * an error message will be generated. + * + * ```proto + * message MyDuration { + * // must be less than or equal to 10s + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; + * } + * ``` + * + * @generated from field: google.protobuf.Duration lte = 4; + */ + value: Duration; + case: "lte"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.DurationRules.greater_than + */ + greaterThan: { + /** + * `gt` requires the duration field value to be greater than the specified + * value (exclusive). If the value of `gt` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyDuration { + * // duration must be greater than 5s [duration.gt] + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + * + * // duration must be greater than 5s and less than 10s [duration.gt_lt] + * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + * + * // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + * } + * ``` + * + * @generated from field: google.protobuf.Duration gt = 5; + */ + value: Duration; + case: "gt"; + } | { + /** + * `gte` requires the duration field value to be greater than or equal to the + * specified value (exclusive). If the value of `gte` is larger than a + * specified `lt` or `lte`, the range is reversed, and the field value must + * be outside the specified range. If the field value doesn't meet the + * required conditions, an error message is generated. + * + * ```proto + * message MyDuration { + * // duration must be greater than or equal to 5s [duration.gte] + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; + * + * // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt] + * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }]; + * + * // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] + * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; + * } + * ``` + * + * @generated from field: google.protobuf.Duration gte = 6; + */ + value: Duration; + case: "gte"; + } | { case: undefined; value?: undefined }; + + /** + * `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + * If the field's value doesn't correspond to any of the specified values, + * an error message will be generated. + * + * ```proto + * message MyDuration { + * // must be in list [1s, 2s, 3s] + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; + * } + * ``` + * + * @generated from field: repeated google.protobuf.Duration in = 7; + */ + in: Duration[]; + + /** + * `not_in` denotes that the field must not be equal to + * any of the specified values of the `google.protobuf.Duration` type. + * If the field's value matches any of these values, an error message will be + * generated. + * + * ```proto + * message MyDuration { + * // value must not be in list [1s, 2s, 3s] + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; + * } + * ``` + * + * @generated from field: repeated google.protobuf.Duration not_in = 8; + */ + notIn: Duration[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyDuration { + * google.protobuf.Duration value = 1 [ + * (buf.validate.field).duration.example = { seconds: 1 }, + * (buf.validate.field).duration.example = { seconds: 2 }, + * ]; + * } + * ``` + * + * @generated from field: repeated google.protobuf.Duration example = 9; + */ + example: Duration[]; +}; + +/** + * Describes the message buf.validate.DurationRules. + * Use `create(DurationRulesSchema)` to create a new message. + */ +export const DurationRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 25); + +/** + * FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type. + * + * @generated from message buf.validate.FieldMaskRules + */ +export type FieldMaskRules = Message<"buf.validate.FieldMaskRules"> & { + /** + * `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly. + * If the field's value deviates from the specified value, an error message + * will be generated. + * + * ```proto + * message MyFieldMask { + * // value must equal ["a"] + * google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = { + * paths: ["a"] + * }]; + * } + * ``` + * + * @generated from field: optional google.protobuf.FieldMask const = 1; + */ + const?: FieldMask | undefined; + + /** + * `in` requires the field value to only contain paths matching specified + * values or their subpaths. + * If any of the field value's paths doesn't match the rule, + * an error message is generated. + * See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + * + * ```proto + * message MyFieldMask { + * // The `value` FieldMask must only contain paths listed in `in`. + * google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + * in: ["a", "b", "c.a"] + * }]; + * } + * ``` + * + * @generated from field: repeated string in = 2; + */ + in: string[]; + + /** + * `not_in` requires the field value to not contain paths matching specified + * values or their subpaths. + * If any of the field value's paths matches the rule, + * an error message is generated. + * See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + * + * ```proto + * message MyFieldMask { + * // The `value` FieldMask shall not contain paths listed in `not_in`. + * google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + * not_in: ["forbidden", "immutable", "c.a"] + * }]; + * } + * ``` + * + * @generated from field: repeated string not_in = 3; + */ + notIn: string[]; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyFieldMask { + * google.protobuf.FieldMask value = 1 [ + * (buf.validate.field).field_mask.example = { paths: ["a", "b"] }, + * (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] }, + * ]; + * } + * ``` + * + * @generated from field: repeated google.protobuf.FieldMask example = 4; + */ + example: FieldMask[]; +}; + +/** + * Describes the message buf.validate.FieldMaskRules. + * Use `create(FieldMaskRulesSchema)` to create a new message. + */ +export const FieldMaskRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 26); + +/** + * TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type. + * + * @generated from message buf.validate.TimestampRules + */ +export type TimestampRules = Message<"buf.validate.TimestampRules"> & { + /** + * `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated. + * + * ```proto + * message MyTimestamp { + * // value must equal 2023-05-03T10:00:00Z + * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; + * } + * ``` + * + * @generated from field: optional google.protobuf.Timestamp const = 2; + */ + const?: Timestamp | undefined; + + /** + * @generated from oneof buf.validate.TimestampRules.less_than + */ + lessThan: { + /** + * `lt` requires the timestamp field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated. + * + * ```proto + * message MyTimestamp { + * // timestamp must be less than '2023-01-01T00:00:00Z' [timestamp.lt] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lt = { seconds: 1672444800 }]; + * } + * ``` + * + * @generated from field: google.protobuf.Timestamp lt = 3; + */ + value: Timestamp; + case: "lt"; + } | { + /** + * `lte` requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated. + * + * ```proto + * message MyTimestamp { + * // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }]; + * } + * ``` + * + * @generated from field: google.protobuf.Timestamp lte = 4; + */ + value: Timestamp; + case: "lte"; + } | { + /** + * `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule. + * + * ```proto + * message MyTimestamp { + * // must be less than now + * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; + * } + * ``` + * + * @generated from field: bool lt_now = 7; + */ + value: boolean; + case: "ltNow"; + } | { case: undefined; value?: undefined }; + + /** + * @generated from oneof buf.validate.TimestampRules.greater_than + */ + greaterThan: { + /** + * `gt` requires the timestamp field value to be greater than the specified + * value (exclusive). If the value of `gt` is larger than a specified `lt` + * or `lte`, the range is reversed, and the field value must be outside the + * specified range. If the field value doesn't meet the required conditions, + * an error message is generated. + * + * ```proto + * message MyTimestamp { + * // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + * + * // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + * + * // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + * } + * ``` + * + * @generated from field: google.protobuf.Timestamp gt = 5; + */ + value: Timestamp; + case: "gt"; + } | { + /** + * `gte` requires the timestamp field value to be greater than or equal to the + * specified value (exclusive). If the value of `gte` is larger than a + * specified `lt` or `lte`, the range is reversed, and the field value + * must be outside the specified range. If the field value doesn't meet + * the required conditions, an error message is generated. + * + * ```proto + * message MyTimestamp { + * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + * + * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + * + * // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive] + * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + * } + * ``` + * + * @generated from field: google.protobuf.Timestamp gte = 6; + */ + value: Timestamp; + case: "gte"; + } | { + /** + * `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule. + * + * ```proto + * message MyTimestamp { + * // must be greater than now + * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; + * } + * ``` + * + * @generated from field: bool gt_now = 8; + */ + value: boolean; + case: "gtNow"; + } | { case: undefined; value?: undefined }; + + /** + * `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated. + * + * ```proto + * message MyTimestamp { + * // must be within 1 hour of now + * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; + * } + * ``` + * + * @generated from field: optional google.protobuf.Duration within = 9; + */ + within?: Duration | undefined; + + /** + * `example` specifies values that the field may have. These values SHOULD + * conform to other rules. `example` values will not impact validation + * but may be used as helpful guidance on how to populate the given field. + * + * ```proto + * message MyTimestamp { + * google.protobuf.Timestamp value = 1 [ + * (buf.validate.field).timestamp.example = { seconds: 1672444800 }, + * (buf.validate.field).timestamp.example = { seconds: 1672531200 }, + * ]; + * } + * ``` + * + * @generated from field: repeated google.protobuf.Timestamp example = 10; + */ + example: Timestamp[]; +}; + +/** + * Describes the message buf.validate.TimestampRules. + * Use `create(TimestampRulesSchema)` to create a new message. + */ +export const TimestampRulesSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 27); + +/** + * `Violations` is a collection of `Violation` messages. This message type is returned by + * Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules. + * Each individual violation is represented by a `Violation` message. + * + * @generated from message buf.validate.Violations + */ +export type Violations = Message<"buf.validate.Violations"> & { + /** + * `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected. + * + * @generated from field: repeated buf.validate.Violation violations = 1; + */ + violations: Violation[]; +}; + +/** + * Describes the message buf.validate.Violations. + * Use `create(ViolationsSchema)` to create a new message. + */ +export const ViolationsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 28); + +/** + * `Violation` represents a single instance where a validation rule, expressed + * as a `Rule`, was not met. It provides information about the field that + * caused the violation, the specific rule that wasn't fulfilled, and a + * human-readable error message. + * + * For example, consider the following message: + * + * ```proto + * message User { + * int32 age = 1 [(buf.validate.field).cel = { + * id: "user.age", + * expression: "this < 18 ? 'User must be at least 18 years old' : ''", + * }]; + * } + * ``` + * + * It could produce the following violation: + * + * ```json + * { + * "ruleId": "user.age", + * "message": "User must be at least 18 years old", + * "field": { + * "elements": [ + * { + * "fieldNumber": 1, + * "fieldName": "age", + * "fieldType": "TYPE_INT32" + * } + * ] + * }, + * "rule": { + * "elements": [ + * { + * "fieldNumber": 23, + * "fieldName": "cel", + * "fieldType": "TYPE_MESSAGE", + * "index": "0" + * } + * ] + * } + * } + * ``` + * + * @generated from message buf.validate.Violation + */ +export type Violation = Message<"buf.validate.Violation"> & { + /** + * `field` is a machine-readable path to the field that failed validation. + * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. + * + * For example, consider the following message: + * + * ```proto + * message Message { + * bool a = 1 [(buf.validate.field).required = true]; + * } + * ``` + * + * It could produce the following violation: + * + * ```textproto + * violation { + * field { element { field_number: 1, field_name: "a", field_type: 8 } } + * ... + * } + * ``` + * + * @generated from field: optional buf.validate.FieldPath field = 5; + */ + field?: FieldPath | undefined; + + /** + * `rule` is a machine-readable path that points to the specific rule that failed validation. + * This will be a nested field starting from the FieldRules of the field that failed validation. + * For custom rules, this will provide the path of the rule, e.g. `cel[0]`. + * + * For example, consider the following message: + * + * ```proto + * message Message { + * bool a = 1 [(buf.validate.field).required = true]; + * bool b = 2 [(buf.validate.field).cel = { + * id: "custom_rule", + * expression: "!this ? 'b must be true': ''" + * }] + * } + * ``` + * + * It could produce the following violations: + * + * ```textproto + * violation { + * rule { element { field_number: 25, field_name: "required", field_type: 8 } } + * ... + * } + * violation { + * rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } } + * ... + * } + * ``` + * + * @generated from field: optional buf.validate.FieldPath rule = 6; + */ + rule?: FieldPath | undefined; + + /** + * `rule_id` is the unique identifier of the `Rule` that was not fulfilled. + * This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated. + * + * @generated from field: optional string rule_id = 2; + */ + ruleId: string; + + /** + * `message` is a human-readable error message that describes the nature of the violation. + * This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation. + * + * @generated from field: optional string message = 3; + */ + message: string; + + /** + * `for_key` indicates whether the violation was caused by a map key, rather than a value. + * + * @generated from field: optional bool for_key = 4; + */ + forKey: boolean; +}; + +/** + * Describes the message buf.validate.Violation. + * Use `create(ViolationSchema)` to create a new message. + */ +export const ViolationSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 29); + +/** + * `FieldPath` provides a path to a nested protobuf field. + * + * This message provides enough information to render a dotted field path even without protobuf descriptors. + * It also provides enough information to resolve a nested field through unknown wire data. + * + * @generated from message buf.validate.FieldPath + */ +export type FieldPath = Message<"buf.validate.FieldPath"> & { + /** + * `elements` contains each element of the path, starting from the root and recursing downward. + * + * @generated from field: repeated buf.validate.FieldPathElement elements = 1; + */ + elements: FieldPathElement[]; +}; + +/** + * Describes the message buf.validate.FieldPath. + * Use `create(FieldPathSchema)` to create a new message. + */ +export const FieldPathSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 30); + +/** + * `FieldPathElement` provides enough information to nest through a single protobuf field. + * + * If the selected field is a map or repeated field, the `subscript` value selects a specific element from it. + * A path that refers to a value nested under a map key or repeated field index will have a `subscript` value. + * The `field_type` field allows unambiguous resolution of a field even if descriptors are not available. + * + * @generated from message buf.validate.FieldPathElement + */ +export type FieldPathElement = Message<"buf.validate.FieldPathElement"> & { + /** + * `field_number` is the field number this path element refers to. + * + * @generated from field: optional int32 field_number = 1; + */ + fieldNumber: number; + + /** + * `field_name` contains the field name this path element refers to. + * This can be used to display a human-readable path even if the field number is unknown. + * + * @generated from field: optional string field_name = 2; + */ + fieldName: string; + + /** + * `field_type` specifies the type of this field. When using reflection, this value is not needed. + * + * This value is provided to make it possible to traverse unknown fields through wire data. + * When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes. + * + * [1]: https://protobuf.dev/programming-guides/encoding/#packed + * [2]: https://protobuf.dev/programming-guides/encoding/#groups + * + * N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and + * can be explicitly used in Protocol Buffers 2023 Edition. + * + * @generated from field: optional google.protobuf.FieldDescriptorProto.Type field_type = 3; + */ + fieldType: FieldDescriptorProto_Type; + + /** + * `key_type` specifies the map key type of this field. This value is useful when traversing + * unknown fields through wire data: specifically, it allows handling the differences between + * different integer encodings. + * + * @generated from field: optional google.protobuf.FieldDescriptorProto.Type key_type = 4; + */ + keyType: FieldDescriptorProto_Type; + + /** + * `value_type` specifies map value type of this field. This is useful if you want to display a + * value inside unknown fields through wire data. + * + * @generated from field: optional google.protobuf.FieldDescriptorProto.Type value_type = 5; + */ + valueType: FieldDescriptorProto_Type; + + /** + * `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field. + * + * @generated from oneof buf.validate.FieldPathElement.subscript + */ + subscript: { + /** + * `index` specifies a 0-based index into a repeated field. + * + * @generated from field: uint64 index = 6; + */ + value: bigint; + case: "index"; + } | { + /** + * `bool_key` specifies a map key of type bool. + * + * @generated from field: bool bool_key = 7; + */ + value: boolean; + case: "boolKey"; + } | { + /** + * `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64. + * + * @generated from field: int64 int_key = 8; + */ + value: bigint; + case: "intKey"; + } | { + /** + * `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64. + * + * @generated from field: uint64 uint_key = 9; + */ + value: bigint; + case: "uintKey"; + } | { + /** + * `string_key` specifies a map key of type string. + * + * @generated from field: string string_key = 10; + */ + value: string; + case: "stringKey"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message buf.validate.FieldPathElement. + * Use `create(FieldPathElementSchema)` to create a new message. + */ +export const FieldPathElementSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_buf_validate_validate, 31); + +/** + * Specifies how `FieldRules.ignore` behaves, depending on the field's value, and + * whether the field tracks presence. + * + * @generated from enum buf.validate.Ignore + */ +export enum Ignore { + /** + * Ignore rules if the field tracks presence and is unset. This is the default + * behavior. + * + * In proto3, only message fields, members of a Protobuf `oneof`, and fields + * with the `optional` label track presence. Consequently, the following fields + * are always validated, whether a value is set or not: + * + * ```proto + * syntax="proto3"; + * + * message RulesApply { + * string email = 1 [ + * (buf.validate.field).string.email = true + * ]; + * int32 age = 2 [ + * (buf.validate.field).int32.gt = 0 + * ]; + * repeated string labels = 3 [ + * (buf.validate.field).repeated.min_items = 1 + * ]; + * } + * ``` + * + * In contrast, the following fields track presence, and are only validated if + * a value is set: + * + * ```proto + * syntax="proto3"; + * + * message RulesApplyIfSet { + * optional string email = 1 [ + * (buf.validate.field).string.email = true + * ]; + * oneof ref { + * string reference = 2 [ + * (buf.validate.field).string.uuid = true + * ]; + * string name = 3 [ + * (buf.validate.field).string.min_len = 4 + * ]; + * } + * SomeMessage msg = 4 [ + * (buf.validate.field).cel = {/* ... *\/} + * ]; + * } + * ``` + * + * To ensure that such a field is set, add the `required` rule. + * + * To learn which fields track presence, see the + * [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + * + * @generated from enum value: IGNORE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Ignore rules if the field is unset, or set to the zero value. + * + * The zero value depends on the field type: + * - For strings, the zero value is the empty string. + * - For bytes, the zero value is empty bytes. + * - For bool, the zero value is false. + * - For numeric types, the zero value is zero. + * - For enums, the zero value is the first defined enum value. + * - For repeated fields, the zero is an empty list. + * - For map fields, the zero is an empty map. + * - For message fields, absence of the message (typically a null-value) is considered zero value. + * + * For fields that track presence (e.g. adding the `optional` label in proto3), + * this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`. + * + * @generated from enum value: IGNORE_IF_ZERO_VALUE = 1; + */ + IF_ZERO_VALUE = 1, + + /** + * Always ignore rules, including the `required` rule. + * + * This is useful for ignoring the rules of a referenced message, or to + * temporarily ignore rules during development. + * + * ```proto + * message MyMessage { + * // The field's rules will always be ignored, including any validations + * // on value's fields. + * MyOtherMessage value = 1 [ + * (buf.validate.field).ignore = IGNORE_ALWAYS + * ]; + * } + * ``` + * + * @generated from enum value: IGNORE_ALWAYS = 3; + */ + ALWAYS = 3, +} + +/** + * Describes the enum buf.validate.Ignore. + */ +export const IgnoreSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_buf_validate_validate, 0); + +/** + * KnownRegex contains some well-known patterns. + * + * @generated from enum buf.validate.KnownRegex + */ +export enum KnownRegex { + /** + * @generated from enum value: KNOWN_REGEX_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2). + * + * @generated from enum value: KNOWN_REGEX_HTTP_HEADER_NAME = 1; + */ + HTTP_HEADER_NAME = 1, + + /** + * HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4). + * + * @generated from enum value: KNOWN_REGEX_HTTP_HEADER_VALUE = 2; + */ + HTTP_HEADER_VALUE = 2, +} + +/** + * Describes the enum buf.validate.KnownRegex. + */ +export const KnownRegexSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_buf_validate_validate, 1); + +/** + * Rules specify the validations to be performed on this message. By default, + * no validation is performed against a message. + * + * @generated from extension: optional buf.validate.MessageRules message = 1159; + */ +export const message: GenExtension = /*@__PURE__*/ + extDesc(file_buf_validate_validate, 0); + +/** + * Rules specify the validations to be performed on this oneof. By default, + * no validation is performed against a oneof. + * + * @generated from extension: optional buf.validate.OneofRules oneof = 1159; + */ +export const oneof: GenExtension = /*@__PURE__*/ + extDesc(file_buf_validate_validate, 1); + +/** + * Rules specify the validations to be performed on this field. By default, + * no validation is performed against a field. + * + * @generated from extension: optional buf.validate.FieldRules field = 1159; + */ +export const field: GenExtension = /*@__PURE__*/ + extDesc(file_buf_validate_validate, 2); + +/** + * Specifies predefined rules. When extending a standard rule message, + * this adds additional CEL expressions that apply when the extension is used. + * + * ```proto + * extend buf.validate.Int32Rules { + * bool is_zero [(buf.validate.predefined).cel = { + * id: "int32.is_zero", + * message: "must be zero", + * expression: "!rule || this == 0", + * }]; + * } + * + * message Foo { + * int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true]; + * } + * ``` + * + * @generated from extension: optional buf.validate.PredefinedRules predefined = 1160; + */ +export const predefined: GenExtension = /*@__PURE__*/ + extDesc(file_buf_validate_validate, 3); + diff --git a/meshexplorer/src/gen/meshexplorer/v1/chat_pb.ts b/meshexplorer/src/gen/meshexplorer/v1/chat_pb.ts new file mode 100644 index 0000000..8094683 --- /dev/null +++ b/meshexplorer/src/gen/meshexplorer/v1/chat_pb.ts @@ -0,0 +1,292 @@ +// @generated by protoc-gen-es v2.12.0 with parameter "target=ts,import_extension=none" +// @generated from file meshexplorer/v1/chat.proto (package meshexplorer.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_buf_validate_validate } from "../../buf/validate/validate_pb"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file meshexplorer/v1/chat.proto. + */ +export const file_meshexplorer_v1_chat: GenFile = /*@__PURE__*/ + fileDesc("ChptZXNoZXhwbG9yZXIvdjEvY2hhdC5wcm90bxIPbWVzaGV4cGxvcmVyLnYxImQKDk9yaWdpblBhdGhJbmZvEg4KBm9yaWdpbhgBIAEoCRIVCg1vcmlnaW5fcHVia2V5GAIgASgJEgwKBHBhd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hW6SBJyEDIOXlswLTlBLUZhLWZdKyRIAIgBARITCgZyZWdpb24YAiABKAlIAYgBARIPCgdkZWNyeXB0GAMgASgIEhQKDHByaXZhdGVfa2V5cxgEIAMoCRImCg1wb2xsX2ludGVydmFsGAUgASgFQgq6SAcaBRiQTihkSAKIAQESIQoIbWF4X3Jvd3MYBiABKAVCCrpIBxoFGOgHKApIA4gBARIdChVza2lwX2luaXRpYWxfbWVzc2FnZXMYByABKAhCDQoLX2NoYW5uZWxfaWRCCQoHX3JlZ2lvbkIQCg5fcG9sbF9pbnRlcnZhbEILCglfbWF4X3Jvd3MyrQEKC0NoYXRTZXJ2aWNlEkwKB0dldENoYXQSHy5tZXNoZXhwbG9yZXIudjEuR2V0Q2hhdFJlcXVlc3QaIC5tZXNoZXhwbG9yZXIudjEuR2V0Q2hhdFJlc3BvbnNlElAKClN0cmVhbUNoYXQSIi5tZXNoZXhwbG9yZXIudjEuU3RyZWFtQ2hhdFJlcXVlc3QaHC5tZXNoZXhwbG9yZXIudjEuQ2hhdE1lc3NhZ2UwAWIGcHJvdG8z", [file_buf_validate_validate]); + +/** + * One (origin, origin_pubkey, path, broker, topic) reception tuple. + * + * @generated from message meshexplorer.v1.OriginPathInfo + */ +export type OriginPathInfo = Message<"meshexplorer.v1.OriginPathInfo"> & { + /** + * @generated from field: string origin = 1; + */ + origin: string; + + /** + * @generated from field: string origin_pubkey = 2; + */ + originPubkey: string; + + /** + * @generated from field: string path = 3; + */ + path: string; + + /** + * @generated from field: string broker = 4; + */ + broker: string; + + /** + * @generated from field: string topic = 5; + */ + topic: string; +}; + +/** + * Describes the message meshexplorer.v1.OriginPathInfo. + * Use `create(OriginPathInfoSchema)` to create a new message. + */ +export const OriginPathInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_chat, 0); + +/** + * A parsed/decrypted public-channel message (parseMeshcoreGroupMessage). + * + * @generated from message meshexplorer.v1.DecryptedChat + */ +export type DecryptedChat = Message<"meshexplorer.v1.DecryptedChat"> & { + /** + * @generated from field: double timestamp = 1; + */ + timestamp: number; + + /** + * @generated from field: int32 msg_type = 2; + */ + msgType: number; + + /** + * @generated from field: string sender = 3; + */ + sender: string; + + /** + * @generated from field: string text = 4; + */ + text: string; + + /** + * @generated from field: string raw_text = 5; + */ + rawText: string; +}; + +/** + * Describes the message meshexplorer.v1.DecryptedChat. + * Use `create(DecryptedChatSchema)` to create a new message. + */ +export const DecryptedChatSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_chat, 1); + +/** + * @generated from message meshexplorer.v1.ChatMessage + */ +export type ChatMessage = Message<"meshexplorer.v1.ChatMessage"> & { + /** + * @generated from field: string ingest_timestamp = 1; + */ + ingestTimestamp: string; + + /** + * @generated from field: string mesh_timestamp = 2; + */ + meshTimestamp: string; + + /** + * @generated from field: string channel_hash = 3; + */ + channelHash: string; + + /** + * @generated from field: string mac = 4; + */ + mac: string; + + /** + * Hex-encoded ciphertext. + * + * @generated from field: string encrypted_message = 5; + */ + encryptedMessage: string; + + /** + * @generated from field: int32 message_count = 6; + */ + messageCount: number; + + /** + * @generated from field: repeated meshexplorer.v1.OriginPathInfo origin_path_info = 7; + */ + originPathInfo: OriginPathInfo[]; + + /** + * @generated from field: string message_id = 8; + */ + messageId: string; + + /** + * Present only when decrypt was requested and decryption succeeded. + * + * @generated from field: optional meshexplorer.v1.DecryptedChat decrypted = 9; + */ + decrypted?: DecryptedChat | undefined; +}; + +/** + * Describes the message meshexplorer.v1.ChatMessage. + * Use `create(ChatMessageSchema)` to create a new message. + */ +export const ChatMessageSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_chat, 2); + +/** + * @generated from message meshexplorer.v1.GetChatRequest + */ +export type GetChatRequest = Message<"meshexplorer.v1.GetChatRequest"> & { + /** + * @generated from field: optional int32 limit = 1; + */ + limit?: number | undefined; + + /** + * @generated from field: optional string before = 2; + */ + before?: string | undefined; + + /** + * @generated from field: optional string after = 3; + */ + after?: string | undefined; + + /** + * @generated from field: optional string channel_id = 4; + */ + channelId?: string | undefined; + + /** + * @generated from field: optional string region = 5; + */ + region?: string | undefined; + + /** + * @generated from field: bool decrypt = 6; + */ + decrypt: boolean; + + /** + * @generated from field: repeated string private_keys = 7; + */ + privateKeys: string[]; +}; + +/** + * Describes the message meshexplorer.v1.GetChatRequest. + * Use `create(GetChatRequestSchema)` to create a new message. + */ +export const GetChatRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_chat, 3); + +/** + * @generated from message meshexplorer.v1.GetChatResponse + */ +export type GetChatResponse = Message<"meshexplorer.v1.GetChatResponse"> & { + /** + * @generated from field: repeated meshexplorer.v1.ChatMessage messages = 1; + */ + messages: ChatMessage[]; +}; + +/** + * Describes the message meshexplorer.v1.GetChatResponse. + * Use `create(GetChatResponseSchema)` to create a new message. + */ +export const GetChatResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_chat, 4); + +/** + * @generated from message meshexplorer.v1.StreamChatRequest + */ +export type StreamChatRequest = Message<"meshexplorer.v1.StreamChatRequest"> & { + /** + * @generated from field: optional string channel_id = 1; + */ + channelId?: string | undefined; + + /** + * @generated from field: optional string region = 2; + */ + region?: string | undefined; + + /** + * @generated from field: bool decrypt = 3; + */ + decrypt: boolean; + + /** + * @generated from field: repeated string private_keys = 4; + */ + privateKeys: string[]; + + /** + * Poll interval in ms (clamped 100..10000, default 1000). + * + * @generated from field: optional int32 poll_interval = 5; + */ + pollInterval?: number | undefined; + + /** + * Max rows per poll (clamped 10..1000, default 500). + * + * @generated from field: optional int32 max_rows = 6; + */ + maxRows?: number | undefined; + + /** + * @generated from field: bool skip_initial_messages = 7; + */ + skipInitialMessages: boolean; +}; + +/** + * Describes the message meshexplorer.v1.StreamChatRequest. + * Use `create(StreamChatRequestSchema)` to create a new message. + */ +export const StreamChatRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_chat, 5); + +/** + * @generated from service meshexplorer.v1.ChatService + */ +export const ChatService: GenService<{ + /** + * @generated from rpc meshexplorer.v1.ChatService.GetChat + */ + getChat: { + methodKind: "unary"; + input: typeof GetChatRequestSchema; + output: typeof GetChatResponseSchema; + }, + /** + * @generated from rpc meshexplorer.v1.ChatService.StreamChat + */ + streamChat: { + methodKind: "server_streaming"; + input: typeof StreamChatRequestSchema; + output: typeof ChatMessageSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_meshexplorer_v1_chat, 0); + diff --git a/meshexplorer/src/gen/meshexplorer/v1/common_pb.ts b/meshexplorer/src/gen/meshexplorer/v1/common_pb.ts new file mode 100644 index 0000000..508769c --- /dev/null +++ b/meshexplorer/src/gen/meshexplorer/v1/common_pb.ts @@ -0,0 +1,90 @@ +// @generated by protoc-gen-es v2.12.0 with parameter "target=ts,import_extension=none" +// @generated from file meshexplorer/v1/common.proto (package meshexplorer.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file meshexplorer/v1/common.proto. + */ +export const file_meshexplorer_v1_common: GenFile = /*@__PURE__*/ + fileDesc("ChxtZXNoZXhwbG9yZXIvdjEvY29tbW9uLnByb3RvEg9tZXNoZXhwbG9yZXIudjEisQIKDE5laWdoYm9yRWRnZRITCgtzb3VyY2Vfbm9kZRgBIAEoCRITCgt0YXJnZXRfbm9kZRgCIAEoCRIXCg9jb25uZWN0aW9uX3R5cGUYAyABKAkSFAoMcGFja2V0X2NvdW50GAQgASgFEhMKC3NvdXJjZV9uYW1lGAUgASgJEhcKD3NvdXJjZV9sYXRpdHVkZRgGIAEoARIYChBzb3VyY2VfbG9uZ2l0dWRlGAcgASgBEhsKE3NvdXJjZV9oYXNfbG9jYXRpb24YCCABKAUSEwoLdGFyZ2V0X25hbWUYCSABKAkSFwoPdGFyZ2V0X2xhdGl0dWRlGAogASgBEhgKEHRhcmdldF9sb25naXR1ZGUYCyABKAESGwoTdGFyZ2V0X2hhc19sb2NhdGlvbhgMIAEoBWIGcHJvdG8z"); + +/** + * A directed edge in the neighbor graph between two located nodes. + * Shared by MapService.GetMap (when includeNeighbors=true) and + * NeighborsService.GetAllNeighbors. Mirrors meshcore_all_neighbor_edges. + * + * @generated from message meshexplorer.v1.NeighborEdge + */ +export type NeighborEdge = Message<"meshexplorer.v1.NeighborEdge"> & { + /** + * @generated from field: string source_node = 1; + */ + sourceNode: string; + + /** + * @generated from field: string target_node = 2; + */ + targetNode: string; + + /** + * @generated from field: string connection_type = 3; + */ + connectionType: string; + + /** + * @generated from field: int32 packet_count = 4; + */ + packetCount: number; + + /** + * @generated from field: string source_name = 5; + */ + sourceName: string; + + /** + * @generated from field: double source_latitude = 6; + */ + sourceLatitude: number; + + /** + * @generated from field: double source_longitude = 7; + */ + sourceLongitude: number; + + /** + * @generated from field: int32 source_has_location = 8; + */ + sourceHasLocation: number; + + /** + * @generated from field: string target_name = 9; + */ + targetName: string; + + /** + * @generated from field: double target_latitude = 10; + */ + targetLatitude: number; + + /** + * @generated from field: double target_longitude = 11; + */ + targetLongitude: number; + + /** + * @generated from field: int32 target_has_location = 12; + */ + targetHasLocation: number; +}; + +/** + * Describes the message meshexplorer.v1.NeighborEdge. + * Use `create(NeighborEdgeSchema)` to create a new message. + */ +export const NeighborEdgeSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_common, 0); + diff --git a/meshexplorer/src/gen/meshexplorer/v1/map_pb.ts b/meshexplorer/src/gen/meshexplorer/v1/map_pb.ts new file mode 100644 index 0000000..654ec60 --- /dev/null +++ b/meshexplorer/src/gen/meshexplorer/v1/map_pb.ts @@ -0,0 +1,169 @@ +// @generated by protoc-gen-es v2.12.0 with parameter "target=ts,import_extension=none" +// @generated from file meshexplorer/v1/map.proto (package meshexplorer.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_buf_validate_validate } from "../../buf/validate/validate_pb"; +import type { NeighborEdge } from "./common_pb"; +import { file_meshexplorer_v1_common } from "./common_pb"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file meshexplorer/v1/map.proto. + */ +export const file_meshexplorer_v1_map: GenFile = /*@__PURE__*/ + fileDesc("ChltZXNoZXhwbG9yZXIvdjEvbWFwLnByb3RvEg9tZXNoZXhwbG9yZXIudjEi0QEKDE5vZGVQb3NpdGlvbhIPCgdub2RlX2lkGAEgASgJEhEKBG5hbWUYAiABKAlIAIgBARIXCgpzaG9ydF9uYW1lGAMgASgJSAGIAQESEAoIbGF0aXR1ZGUYBCABKAESEQoJbG9uZ2l0dWRlGAUgASgBEhEKCWxhc3Rfc2VlbhgGIAEoCRIXCgpmaXJzdF9zZWVuGAcgASgJSAKIAQESDAoEdHlwZRgIIAEoCUIHCgVfbmFtZUINCgtfc2hvcnRfbmFtZUINCgtfZmlyc3Rfc2VlbiL5AgoNR2V0TWFwUmVxdWVzdBItCgdtaW5fbGF0GAEgASgBQhe6SBQSEhkAAAAAAIBWQCkAAAAAAIBWwEgAiAEBEi0KB21heF9sYXQYAiABKAFCF7pIFBISGQAAAAAAgFZAKQAAAAAAgFbASAGIAQESLQoHbWluX2xuZxgDIAEoAUIXukgUEhIZAAAAAACAZkApAAAAAACAZsBIAogBARItCgdtYXhfbG5nGAQgASgBQhe6SBQSEhkAAAAAAIBmQCkAAAAAAIBmwEgDiAEBEhIKCm5vZGVfdHlwZXMYBSADKAkSHwoJbGFzdF9zZWVuGAYgASgFQge6SAQaAigASASIAQESEwoGcmVnaW9uGAcgASgJSAWIAQESGQoRaW5jbHVkZV9uZWlnaGJvcnMYCCABKAhCCgoIX21pbl9sYXRCCgoIX21heF9sYXRCCgoIX21pbl9sbmdCCgoIX21heF9sbmdCDAoKX2xhc3Rfc2VlbkIJCgdfcmVnaW9uInAKDkdldE1hcFJlc3BvbnNlEiwKBW5vZGVzGAEgAygLMh0ubWVzaGV4cGxvcmVyLnYxLk5vZGVQb3NpdGlvbhIwCgluZWlnaGJvcnMYAiADKAsyHS5tZXNoZXhwbG9yZXIudjEuTmVpZ2hib3JFZGdlMlcKCk1hcFNlcnZpY2USSQoGR2V0TWFwEh4ubWVzaGV4cGxvcmVyLnYxLkdldE1hcFJlcXVlc3QaHy5tZXNoZXhwbG9yZXIudjEuR2V0TWFwUmVzcG9uc2ViBnByb3RvMw", [file_buf_validate_validate, file_meshexplorer_v1_common]); + +/** + * Latest known position of a node. Mirrors unified_latest_nodeinfo rows + * returned by getNodePositions(). + * + * @generated from message meshexplorer.v1.NodePosition + */ +export type NodePosition = Message<"meshexplorer.v1.NodePosition"> & { + /** + * @generated from field: string node_id = 1; + */ + nodeId: string; + + /** + * @generated from field: optional string name = 2; + */ + name?: string | undefined; + + /** + * @generated from field: optional string short_name = 3; + */ + shortName?: string | undefined; + + /** + * @generated from field: double latitude = 4; + */ + latitude: number; + + /** + * @generated from field: double longitude = 5; + */ + longitude: number; + + /** + * @generated from field: string last_seen = 6; + */ + lastSeen: string; + + /** + * @generated from field: optional string first_seen = 7; + */ + firstSeen?: string | undefined; + + /** + * @generated from field: string type = 8; + */ + type: string; +}; + +/** + * Describes the message meshexplorer.v1.NodePosition. + * Use `create(NodePositionSchema)` to create a new message. + */ +export const NodePositionSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_map, 0); + +/** + * @generated from message meshexplorer.v1.GetMapRequest + */ +export type GetMapRequest = Message<"meshexplorer.v1.GetMapRequest"> & { + /** + * Bounding box (decimal degrees). Unset fields mean "unbounded" on that edge. + * + * @generated from field: optional double min_lat = 1; + */ + minLat?: number | undefined; + + /** + * @generated from field: optional double max_lat = 2; + */ + maxLat?: number | undefined; + + /** + * @generated from field: optional double min_lng = 3; + */ + minLng?: number | undefined; + + /** + * @generated from field: optional double max_lng = 4; + */ + maxLng?: number | undefined; + + /** + * @generated from field: repeated string node_types = 5; + */ + nodeTypes: string[]; + + /** + * Only include nodes seen within this many seconds. + * + * @generated from field: optional int32 last_seen = 6; + */ + lastSeen?: number | undefined; + + /** + * @generated from field: optional string region = 7; + */ + region?: string | undefined; + + /** + * When true, also compute and return the neighbor edge graph. + * + * @generated from field: bool include_neighbors = 8; + */ + includeNeighbors: boolean; +}; + +/** + * Describes the message meshexplorer.v1.GetMapRequest. + * Use `create(GetMapRequestSchema)` to create a new message. + */ +export const GetMapRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_map, 1); + +/** + * @generated from message meshexplorer.v1.GetMapResponse + */ +export type GetMapResponse = Message<"meshexplorer.v1.GetMapResponse"> & { + /** + * @generated from field: repeated meshexplorer.v1.NodePosition nodes = 1; + */ + nodes: NodePosition[]; + + /** + * Populated only when include_neighbors was set on the request. + * + * @generated from field: repeated meshexplorer.v1.NeighborEdge neighbors = 2; + */ + neighbors: NeighborEdge[]; +}; + +/** + * Describes the message meshexplorer.v1.GetMapResponse. + * Use `create(GetMapResponseSchema)` to create a new message. + */ +export const GetMapResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_map, 2); + +/** + * @generated from service meshexplorer.v1.MapService + */ +export const MapService: GenService<{ + /** + * @generated from rpc meshexplorer.v1.MapService.GetMap + */ + getMap: { + methodKind: "unary"; + input: typeof GetMapRequestSchema; + output: typeof GetMapResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_meshexplorer_v1_map, 0); + diff --git a/meshexplorer/src/gen/meshexplorer/v1/neighbors_pb.ts b/meshexplorer/src/gen/meshexplorer/v1/neighbors_pb.ts new file mode 100644 index 0000000..5c75845 --- /dev/null +++ b/meshexplorer/src/gen/meshexplorer/v1/neighbors_pb.ts @@ -0,0 +1,96 @@ +// @generated by protoc-gen-es v2.12.0 with parameter "target=ts,import_extension=none" +// @generated from file meshexplorer/v1/neighbors.proto (package meshexplorer.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_buf_validate_validate } from "../../buf/validate/validate_pb"; +import type { NeighborEdge } from "./common_pb"; +import { file_meshexplorer_v1_common } from "./common_pb"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file meshexplorer/v1/neighbors.proto. + */ +export const file_meshexplorer_v1_neighbors: GenFile = /*@__PURE__*/ + fileDesc("Ch9tZXNoZXhwbG9yZXIvdjEvbmVpZ2hib3JzLnByb3RvEg9tZXNoZXhwbG9yZXIudjEi5wIKFkdldEFsbE5laWdoYm9yc1JlcXVlc3QSLQoHbWluX2xhdBgBIAEoAUIXukgUEhIZAAAAAACAVkApAAAAAACAVsBIAIgBARItCgdtYXhfbGF0GAIgASgBQhe6SBQSEhkAAAAAAIBWQCkAAAAAAIBWwEgBiAEBEi0KB21pbl9sbmcYAyABKAFCF7pIFBISGQAAAAAAgGZAKQAAAAAAgGbASAKIAQESLQoHbWF4X2xuZxgEIAEoAUIXukgUEhIZAAAAAACAZkApAAAAAACAZsBIA4gBARISCgpub2RlX3R5cGVzGAUgAygJEh8KCWxhc3Rfc2VlbhgGIAEoBUIHukgEGgIoAEgEiAEBEhMKBnJlZ2lvbhgHIAEoCUgFiAEBQgoKCF9taW5fbGF0QgoKCF9tYXhfbGF0QgoKCF9taW5fbG5nQgoKCF9tYXhfbG5nQgwKCl9sYXN0X3NlZW5CCQoHX3JlZ2lvbiJLChdHZXRBbGxOZWlnaGJvcnNSZXNwb25zZRIwCgluZWlnaGJvcnMYASADKAsyHS5tZXNoZXhwbG9yZXIudjEuTmVpZ2hib3JFZGdlMngKEE5laWdoYm9yc1NlcnZpY2USZAoPR2V0QWxsTmVpZ2hib3JzEicubWVzaGV4cGxvcmVyLnYxLkdldEFsbE5laWdoYm9yc1JlcXVlc3QaKC5tZXNoZXhwbG9yZXIudjEuR2V0QWxsTmVpZ2hib3JzUmVzcG9uc2ViBnByb3RvMw", [file_buf_validate_validate, file_meshexplorer_v1_common]); + +/** + * @generated from message meshexplorer.v1.GetAllNeighborsRequest + */ +export type GetAllNeighborsRequest = Message<"meshexplorer.v1.GetAllNeighborsRequest"> & { + /** + * @generated from field: optional double min_lat = 1; + */ + minLat?: number | undefined; + + /** + * @generated from field: optional double max_lat = 2; + */ + maxLat?: number | undefined; + + /** + * @generated from field: optional double min_lng = 3; + */ + minLng?: number | undefined; + + /** + * @generated from field: optional double max_lng = 4; + */ + maxLng?: number | undefined; + + /** + * @generated from field: repeated string node_types = 5; + */ + nodeTypes: string[]; + + /** + * @generated from field: optional int32 last_seen = 6; + */ + lastSeen?: number | undefined; + + /** + * @generated from field: optional string region = 7; + */ + region?: string | undefined; +}; + +/** + * Describes the message meshexplorer.v1.GetAllNeighborsRequest. + * Use `create(GetAllNeighborsRequestSchema)` to create a new message. + */ +export const GetAllNeighborsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_neighbors, 0); + +/** + * @generated from message meshexplorer.v1.GetAllNeighborsResponse + */ +export type GetAllNeighborsResponse = Message<"meshexplorer.v1.GetAllNeighborsResponse"> & { + /** + * @generated from field: repeated meshexplorer.v1.NeighborEdge neighbors = 1; + */ + neighbors: NeighborEdge[]; +}; + +/** + * Describes the message meshexplorer.v1.GetAllNeighborsResponse. + * Use `create(GetAllNeighborsResponseSchema)` to create a new message. + */ +export const GetAllNeighborsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_neighbors, 1); + +/** + * @generated from service meshexplorer.v1.NeighborsService + */ +export const NeighborsService: GenService<{ + /** + * @generated from rpc meshexplorer.v1.NeighborsService.GetAllNeighbors + */ + getAllNeighbors: { + methodKind: "unary"; + input: typeof GetAllNeighborsRequestSchema; + output: typeof GetAllNeighborsResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_meshexplorer_v1_neighbors, 0); + diff --git a/meshexplorer/src/gen/meshexplorer/v1/node_pb.ts b/meshexplorer/src/gen/meshexplorer/v1/node_pb.ts new file mode 100644 index 0000000..efd227d --- /dev/null +++ b/meshexplorer/src/gen/meshexplorer/v1/node_pb.ts @@ -0,0 +1,654 @@ +// @generated by protoc-gen-es v2.12.0 with parameter "target=ts,import_extension=none" +// @generated from file meshexplorer/v1/node.proto (package meshexplorer.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_buf_validate_validate } from "../../buf/validate/validate_pb"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file meshexplorer/v1/node.proto. + */ +export const file_meshexplorer_v1_node: GenFile = /*@__PURE__*/ + fileDesc("ChptZXNoZXhwbG9yZXIvdjEvbm9kZS5wcm90bxIPbWVzaGV4cGxvcmVyLnYxIssCCghOb2RlSW5mbxISCgpwdWJsaWNfa2V5GAEgASgJEhEKCW5vZGVfbmFtZRgCIAEoCRIVCghsYXRpdHVkZRgDIAEoAUgAiAEBEhYKCWxvbmdpdHVkZRgEIAEoAUgBiAEBEhQKDGhhc19sb2NhdGlvbhgFIAEoBRITCgtpc19yZXBlYXRlchgGIAEoBRIUCgxpc19jaGF0X25vZGUYByABKAUSFgoOaXNfcm9vbV9zZXJ2ZXIYCCABKAUSEAoIaGFzX25hbWUYCSABKAUSEwoGYnJva2VyGAogASgJSAKIAQESEgoFdG9waWMYCyABKAlIA4gBARISCgpmaXJzdF9zZWVuGAwgASgJEhEKCWxhc3Rfc2VlbhgNIAEoCUILCglfbGF0aXR1ZGVCDAoKX2xvbmdpdHVkZUIJCgdfYnJva2VyQggKBl90b3BpYyJMChVPcmlnaW5QYXRoUHVia2V5VHVwbGUSDgoGb3JpZ2luGAEgASgJEgwKBHBhdGgYAiABKAkSFQoNb3JpZ2luX3B1YmtleRgDIAEoCSLuAgoGQW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XVlc3QaJC5tZXNoZXhwbG9yZXIudjEuU2VhcmNoTm9kZXNSZXNwb25zZWIGcHJvdG8z", [file_buf_validate_validate]); + +/** + * Basic node identity/capabilities from the latest advert (getMeshcoreNodeInfo). + * + * @generated from message meshexplorer.v1.NodeInfo + */ +export type NodeInfo = Message<"meshexplorer.v1.NodeInfo"> & { + /** + * @generated from field: string public_key = 1; + */ + publicKey: string; + + /** + * @generated from field: string node_name = 2; + */ + nodeName: string; + + /** + * @generated from field: optional double latitude = 3; + */ + latitude?: number | undefined; + + /** + * @generated from field: optional double longitude = 4; + */ + longitude?: number | undefined; + + /** + * @generated from field: int32 has_location = 5; + */ + hasLocation: number; + + /** + * @generated from field: int32 is_repeater = 6; + */ + isRepeater: number; + + /** + * @generated from field: int32 is_chat_node = 7; + */ + isChatNode: number; + + /** + * @generated from field: int32 is_room_server = 8; + */ + isRoomServer: number; + + /** + * @generated from field: int32 has_name = 9; + */ + hasName: number; + + /** + * @generated from field: optional string broker = 10; + */ + broker?: string | undefined; + + /** + * @generated from field: optional string topic = 11; + */ + topic?: string | undefined; + + /** + * @generated from field: string first_seen = 12; + */ + firstSeen: string; + + /** + * @generated from field: string last_seen = 13; + */ + lastSeen: string; +}; + +/** + * Describes the message meshexplorer.v1.NodeInfo. + * Use `create(NodeInfoSchema)` to create a new message. + */ +export const NodeInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 0); + +/** + * One (origin, path, origin_pubkey) tuple from an advert's reception paths. + * + * @generated from message meshexplorer.v1.OriginPathPubkeyTuple + */ +export type OriginPathPubkeyTuple = Message<"meshexplorer.v1.OriginPathPubkeyTuple"> & { + /** + * @generated from field: string origin = 1; + */ + origin: string; + + /** + * @generated from field: string path = 2; + */ + path: string; + + /** + * @generated from field: string origin_pubkey = 3; + */ + originPubkey: string; +}; + +/** + * Describes the message meshexplorer.v1.OriginPathPubkeyTuple. + * Use `create(OriginPathPubkeyTupleSchema)` to create a new message. + */ +export const OriginPathPubkeyTupleSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 1); + +/** + * An advert grouped by packet_hash, with all the paths it was heard over. + * + * @generated from message meshexplorer.v1.Advert + */ +export type Advert = Message<"meshexplorer.v1.Advert"> & { + /** + * @generated from field: string adv_timestamp = 1; + */ + advTimestamp: string; + + /** + * @generated from field: repeated meshexplorer.v1.OriginPathPubkeyTuple origin_path_pubkey_tuples = 2; + */ + originPathPubkeyTuples: OriginPathPubkeyTuple[]; + + /** + * @generated from field: int32 advert_count = 3; + */ + advertCount: number; + + /** + * @generated from field: string earliest_timestamp = 4; + */ + earliestTimestamp: string; + + /** + * @generated from field: string latest_timestamp = 5; + */ + latestTimestamp: string; + + /** + * @generated from field: optional double latitude = 6; + */ + latitude?: number | undefined; + + /** + * @generated from field: optional double longitude = 7; + */ + longitude?: number | undefined; + + /** + * @generated from field: int32 is_repeater = 8; + */ + isRepeater: number; + + /** + * @generated from field: int32 is_chat_node = 9; + */ + isChatNode: number; + + /** + * @generated from field: int32 is_room_server = 10; + */ + isRoomServer: number; + + /** + * @generated from field: int32 has_location = 11; + */ + hasLocation: number; + + /** + * @generated from field: string packet_hash = 12; + */ + packetHash: string; +}; + +/** + * Describes the message meshexplorer.v1.Advert. + * Use `create(AdvertSchema)` to create a new message. + */ +export const AdvertSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 2); + +/** + * @generated from message meshexplorer.v1.LocationHistory + */ +export type LocationHistory = Message<"meshexplorer.v1.LocationHistory"> & { + /** + * @generated from field: string mesh_timestamp = 1; + */ + meshTimestamp: string; + + /** + * @generated from field: double latitude = 2; + */ + latitude: number; + + /** + * @generated from field: double longitude = 3; + */ + longitude: number; +}; + +/** + * Describes the message meshexplorer.v1.LocationHistory. + * Use `create(LocationHistorySchema)` to create a new message. + */ +export const LocationHistorySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 3); + +/** + * @generated from message meshexplorer.v1.MqttTopic + */ +export type MqttTopic = Message<"meshexplorer.v1.MqttTopic"> & { + /** + * @generated from field: string topic = 1; + */ + topic: string; + + /** + * @generated from field: string broker = 2; + */ + broker: string; + + /** + * @generated from field: string last_packet_time = 3; + */ + lastPacketTime: string; + + /** + * @generated from field: bool is_recent = 4; + */ + isRecent: boolean; +}; + +/** + * Describes the message meshexplorer.v1.MqttTopic. + * Use `create(MqttTopicSchema)` to create a new message. + */ +export const MqttTopicSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 4); + +/** + * @generated from message meshexplorer.v1.MqttInfo + */ +export type MqttInfo = Message<"meshexplorer.v1.MqttInfo"> & { + /** + * @generated from field: bool is_uplinked = 1; + */ + isUplinked: boolean; + + /** + * @generated from field: bool has_packets = 2; + */ + hasPackets: boolean; + + /** + * @generated from field: repeated meshexplorer.v1.MqttTopic topics = 3; + */ + topics: MqttTopic[]; +}; + +/** + * Describes the message meshexplorer.v1.MqttInfo. + * Use `create(MqttInfoSchema)` to create a new message. + */ +export const MqttInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 5); + +/** + * @generated from message meshexplorer.v1.GetNodeRequest + */ +export type GetNodeRequest = Message<"meshexplorer.v1.GetNodeRequest"> & { + /** + * @generated from field: string public_key = 1; + */ + publicKey: string; + + /** + * Max number of recent adverts to return (default 50). + * + * @generated from field: optional int32 limit = 2; + */ + limit?: number | undefined; +}; + +/** + * Describes the message meshexplorer.v1.GetNodeRequest. + * Use `create(GetNodeRequestSchema)` to create a new message. + */ +export const GetNodeRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 6); + +/** + * @generated from message meshexplorer.v1.GetNodeResponse + */ +export type GetNodeResponse = Message<"meshexplorer.v1.GetNodeResponse"> & { + /** + * @generated from field: meshexplorer.v1.NodeInfo node = 1; + */ + node?: NodeInfo | undefined; + + /** + * @generated from field: repeated meshexplorer.v1.Advert recent_adverts = 2; + */ + recentAdverts: Advert[]; + + /** + * @generated from field: repeated meshexplorer.v1.LocationHistory location_history = 3; + */ + locationHistory: LocationHistory[]; + + /** + * @generated from field: meshexplorer.v1.MqttInfo mqtt = 4; + */ + mqtt?: MqttInfo | undefined; + + /** + * @generated from field: optional string region = 5; + */ + region?: string | undefined; +}; + +/** + * Describes the message meshexplorer.v1.GetNodeResponse. + * Use `create(GetNodeResponseSchema)` to create a new message. + */ +export const GetNodeResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 7); + +/** + * Direct neighbor of a node (meshcore_node_direct_neighbors). + * + * @generated from message meshexplorer.v1.Neighbor + */ +export type Neighbor = Message<"meshexplorer.v1.Neighbor"> & { + /** + * @generated from field: string public_key = 1; + */ + publicKey: string; + + /** + * @generated from field: string node_name = 2; + */ + nodeName: string; + + /** + * @generated from field: optional double latitude = 3; + */ + latitude?: number | undefined; + + /** + * @generated from field: optional double longitude = 4; + */ + longitude?: number | undefined; + + /** + * @generated from field: int32 has_location = 5; + */ + hasLocation: number; + + /** + * @generated from field: int32 is_repeater = 6; + */ + isRepeater: number; + + /** + * @generated from field: int32 is_chat_node = 7; + */ + isChatNode: number; + + /** + * @generated from field: int32 is_room_server = 8; + */ + isRoomServer: number; + + /** + * @generated from field: int32 has_name = 9; + */ + hasName: number; + + /** + * @generated from field: repeated string directions = 10; + */ + directions: string[]; +}; + +/** + * Describes the message meshexplorer.v1.Neighbor. + * Use `create(NeighborSchema)` to create a new message. + */ +export const NeighborSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 8); + +/** + * @generated from message meshexplorer.v1.GetNodeNeighborsRequest + */ +export type GetNodeNeighborsRequest = Message<"meshexplorer.v1.GetNodeNeighborsRequest"> & { + /** + * @generated from field: string public_key = 1; + */ + publicKey: string; + + /** + * @generated from field: optional int32 last_seen = 2; + */ + lastSeen?: number | undefined; +}; + +/** + * Describes the message meshexplorer.v1.GetNodeNeighborsRequest. + * Use `create(GetNodeNeighborsRequestSchema)` to create a new message. + */ +export const GetNodeNeighborsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 9); + +/** + * @generated from message meshexplorer.v1.GetNodeNeighborsResponse + */ +export type GetNodeNeighborsResponse = Message<"meshexplorer.v1.GetNodeNeighborsResponse"> & { + /** + * @generated from field: repeated meshexplorer.v1.Neighbor neighbors = 1; + */ + neighbors: Neighbor[]; +}; + +/** + * Describes the message meshexplorer.v1.GetNodeNeighborsResponse. + * Use `create(GetNodeNeighborsResponseSchema)` to create a new message. + */ +export const GetNodeNeighborsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 10); + +/** + * One search request within a (possibly batched) SearchNodes call. + * + * @generated from message meshexplorer.v1.SearchQuery + */ +export type SearchQuery = Message<"meshexplorer.v1.SearchQuery"> & { + /** + * @generated from field: optional string query = 1; + */ + query?: string | undefined; + + /** + * @generated from field: optional string region = 2; + */ + region?: string | undefined; + + /** + * @generated from field: optional int32 last_seen = 3; + */ + lastSeen?: number | undefined; + + /** + * @generated from field: optional int32 limit = 4; + */ + limit?: number | undefined; + + /** + * @generated from field: optional bool exact = 5; + */ + exact?: boolean | undefined; + + /** + * @generated from field: optional bool is_repeater = 6; + */ + isRepeater?: boolean | undefined; +}; + +/** + * Describes the message meshexplorer.v1.SearchQuery. + * Use `create(SearchQuerySchema)` to create a new message. + */ +export const SearchQuerySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 11); + +/** + * @generated from message meshexplorer.v1.SearchResult + */ +export type SearchResult = Message<"meshexplorer.v1.SearchResult"> & { + /** + * @generated from field: string public_key = 1; + */ + publicKey: string; + + /** + * @generated from field: string node_name = 2; + */ + nodeName: string; + + /** + * @generated from field: optional double latitude = 3; + */ + latitude?: number | undefined; + + /** + * @generated from field: optional double longitude = 4; + */ + longitude?: number | undefined; + + /** + * @generated from field: int32 has_location = 5; + */ + hasLocation: number; + + /** + * @generated from field: int32 is_repeater = 6; + */ + isRepeater: number; + + /** + * @generated from field: int32 is_chat_node = 7; + */ + isChatNode: number; + + /** + * @generated from field: int32 is_room_server = 8; + */ + isRoomServer: number; + + /** + * @generated from field: int32 has_name = 9; + */ + hasName: number; + + /** + * @generated from field: string first_heard = 10; + */ + firstHeard: string; + + /** + * @generated from field: string last_seen = 11; + */ + lastSeen: string; + + /** + * @generated from field: string broker = 12; + */ + broker: string; + + /** + * @generated from field: string topic = 13; + */ + topic: string; +}; + +/** + * Describes the message meshexplorer.v1.SearchResult. + * Use `create(SearchResultSchema)` to create a new message. + */ +export const SearchResultSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 12); + +/** + * Results for a single query in the batch (preserves per-query grouping). + * + * @generated from message meshexplorer.v1.SearchResultList + */ +export type SearchResultList = Message<"meshexplorer.v1.SearchResultList"> & { + /** + * @generated from field: repeated meshexplorer.v1.SearchResult results = 1; + */ + results: SearchResult[]; +}; + +/** + * Describes the message meshexplorer.v1.SearchResultList. + * Use `create(SearchResultListSchema)` to create a new message. + */ +export const SearchResultListSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 13); + +/** + * @generated from message meshexplorer.v1.SearchNodesRequest + */ +export type SearchNodesRequest = Message<"meshexplorer.v1.SearchNodesRequest"> & { + /** + * @generated from field: repeated meshexplorer.v1.SearchQuery queries = 1; + */ + queries: SearchQuery[]; +}; + +/** + * Describes the message meshexplorer.v1.SearchNodesRequest. + * Use `create(SearchNodesRequestSchema)` to create a new message. + */ +export const SearchNodesRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 14); + +/** + * @generated from message meshexplorer.v1.SearchNodesResponse + */ +export type SearchNodesResponse = Message<"meshexplorer.v1.SearchNodesResponse"> & { + /** + * One entry per input query, in the same order. + * + * @generated from field: repeated meshexplorer.v1.SearchResultList results = 1; + */ + results: SearchResultList[]; +}; + +/** + * Describes the message meshexplorer.v1.SearchNodesResponse. + * Use `create(SearchNodesResponseSchema)` to create a new message. + */ +export const SearchNodesResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_node, 15); + +/** + * @generated from service meshexplorer.v1.NodeService + */ +export const NodeService: GenService<{ + /** + * @generated from rpc meshexplorer.v1.NodeService.GetNode + */ + getNode: { + methodKind: "unary"; + input: typeof GetNodeRequestSchema; + output: typeof GetNodeResponseSchema; + }, + /** + * @generated from rpc meshexplorer.v1.NodeService.GetNodeNeighbors + */ + getNodeNeighbors: { + methodKind: "unary"; + input: typeof GetNodeNeighborsRequestSchema; + output: typeof GetNodeNeighborsResponseSchema; + }, + /** + * @generated from rpc meshexplorer.v1.NodeService.SearchNodes + */ + searchNodes: { + methodKind: "unary"; + input: typeof SearchNodesRequestSchema; + output: typeof SearchNodesResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_meshexplorer_v1_node, 0); + diff --git a/meshexplorer/src/gen/meshexplorer/v1/packets_pb.ts b/meshexplorer/src/gen/meshexplorer/v1/packets_pb.ts new file mode 100644 index 0000000..81beccd --- /dev/null +++ b/meshexplorer/src/gen/meshexplorer/v1/packets_pb.ts @@ -0,0 +1,154 @@ +// @generated by protoc-gen-es v2.12.0 with parameter "target=ts,import_extension=none" +// @generated from file meshexplorer/v1/packets.proto (package meshexplorer.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import { file_buf_validate_validate } from "../../buf/validate/validate_pb"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file meshexplorer/v1/packets.proto. + */ +export const file_meshexplorer_v1_packets: GenFile = /*@__PURE__*/ + fileDesc("Ch1tZXNoZXhwbG9yZXIvdjEvcGFja2V0cy5wcm90bxIPbWVzaGV4cGxvcmVyLnYxIvMBCgZQYWNrZXQSGAoQaW5nZXN0X3RpbWVzdGFtcBgBIAEoCRIWCg5tZXNoX3RpbWVzdGFtcBgCIAEoCRIOCgZicm9rZXIYAyABKAkSDQoFdG9waWMYBCABKAkSDgoGcGFja2V0GAUgASgJEhAKCHBhdGhfbGVuGAYgASgFEgwKBHBhdGgYByABKAkSEgoKcm91dGVfdHlwZRgIIAEoBRIUCgxwYXlsb2FkX3R5cGUYCSABKAUSFwoPcGF5bG9hZF92ZXJzaW9uGAogASgFEg4KBmhlYWRlchgLIAEoBRIVCg1vcmlnaW5fcHVia2V5GAwgASgJIs8CChRTdHJlYW1QYWNrZXRzUmVxdWVzdBITCgZyZWdpb24YASABKAlIAIgBARIkCgxwYXlsb2FkX3R5cGUYAiABKAVCCbpIBhoEGA8oAEgBiAEBEiIKCnJvdXRlX3R5cGUYAyABKAVCCbpIBhoEGAMoAEgCiAEBEjEKDW9yaWdpbl9wdWJrZXkYBCABKAlCFbpIEnIQMg5eWzAtOUEtRmEtZl0rJEgDiAEBEiYKDXBvbGxfaW50ZXJ2YWwYBSABKAVCCrpIBxoFGJBOKGRIBIgBARIhCghtYXhfcm93cxgGIAEoBUIKukgHGgUYkE4oCkgFiAEBQgkKB19yZWdpb25CDwoNX3BheWxvYWRfdHlwZUINCgtfcm91dGVfdHlwZUIQCg5fb3JpZ2luX3B1YmtleUIQCg5fcG9sbF9pbnRlcnZhbEILCglfbWF4X3Jvd3MyYwoOUGFja2V0c1NlcnZpY2USUQoNU3RyZWFtUGFja2V0cxIlLm1lc2hleHBsb3Jlci52MS5TdHJlYW1QYWNrZXRzUmVxdWVzdBoXLm1lc2hleHBsb3Jlci52MS5QYWNrZXQwAWIGcHJvdG8z", [file_buf_validate_validate]); + +/** + * A raw mesh packet (meshcore_packets), hex fields kept as hex strings. + * + * @generated from message meshexplorer.v1.Packet + */ +export type Packet = Message<"meshexplorer.v1.Packet"> & { + /** + * @generated from field: string ingest_timestamp = 1; + */ + ingestTimestamp: string; + + /** + * @generated from field: string mesh_timestamp = 2; + */ + meshTimestamp: string; + + /** + * @generated from field: string broker = 3; + */ + broker: string; + + /** + * @generated from field: string topic = 4; + */ + topic: string; + + /** + * @generated from field: string packet = 5; + */ + packet: string; + + /** + * @generated from field: int32 path_len = 6; + */ + pathLen: number; + + /** + * @generated from field: string path = 7; + */ + path: string; + + /** + * @generated from field: int32 route_type = 8; + */ + routeType: number; + + /** + * @generated from field: int32 payload_type = 9; + */ + payloadType: number; + + /** + * @generated from field: int32 payload_version = 10; + */ + payloadVersion: number; + + /** + * @generated from field: int32 header = 11; + */ + header: number; + + /** + * @generated from field: string origin_pubkey = 12; + */ + originPubkey: string; +}; + +/** + * Describes the message meshexplorer.v1.Packet. + * Use `create(PacketSchema)` to create a new message. + */ +export const PacketSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_packets, 0); + +/** + * @generated from message meshexplorer.v1.StreamPacketsRequest + */ +export type StreamPacketsRequest = Message<"meshexplorer.v1.StreamPacketsRequest"> & { + /** + * @generated from field: optional string region = 1; + */ + region?: string | undefined; + + /** + * Payload type filter (0..15). + * + * @generated from field: optional int32 payload_type = 2; + */ + payloadType?: number | undefined; + + /** + * Route type filter (0..3). + * + * @generated from field: optional int32 route_type = 3; + */ + routeType?: number | undefined; + + /** + * @generated from field: optional string origin_pubkey = 4; + */ + originPubkey?: string | undefined; + + /** + * Poll interval in ms (clamped 100..10000, default 500). + * + * @generated from field: optional int32 poll_interval = 5; + */ + pollInterval?: number | undefined; + + /** + * Max rows per poll (clamped 10..10000, default 10). + * + * @generated from field: optional int32 max_rows = 6; + */ + maxRows?: number | undefined; +}; + +/** + * Describes the message meshexplorer.v1.StreamPacketsRequest. + * Use `create(StreamPacketsRequestSchema)` to create a new message. + */ +export const StreamPacketsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_packets, 1); + +/** + * @generated from service meshexplorer.v1.PacketsService + */ +export const PacketsService: GenService<{ + /** + * @generated from rpc meshexplorer.v1.PacketsService.StreamPackets + */ + streamPackets: { + methodKind: "server_streaming"; + input: typeof StreamPacketsRequestSchema; + output: typeof PacketSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_meshexplorer_v1_packets, 0); + diff --git a/meshexplorer/src/gen/meshexplorer/v1/stats_pb.ts b/meshexplorer/src/gen/meshexplorer/v1/stats_pb.ts new file mode 100644 index 0000000..b1bf6c7 --- /dev/null +++ b/meshexplorer/src/gen/meshexplorer/v1/stats_pb.ts @@ -0,0 +1,224 @@ +// @generated by protoc-gen-es v2.12.0 with parameter "target=ts,import_extension=none" +// @generated from file meshexplorer/v1/stats.proto (package meshexplorer.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file meshexplorer/v1/stats.proto. + */ +export const file_meshexplorer_v1_stats: GenFile = /*@__PURE__*/ + fileDesc("ChttZXNoZXhwbG9yZXIvdjEvc3RhdHMucHJvdG8SD21lc2hleHBsb3Jlci52MSIuCgxTdGF0c1JlcXVlc3QSEwoGcmVnaW9uGAEgASgJSACIAQFCCQoHX3JlZ2lvbiIsChVHZXRUb3RhbE5vZGVzUmVzcG9uc2USEwoLdG90YWxfbm9kZXMYASABKAUipgEKEE5vZGVzT3ZlclRpbWVSb3cSCwoDZGF5GAEgASgJEh8KF2N1bXVsYXRpdmVfdW5pcXVlX25vZGVzGAIgASgFEhsKE25vZGVzX3dpdGhfbG9jYXRpb24YAyABKAUSHgoWbm9kZXNfd2l0aG91dF9sb2NhdGlvbhgEIAEoBRIRCglyZXBlYXRlcnMYBSABKAUSFAoMcm9vbV9zZXJ2ZXJzGAYgASgFIksKGEdldE5vZGVzT3ZlclRpbWVSZXNwb25zZRIvCgRkYXRhGAEgAygLMiEubWVzaGV4cGxvcmVyLnYxLk5vZGVzT3ZlclRpbWVSb3ciQAoRUG9wdWxhckNoYW5uZWxSb3cSFAoMY2hhbm5lbF9oYXNoGAEgASgJEhUKDW1lc3NhZ2VfY291bnQYAiABKAUiTgoaR2V0UG9wdWxhckNoYW5uZWxzUmVzcG9uc2USMAoEZGF0YRgBIAMoCzIiLm1lc2hleHBsb3Jlci52MS5Qb3B1bGFyQ2hhbm5lbFJvdyI3ChFSZXBlYXRlclByZWZpeFJvdxIOCgZwcmVmaXgYASABKAkSEgoKbm9kZV9uYW1lcxgCIAMoCSJPChtHZXRSZXBlYXRlclByZWZpeGVzUmVzcG9uc2USMAoEZGF0YRgBIAMoCzIiLm1lc2hleHBsb3Jlci52MS5SZXBlYXRlclByZWZpeFJvdzKKAwoMU3RhdHNTZXJ2aWNlElYKDUdldFRvdGFsTm9kZXMSHS5tZXNoZXhwbG9yZXIudjEuU3RhdHNSZXF1ZXN0GiYubWVzaGV4cGxvcmVyLnYxLkdldFRvdGFsTm9kZXNSZXNwb25zZRJcChBHZXROb2Rlc092ZXJUaW1lEh0ubWVzaGV4cGxvcmVyLnYxLlN0YXRzUmVxdWVzdBopLm1lc2hleHBsb3Jlci52MS5HZXROb2Rlc092ZXJUaW1lUmVzcG9uc2USYAoSR2V0UG9wdWxhckNoYW5uZWxzEh0ubWVzaGV4cGxvcmVyLnYxLlN0YXRzUmVxdWVzdBorLm1lc2hleHBsb3Jlci52MS5HZXRQb3B1bGFyQ2hhbm5lbHNSZXNwb25zZRJiChNHZXRSZXBlYXRlclByZWZpeGVzEh0ubWVzaGV4cGxvcmVyLnYxLlN0YXRzUmVxdWVzdBosLm1lc2hleHBsb3Jlci52MS5HZXRSZXBlYXRlclByZWZpeGVzUmVzcG9uc2ViBnByb3RvMw"); + +/** + * @generated from message meshexplorer.v1.StatsRequest + */ +export type StatsRequest = Message<"meshexplorer.v1.StatsRequest"> & { + /** + * @generated from field: optional string region = 1; + */ + region?: string | undefined; +}; + +/** + * Describes the message meshexplorer.v1.StatsRequest. + * Use `create(StatsRequestSchema)` to create a new message. + */ +export const StatsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_stats, 0); + +/** + * @generated from message meshexplorer.v1.GetTotalNodesResponse + */ +export type GetTotalNodesResponse = Message<"meshexplorer.v1.GetTotalNodesResponse"> & { + /** + * @generated from field: int32 total_nodes = 1; + */ + totalNodes: number; +}; + +/** + * Describes the message meshexplorer.v1.GetTotalNodesResponse. + * Use `create(GetTotalNodesResponseSchema)` to create a new message. + */ +export const GetTotalNodesResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_stats, 1); + +/** + * @generated from message meshexplorer.v1.NodesOverTimeRow + */ +export type NodesOverTimeRow = Message<"meshexplorer.v1.NodesOverTimeRow"> & { + /** + * @generated from field: string day = 1; + */ + day: string; + + /** + * @generated from field: int32 cumulative_unique_nodes = 2; + */ + cumulativeUniqueNodes: number; + + /** + * @generated from field: int32 nodes_with_location = 3; + */ + nodesWithLocation: number; + + /** + * @generated from field: int32 nodes_without_location = 4; + */ + nodesWithoutLocation: number; + + /** + * @generated from field: int32 repeaters = 5; + */ + repeaters: number; + + /** + * @generated from field: int32 room_servers = 6; + */ + roomServers: number; +}; + +/** + * Describes the message meshexplorer.v1.NodesOverTimeRow. + * Use `create(NodesOverTimeRowSchema)` to create a new message. + */ +export const NodesOverTimeRowSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_stats, 2); + +/** + * @generated from message meshexplorer.v1.GetNodesOverTimeResponse + */ +export type GetNodesOverTimeResponse = Message<"meshexplorer.v1.GetNodesOverTimeResponse"> & { + /** + * @generated from field: repeated meshexplorer.v1.NodesOverTimeRow data = 1; + */ + data: NodesOverTimeRow[]; +}; + +/** + * Describes the message meshexplorer.v1.GetNodesOverTimeResponse. + * Use `create(GetNodesOverTimeResponseSchema)` to create a new message. + */ +export const GetNodesOverTimeResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_stats, 3); + +/** + * @generated from message meshexplorer.v1.PopularChannelRow + */ +export type PopularChannelRow = Message<"meshexplorer.v1.PopularChannelRow"> & { + /** + * @generated from field: string channel_hash = 1; + */ + channelHash: string; + + /** + * @generated from field: int32 message_count = 2; + */ + messageCount: number; +}; + +/** + * Describes the message meshexplorer.v1.PopularChannelRow. + * Use `create(PopularChannelRowSchema)` to create a new message. + */ +export const PopularChannelRowSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_stats, 4); + +/** + * @generated from message meshexplorer.v1.GetPopularChannelsResponse + */ +export type GetPopularChannelsResponse = Message<"meshexplorer.v1.GetPopularChannelsResponse"> & { + /** + * @generated from field: repeated meshexplorer.v1.PopularChannelRow data = 1; + */ + data: PopularChannelRow[]; +}; + +/** + * Describes the message meshexplorer.v1.GetPopularChannelsResponse. + * Use `create(GetPopularChannelsResponseSchema)` to create a new message. + */ +export const GetPopularChannelsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_stats, 5); + +/** + * @generated from message meshexplorer.v1.RepeaterPrefixRow + */ +export type RepeaterPrefixRow = Message<"meshexplorer.v1.RepeaterPrefixRow"> & { + /** + * @generated from field: string prefix = 1; + */ + prefix: string; + + /** + * @generated from field: repeated string node_names = 2; + */ + nodeNames: string[]; +}; + +/** + * Describes the message meshexplorer.v1.RepeaterPrefixRow. + * Use `create(RepeaterPrefixRowSchema)` to create a new message. + */ +export const RepeaterPrefixRowSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_stats, 6); + +/** + * @generated from message meshexplorer.v1.GetRepeaterPrefixesResponse + */ +export type GetRepeaterPrefixesResponse = Message<"meshexplorer.v1.GetRepeaterPrefixesResponse"> & { + /** + * @generated from field: repeated meshexplorer.v1.RepeaterPrefixRow data = 1; + */ + data: RepeaterPrefixRow[]; +}; + +/** + * Describes the message meshexplorer.v1.GetRepeaterPrefixesResponse. + * Use `create(GetRepeaterPrefixesResponseSchema)` to create a new message. + */ +export const GetRepeaterPrefixesResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_meshexplorer_v1_stats, 7); + +/** + * @generated from service meshexplorer.v1.StatsService + */ +export const StatsService: GenService<{ + /** + * @generated from rpc meshexplorer.v1.StatsService.GetTotalNodes + */ + getTotalNodes: { + methodKind: "unary"; + input: typeof StatsRequestSchema; + output: typeof GetTotalNodesResponseSchema; + }, + /** + * @generated from rpc meshexplorer.v1.StatsService.GetNodesOverTime + */ + getNodesOverTime: { + methodKind: "unary"; + input: typeof StatsRequestSchema; + output: typeof GetNodesOverTimeResponseSchema; + }, + /** + * @generated from rpc meshexplorer.v1.StatsService.GetPopularChannels + */ + getPopularChannels: { + methodKind: "unary"; + input: typeof StatsRequestSchema; + output: typeof GetPopularChannelsResponseSchema; + }, + /** + * @generated from rpc meshexplorer.v1.StatsService.GetRepeaterPrefixes + */ + getRepeaterPrefixes: { + methodKind: "unary"; + input: typeof StatsRequestSchema; + output: typeof GetRepeaterPrefixesResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_meshexplorer_v1_stats, 0); + diff --git a/meshexplorer/src/hooks/useAllNeighbors.ts b/meshexplorer/src/hooks/useAllNeighbors.ts index 0eb5032..eaafaf5 100644 --- a/meshexplorer/src/hooks/useAllNeighbors.ts +++ b/meshexplorer/src/hooks/useAllNeighbors.ts @@ -1,5 +1,5 @@ -import { useQuery } from '@tanstack/react-query'; -import { buildApiUrl } from '@/lib/api'; +import { useQuery } from '@connectrpc/connect-query'; +import { NeighborsService } from '@/gen/meshexplorer/v1/neighbors_pb'; export interface AllNeighborsConnection { source_node: string; @@ -27,55 +27,46 @@ interface UseAllNeighborsParams { enabled?: boolean; } -export function useAllNeighbors({ - minLat, - maxLat, - minLng, - maxLng, - nodeTypes, - lastSeen, +export function useAllNeighbors({ + minLat, + maxLat, + minLng, + maxLng, + nodeTypes, + lastSeen, region, - enabled = true + enabled = true, }: UseAllNeighborsParams) { - return useQuery({ - queryKey: ['allNeighbors', minLat, maxLat, minLng, maxLng, nodeTypes, lastSeen, region], - queryFn: async (): Promise => { - const params = new URLSearchParams(); - - if (minLat !== null && minLat !== undefined) { - params.append('minLat', minLat.toString()); - } - if (maxLat !== null && maxLat !== undefined) { - params.append('maxLat', maxLat.toString()); - } - if (minLng !== null && minLng !== undefined) { - params.append('minLng', minLng.toString()); - } - if (maxLng !== null && maxLng !== undefined) { - params.append('maxLng', maxLng.toString()); - } - if (nodeTypes && nodeTypes.length > 0) { - nodeTypes.forEach(type => params.append('nodeTypes', type)); - } - if (lastSeen !== null && lastSeen !== undefined) { - params.append('lastSeen', lastSeen.toString()); - } - if (region) { - params.append('region', region); - } - - const url = `/api/neighbors/all${params.toString() ? `?${params.toString()}` : ''}`; - - const response = await fetch(buildApiUrl(url)); - if (!response.ok) { - throw new Error(`Failed to fetch all neighbors: ${response.statusText}`); - } - - return response.json(); + return useQuery( + NeighborsService.method.getAllNeighbors, + { + minLat: minLat ?? undefined, + maxLat: maxLat ?? undefined, + minLng: minLng ?? undefined, + maxLng: maxLng ?? undefined, + nodeTypes: nodeTypes ?? [], + lastSeen: lastSeen ?? undefined, + region, }, - enabled: enabled, - staleTime: 5 * 60 * 1000, // 5 minutes (shorter than individual neighbors since this is more expensive) - gcTime: 15 * 60 * 1000, // 15 minutes - }); + { + select: (res): AllNeighborsConnection[] => + res.neighbors.map((n) => ({ + source_node: n.sourceNode, + target_node: n.targetNode, + connection_type: n.connectionType, + packet_count: n.packetCount, + source_name: n.sourceName, + source_latitude: n.sourceLatitude, + source_longitude: n.sourceLongitude, + source_has_location: n.sourceHasLocation, + target_name: n.targetName, + target_latitude: n.targetLatitude, + target_longitude: n.targetLongitude, + target_has_location: n.targetHasLocation, + })), + enabled, + staleTime: 5 * 60 * 1000, // 5 minutes + gcTime: 15 * 60 * 1000, // 15 minutes + }, + ); } - diff --git a/meshexplorer/src/hooks/useChatMessages.ts b/meshexplorer/src/hooks/useChatMessages.ts index 3f780f7..a539c1a 100644 --- a/meshexplorer/src/hooks/useChatMessages.ts +++ b/meshexplorer/src/hooks/useChatMessages.ts @@ -1,8 +1,10 @@ "use client"; -import { useInfiniteQuery, useQuery, useQueryClient } from '@tanstack/react-query'; +import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect, useMemo } from 'react'; -import { buildApiUrl } from '@/lib/api'; +import { Code, ConnectError } from '@connectrpc/connect'; +import { chatClient } from '@/lib/connect/client'; +import type { ChatMessage as GenChatMessage } from '@/gen/meshexplorer/v1/chat_pb'; import { ChatMessage } from '@/components/ChatMessageItem'; interface ChatMessagesParams { @@ -20,6 +22,63 @@ interface ChatMessagesPage { const PAGE_SIZE = 20; +// Maps the generated (camelCase) ChatMessage to the snake_case shape the chat +// components consume. `origins`/`path_len` were never populated by the REST API +// and are unused by the renderer, so they're intentionally omitted. +function toChatMessage(m: GenChatMessage): ChatMessage { + return { + message_id: m.messageId, + ingest_timestamp: m.ingestTimestamp, + mesh_timestamp: m.meshTimestamp, + channel_hash: m.channelHash, + mac: m.mac, + encrypted_message: m.encryptedMessage, + message_count: m.messageCount, + origin_path_info: m.originPathInfo.map( + (o) => + [o.origin, o.originPubkey, o.path, o.broker, o.topic] as [ + string, + string, + string, + string, + string, + ], + ), + } as ChatMessage; +} + +// Inserts a single streamed message into the infinite-query cache, de-duping by +// message_id, keeping newest-first order, and re-paginating into PAGE_SIZE pages. +function mergeStreamedMessage(oldData: any, newMessage: ChatMessage) { + if (!oldData?.pages?.[0]) return oldData; + + const all = oldData.pages.flatMap((p: ChatMessagesPage) => p.messages) as ChatMessage[]; + const existingIndex = all.findIndex((m) => m.message_id === newMessage.message_id); + + let merged: ChatMessage[]; + if (existingIndex !== -1) { + merged = [...all]; + merged[existingIndex] = newMessage; + } else { + merged = [newMessage, ...all]; + } + + merged.sort( + (a, b) => new Date(b.ingest_timestamp).getTime() - new Date(a.ingest_timestamp).getTime(), + ); + + const pages = []; + for (let i = 0; i < merged.length; i += PAGE_SIZE) { + const pageIndex = Math.floor(i / PAGE_SIZE); + pages.push({ + ...(oldData.pages[pageIndex] || { hasMore: false }), + messages: merged.slice(i, i + PAGE_SIZE), + }); + } + + return { ...oldData, pages }; +} + export function useChatMessages({ channelId, region, @@ -29,12 +88,12 @@ export function useChatMessages({ const queryClient = useQueryClient(); // Build base query key - const baseQueryKey = useMemo(() => - ['chat-messages', channelId, region] as const, - [channelId, region] + const baseQueryKey = useMemo( + () => ['chat-messages', channelId, region] as const, + [channelId, region], ); - // Main infinite query for loading messages with pagination + // Infinite query loads message history (older pages) via the unary GetChat RPC. const messagesQuery = useInfiniteQuery({ queryKey: baseQueryKey, queryFn: async ({ pageParam, signal }): Promise => { @@ -42,28 +101,23 @@ export function useChatMessages({ throw new Error('Region is required'); } - let url = `/api/chat?limit=${PAGE_SIZE}®ion=${encodeURIComponent(region)}`; - if (channelId) { - url += `&channel_id=${channelId}`; - } - - if (pageParam) { - url += `&before=${encodeURIComponent(pageParam)}`; - } + const res = await chatClient.getChat( + { + limit: PAGE_SIZE, + region, + channelId: channelId || undefined, + before: pageParam || undefined, + }, + { signal }, + ); + + const messages = res.messages.map(toChatMessage); - const response = await fetch(buildApiUrl(url), { signal }); - - if (!response.ok) { - throw new Error(`Failed to fetch chat messages: ${response.statusText}`); - } - - const data = await response.json(); - const messages = Array.isArray(data) ? data : []; - return { messages, hasMore: messages.length === PAGE_SIZE, - oldestTimestamp: messages.length > 0 ? messages[messages.length - 1].ingest_timestamp : undefined, + oldestTimestamp: + messages.length > 0 ? messages[messages.length - 1].ingest_timestamp : undefined, }; }, getNextPageParam: (lastPage) => { @@ -76,106 +130,57 @@ export function useChatMessages({ retry: 1, }); - // Auto-refresh query to get newer messages - const latestTimestamp = messagesQuery.data?.pages[0]?.messages[0]?.ingest_timestamp; - - const autoRefreshQuery = useQuery({ - queryKey: [...baseQueryKey, 'auto-refresh', latestTimestamp], - queryFn: async ({ signal }): Promise => { - if (!region || !latestTimestamp) { - return []; - } - - let url = `/api/chat?limit=${PAGE_SIZE}®ion=${encodeURIComponent(region)}`; - if (channelId) { - url += `&channel_id=${channelId}`; - } - url += `&after=${encodeURIComponent(latestTimestamp)}`; - - const response = await fetch(buildApiUrl(url), { signal }); - - if (!response.ok) { - throw new Error(`Failed to fetch new chat messages: ${response.statusText}`); - } - - const data = await response.json(); - return Array.isArray(data) ? data : []; - }, - enabled: enabled && autoRefreshEnabled && !!region && !!latestTimestamp, - refetchInterval: 5000, // 5 seconds - staleTime: 0, // Always fresh for auto-refresh - retry: 1, - }); - - // When auto-refresh finds new messages, update the main query + // Live updates: subscribe to the StreamChat server-streaming RPC and merge new + // messages into the cache as they arrive (replaces the old 5s polling query). useEffect(() => { - if (autoRefreshQuery.data && autoRefreshQuery.data.length > 0) { - queryClient.setQueryData(baseQueryKey, (oldData: any) => { - if (!oldData?.pages?.[0]) return oldData; - - const newMessages = autoRefreshQuery.data; - - // Get all existing messages from all pages - const allExistingMessages = oldData.pages.flatMap((page: any) => page.messages); - - // Process new messages: replace duplicates and collect truly new ones - const trulyNewMessages: ChatMessage[] = []; - const updatedExistingMessages = [...allExistingMessages]; - - for (const newMessage of newMessages) { - const existingIndex = updatedExistingMessages.findIndex( - (msg: ChatMessage) => msg.message_id === newMessage.message_id - ); - - if (existingIndex !== -1) { - // Replace existing message with the new one - updatedExistingMessages[existingIndex] = newMessage; - } else { - // This is a truly new message - trulyNewMessages.push(newMessage); - } - } - - // Combine truly new messages with updated existing messages - // Sort by ingest_timestamp to maintain order - const allMessages = [...trulyNewMessages, ...updatedExistingMessages] - .sort((a, b) => new Date(b.ingest_timestamp).getTime() - new Date(a.ingest_timestamp).getTime()); - - // Redistribute messages back into pages - const updatedPages = []; - let currentPageMessages = []; - - for (let i = 0; i < allMessages.length; i++) { - currentPageMessages.push(allMessages[i]); - - if (currentPageMessages.length === PAGE_SIZE || i === allMessages.length - 1) { - updatedPages.push({ - ...oldData.pages[Math.floor(i / PAGE_SIZE)] || { hasMore: false }, - messages: currentPageMessages, - }); - currentPageMessages = []; - } - } - - return { - ...oldData, - pages: updatedPages, - }; - }); + if (!enabled || !autoRefreshEnabled || !region) { + return; } - }, [autoRefreshQuery.data, queryClient, baseQueryKey]); + + const controller = new AbortController(); + let cancelled = false; + + (async () => { + try { + const stream = chatClient.streamChat( + { + channelId: channelId || undefined, + region, + // History is loaded by GetChat; only stream messages from now on. + skipInitialMessages: true, + }, + { signal: controller.signal }, + ); + + for await (const genMsg of stream) { + if (cancelled) break; + const msg = toChatMessage(genMsg); + queryClient.setQueryData(baseQueryKey, (oldData: any) => + mergeStreamedMessage(oldData, msg), + ); + } + } catch (err) { + if (controller.signal.aborted) return; + if (err instanceof ConnectError && err.code === Code.Canceled) return; + // A dropped stream shouldn't crash the chat UI; history is still usable. + console.warn('Chat stream error:', err); + } + })(); + + return () => { + cancelled = true; + controller.abort(); + }; + }, [enabled, autoRefreshEnabled, region, channelId, queryClient, baseQueryKey]); // Flatten all messages from all pages - const allMessages = messagesQuery.data?.pages.flatMap(page => page.messages) ?? []; - - // Check if there are more pages to load - const hasNextPage = messagesQuery.hasNextPage; - + const allMessages = messagesQuery.data?.pages.flatMap((page) => page.messages) ?? []; + return { messages: allMessages, loading: messagesQuery.isLoading, - error: messagesQuery.error || autoRefreshQuery.error, - hasMore: hasNextPage, + error: messagesQuery.error, + hasMore: messagesQuery.hasNextPage, loadMore: messagesQuery.fetchNextPage, isLoadingMore: messagesQuery.isFetchingNextPage, refresh: () => { diff --git a/meshexplorer/src/hooks/useMeshcoreSearch.ts b/meshexplorer/src/hooks/useMeshcoreSearch.ts index 067f35a..df7f1b0 100644 --- a/meshexplorer/src/hooks/useMeshcoreSearch.ts +++ b/meshexplorer/src/hooks/useMeshcoreSearch.ts @@ -1,6 +1,7 @@ import { useQuery, useQueries } from '@tanstack/react-query'; import { create, windowScheduler, indexedResolver } from '@yornaath/batshit'; -import { buildApiUrl } from '@/lib/api'; +import { nodeClient } from '@/lib/connect/client'; +import type { SearchResult } from '@/gen/meshexplorer/v1/node_pb'; import { useMemo } from 'react'; export interface MeshcoreSearchResult { @@ -19,6 +20,25 @@ export interface MeshcoreSearchResult { topic: string; } +// Maps a generated (camelCase) SearchResult to the snake_case shape consumers use. +function toSearchResult(r: SearchResult): MeshcoreSearchResult { + return { + public_key: r.publicKey, + node_name: r.nodeName, + latitude: r.latitude ?? null, + longitude: r.longitude ?? null, + has_location: r.hasLocation, + is_repeater: r.isRepeater, + is_chat_node: r.isChatNode, + is_room_server: r.isRoomServer, + has_name: r.hasName, + first_heard: r.firstHeard, + last_seen: r.lastSeen, + broker: r.broker, + topic: r.topic, + }; +} + export interface MeshcoreSearchResponse { results: MeshcoreSearchResult[]; total: number; @@ -48,26 +68,27 @@ const searchBatcher = create({ // Create AbortController for this batch const abortController = new AbortController(); - + // Store the abort controller so individual queries can cancel the batch (searchBatcher as any)._currentAbortController = abortController; - const response = await fetch(buildApiUrl('/api/meshcore/search'), { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ queries: normalizedQueries }), - signal: abortController.signal, - }); - - if (!response.ok) { - throw new Error(`Failed to execute batch search: ${response.statusText}`); - } - - const batchResponse = await response.json(); - - // Return results with batch context for resolver + const response = await nodeClient.searchNodes( + { + queries: normalizedQueries.map((q) => ({ + query: q.query, + region: q.region, + lastSeen: q.lastSeen, + limit: q.limit, + exact: q.exact, + isRepeater: q.is_repeater, + })), + }, + { signal: abortController.signal }, + ); + + // Return results with batch context for resolver (array-of-arrays, one per query) return { - results: batchResponse.results || [], + results: response.results.map((list) => list.results.map(toSearchResult)), queries: queries }; }, diff --git a/meshexplorer/src/hooks/useNeighbors.ts b/meshexplorer/src/hooks/useNeighbors.ts index 8cf12bd..cedb46d 100644 --- a/meshexplorer/src/hooks/useNeighbors.ts +++ b/meshexplorer/src/hooks/useNeighbors.ts @@ -1,5 +1,5 @@ -import { useQuery } from '@tanstack/react-query'; -import { buildApiUrl } from '@/lib/api'; +import { useQuery } from '@connectrpc/connect-query'; +import { NodeService } from '@/gen/meshexplorer/v1/node_pb'; export interface Neighbor { public_key: string; @@ -21,26 +21,29 @@ interface UseNeighborsParams { } export function useNeighbors({ nodeId, lastSeen, enabled = true }: UseNeighborsParams) { - return useQuery({ - queryKey: ['neighbors', nodeId, lastSeen], - queryFn: async (): Promise => { - if (!nodeId) return []; - - const params = new URLSearchParams(); - if (lastSeen !== null && lastSeen !== undefined) { - params.append('lastSeen', lastSeen.toString()); - } - const url = `/api/meshcore/node/${nodeId}/neighbors${params.toString() ? `?${params.toString()}` : ''}`; - - const response = await fetch(buildApiUrl(url)); - if (!response.ok) { - throw new Error(`Failed to fetch neighbors: ${response.statusText}`); - } - - return response.json(); + return useQuery( + NodeService.method.getNodeNeighbors, + { + publicKey: nodeId ?? '', + lastSeen: lastSeen ?? undefined, }, - enabled: enabled && !!nodeId, - staleTime: 15 * 60 * 1000, // 15 minutes - gcTime: 15 * 60 * 1000, // 15 minutes - }); + { + select: (res): Neighbor[] => + res.neighbors.map((n) => ({ + public_key: n.publicKey, + node_name: n.nodeName, + latitude: n.latitude ?? null, + longitude: n.longitude ?? null, + has_location: n.hasLocation, + is_repeater: n.isRepeater, + is_chat_node: n.isChatNode, + is_room_server: n.isRoomServer, + has_name: n.hasName, + directions: n.directions, + })), + enabled: enabled && !!nodeId, + staleTime: 15 * 60 * 1000, // 15 minutes + gcTime: 15 * 60 * 1000, // 15 minutes + }, + ); } diff --git a/meshexplorer/src/hooks/useNodeData.ts b/meshexplorer/src/hooks/useNodeData.ts index a5cfd49..c714afc 100644 --- a/meshexplorer/src/hooks/useNodeData.ts +++ b/meshexplorer/src/hooks/useNodeData.ts @@ -1,5 +1,7 @@ import { useQuery } from '@tanstack/react-query'; -import { buildApiUrl } from '@/lib/api'; +import { Code, ConnectError } from '@connectrpc/connect'; +import { nodeClient } from '@/lib/connect/client'; +import type { GetNodeResponse } from '@/gen/meshexplorer/v1/node_pb'; export interface NodeInfo { public_key: string; @@ -71,50 +73,102 @@ interface UseNodeDataParams { enabled?: boolean; } +// Maps the generated (camelCase) GetNodeResponse to the snake_case NodeData +// shape the page components already consume. +function toNodeData(res: GetNodeResponse): NodeData { + const node = res.node!; + return { + node: { + public_key: node.publicKey, + node_name: node.nodeName, + latitude: node.latitude ?? null, + longitude: node.longitude ?? null, + has_location: node.hasLocation, + is_repeater: node.isRepeater, + is_chat_node: node.isChatNode, + is_room_server: node.isRoomServer, + has_name: node.hasName, + broker: node.broker ?? null, + topic: node.topic ?? null, + first_seen: node.firstSeen, + last_seen: node.lastSeen, + }, + recentAdverts: res.recentAdverts.map((a, index) => ({ + group_id: index, + origin_path_pubkey_tuples: a.originPathPubkeyTuples.map( + (t) => [t.origin, t.path, t.originPubkey] as [string, string, string], + ), + advert_count: a.advertCount, + earliest_timestamp: a.earliestTimestamp, + latest_timestamp: a.latestTimestamp, + latitude: a.latitude ?? null, + longitude: a.longitude ?? null, + is_repeater: a.isRepeater, + is_chat_node: a.isChatNode, + is_room_server: a.isRoomServer, + has_location: a.hasLocation, + packet_hash: a.packetHash, + })), + locationHistory: res.locationHistory.map((l) => ({ + mesh_timestamp: l.meshTimestamp, + latitude: l.latitude, + longitude: l.longitude, + })), + mqtt: { + is_uplinked: res.mqtt?.isUplinked ?? false, + has_packets: res.mqtt?.hasPackets ?? false, + topics: (res.mqtt?.topics ?? []).map((t) => ({ + topic: t.topic, + broker: t.broker, + last_packet_time: t.lastPacketTime, + is_recent: t.isRecent, + })), + }, + region: res.region ?? null, + }; +} + +// Maps a ConnectError to the NodeError shape (with HTTP-like status) the +// node page uses to pick an error icon/title and drive retry behavior. +function toNodeError(err: unknown): NodeError & { status: number } { + if (err instanceof ConnectError) { + switch (err.code) { + case Code.NotFound: + return { error: err.message, code: 'NODE_NOT_FOUND', status: 404 }; + case Code.InvalidArgument: + return { error: err.message, code: 'INVALID_PUBLIC_KEY', status: 400 }; + case Code.Unavailable: + return { error: err.message, code: 'DATABASE_ERROR', status: 503 }; + default: + return { error: err.message, code: 'INTERNAL_ERROR', status: 500 }; + } + } + return { error: 'An unexpected error occurred', code: 'UNKNOWN_ERROR', status: 500 }; +} + export function useNodeData({ publicKey, limit = 50, enabled = true }: UseNodeDataParams) { - return useQuery({ + return useQuery({ queryKey: ['node-data', publicKey, limit], queryFn: async (): Promise => { if (!publicKey) { - throw { error: "Public key is required", code: "MISSING_PUBLIC_KEY" } as NodeError; + throw { error: 'Public key is required', code: 'MISSING_PUBLIC_KEY', status: 400 } as NodeError & { + status: number; + }; } - - const params = new URLSearchParams(); - if (limit !== 50) { - params.append('limit', limit.toString()); + + try { + const res = await nodeClient.getNode({ publicKey, limit }); + return toNodeData(res); + } catch (err) { + throw toNodeError(err); } - - const url = `/api/meshcore/node/${publicKey}${params.toString() ? `?${params.toString()}` : ''}`; - - const response = await fetch(buildApiUrl(url)); - - // Handle specific error responses - if (!response.ok) { - let errorData: NodeError; - try { - errorData = await response.json(); - } catch { - errorData = { - error: `HTTP ${response.status}: ${response.statusText}`, - code: 'UNKNOWN_ERROR' - }; - } - - // Add status information to error for better handling - throw { - ...errorData, - status: response.status - } as NodeError & { status: number }; - } - - return response.json(); }, enabled: enabled && !!publicKey, staleTime: 15 * 60 * 1000, // 15 minutes gcTime: 15 * 60 * 1000, // 15 minutes retry: (failureCount, error) => { // Don't retry for client errors (4xx) - const status = (error as NodeError & { status?: number })?.status; + const status = error?.status; if (status && status >= 400 && status < 500) { return false; } diff --git a/meshexplorer/src/hooks/useQueryParams.ts b/meshexplorer/src/hooks/useQueryParams.ts index 5e35daf..8a88513 100644 --- a/meshexplorer/src/hooks/useQueryParams.ts +++ b/meshexplorer/src/hooks/useQueryParams.ts @@ -32,8 +32,8 @@ export function useQueryParams>(defaultValues: T = // (not from our own updates) useEffect(() => { const newState = { ...defaultValues }; - - searchParams.forEach((value, key) => { + + searchParams?.forEach((value, key) => { // Don't auto-convert 'q' (query) parameter to number since it should always be a string if (key !== 'q' && !isNaN(Number(value)) && value !== '') { newState[key as keyof T] = Number(value) as T[keyof T]; diff --git a/meshexplorer/src/hooks/useStats.ts b/meshexplorer/src/hooks/useStats.ts index eb6d3cc..a05f5de 100644 --- a/meshexplorer/src/hooks/useStats.ts +++ b/meshexplorer/src/hooks/useStats.ts @@ -1,6 +1,6 @@ import React from "react"; -import { useQuery } from "@tanstack/react-query"; -import { buildApiUrl } from "@/lib/api"; +import { useQuery } from "@connectrpc/connect-query"; +import { StatsService } from "@/gen/meshexplorer/v1/stats_pb"; interface TotalNodesResponse { total_nodes: number; @@ -41,108 +41,95 @@ const STALE_TIME = 5 * 60 * 1000; // 5 minutes const GC_TIME = 10 * 60 * 1000; // 10 minutes export function useTotalNodes(region?: string) { - return useQuery({ - queryKey: ['stats', 'total-nodes', region], - queryFn: async ({ signal }) => { - const regionParam = region ? `?region=${encodeURIComponent(region)}` : ''; - const response = await fetch(buildApiUrl(`/api/stats/total-nodes${regionParam}`), { - signal - }); - - if (!response.ok) { - throw new Error(`Failed to fetch total nodes: ${response.statusText}`); - } - - return response.json(); + return useQuery( + StatsService.method.getTotalNodes, + { region }, + { + select: (res): TotalNodesResponse => ({ total_nodes: res.totalNodes }), + staleTime: STALE_TIME, + gcTime: GC_TIME, + retry: 2, }, - staleTime: STALE_TIME, - gcTime: GC_TIME, - retry: 2, - }); + ); } export function useNodesOverTime(region?: string) { - return useQuery({ - queryKey: ['stats', 'nodes-over-time', region], - queryFn: async ({ signal }) => { - const regionParam = region ? `?region=${encodeURIComponent(region)}` : ''; - const response = await fetch(buildApiUrl(`/api/stats/nodes-over-time${regionParam}`), { - signal - }); - - if (!response.ok) { - throw new Error(`Failed to fetch nodes over time: ${response.statusText}`); - } - - return response.json(); + return useQuery( + StatsService.method.getNodesOverTime, + { region }, + { + select: (res): NodesOverTimeResponse => ({ + data: res.data.map((r) => ({ + day: r.day, + cumulative_unique_nodes: r.cumulativeUniqueNodes, + nodes_with_location: r.nodesWithLocation, + nodes_without_location: r.nodesWithoutLocation, + repeaters: r.repeaters, + room_servers: r.roomServers, + })), + }), + staleTime: STALE_TIME, + gcTime: GC_TIME, + retry: 2, }, - staleTime: STALE_TIME, - gcTime: GC_TIME, - retry: 2, - }); + ); } export function usePopularChannels(region?: string) { - return useQuery({ - queryKey: ['stats', 'popular-channels', region], - queryFn: async ({ signal }) => { - const regionParam = region ? `?region=${encodeURIComponent(region)}` : ''; - const response = await fetch(buildApiUrl(`/api/stats/popular-channels${regionParam}`), { - signal - }); - - if (!response.ok) { - throw new Error(`Failed to fetch popular channels: ${response.statusText}`); - } - - return response.json(); + return useQuery( + StatsService.method.getPopularChannels, + { region }, + { + select: (res): PopularChannelsResponse => ({ + data: res.data.map((r) => ({ + channel_hash: r.channelHash, + message_count: r.messageCount, + })), + }), + staleTime: STALE_TIME, + gcTime: GC_TIME, + retry: 2, }, - staleTime: STALE_TIME, - gcTime: GC_TIME, - retry: 2, - }); + ); } export function useRepeaterPrefixes(region?: string) { - return useQuery({ - queryKey: ['stats', 'repeater-prefixes', region], - queryFn: async ({ signal }) => { - const regionParam = region ? `?region=${encodeURIComponent(region)}` : ''; - const response = await fetch(buildApiUrl(`/api/stats/repeater-prefixes${regionParam}`), { - signal - }); - - if (!response.ok) { - throw new Error(`Failed to fetch repeater prefixes: ${response.statusText}`); - } - - return response.json(); + return useQuery( + StatsService.method.getRepeaterPrefixes, + { region }, + { + select: (res): RepeaterPrefixesResponse => ({ + data: res.data.map((r) => ({ + prefix: r.prefix, + node_names: r.nodeNames, + })), + }), + staleTime: STALE_TIME, + gcTime: GC_TIME, + retry: 2, }, - staleTime: STALE_TIME, - gcTime: GC_TIME, - retry: 2, - }); + ); } export function useUnusedPrefixes(region?: string) { const { data: repeaterPrefixesData, isLoading, error } = useRepeaterPrefixes(region); - + const unusedPrefixes = React.useMemo(() => { if (!repeaterPrefixesData?.data) return []; - + // Generate all possible 2-character hex prefixes (01-FE, excluding 00 and FF) const allPrefixes = []; for (let i = 1; i < 255; i++) { allPrefixes.push(i.toString(16).padStart(2, '0').toUpperCase()); } - + // Get used prefixes from the API response const usedPrefixes = new Set(repeaterPrefixesData.data.map(row => row.prefix)); - + // Find unused prefixes return allPrefixes.filter(prefix => !usedPrefixes.has(prefix)); }, [repeaterPrefixesData?.data]); - + return { data: unusedPrefixes, isLoading, diff --git a/meshexplorer/src/lib/connect/client.ts b/meshexplorer/src/lib/connect/client.ts new file mode 100644 index 0000000..95eb038 --- /dev/null +++ b/meshexplorer/src/lib/connect/client.ts @@ -0,0 +1,12 @@ +import { createClient } from "@connectrpc/connect"; +import { transport } from "./transport"; +import { MapService } from "@/gen/meshexplorer/v1/map_pb"; +import { NodeService } from "@/gen/meshexplorer/v1/node_pb"; +import { ChatService } from "@/gen/meshexplorer/v1/chat_pb"; + +// Promise-based clients for the imperative call sites that don't fit the +// connect-query hook shape (the map's manual fetch, batched search, and the +// infinite-scroll chat query). The simple hooks use connect-query directly. +export const mapClient = createClient(MapService, transport); +export const nodeClient = createClient(NodeService, transport); +export const chatClient = createClient(ChatService, transport); diff --git a/meshexplorer/src/lib/connect/transport.ts b/meshexplorer/src/lib/connect/transport.ts new file mode 100644 index 0000000..d920972 --- /dev/null +++ b/meshexplorer/src/lib/connect/transport.ts @@ -0,0 +1,9 @@ +import { createConnectTransport } from "@connectrpc/connect-web"; +import { getApiBaseUrl } from "@/lib/api"; + +// ConnectRPC services are served under the `/api` prefix (see +// src/pages/api/[[...connect]].ts), alongside the legacy REST routes. +// Honors NEXT_PUBLIC_API_URL the same way buildApiUrl() does. +export const transport = createConnectTransport({ + baseUrl: `${getApiBaseUrl()}/api`, +}); diff --git a/meshexplorer/src/pages/api/[[...connect]].ts b/meshexplorer/src/pages/api/[[...connect]].ts new file mode 100644 index 0000000..c064491 --- /dev/null +++ b/meshexplorer/src/pages/api/[[...connect]].ts @@ -0,0 +1,14 @@ +import { nextJsApiRouter } from "@connectrpc/connect-next"; +import routes from "@/server/connect/routes"; +import { validationInterceptor } from "@/server/connect/validation"; + +// Serves every ConnectRPC service under /api/./. +// Next only treats files under pages/api/** as API routes, so the catch-all +// lives here (the default /api prefix matches the file location). protovalidate +// runs on every request via the interceptor before handlers see the message. +const { handler, config } = nextJsApiRouter({ + routes, + interceptors: [validationInterceptor], +}); + +export { handler as default, config }; diff --git a/meshexplorer/src/server/connect/chat.ts b/meshexplorer/src/server/connect/chat.ts new file mode 100644 index 0000000..91b9f98 --- /dev/null +++ b/meshexplorer/src/server/connect/chat.ts @@ -0,0 +1,127 @@ +import type { MessageInitShape } from "@bufbuild/protobuf"; +import type { ServiceImpl } from "@connectrpc/connect"; +import { ChatService } from "@/gen/meshexplorer/v1/chat_pb"; +import type { ChatMessageSchema } from "@/gen/meshexplorer/v1/chat_pb"; +import { getLatestChatMessages } from "@/lib/clickhouse/actions"; +import { + createClickHouseStreamer, + createChatMessagesStreamerConfig, +} from "@/lib/clickhouse/streaming"; +import { decryptMeshcoreGroupMessage } from "@/lib/meshcore"; + +const PUBLIC_MESHCORE_KEY = "izOH6cXN6mrJ5e26oRXNcg=="; + +interface ChatRow { + ingest_timestamp: string; + mesh_timestamp: string; + channel_hash: string; + mac: string; + encrypted_message: string; + message_count: number; + origin_path_info: Array<[string, string, string, string, string]>; + message_id: string; +} + +type ParsedMessage = { + timestamp: number; + msgType: number; + sender: string; + text: string; + rawText: string; +}; + +function toChatMessage( + row: ChatRow, + decrypted: ParsedMessage | null, +): MessageInitShape { + return { + ingestTimestamp: row.ingest_timestamp, + meshTimestamp: row.mesh_timestamp, + channelHash: row.channel_hash, + mac: row.mac, + encryptedMessage: row.encrypted_message, + messageCount: row.message_count, + originPathInfo: (row.origin_path_info ?? []).map( + ([origin, originPubkey, path, broker, topic]) => ({ + origin, + originPubkey, + path, + broker, + topic, + }), + ), + messageId: row.message_id, + decrypted: decrypted + ? { + timestamp: decrypted.timestamp, + msgType: decrypted.msgType, + sender: decrypted.sender, + text: decrypted.text, + rawText: decrypted.rawText, + } + : undefined, + }; +} + +async function decryptRow(row: ChatRow, keys: string[]): Promise { + try { + const decrypted = (await decryptMeshcoreGroupMessage({ + encrypted_message: row.encrypted_message, + mac: row.mac, + channel_hash: row.channel_hash, + knownKeys: keys, + parse: true, + })) as ParsedMessage | null; + return decrypted ?? null; + } catch { + return null; + } +} + +export const chatServiceImpl: ServiceImpl = { + async getChat(req) { + const messages = (await getLatestChatMessages({ + limit: req.limit ?? 20, + before: req.before, + after: req.after, + channelId: req.channelId, + region: req.region, + })) as ChatRow[]; + + const keys = req.decrypt ? [PUBLIC_MESHCORE_KEY, ...req.privateKeys] : []; + + const out: MessageInitShape[] = []; + for (const row of messages) { + if (req.decrypt) { + const decrypted = await decryptRow(row, keys); + // Match the REST endpoint: only emit messages that decrypted. + if (decrypted) { + out.push(toChatMessage(row, decrypted)); + } + } else { + out.push(toChatMessage(row, null)); + } + } + return { messages: out }; + }, + + async *streamChat(req) { + const channelId = req.channelId ? req.channelId.toLowerCase() : undefined; + const config = createChatMessagesStreamerConfig(channelId, req.region); + config.pollInterval = req.pollInterval ?? 1000; + config.maxRowsPerPoll = req.maxRows ?? 500; + config.skipInitialMessages = req.skipInitialMessages; + + const streamer = createClickHouseStreamer(config); + const keys = req.decrypt ? [PUBLIC_MESHCORE_KEY, ...req.privateKeys] : []; + + const params: Record = {}; + if (channelId) params.channelId = channelId; + + for await (const result of streamer(params)) { + const row = result.row; + const decrypted = req.decrypt ? await decryptRow(row, keys) : null; + yield toChatMessage(row, decrypted); + } + }, +}; diff --git a/meshexplorer/src/server/connect/map.ts b/meshexplorer/src/server/connect/map.ts new file mode 100644 index 0000000..7a81c30 --- /dev/null +++ b/meshexplorer/src/server/connect/map.ts @@ -0,0 +1,50 @@ +import type { ServiceImpl } from "@connectrpc/connect"; +import { MapService } from "@/gen/meshexplorer/v1/map_pb"; +import { getNodePositions, getAllNodeNeighbors } from "@/lib/clickhouse/actions"; +import { numToParam, toNeighborEdge, type NeighborEdgeRow } from "./mappers"; + +export const mapServiceImpl: ServiceImpl = { + async getMap(req) { + const minLat = numToParam(req.minLat); + const maxLat = numToParam(req.maxLat); + const minLng = numToParam(req.minLng); + const maxLng = numToParam(req.maxLng); + const lastSeen = numToParam(req.lastSeen); + + const positions = await getNodePositions({ + minLat, + maxLat, + minLng, + maxLng, + nodeTypes: req.nodeTypes, + lastSeen, + }); + + let neighbors: NeighborEdgeRow[] = []; + if (req.includeNeighbors) { + neighbors = await getAllNodeNeighbors( + lastSeen, + minLat, + maxLat, + minLng, + maxLng, + req.nodeTypes, + req.region, + ); + } + + return { + nodes: positions.map((p) => ({ + nodeId: p.node_id, + name: p.name ?? undefined, + shortName: p.short_name ?? undefined, + latitude: p.latitude, + longitude: p.longitude, + lastSeen: p.last_seen, + firstSeen: p.first_seen ?? undefined, + type: p.type, + })), + neighbors: neighbors.map(toNeighborEdge), + }; + }, +}; diff --git a/meshexplorer/src/server/connect/mappers.ts b/meshexplorer/src/server/connect/mappers.ts new file mode 100644 index 0000000..3708dad --- /dev/null +++ b/meshexplorer/src/server/connect/mappers.ts @@ -0,0 +1,41 @@ +import type { MessageInitShape } from "@bufbuild/protobuf"; +import type { NeighborEdgeSchema } from "@/gen/meshexplorer/v1/common_pb"; + +// Row shape returned by getAllNodeNeighbors() / getNodePositions() neighbor data. +export interface NeighborEdgeRow { + source_node: string; + target_node: string; + connection_type: string; + packet_count: number; + source_name: string; + source_latitude: number; + source_longitude: number; + source_has_location: number; + target_name: string; + target_latitude: number; + target_longitude: number; + target_has_location: number; +} + +/** Maps a ClickHouse neighbor-edge row to the NeighborEdge proto init shape. */ +export function toNeighborEdge(row: NeighborEdgeRow): MessageInitShape { + return { + sourceNode: row.source_node, + targetNode: row.target_node, + connectionType: row.connection_type, + packetCount: row.packet_count, + sourceName: row.source_name, + sourceLatitude: row.source_latitude, + sourceLongitude: row.source_longitude, + sourceHasLocation: row.source_has_location, + targetName: row.target_name, + targetLatitude: row.target_latitude, + targetLongitude: row.target_longitude, + targetHasLocation: row.target_has_location, + }; +} + +/** Converts an optional numeric request field to the `string | null` the actions expect. */ +export function numToParam(n: number | undefined): string | null { + return n === undefined ? null : String(n); +} diff --git a/meshexplorer/src/server/connect/neighbors.ts b/meshexplorer/src/server/connect/neighbors.ts new file mode 100644 index 0000000..eb88b66 --- /dev/null +++ b/meshexplorer/src/server/connect/neighbors.ts @@ -0,0 +1,19 @@ +import type { ServiceImpl } from "@connectrpc/connect"; +import { NeighborsService } from "@/gen/meshexplorer/v1/neighbors_pb"; +import { getAllNodeNeighbors } from "@/lib/clickhouse/actions"; +import { numToParam, toNeighborEdge } from "./mappers"; + +export const neighborsServiceImpl: ServiceImpl = { + async getAllNeighbors(req) { + const neighbors = await getAllNodeNeighbors( + numToParam(req.lastSeen), + numToParam(req.minLat), + numToParam(req.maxLat), + numToParam(req.minLng), + numToParam(req.maxLng), + req.nodeTypes, + req.region, + ); + return { neighbors: neighbors.map(toNeighborEdge) }; + }, +}; diff --git a/meshexplorer/src/server/connect/node.ts b/meshexplorer/src/server/connect/node.ts new file mode 100644 index 0000000..6bdda56 --- /dev/null +++ b/meshexplorer/src/server/connect/node.ts @@ -0,0 +1,170 @@ +import type { MessageInitShape } from "@bufbuild/protobuf"; +import { Code, ConnectError, type ServiceImpl } from "@connectrpc/connect"; +import { NodeService } from "@/gen/meshexplorer/v1/node_pb"; +import type { SearchResultSchema } from "@/gen/meshexplorer/v1/node_pb"; +import { + getMeshcoreNodeInfo, + getMeshcoreNodeNeighbors, + searchMeshcoreNodes, +} from "@/lib/clickhouse/actions"; + +interface SearchResultRow { + public_key: string; + node_name: string; + latitude: number | null; + longitude: number | null; + has_location: number; + is_repeater: number; + is_chat_node: number; + is_room_server: number; + has_name: number; + first_heard: string; + last_seen: string; + broker: string; + topic: string; +} + +function toSearchResult(row: SearchResultRow): MessageInitShape { + return { + publicKey: row.public_key, + nodeName: row.node_name, + latitude: row.latitude ?? undefined, + longitude: row.longitude ?? undefined, + hasLocation: row.has_location, + isRepeater: row.is_repeater, + isChatNode: row.is_chat_node, + isRoomServer: row.is_room_server, + hasName: row.has_name, + firstHeard: row.first_heard, + lastSeen: row.last_seen, + broker: row.broker, + topic: row.topic, + }; +} + +export const nodeServiceImpl: ServiceImpl = { + async getNode(req) { + const publicKey = req.publicKey.toUpperCase(); + const nodeInfo = await getMeshcoreNodeInfo(publicKey, req.limit ?? 50); + + if (!nodeInfo) { + throw new ConnectError(`node not found: ${publicKey}`, Code.NotFound); + } + + const node = nodeInfo.node; + // recentAdverts / locationHistory come back as untyped JSON rows. + const adverts = nodeInfo.recentAdverts as Array<{ + adv_timestamp: string; + origin_path_pubkey_tuples: Array<[string, string, string]>; + advert_count: number; + earliest_timestamp: string; + latest_timestamp: string; + latitude: number | null; + longitude: number | null; + is_repeater: number; + is_chat_node: number; + is_room_server: number; + has_location: number; + packet_hash: string; + }>; + const locationHistory = nodeInfo.locationHistory as Array<{ + mesh_timestamp: string; + latitude: number; + longitude: number; + }>; + + return { + node: { + publicKey: node.public_key, + nodeName: node.node_name, + latitude: node.latitude ?? undefined, + longitude: node.longitude ?? undefined, + hasLocation: node.has_location, + isRepeater: node.is_repeater, + isChatNode: node.is_chat_node, + isRoomServer: node.is_room_server, + hasName: node.has_name, + broker: node.broker ?? undefined, + topic: node.topic ?? undefined, + firstSeen: node.first_seen, + lastSeen: node.last_seen, + }, + recentAdverts: adverts.map((a) => ({ + advTimestamp: a.adv_timestamp, + originPathPubkeyTuples: (a.origin_path_pubkey_tuples ?? []).map( + ([origin, path, originPubkey]) => ({ origin, path, originPubkey }), + ), + advertCount: a.advert_count, + earliestTimestamp: a.earliest_timestamp, + latestTimestamp: a.latest_timestamp, + latitude: a.latitude ?? undefined, + longitude: a.longitude ?? undefined, + isRepeater: a.is_repeater, + isChatNode: a.is_chat_node, + isRoomServer: a.is_room_server, + hasLocation: a.has_location, + packetHash: a.packet_hash, + })), + locationHistory: locationHistory.map((l) => ({ + meshTimestamp: l.mesh_timestamp, + latitude: l.latitude, + longitude: l.longitude, + })), + mqtt: { + isUplinked: nodeInfo.mqtt.is_uplinked, + hasPackets: nodeInfo.mqtt.has_packets, + topics: nodeInfo.mqtt.topics.map((t) => ({ + topic: t.topic, + broker: t.broker, + lastPacketTime: t.last_packet_time, + isRecent: t.is_recent, + })), + }, + region: nodeInfo.region ?? undefined, + }; + }, + + async getNodeNeighbors(req) { + const neighbors = await getMeshcoreNodeNeighbors( + req.publicKey.toUpperCase(), + req.lastSeen === undefined ? null : String(req.lastSeen), + ); + return { + neighbors: neighbors.map((n) => ({ + publicKey: n.public_key, + nodeName: n.node_name, + latitude: n.latitude ?? undefined, + longitude: n.longitude ?? undefined, + hasLocation: n.has_location, + isRepeater: n.is_repeater, + isChatNode: n.is_chat_node, + isRoomServer: n.is_room_server, + hasName: n.has_name, + directions: n.directions, + })), + }; + }, + + async searchNodes(req) { + if (req.queries.length === 0) { + return { results: [] }; + } + + const queries = req.queries.map((q) => ({ + query: q.query, + region: q.region, + lastSeen: q.lastSeen === undefined ? null : String(q.lastSeen), + limit: q.limit ?? 50, + exact: q.exact ?? false, + is_repeater: q.isRepeater, + })); + + const grouped = (await searchMeshcoreNodes(queries)) as SearchResultRow[][]; + + return { + results: grouped.map((group) => ({ + results: group.map(toSearchResult), + })), + }; + }, +}; diff --git a/meshexplorer/src/server/connect/packets.ts b/meshexplorer/src/server/connect/packets.ts new file mode 100644 index 0000000..a5bdf77 --- /dev/null +++ b/meshexplorer/src/server/connect/packets.ts @@ -0,0 +1,60 @@ +import type { ServiceImpl } from "@connectrpc/connect"; +import { PacketsService } from "@/gen/meshexplorer/v1/packets_pb"; +import { + createClickHouseStreamer, + createMeshcorePacketsStreamerConfig, +} from "@/lib/clickhouse/streaming"; + +interface PacketRow { + ingest_timestamp: string; + mesh_timestamp: string; + broker: string; + topic: string; + packet: string; + path_len: number; + path: string; + route_type: number; + payload_type: number; + payload_version: number; + header: number; + origin_pubkey: string; +} + +export const packetsServiceImpl: ServiceImpl = { + async *streamPackets(req) { + const originPubkey = req.originPubkey ? req.originPubkey.toUpperCase() : undefined; + const config = createMeshcorePacketsStreamerConfig( + req.region, + req.payloadType, + req.routeType, + originPubkey, + ); + config.pollInterval = req.pollInterval ?? 500; + config.maxRowsPerPoll = req.maxRows ?? 10; + + const streamer = createClickHouseStreamer(config); + + const params: Record = {}; + if (req.payloadType !== undefined) params.payloadType = req.payloadType; + if (req.routeType !== undefined) params.routeType = req.routeType; + if (originPubkey) params.originPubkey = originPubkey; + + for await (const result of streamer(params)) { + const row = result.row; + yield { + ingestTimestamp: row.ingest_timestamp, + meshTimestamp: row.mesh_timestamp, + broker: row.broker, + topic: row.topic, + packet: row.packet, + pathLen: row.path_len, + path: row.path, + routeType: row.route_type, + payloadType: row.payload_type, + payloadVersion: row.payload_version, + header: row.header, + originPubkey: row.origin_pubkey, + }; + } + }, +}; diff --git a/meshexplorer/src/server/connect/routes.ts b/meshexplorer/src/server/connect/routes.ts new file mode 100644 index 0000000..58c61c5 --- /dev/null +++ b/meshexplorer/src/server/connect/routes.ts @@ -0,0 +1,22 @@ +import type { ConnectRouter } from "@connectrpc/connect"; +import { MapService } from "@/gen/meshexplorer/v1/map_pb"; +import { NeighborsService } from "@/gen/meshexplorer/v1/neighbors_pb"; +import { NodeService } from "@/gen/meshexplorer/v1/node_pb"; +import { StatsService } from "@/gen/meshexplorer/v1/stats_pb"; +import { ChatService } from "@/gen/meshexplorer/v1/chat_pb"; +import { PacketsService } from "@/gen/meshexplorer/v1/packets_pb"; +import { mapServiceImpl } from "./map"; +import { neighborsServiceImpl } from "./neighbors"; +import { nodeServiceImpl } from "./node"; +import { statsServiceImpl } from "./stats"; +import { chatServiceImpl } from "./chat"; +import { packetsServiceImpl } from "./packets"; + +export default function routes(router: ConnectRouter) { + router.service(MapService, mapServiceImpl); + router.service(NeighborsService, neighborsServiceImpl); + router.service(NodeService, nodeServiceImpl); + router.service(StatsService, statsServiceImpl); + router.service(ChatService, chatServiceImpl); + router.service(PacketsService, packetsServiceImpl); +} diff --git a/meshexplorer/src/server/connect/stats.ts b/meshexplorer/src/server/connect/stats.ts new file mode 100644 index 0000000..45cdd5e --- /dev/null +++ b/meshexplorer/src/server/connect/stats.ts @@ -0,0 +1,123 @@ +import type { ServiceImpl } from "@connectrpc/connect"; +import { StatsService } from "@/gen/meshexplorer/v1/stats_pb"; +import { clickhouse } from "@/lib/clickhouse/clickhouse"; +import { + generateRegionWhereClause, + generateRegionWhereClauseFromArray, +} from "@/lib/regionFilters"; + +export const statsServiceImpl: ServiceImpl = { + async getTotalNodes(req) { + const regionFilter = generateRegionWhereClause(req.region); + const whereClause = regionFilter.whereClause ? `WHERE ${regionFilter.whereClause}` : ""; + const query = `SELECT count(DISTINCT public_key) AS total_nodes FROM meshcore_adverts ${whereClause}`; + const resultSet = await clickhouse.query({ query, format: "JSONEachRow" }); + const rows = (await resultSet.json()) as Array<{ total_nodes: number }>; + return { totalNodes: rows.length > 0 ? Number(rows[0].total_nodes) : 0 }; + }, + + async getNodesOverTime(req) { + const regionFilter = generateRegionWhereClause(req.region); + const regionWhereClause = regionFilter.whereClause ? `WHERE ${regionFilter.whereClause}` : ""; + const query = ` + WITH all_nodes AS ( + SELECT toDate(ingest_timestamp) AS day, public_key, latitude, longitude, is_repeater, is_room_server + FROM meshcore_adverts + ${regionWhereClause} + ), + all_days AS ( + SELECT DISTINCT day FROM all_nodes + ORDER BY day ASC + ), + rolling_window AS ( + SELECT + d.day, + n.public_key, + n.latitude, + n.longitude, + n.is_repeater, + n.is_room_server + FROM all_days d + INNER JOIN all_nodes n ON n.day BETWEEN (d.day - INTERVAL 6 DAY) AND d.day + ) + SELECT day, + count(DISTINCT public_key) AS cumulative_unique_nodes, + count(DISTINCT CASE WHEN latitude IS NOT NULL AND longitude IS NOT NULL AND latitude != 0 AND longitude != 0 THEN public_key END) AS nodes_with_location, + count(DISTINCT CASE WHEN latitude IS NULL OR longitude IS NULL OR latitude = 0 OR longitude = 0 THEN public_key END) AS nodes_without_location, + count(DISTINCT CASE WHEN is_repeater = 1 THEN public_key END) AS repeaters, + count(DISTINCT CASE WHEN is_room_server = 1 THEN public_key END) AS room_servers + FROM rolling_window + GROUP BY day + ORDER BY day ASC + `; + const resultSet = await clickhouse.query({ query, format: "JSONEachRow" }); + const rows = (await resultSet.json()) as Array<{ + day: string; + cumulative_unique_nodes: number; + nodes_with_location: number; + nodes_without_location: number; + repeaters: number; + room_servers: number; + }>; + return { + data: rows.map((r) => ({ + day: r.day, + cumulativeUniqueNodes: Number(r.cumulative_unique_nodes), + nodesWithLocation: Number(r.nodes_with_location), + nodesWithoutLocation: Number(r.nodes_without_location), + repeaters: Number(r.repeaters), + roomServers: Number(r.room_servers), + })), + }; + }, + + async getPopularChannels(req) { + const regionFilter = generateRegionWhereClauseFromArray(req.region); + const whereClause = regionFilter.whereClause ? `WHERE ${regionFilter.whereClause}` : ""; + const query = ` + SELECT channel_hash, count() AS message_count + FROM meshcore_public_channel_messages + ${whereClause} + GROUP BY channel_hash + ORDER BY message_count DESC + LIMIT 10 + `; + const resultSet = await clickhouse.query({ query, format: "JSONEachRow" }); + const rows = (await resultSet.json()) as Array<{ channel_hash: string; message_count: number }>; + return { + data: rows.map((r) => ({ + channelHash: r.channel_hash, + messageCount: Number(r.message_count), + })), + }; + }, + + async getRepeaterPrefixes(req) { + const regionFilter = generateRegionWhereClause(req.region); + const regionWhereClause = regionFilter.whereClause ? `AND ${regionFilter.whereClause}` : ""; + const query = ` + SELECT + substring(public_key, 1, 2) as prefix, + count() as node_count, + groupArray(node_name) as node_names + FROM meshcore_adverts_latest + WHERE is_repeater = 1 + AND last_seen >= now() - INTERVAL 2 DAY + ${regionWhereClause} + GROUP BY prefix + ORDER BY node_count DESC, prefix ASC + `; + const resultSet = await clickhouse.query({ query, format: "JSONEachRow" }); + const rows = (await resultSet.json()) as Array<{ + prefix: string; + node_count: number; + node_names: string[]; + }>; + return { + data: rows.map((r) => ({ + prefix: r.prefix, + nodeNames: r.node_names, + })), + }; + }, +}; diff --git a/meshexplorer/src/server/connect/validation.ts b/meshexplorer/src/server/connect/validation.ts new file mode 100644 index 0000000..ce98097 --- /dev/null +++ b/meshexplorer/src/server/connect/validation.ts @@ -0,0 +1,39 @@ +import type { DescMessage, MessageShape } from "@bufbuild/protobuf"; +import { createValidator } from "@bufbuild/protovalidate"; +import { Code, ConnectError, type Interceptor } from "@connectrpc/connect"; + +// A single validator instance compiles and caches CEL programs per message +// type, so reuse it across all requests. +const validator = createValidator(); + +function assertValid(schema: Desc, message: MessageShape): void { + const result = validator.validate(schema, message); + if (result.kind === "invalid") { + // Surface the human-readable rule violations to the caller. + throw new ConnectError(result.error.message, Code.InvalidArgument); + } + if (result.kind === "error") { + // A rule failed to compile/evaluate — that's a server-side bug, not bad input. + throw new ConnectError(`request validation failed: ${result.error.message}`, Code.Internal); + } +} + +/** + * Server interceptor that enforces protovalidate (buf.validate) rules on every + * inbound request message before it reaches a handler. Works for unary calls + * and for the single request message of server-streaming calls. + */ +export const validationInterceptor: Interceptor = (next) => async (req) => { + if (req.stream) { + const source = req.message; + const validated = (async function* () { + for await (const message of source) { + assertValid(req.method.input, message); + yield message; + } + })(); + return next({ ...req, message: validated }); + } + assertValid(req.method.input, req.message); + return next(req); +};