mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-13 01:05:37 +02:00
⭐ feat: protobuf input messaging (#165)
Replace json protocol by protobuf generate protobuf files with `bun buf generate` or just `buf generate` - [x] Implement all datatypes with proto files - [x] Map to ts types or use the generated proto types directly with: - [x] web frontend - [x] relay - [x] runner - [ ] final performance test (to be done when CI builds new images) --------- Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
This commit is contained in:
60
packages/input/src/proto/latency_tracker_pb.ts
Normal file
60
packages/input/src/proto/latency_tracker_pb.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
// @generated by protoc-gen-es v2.2.3 with parameter "target=ts"
|
||||
// @generated from file latency_tracker.proto (package proto, syntax proto3)
|
||||
/* eslint-disable */
|
||||
|
||||
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
|
||||
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
|
||||
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file latency_tracker.proto.
|
||||
*/
|
||||
export const file_latency_tracker: GenFile = /*@__PURE__*/
|
||||
fileDesc("ChVsYXRlbmN5X3RyYWNrZXIucHJvdG8SBXByb3RvIk4KE1Byb3RvVGltZXN0YW1wRW50cnkSDQoFc3RhZ2UYASABKAkSKAoEdGltZRgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiWgoTUHJvdG9MYXRlbmN5VHJhY2tlchITCgtzZXF1ZW5jZV9pZBgBIAEoCRIuCgp0aW1lc3RhbXBzGAIgAygLMhoucHJvdG8uUHJvdG9UaW1lc3RhbXBFbnRyeUIWWhRyZWxheS9pbnRlcm5hbC9wcm90b2IGcHJvdG8z", [file_google_protobuf_timestamp]);
|
||||
|
||||
/**
|
||||
* @generated from message proto.ProtoTimestampEntry
|
||||
*/
|
||||
export type ProtoTimestampEntry = Message<"proto.ProtoTimestampEntry"> & {
|
||||
/**
|
||||
* @generated from field: string stage = 1;
|
||||
*/
|
||||
stage: string;
|
||||
|
||||
/**
|
||||
* @generated from field: google.protobuf.Timestamp time = 2;
|
||||
*/
|
||||
time?: Timestamp;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoTimestampEntry.
|
||||
* Use `create(ProtoTimestampEntrySchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoTimestampEntrySchema: GenMessage<ProtoTimestampEntry> = /*@__PURE__*/
|
||||
messageDesc(file_latency_tracker, 0);
|
||||
|
||||
/**
|
||||
* @generated from message proto.ProtoLatencyTracker
|
||||
*/
|
||||
export type ProtoLatencyTracker = Message<"proto.ProtoLatencyTracker"> & {
|
||||
/**
|
||||
* @generated from field: string sequence_id = 1;
|
||||
*/
|
||||
sequenceId: string;
|
||||
|
||||
/**
|
||||
* @generated from field: repeated proto.ProtoTimestampEntry timestamps = 2;
|
||||
*/
|
||||
timestamps: ProtoTimestampEntry[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoLatencyTracker.
|
||||
* Use `create(ProtoLatencyTrackerSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoLatencyTrackerSchema: GenMessage<ProtoLatencyTracker> = /*@__PURE__*/
|
||||
messageDesc(file_latency_tracker, 1);
|
||||
|
||||
62
packages/input/src/proto/messages_pb.ts
Normal file
62
packages/input/src/proto/messages_pb.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
// @generated by protoc-gen-es v2.2.3 with parameter "target=ts"
|
||||
// @generated from file messages.proto (package proto, syntax proto3)
|
||||
/* eslint-disable */
|
||||
|
||||
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
|
||||
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
|
||||
import type { ProtoInput } from "./types_pb";
|
||||
import { file_types } from "./types_pb";
|
||||
import type { ProtoLatencyTracker } from "./latency_tracker_pb";
|
||||
import { file_latency_tracker } from "./latency_tracker_pb";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file messages.proto.
|
||||
*/
|
||||
export const file_messages: GenFile = /*@__PURE__*/
|
||||
fileDesc("Cg5tZXNzYWdlcy5wcm90bxIFcHJvdG8iVQoQUHJvdG9NZXNzYWdlQmFzZRIUCgxwYXlsb2FkX3R5cGUYASABKAkSKwoHbGF0ZW5jeRgCIAEoCzIaLnByb3RvLlByb3RvTGF0ZW5jeVRyYWNrZXIiYwoRUHJvdG9NZXNzYWdlSW5wdXQSLQoMbWVzc2FnZV9iYXNlGAEgASgLMhcucHJvdG8uUHJvdG9NZXNzYWdlQmFzZRIfCgRkYXRhGAIgASgLMhEucHJvdG8uUHJvdG9JbnB1dEIWWhRyZWxheS9pbnRlcm5hbC9wcm90b2IGcHJvdG8z", [file_types, file_latency_tracker]);
|
||||
|
||||
/**
|
||||
* @generated from message proto.ProtoMessageBase
|
||||
*/
|
||||
export type ProtoMessageBase = Message<"proto.ProtoMessageBase"> & {
|
||||
/**
|
||||
* @generated from field: string payload_type = 1;
|
||||
*/
|
||||
payloadType: string;
|
||||
|
||||
/**
|
||||
* @generated from field: proto.ProtoLatencyTracker latency = 2;
|
||||
*/
|
||||
latency?: ProtoLatencyTracker;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoMessageBase.
|
||||
* Use `create(ProtoMessageBaseSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoMessageBaseSchema: GenMessage<ProtoMessageBase> = /*@__PURE__*/
|
||||
messageDesc(file_messages, 0);
|
||||
|
||||
/**
|
||||
* @generated from message proto.ProtoMessageInput
|
||||
*/
|
||||
export type ProtoMessageInput = Message<"proto.ProtoMessageInput"> & {
|
||||
/**
|
||||
* @generated from field: proto.ProtoMessageBase message_base = 1;
|
||||
*/
|
||||
messageBase?: ProtoMessageBase;
|
||||
|
||||
/**
|
||||
* @generated from field: proto.ProtoInput data = 2;
|
||||
*/
|
||||
data?: ProtoInput;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoMessageInput.
|
||||
* Use `create(ProtoMessageInputSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoMessageInputSchema: GenMessage<ProtoMessageInput> = /*@__PURE__*/
|
||||
messageDesc(file_messages, 1);
|
||||
|
||||
272
packages/input/src/proto/types_pb.ts
Normal file
272
packages/input/src/proto/types_pb.ts
Normal file
@@ -0,0 +1,272 @@
|
||||
// @generated by protoc-gen-es v2.2.3 with parameter "target=ts"
|
||||
// @generated from file types.proto (package proto, syntax proto3)
|
||||
/* eslint-disable */
|
||||
|
||||
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
|
||||
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
/**
|
||||
* Describes the file types.proto.
|
||||
*/
|
||||
export const file_types: GenFile = /*@__PURE__*/
|
||||
fileDesc("Cgt0eXBlcy5wcm90bxIFcHJvdG8iNAoOUHJvdG9Nb3VzZU1vdmUSDAoEdHlwZRgBIAEoCRIJCgF4GAIgASgFEgkKAXkYAyABKAUiNwoRUHJvdG9Nb3VzZU1vdmVBYnMSDAoEdHlwZRgBIAEoCRIJCgF4GAIgASgFEgkKAXkYAyABKAUiNQoPUHJvdG9Nb3VzZVdoZWVsEgwKBHR5cGUYASABKAkSCQoBeBgCIAEoBRIJCgF5GAMgASgFIi4KEVByb3RvTW91c2VLZXlEb3duEgwKBHR5cGUYASABKAkSCwoDa2V5GAIgASgFIiwKD1Byb3RvTW91c2VLZXlVcBIMCgR0eXBlGAEgASgJEgsKA2tleRgCIAEoBSIpCgxQcm90b0tleURvd24SDAoEdHlwZRgBIAEoCRILCgNrZXkYAiABKAUiJwoKUHJvdG9LZXlVcBIMCgR0eXBlGAEgASgJEgsKA2tleRgCIAEoBSLcAgoKUHJvdG9JbnB1dBIrCgptb3VzZV9tb3ZlGAEgASgLMhUucHJvdG8uUHJvdG9Nb3VzZU1vdmVIABIyCg5tb3VzZV9tb3ZlX2FicxgCIAEoCzIYLnByb3RvLlByb3RvTW91c2VNb3ZlQWJzSAASLQoLbW91c2Vfd2hlZWwYAyABKAsyFi5wcm90by5Qcm90b01vdXNlV2hlZWxIABIyCg5tb3VzZV9rZXlfZG93bhgEIAEoCzIYLnByb3RvLlByb3RvTW91c2VLZXlEb3duSAASLgoMbW91c2Vfa2V5X3VwGAUgASgLMhYucHJvdG8uUHJvdG9Nb3VzZUtleVVwSAASJwoIa2V5X2Rvd24YBiABKAsyEy5wcm90by5Qcm90b0tleURvd25IABIjCgZrZXlfdXAYByABKAsyES5wcm90by5Qcm90b0tleVVwSABCDAoKaW5wdXRfdHlwZUIWWhRyZWxheS9pbnRlcm5hbC9wcm90b2IGcHJvdG8z");
|
||||
|
||||
/**
|
||||
* MouseMove message
|
||||
*
|
||||
* @generated from message proto.ProtoMouseMove
|
||||
*/
|
||||
export type ProtoMouseMove = Message<"proto.ProtoMouseMove"> & {
|
||||
/**
|
||||
* Fixed value "MouseMove"
|
||||
*
|
||||
* @generated from field: string type = 1;
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 x = 2;
|
||||
*/
|
||||
x: number;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 y = 3;
|
||||
*/
|
||||
y: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoMouseMove.
|
||||
* Use `create(ProtoMouseMoveSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoMouseMoveSchema: GenMessage<ProtoMouseMove> = /*@__PURE__*/
|
||||
messageDesc(file_types, 0);
|
||||
|
||||
/**
|
||||
* MouseMoveAbs message
|
||||
*
|
||||
* @generated from message proto.ProtoMouseMoveAbs
|
||||
*/
|
||||
export type ProtoMouseMoveAbs = Message<"proto.ProtoMouseMoveAbs"> & {
|
||||
/**
|
||||
* Fixed value "MouseMoveAbs"
|
||||
*
|
||||
* @generated from field: string type = 1;
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 x = 2;
|
||||
*/
|
||||
x: number;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 y = 3;
|
||||
*/
|
||||
y: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoMouseMoveAbs.
|
||||
* Use `create(ProtoMouseMoveAbsSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoMouseMoveAbsSchema: GenMessage<ProtoMouseMoveAbs> = /*@__PURE__*/
|
||||
messageDesc(file_types, 1);
|
||||
|
||||
/**
|
||||
* MouseWheel message
|
||||
*
|
||||
* @generated from message proto.ProtoMouseWheel
|
||||
*/
|
||||
export type ProtoMouseWheel = Message<"proto.ProtoMouseWheel"> & {
|
||||
/**
|
||||
* Fixed value "MouseWheel"
|
||||
*
|
||||
* @generated from field: string type = 1;
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 x = 2;
|
||||
*/
|
||||
x: number;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 y = 3;
|
||||
*/
|
||||
y: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoMouseWheel.
|
||||
* Use `create(ProtoMouseWheelSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoMouseWheelSchema: GenMessage<ProtoMouseWheel> = /*@__PURE__*/
|
||||
messageDesc(file_types, 2);
|
||||
|
||||
/**
|
||||
* MouseKeyDown message
|
||||
*
|
||||
* @generated from message proto.ProtoMouseKeyDown
|
||||
*/
|
||||
export type ProtoMouseKeyDown = Message<"proto.ProtoMouseKeyDown"> & {
|
||||
/**
|
||||
* Fixed value "MouseKeyDown"
|
||||
*
|
||||
* @generated from field: string type = 1;
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 key = 2;
|
||||
*/
|
||||
key: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoMouseKeyDown.
|
||||
* Use `create(ProtoMouseKeyDownSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoMouseKeyDownSchema: GenMessage<ProtoMouseKeyDown> = /*@__PURE__*/
|
||||
messageDesc(file_types, 3);
|
||||
|
||||
/**
|
||||
* MouseKeyUp message
|
||||
*
|
||||
* @generated from message proto.ProtoMouseKeyUp
|
||||
*/
|
||||
export type ProtoMouseKeyUp = Message<"proto.ProtoMouseKeyUp"> & {
|
||||
/**
|
||||
* Fixed value "MouseKeyUp"
|
||||
*
|
||||
* @generated from field: string type = 1;
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 key = 2;
|
||||
*/
|
||||
key: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoMouseKeyUp.
|
||||
* Use `create(ProtoMouseKeyUpSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoMouseKeyUpSchema: GenMessage<ProtoMouseKeyUp> = /*@__PURE__*/
|
||||
messageDesc(file_types, 4);
|
||||
|
||||
/**
|
||||
* KeyDown message
|
||||
*
|
||||
* @generated from message proto.ProtoKeyDown
|
||||
*/
|
||||
export type ProtoKeyDown = Message<"proto.ProtoKeyDown"> & {
|
||||
/**
|
||||
* Fixed value "KeyDown"
|
||||
*
|
||||
* @generated from field: string type = 1;
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 key = 2;
|
||||
*/
|
||||
key: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoKeyDown.
|
||||
* Use `create(ProtoKeyDownSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoKeyDownSchema: GenMessage<ProtoKeyDown> = /*@__PURE__*/
|
||||
messageDesc(file_types, 5);
|
||||
|
||||
/**
|
||||
* KeyUp message
|
||||
*
|
||||
* @generated from message proto.ProtoKeyUp
|
||||
*/
|
||||
export type ProtoKeyUp = Message<"proto.ProtoKeyUp"> & {
|
||||
/**
|
||||
* Fixed value "KeyUp"
|
||||
*
|
||||
* @generated from field: string type = 1;
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* @generated from field: int32 key = 2;
|
||||
*/
|
||||
key: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoKeyUp.
|
||||
* Use `create(ProtoKeyUpSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoKeyUpSchema: GenMessage<ProtoKeyUp> = /*@__PURE__*/
|
||||
messageDesc(file_types, 6);
|
||||
|
||||
/**
|
||||
* Union of all Input types
|
||||
*
|
||||
* @generated from message proto.ProtoInput
|
||||
*/
|
||||
export type ProtoInput = Message<"proto.ProtoInput"> & {
|
||||
/**
|
||||
* @generated from oneof proto.ProtoInput.input_type
|
||||
*/
|
||||
inputType: {
|
||||
/**
|
||||
* @generated from field: proto.ProtoMouseMove mouse_move = 1;
|
||||
*/
|
||||
value: ProtoMouseMove;
|
||||
case: "mouseMove";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: proto.ProtoMouseMoveAbs mouse_move_abs = 2;
|
||||
*/
|
||||
value: ProtoMouseMoveAbs;
|
||||
case: "mouseMoveAbs";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: proto.ProtoMouseWheel mouse_wheel = 3;
|
||||
*/
|
||||
value: ProtoMouseWheel;
|
||||
case: "mouseWheel";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: proto.ProtoMouseKeyDown mouse_key_down = 4;
|
||||
*/
|
||||
value: ProtoMouseKeyDown;
|
||||
case: "mouseKeyDown";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: proto.ProtoMouseKeyUp mouse_key_up = 5;
|
||||
*/
|
||||
value: ProtoMouseKeyUp;
|
||||
case: "mouseKeyUp";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: proto.ProtoKeyDown key_down = 6;
|
||||
*/
|
||||
value: ProtoKeyDown;
|
||||
case: "keyDown";
|
||||
} | {
|
||||
/**
|
||||
* @generated from field: proto.ProtoKeyUp key_up = 7;
|
||||
*/
|
||||
value: ProtoKeyUp;
|
||||
case: "keyUp";
|
||||
} | { case: undefined; value?: undefined };
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message proto.ProtoInput.
|
||||
* Use `create(ProtoInputSchema)` to create a new message.
|
||||
*/
|
||||
export const ProtoInputSchema: GenMessage<ProtoInput> = /*@__PURE__*/
|
||||
messageDesc(file_types, 7);
|
||||
|
||||
Reference in New Issue
Block a user