From cde4682326c2d786f239c7f7769419155e6655ce Mon Sep 17 00:00:00 2001 From: Federico Peralta Date: Tue, 3 Sep 2024 17:28:01 -0300 Subject: [PATCH] Init reporter (#655) We've decided to forgo using the reporter to normalize the JSON payload and, instead, at a later stage, refactor it to report payloads to the remote backend. For now, disable the API (keep the types in place) so it's not accidentally relied on. --------- Co-authored-by: Sebastian Tiedtke --- go.mod | 2 +- internal/cmd/server.go | 2 + .../go/runme/reporter/v1alpha1/reporter.pb.go | 1068 +++++++++++++++++ .../reporter/v1alpha1/reporter_grpc.pb.go | 121 ++ .../runme/reporter/v1alpha1/reporter.graphql | 317 +++++ .../reporter/v1alpha1/reporter_pb.client.d.ts | 34 + .../reporter/v1alpha1/reporter_pb.client.js | 25 + .../runme/reporter/v1alpha1/reporter_pb.d.ts | 304 +++++ .../ts/runme/reporter/v1alpha1/reporter_pb.js | 155 +++ .../runme/reporter/v1alpha1/reporter.proto | 83 ++ .../editor/reporterservice/service.go | 94 ++ .../editor/reporterservice/service_test.go | 159 +++ 12 files changed, 2363 insertions(+), 1 deletion(-) create mode 100644 pkg/api/gen/proto/go/runme/reporter/v1alpha1/reporter.pb.go create mode 100644 pkg/api/gen/proto/go/runme/reporter/v1alpha1/reporter_grpc.pb.go create mode 100644 pkg/api/gen/proto/gql/runme/reporter/v1alpha1/reporter.graphql create mode 100644 pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.client.d.ts create mode 100644 pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.client.js create mode 100644 pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.d.ts create mode 100644 pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.js create mode 100644 pkg/api/proto/runme/reporter/v1alpha1/reporter.proto create mode 100644 pkg/document/editor/reporterservice/service.go create mode 100644 pkg/document/editor/reporterservice/service_test.go diff --git a/go.mod b/go.mod index 167955e19..5b41af299 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/stateful/runme/v3 -go 1.22 +go 1.22.0 // replace github.com/stateful/godotenv => ../godotenv diff --git a/internal/cmd/server.go b/internal/cmd/server.go index ac865fa66..02be0b1dc 100644 --- a/internal/cmd/server.go +++ b/internal/cmd/server.go @@ -105,6 +105,8 @@ The kernel is used to run long running processes like shells and interacting wit ) parserv1.RegisterParserServiceServer(server, editorservice.NewParserServiceServer(logger)) projectv1.RegisterProjectServiceServer(server, projectservice.NewProjectServiceServer(logger)) + // todo(sebastian): decided to forgo the reporter service for now + // reporterv1alpha1.RegisterReporterServiceServer(server, reporterservice.NewReporterServiceServer(logger)) if enableRunner { runnerServicev1, err := runner.NewRunnerService(logger) if err != nil { diff --git a/pkg/api/gen/proto/go/runme/reporter/v1alpha1/reporter.pb.go b/pkg/api/gen/proto/go/runme/reporter/v1alpha1/reporter.pb.go new file mode 100644 index 000000000..8c52574db --- /dev/null +++ b/pkg/api/gen/proto/go/runme/reporter/v1alpha1/reporter.pb.go @@ -0,0 +1,1068 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: runme/reporter/v1alpha1/reporter.proto + +package reporterv1alpha1 + +import ( + v1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/parser/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TransformRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Notebook *v1.Notebook `protobuf:"bytes,1,opt,name=notebook,proto3" json:"notebook,omitempty"` + Extension *TransformRequestExtension `protobuf:"bytes,2,opt,name=extension,proto3" json:"extension,omitempty"` +} + +func (x *TransformRequest) Reset() { + *x = TransformRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransformRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransformRequest) ProtoMessage() {} + +func (x *TransformRequest) ProtoReflect() protoreflect.Message { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransformRequest.ProtoReflect.Descriptor instead. +func (*TransformRequest) Descriptor() ([]byte, []int) { + return file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP(), []int{0} +} + +func (x *TransformRequest) GetNotebook() *v1.Notebook { + if x != nil { + return x.Notebook + } + return nil +} + +func (x *TransformRequest) GetExtension() *TransformRequestExtension { + if x != nil { + return x.Extension + } + return nil +} + +type TransformRequestExtension struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AutoSave *bool `protobuf:"varint,2,opt,name=auto_save,json=autoSave,proto3,oneof" json:"auto_save,omitempty"` + Repository *string `protobuf:"bytes,3,opt,name=repository,proto3,oneof" json:"repository,omitempty"` + Branch *string `protobuf:"bytes,4,opt,name=branch,proto3,oneof" json:"branch,omitempty"` + Commit *string `protobuf:"bytes,5,opt,name=commit,proto3,oneof" json:"commit,omitempty"` + FilePath *string `protobuf:"bytes,6,opt,name=file_path,json=filePath,proto3,oneof" json:"file_path,omitempty"` + FileContent []byte `protobuf:"bytes,7,opt,name=file_content,json=fileContent,proto3,oneof" json:"file_content,omitempty"` + PlainOutput []byte `protobuf:"bytes,8,opt,name=plain_output,json=plainOutput,proto3,oneof" json:"plain_output,omitempty"` + MaskedOutput []byte `protobuf:"bytes,9,opt,name=masked_output,json=maskedOutput,proto3,oneof" json:"masked_output,omitempty"` + MacAddress *string `protobuf:"bytes,10,opt,name=mac_address,json=macAddress,proto3,oneof" json:"mac_address,omitempty"` + Hostname *string `protobuf:"bytes,11,opt,name=hostname,proto3,oneof" json:"hostname,omitempty"` + Platform *string `protobuf:"bytes,12,opt,name=platform,proto3,oneof" json:"platform,omitempty"` + Release *string `protobuf:"bytes,13,opt,name=release,proto3,oneof" json:"release,omitempty"` + Arch *string `protobuf:"bytes,14,opt,name=arch,proto3,oneof" json:"arch,omitempty"` + Vendor *string `protobuf:"bytes,15,opt,name=vendor,proto3,oneof" json:"vendor,omitempty"` + Shell *string `protobuf:"bytes,16,opt,name=shell,proto3,oneof" json:"shell,omitempty"` + VsAppHost *string `protobuf:"bytes,17,opt,name=vs_app_host,json=vsAppHost,proto3,oneof" json:"vs_app_host,omitempty"` + VsAppName *string `protobuf:"bytes,18,opt,name=vs_app_name,json=vsAppName,proto3,oneof" json:"vs_app_name,omitempty"` + VsAppSessionId *string `protobuf:"bytes,19,opt,name=vs_app_session_id,json=vsAppSessionId,proto3,oneof" json:"vs_app_session_id,omitempty"` + VsMachineId *string `protobuf:"bytes,20,opt,name=vs_machine_id,json=vsMachineId,proto3,oneof" json:"vs_machine_id,omitempty"` + VsMetadata map[string]string `protobuf:"bytes,21,rep,name=vs_metadata,json=vsMetadata,proto3" json:"vs_metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *TransformRequestExtension) Reset() { + *x = TransformRequestExtension{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransformRequestExtension) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransformRequestExtension) ProtoMessage() {} + +func (x *TransformRequestExtension) ProtoReflect() protoreflect.Message { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransformRequestExtension.ProtoReflect.Descriptor instead. +func (*TransformRequestExtension) Descriptor() ([]byte, []int) { + return file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP(), []int{1} +} + +func (x *TransformRequestExtension) GetAutoSave() bool { + if x != nil && x.AutoSave != nil { + return *x.AutoSave + } + return false +} + +func (x *TransformRequestExtension) GetRepository() string { + if x != nil && x.Repository != nil { + return *x.Repository + } + return "" +} + +func (x *TransformRequestExtension) GetBranch() string { + if x != nil && x.Branch != nil { + return *x.Branch + } + return "" +} + +func (x *TransformRequestExtension) GetCommit() string { + if x != nil && x.Commit != nil { + return *x.Commit + } + return "" +} + +func (x *TransformRequestExtension) GetFilePath() string { + if x != nil && x.FilePath != nil { + return *x.FilePath + } + return "" +} + +func (x *TransformRequestExtension) GetFileContent() []byte { + if x != nil { + return x.FileContent + } + return nil +} + +func (x *TransformRequestExtension) GetPlainOutput() []byte { + if x != nil { + return x.PlainOutput + } + return nil +} + +func (x *TransformRequestExtension) GetMaskedOutput() []byte { + if x != nil { + return x.MaskedOutput + } + return nil +} + +func (x *TransformRequestExtension) GetMacAddress() string { + if x != nil && x.MacAddress != nil { + return *x.MacAddress + } + return "" +} + +func (x *TransformRequestExtension) GetHostname() string { + if x != nil && x.Hostname != nil { + return *x.Hostname + } + return "" +} + +func (x *TransformRequestExtension) GetPlatform() string { + if x != nil && x.Platform != nil { + return *x.Platform + } + return "" +} + +func (x *TransformRequestExtension) GetRelease() string { + if x != nil && x.Release != nil { + return *x.Release + } + return "" +} + +func (x *TransformRequestExtension) GetArch() string { + if x != nil && x.Arch != nil { + return *x.Arch + } + return "" +} + +func (x *TransformRequestExtension) GetVendor() string { + if x != nil && x.Vendor != nil { + return *x.Vendor + } + return "" +} + +func (x *TransformRequestExtension) GetShell() string { + if x != nil && x.Shell != nil { + return *x.Shell + } + return "" +} + +func (x *TransformRequestExtension) GetVsAppHost() string { + if x != nil && x.VsAppHost != nil { + return *x.VsAppHost + } + return "" +} + +func (x *TransformRequestExtension) GetVsAppName() string { + if x != nil && x.VsAppName != nil { + return *x.VsAppName + } + return "" +} + +func (x *TransformRequestExtension) GetVsAppSessionId() string { + if x != nil && x.VsAppSessionId != nil { + return *x.VsAppSessionId + } + return "" +} + +func (x *TransformRequestExtension) GetVsMachineId() string { + if x != nil && x.VsMachineId != nil { + return *x.VsMachineId + } + return "" +} + +func (x *TransformRequestExtension) GetVsMetadata() map[string]string { + if x != nil { + return x.VsMetadata + } + return nil +} + +type TransformResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Notebook *v1.Notebook `protobuf:"bytes,1,opt,name=notebook,proto3" json:"notebook,omitempty"` + Extension *ReporterExtension `protobuf:"bytes,2,opt,name=extension,proto3" json:"extension,omitempty"` +} + +func (x *TransformResponse) Reset() { + *x = TransformResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransformResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransformResponse) ProtoMessage() {} + +func (x *TransformResponse) ProtoReflect() protoreflect.Message { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransformResponse.ProtoReflect.Descriptor instead. +func (*TransformResponse) Descriptor() ([]byte, []int) { + return file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP(), []int{2} +} + +func (x *TransformResponse) GetNotebook() *v1.Notebook { + if x != nil { + return x.Notebook + } + return nil +} + +func (x *TransformResponse) GetExtension() *ReporterExtension { + if x != nil { + return x.Extension + } + return nil +} + +type ReporterExtension struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AutoSave bool `protobuf:"varint,1,opt,name=auto_save,json=autoSave,proto3" json:"auto_save,omitempty"` + Git *ReporterGit `protobuf:"bytes,2,opt,name=git,proto3" json:"git,omitempty"` + File *ReporterFile `protobuf:"bytes,3,opt,name=file,proto3" json:"file,omitempty"` + Session *ReporterSession `protobuf:"bytes,4,opt,name=session,proto3" json:"session,omitempty"` + Device *ReporterDevice `protobuf:"bytes,5,opt,name=device,proto3" json:"device,omitempty"` +} + +func (x *ReporterExtension) Reset() { + *x = ReporterExtension{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReporterExtension) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReporterExtension) ProtoMessage() {} + +func (x *ReporterExtension) ProtoReflect() protoreflect.Message { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReporterExtension.ProtoReflect.Descriptor instead. +func (*ReporterExtension) Descriptor() ([]byte, []int) { + return file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP(), []int{3} +} + +func (x *ReporterExtension) GetAutoSave() bool { + if x != nil { + return x.AutoSave + } + return false +} + +func (x *ReporterExtension) GetGit() *ReporterGit { + if x != nil { + return x.Git + } + return nil +} + +func (x *ReporterExtension) GetFile() *ReporterFile { + if x != nil { + return x.File + } + return nil +} + +func (x *ReporterExtension) GetSession() *ReporterSession { + if x != nil { + return x.Session + } + return nil +} + +func (x *ReporterExtension) GetDevice() *ReporterDevice { + if x != nil { + return x.Device + } + return nil +} + +type ReporterGit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Repository string `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` + Branch string `protobuf:"bytes,2,opt,name=branch,proto3" json:"branch,omitempty"` + Commit string `protobuf:"bytes,3,opt,name=commit,proto3" json:"commit,omitempty"` +} + +func (x *ReporterGit) Reset() { + *x = ReporterGit{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReporterGit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReporterGit) ProtoMessage() {} + +func (x *ReporterGit) ProtoReflect() protoreflect.Message { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReporterGit.ProtoReflect.Descriptor instead. +func (*ReporterGit) Descriptor() ([]byte, []int) { + return file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP(), []int{4} +} + +func (x *ReporterGit) GetRepository() string { + if x != nil { + return x.Repository + } + return "" +} + +func (x *ReporterGit) GetBranch() string { + if x != nil { + return x.Branch + } + return "" +} + +func (x *ReporterGit) GetCommit() string { + if x != nil { + return x.Commit + } + return "" +} + +type ReporterSession struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlainOutput []byte `protobuf:"bytes,1,opt,name=plain_output,json=plainOutput,proto3" json:"plain_output,omitempty"` + MaskedOutput []byte `protobuf:"bytes,2,opt,name=masked_output,json=maskedOutput,proto3" json:"masked_output,omitempty"` +} + +func (x *ReporterSession) Reset() { + *x = ReporterSession{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReporterSession) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReporterSession) ProtoMessage() {} + +func (x *ReporterSession) ProtoReflect() protoreflect.Message { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReporterSession.ProtoReflect.Descriptor instead. +func (*ReporterSession) Descriptor() ([]byte, []int) { + return file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP(), []int{5} +} + +func (x *ReporterSession) GetPlainOutput() []byte { + if x != nil { + return x.PlainOutput + } + return nil +} + +func (x *ReporterSession) GetMaskedOutput() []byte { + if x != nil { + return x.MaskedOutput + } + return nil +} + +type ReporterFile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *ReporterFile) Reset() { + *x = ReporterFile{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReporterFile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReporterFile) ProtoMessage() {} + +func (x *ReporterFile) ProtoReflect() protoreflect.Message { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReporterFile.ProtoReflect.Descriptor instead. +func (*ReporterFile) Descriptor() ([]byte, []int) { + return file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP(), []int{6} +} + +func (x *ReporterFile) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *ReporterFile) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +type ReporterDevice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MacAddress string `protobuf:"bytes,1,opt,name=mac_address,json=macAddress,proto3" json:"mac_address,omitempty"` + Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"` + Platform string `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"` + Release string `protobuf:"bytes,4,opt,name=release,proto3" json:"release,omitempty"` + Arch string `protobuf:"bytes,5,opt,name=arch,proto3" json:"arch,omitempty"` + Vendor string `protobuf:"bytes,6,opt,name=vendor,proto3" json:"vendor,omitempty"` + Shell string `protobuf:"bytes,7,opt,name=shell,proto3" json:"shell,omitempty"` + VsAppHost string `protobuf:"bytes,8,opt,name=vs_app_host,json=vsAppHost,proto3" json:"vs_app_host,omitempty"` + VsAppName string `protobuf:"bytes,9,opt,name=vs_app_name,json=vsAppName,proto3" json:"vs_app_name,omitempty"` + VsAppSessionId string `protobuf:"bytes,10,opt,name=vs_app_session_id,json=vsAppSessionId,proto3" json:"vs_app_session_id,omitempty"` + VsMachineId string `protobuf:"bytes,11,opt,name=vs_machine_id,json=vsMachineId,proto3" json:"vs_machine_id,omitempty"` + VsMetadata map[string]string `protobuf:"bytes,12,rep,name=vs_metadata,json=vsMetadata,proto3" json:"vs_metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ReporterDevice) Reset() { + *x = ReporterDevice{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReporterDevice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReporterDevice) ProtoMessage() {} + +func (x *ReporterDevice) ProtoReflect() protoreflect.Message { + mi := &file_runme_reporter_v1alpha1_reporter_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReporterDevice.ProtoReflect.Descriptor instead. +func (*ReporterDevice) Descriptor() ([]byte, []int) { + return file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP(), []int{7} +} + +func (x *ReporterDevice) GetMacAddress() string { + if x != nil { + return x.MacAddress + } + return "" +} + +func (x *ReporterDevice) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *ReporterDevice) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *ReporterDevice) GetRelease() string { + if x != nil { + return x.Release + } + return "" +} + +func (x *ReporterDevice) GetArch() string { + if x != nil { + return x.Arch + } + return "" +} + +func (x *ReporterDevice) GetVendor() string { + if x != nil { + return x.Vendor + } + return "" +} + +func (x *ReporterDevice) GetShell() string { + if x != nil { + return x.Shell + } + return "" +} + +func (x *ReporterDevice) GetVsAppHost() string { + if x != nil { + return x.VsAppHost + } + return "" +} + +func (x *ReporterDevice) GetVsAppName() string { + if x != nil { + return x.VsAppName + } + return "" +} + +func (x *ReporterDevice) GetVsAppSessionId() string { + if x != nil { + return x.VsAppSessionId + } + return "" +} + +func (x *ReporterDevice) GetVsMachineId() string { + if x != nil { + return x.VsMachineId + } + return "" +} + +func (x *ReporterDevice) GetVsMetadata() map[string]string { + if x != nil { + return x.VsMetadata + } + return nil +} + +var File_runme_reporter_v1alpha1_reporter_proto protoreflect.FileDescriptor + +var file_runme_reporter_v1alpha1_reporter_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x1a, 0x1c, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x9b, 0x01, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x70, + 0x61, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, + 0x6b, 0x52, 0x08, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x12, 0x50, 0x0a, 0x09, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, + 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, + 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xe8, 0x08, + 0x0a, 0x19, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x6f, 0x5f, 0x73, 0x61, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, + 0x52, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x53, 0x61, 0x76, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, + 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x88, + 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x02, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, + 0x1b, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, + 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x04, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x26, + 0x0a, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0c, 0x48, 0x05, 0x52, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, + 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x06, 0x52, 0x0b, + 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x88, 0x01, 0x01, 0x12, 0x28, + 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x07, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x08, 0x52, + 0x0a, 0x6d, 0x61, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1f, + 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, + 0x1f, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x0a, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x88, 0x01, 0x01, + 0x12, 0x1d, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x0b, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x88, 0x01, 0x01, 0x12, + 0x17, 0x0a, 0x04, 0x61, 0x72, 0x63, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x48, 0x0c, 0x52, + 0x04, 0x61, 0x72, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, + 0x6f, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x48, 0x0d, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, + 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x0e, 0x52, 0x05, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x88, 0x01, 0x01, + 0x12, 0x23, 0x0a, 0x0b, 0x76, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x09, 0x48, 0x0f, 0x52, 0x09, 0x76, 0x73, 0x41, 0x70, 0x70, 0x48, 0x6f, + 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0b, 0x76, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x48, 0x10, 0x52, 0x09, 0x76, 0x73, + 0x41, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x11, 0x76, 0x73, + 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x09, 0x48, 0x11, 0x52, 0x0e, 0x76, 0x73, 0x41, 0x70, 0x70, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0d, 0x76, 0x73, + 0x5f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x12, 0x52, 0x0b, 0x76, 0x73, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x63, 0x0a, 0x0b, 0x76, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, + 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x73, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x76, 0x73, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3d, 0x0a, 0x0f, 0x56, 0x73, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x75, 0x74, 0x6f, + 0x5f, 0x73, 0x61, 0x76, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x42, + 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x66, 0x69, 0x6c, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x70, 0x6c, + 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6d, + 0x61, 0x73, 0x6b, 0x65, 0x64, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x42, 0x0e, 0x0a, 0x0c, + 0x5f, 0x6d, 0x61, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x0b, 0x0a, 0x09, + 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x42, 0x09, 0x0a, 0x07, 0x5f, + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x73, 0x68, 0x65, 0x6c, 0x6c, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x76, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x6f, 0x73, 0x74, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x76, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x76, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x76, 0x73, 0x5f, 0x6d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x22, 0x94, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, + 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x52, 0x08, 0x6e, 0x6f, 0x74, + 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x12, 0x48, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, + 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, + 0xa8, 0x02, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x73, 0x61, + 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x53, 0x61, + 0x76, 0x65, 0x12, 0x36, 0x0a, 0x03, 0x67, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x72, 0x47, 0x69, 0x74, 0x52, 0x03, 0x67, 0x69, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x66, 0x69, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, + 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x65, 0x52, + 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x06, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x75, 0x6e, 0x6d, + 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x5d, 0x0a, 0x0b, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x47, 0x69, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0x59, 0x0a, 0x0f, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, + 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, + 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x22, 0x3c, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, + 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x22, 0xed, 0x03, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x63, 0x68, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, + 0x6e, 0x64, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x12, 0x1e, 0x0a, 0x0b, 0x76, 0x73, + 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x76, 0x73, 0x41, 0x70, 0x70, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x76, 0x73, + 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x76, 0x73, 0x41, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x11, 0x76, 0x73, + 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x73, 0x41, 0x70, 0x70, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x76, 0x73, 0x5f, 0x6d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x76, 0x73, + 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x58, 0x0a, 0x0b, 0x76, 0x73, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, + 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x76, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x1a, 0x3d, 0x0a, 0x0f, 0x56, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x32, 0x75, 0x0a, 0x0f, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, + 0x72, 0x6d, 0x12, 0x29, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, + 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5c, 0x5a, 0x5a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, + 0x2f, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x72, + 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_runme_reporter_v1alpha1_reporter_proto_rawDescOnce sync.Once + file_runme_reporter_v1alpha1_reporter_proto_rawDescData = file_runme_reporter_v1alpha1_reporter_proto_rawDesc +) + +func file_runme_reporter_v1alpha1_reporter_proto_rawDescGZIP() []byte { + file_runme_reporter_v1alpha1_reporter_proto_rawDescOnce.Do(func() { + file_runme_reporter_v1alpha1_reporter_proto_rawDescData = protoimpl.X.CompressGZIP(file_runme_reporter_v1alpha1_reporter_proto_rawDescData) + }) + return file_runme_reporter_v1alpha1_reporter_proto_rawDescData +} + +var file_runme_reporter_v1alpha1_reporter_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_runme_reporter_v1alpha1_reporter_proto_goTypes = []any{ + (*TransformRequest)(nil), // 0: runme.reporter.v1alpha1.TransformRequest + (*TransformRequestExtension)(nil), // 1: runme.reporter.v1alpha1.TransformRequestExtension + (*TransformResponse)(nil), // 2: runme.reporter.v1alpha1.TransformResponse + (*ReporterExtension)(nil), // 3: runme.reporter.v1alpha1.ReporterExtension + (*ReporterGit)(nil), // 4: runme.reporter.v1alpha1.ReporterGit + (*ReporterSession)(nil), // 5: runme.reporter.v1alpha1.ReporterSession + (*ReporterFile)(nil), // 6: runme.reporter.v1alpha1.ReporterFile + (*ReporterDevice)(nil), // 7: runme.reporter.v1alpha1.ReporterDevice + nil, // 8: runme.reporter.v1alpha1.TransformRequestExtension.VsMetadataEntry + nil, // 9: runme.reporter.v1alpha1.ReporterDevice.VsMetadataEntry + (*v1.Notebook)(nil), // 10: runme.parser.v1.Notebook +} +var file_runme_reporter_v1alpha1_reporter_proto_depIdxs = []int32{ + 10, // 0: runme.reporter.v1alpha1.TransformRequest.notebook:type_name -> runme.parser.v1.Notebook + 1, // 1: runme.reporter.v1alpha1.TransformRequest.extension:type_name -> runme.reporter.v1alpha1.TransformRequestExtension + 8, // 2: runme.reporter.v1alpha1.TransformRequestExtension.vs_metadata:type_name -> runme.reporter.v1alpha1.TransformRequestExtension.VsMetadataEntry + 10, // 3: runme.reporter.v1alpha1.TransformResponse.notebook:type_name -> runme.parser.v1.Notebook + 3, // 4: runme.reporter.v1alpha1.TransformResponse.extension:type_name -> runme.reporter.v1alpha1.ReporterExtension + 4, // 5: runme.reporter.v1alpha1.ReporterExtension.git:type_name -> runme.reporter.v1alpha1.ReporterGit + 6, // 6: runme.reporter.v1alpha1.ReporterExtension.file:type_name -> runme.reporter.v1alpha1.ReporterFile + 5, // 7: runme.reporter.v1alpha1.ReporterExtension.session:type_name -> runme.reporter.v1alpha1.ReporterSession + 7, // 8: runme.reporter.v1alpha1.ReporterExtension.device:type_name -> runme.reporter.v1alpha1.ReporterDevice + 9, // 9: runme.reporter.v1alpha1.ReporterDevice.vs_metadata:type_name -> runme.reporter.v1alpha1.ReporterDevice.VsMetadataEntry + 0, // 10: runme.reporter.v1alpha1.ReporterService.Transform:input_type -> runme.reporter.v1alpha1.TransformRequest + 2, // 11: runme.reporter.v1alpha1.ReporterService.Transform:output_type -> runme.reporter.v1alpha1.TransformResponse + 11, // [11:12] is the sub-list for method output_type + 10, // [10:11] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_runme_reporter_v1alpha1_reporter_proto_init() } +func file_runme_reporter_v1alpha1_reporter_proto_init() { + if File_runme_reporter_v1alpha1_reporter_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*TransformRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*TransformRequestExtension); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*TransformResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*ReporterExtension); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*ReporterGit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*ReporterSession); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*ReporterFile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*ReporterDevice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_runme_reporter_v1alpha1_reporter_proto_msgTypes[1].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_runme_reporter_v1alpha1_reporter_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_runme_reporter_v1alpha1_reporter_proto_goTypes, + DependencyIndexes: file_runme_reporter_v1alpha1_reporter_proto_depIdxs, + MessageInfos: file_runme_reporter_v1alpha1_reporter_proto_msgTypes, + }.Build() + File_runme_reporter_v1alpha1_reporter_proto = out.File + file_runme_reporter_v1alpha1_reporter_proto_rawDesc = nil + file_runme_reporter_v1alpha1_reporter_proto_goTypes = nil + file_runme_reporter_v1alpha1_reporter_proto_depIdxs = nil +} diff --git a/pkg/api/gen/proto/go/runme/reporter/v1alpha1/reporter_grpc.pb.go b/pkg/api/gen/proto/go/runme/reporter/v1alpha1/reporter_grpc.pb.go new file mode 100644 index 000000000..bdabc9af1 --- /dev/null +++ b/pkg/api/gen/proto/go/runme/reporter/v1alpha1/reporter_grpc.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: runme/reporter/v1alpha1/reporter.proto + +package reporterv1alpha1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + ReporterService_Transform_FullMethodName = "/runme.reporter.v1alpha1.ReporterService/Transform" +) + +// ReporterServiceClient is the client API for ReporterService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ReporterServiceClient interface { + Transform(ctx context.Context, in *TransformRequest, opts ...grpc.CallOption) (*TransformResponse, error) +} + +type reporterServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewReporterServiceClient(cc grpc.ClientConnInterface) ReporterServiceClient { + return &reporterServiceClient{cc} +} + +func (c *reporterServiceClient) Transform(ctx context.Context, in *TransformRequest, opts ...grpc.CallOption) (*TransformResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TransformResponse) + err := c.cc.Invoke(ctx, ReporterService_Transform_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReporterServiceServer is the server API for ReporterService service. +// All implementations must embed UnimplementedReporterServiceServer +// for forward compatibility. +type ReporterServiceServer interface { + Transform(context.Context, *TransformRequest) (*TransformResponse, error) + mustEmbedUnimplementedReporterServiceServer() +} + +// UnimplementedReporterServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedReporterServiceServer struct{} + +func (UnimplementedReporterServiceServer) Transform(context.Context, *TransformRequest) (*TransformResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Transform not implemented") +} +func (UnimplementedReporterServiceServer) mustEmbedUnimplementedReporterServiceServer() {} +func (UnimplementedReporterServiceServer) testEmbeddedByValue() {} + +// UnsafeReporterServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ReporterServiceServer will +// result in compilation errors. +type UnsafeReporterServiceServer interface { + mustEmbedUnimplementedReporterServiceServer() +} + +func RegisterReporterServiceServer(s grpc.ServiceRegistrar, srv ReporterServiceServer) { + // If the following call pancis, it indicates UnimplementedReporterServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&ReporterService_ServiceDesc, srv) +} + +func _ReporterService_Transform_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TransformRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReporterServiceServer).Transform(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ReporterService_Transform_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReporterServiceServer).Transform(ctx, req.(*TransformRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ReporterService_ServiceDesc is the grpc.ServiceDesc for ReporterService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ReporterService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "runme.reporter.v1alpha1.ReporterService", + HandlerType: (*ReporterServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Transform", + Handler: _ReporterService_Transform_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "runme/reporter/v1alpha1/reporter.proto", +} diff --git a/pkg/api/gen/proto/gql/runme/reporter/v1alpha1/reporter.graphql b/pkg/api/gen/proto/gql/runme/reporter/v1alpha1/reporter.graphql new file mode 100644 index 000000000..2ec5a72c9 --- /dev/null +++ b/pkg/api/gen/proto/gql/runme/reporter/v1alpha1/reporter.graphql @@ -0,0 +1,317 @@ +directive @ReporterService on FIELD_DEFINITION +""" + Wrapper message for `bool`. + + The JSON representation for `BoolValue` is JSON `true` and `false`. + +""" +type BoolValue { + """ + The bool value. + + """ + value: Boolean +} +""" + Wrapper message for `bool`. + + The JSON representation for `BoolValue` is JSON `true` and `false`. + +""" +input BoolValueInput { + """ + The bool value. + + """ + value: Boolean +} +scalar Bytes +type Cell { + kind: CellKind + value: String + languageId: String + metadata: [Cell_MetadataEntry!] + textRange: TextRange + outputs: [CellOutput!] + executionSummary: CellExecutionSummary +} +type CellExecutionSummary { + executionOrder: UInt32Value + success: BoolValue + timing: ExecutionSummaryTiming +} +input CellExecutionSummaryInput { + executionOrder: UInt32ValueInput + success: BoolValueInput + timing: ExecutionSummaryTimingInput +} +input CellInput { + kind: CellKind + value: String + languageId: String + metadata: [Cell_MetadataEntryInput!] + textRange: TextRangeInput + outputs: [CellOutputInput!] + executionSummary: CellExecutionSummaryInput +} +enum CellKind { + CELL_KIND_UNSPECIFIED + CELL_KIND_MARKUP + CELL_KIND_CODE +} +type CellOutput { + items: [CellOutputItem!] + metadata: [CellOutput_MetadataEntry!] + processInfo: CellOutputProcessInfo +} +input CellOutputInput { + items: [CellOutputItemInput!] + metadata: [CellOutput_MetadataEntryInput!] + processInfo: CellOutputProcessInfoInput +} +type CellOutputItem { + data: Bytes + type: String + mime: String +} +input CellOutputItemInput { + data: Bytes + type: String + mime: String +} +type CellOutputProcessInfo { + exitReason: ProcessInfoExitReason + pid: Int64Value +} +input CellOutputProcessInfoInput { + exitReason: ProcessInfoExitReasonInput + pid: Int64ValueInput +} +type CellOutput_MetadataEntry { + key: String + value: String +} +input CellOutput_MetadataEntryInput { + key: String + value: String +} +type Cell_MetadataEntry { + key: String + value: String +} +input Cell_MetadataEntryInput { + key: String + value: String +} +type ExecutionSummaryTiming { + startTime: Int64Value + endTime: Int64Value +} +input ExecutionSummaryTimingInput { + startTime: Int64ValueInput + endTime: Int64ValueInput +} +type Frontmatter { + shell: String + cwd: String + skipPrompts: Boolean + runme: FrontmatterRunme + category: String + terminalRows: String +} +input FrontmatterInput { + shell: String + cwd: String + skipPrompts: Boolean + runme: FrontmatterRunmeInput + category: String + terminalRows: String +} +type FrontmatterRunme { + id: String + version: String + session: RunmeSession +} +input FrontmatterRunmeInput { + id: String + version: String + session: RunmeSessionInput +} +""" + Wrapper message for `int64`. + + The JSON representation for `Int64Value` is JSON string. + +""" +type Int64Value { + """ + The int64 value. + + """ + value: Int +} +""" + Wrapper message for `int64`. + + The JSON representation for `Int64Value` is JSON string. + +""" +input Int64ValueInput { + """ + The int64 value. + + """ + value: Int +} +type Mutation { + reporterServiceTransform(in: TransformRequestInput): TransformResponse +} +type Notebook { + cells: [Cell!] + metadata: [Notebook_MetadataEntry!] + frontmatter: Frontmatter +} +input NotebookInput { + cells: [CellInput!] + metadata: [Notebook_MetadataEntryInput!] + frontmatter: FrontmatterInput +} +type Notebook_MetadataEntry { + key: String + value: String +} +input Notebook_MetadataEntryInput { + key: String + value: String +} +type ProcessInfoExitReason { + type: String + code: UInt32Value +} +input ProcessInfoExitReasonInput { + type: String + code: UInt32ValueInput +} +type Query { + dummy: Boolean +} +type ReporterDevice { + macAddress: String + hostname: String + platform: String + release: String + arch: String + vendor: String + shell: String + vsAppHost: String + vsAppName: String + vsAppSessionId: String + vsMachineId: String + vsMetadata: [ReporterDevice_VsMetadataEntry!] +} +type ReporterDevice_VsMetadataEntry { + key: String + value: String +} +type ReporterExtension { + autoSave: Boolean + git: ReporterGit + file: ReporterFile + session: ReporterSession + device: ReporterDevice +} +type ReporterFile { + path: String + content: Bytes +} +type ReporterGit { + repository: String + branch: String + commit: String +} +type ReporterSession { + plainOutput: Bytes + maskedOutput: Bytes +} +type RunmeSession { + id: String + document: RunmeSessionDocument +} +type RunmeSessionDocument { + relativePath: String +} +input RunmeSessionDocumentInput { + relativePath: String +} +input RunmeSessionInput { + id: String + document: RunmeSessionDocumentInput +} +type TextRange { + start: Int + end: Int +} +input TextRangeInput { + start: Int + end: Int +} +input TransformRequestExtensionInput { + autoSave: Boolean + repository: String + branch: String + commit: String + filePath: String + fileContent: Bytes + plainOutput: Bytes + maskedOutput: Bytes + macAddress: String + hostname: String + platform: String + release: String + arch: String + vendor: String + shell: String + vsAppHost: String + vsAppName: String + vsAppSessionId: String + vsMachineId: String + vsMetadata: [TransformRequestExtension_VsMetadataEntryInput!] +} +input TransformRequestExtension_VsMetadataEntryInput { + key: String + value: String +} +input TransformRequestInput { + notebook: NotebookInput + extension: TransformRequestExtensionInput +} +type TransformResponse { + notebook: Notebook + extension: ReporterExtension +} +""" + Wrapper message for `uint32`. + + The JSON representation for `UInt32Value` is JSON number. + +""" +type UInt32Value { + """ + The uint32 value. + + """ + value: Int +} +""" + Wrapper message for `uint32`. + + The JSON representation for `UInt32Value` is JSON number. + +""" +input UInt32ValueInput { + """ + The uint32 value. + + """ + value: Int +} diff --git a/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.client.d.ts b/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.client.d.ts new file mode 100644 index 000000000..aa9b9f16b --- /dev/null +++ b/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.client.d.ts @@ -0,0 +1,34 @@ +/* eslint-disable */ +// @generated by protobuf-ts 2.9.4 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable +// @generated from protobuf file "runme/reporter/v1alpha1/reporter.proto" (package "runme.reporter.v1alpha1", syntax proto3) +// tslint:disable +// @ts-nocheck +import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; +import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; +import type { TransformResponse } from "./reporter_pb"; +import type { TransformRequest } from "./reporter_pb"; +import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; +import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; +/** + * @generated from protobuf service runme.reporter.v1alpha1.ReporterService + */ +export interface IReporterServiceClient { + /** + * @generated from protobuf rpc: Transform(runme.reporter.v1alpha1.TransformRequest) returns (runme.reporter.v1alpha1.TransformResponse); + */ + transform(input: TransformRequest, options?: RpcOptions): UnaryCall; +} +/** + * @generated from protobuf service runme.reporter.v1alpha1.ReporterService + */ +export declare class ReporterServiceClient implements IReporterServiceClient, ServiceInfo { + private readonly _transport; + typeName: any; + methods: any; + options: any; + constructor(_transport: RpcTransport); + /** + * @generated from protobuf rpc: Transform(runme.reporter.v1alpha1.TransformRequest) returns (runme.reporter.v1alpha1.TransformResponse); + */ + transform(input: TransformRequest, options?: RpcOptions): UnaryCall; +} diff --git a/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.client.js b/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.client.js new file mode 100644 index 000000000..03e7ab264 --- /dev/null +++ b/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.client.js @@ -0,0 +1,25 @@ +/* eslint-disable */ +// @generated by protobuf-ts 2.9.4 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable +// @generated from protobuf file "runme/reporter/v1alpha1/reporter.proto" (package "runme.reporter.v1alpha1", syntax proto3) +// tslint:disable +// @ts-nocheck +import { ReporterService } from "./reporter_pb"; +import { stackIntercept } from "@protobuf-ts/runtime-rpc"; +/** + * @generated from protobuf service runme.reporter.v1alpha1.ReporterService + */ +export class ReporterServiceClient { + constructor(_transport) { + this._transport = _transport; + this.typeName = ReporterService.typeName; + this.methods = ReporterService.methods; + this.options = ReporterService.options; + } + /** + * @generated from protobuf rpc: Transform(runme.reporter.v1alpha1.TransformRequest) returns (runme.reporter.v1alpha1.TransformResponse); + */ + transform(input, options) { + const method = this.methods[0], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } +} diff --git a/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.d.ts b/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.d.ts new file mode 100644 index 000000000..5744cca50 --- /dev/null +++ b/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.d.ts @@ -0,0 +1,304 @@ +/* eslint-disable */ +// @generated by protobuf-ts 2.9.4 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable +// @generated from protobuf file "runme/reporter/v1alpha1/reporter.proto" (package "runme.reporter.v1alpha1", syntax proto3) +// tslint:disable +// @ts-nocheck +import { MessageType } from "@protobuf-ts/runtime"; +import { Notebook } from "../../parser/v1/parser_pb"; +/** + * @generated from protobuf message runme.reporter.v1alpha1.TransformRequest + */ +export interface TransformRequest { + /** + * @generated from protobuf field: runme.parser.v1.Notebook notebook = 1; + */ + notebook?: Notebook; + /** + * @generated from protobuf field: runme.reporter.v1alpha1.TransformRequestExtension extension = 2; + */ + extension?: TransformRequestExtension; +} +/** + * @generated from protobuf message runme.reporter.v1alpha1.TransformRequestExtension + */ +export interface TransformRequestExtension { + /** + * @generated from protobuf field: optional bool auto_save = 2; + */ + autoSave?: boolean; + /** + * @generated from protobuf field: optional string repository = 3; + */ + repository?: string; + /** + * @generated from protobuf field: optional string branch = 4; + */ + branch?: string; + /** + * @generated from protobuf field: optional string commit = 5; + */ + commit?: string; + /** + * @generated from protobuf field: optional string file_path = 6; + */ + filePath?: string; + /** + * @generated from protobuf field: optional bytes file_content = 7; + */ + fileContent?: Uint8Array; + /** + * @generated from protobuf field: optional bytes plain_output = 8; + */ + plainOutput?: Uint8Array; + /** + * @generated from protobuf field: optional bytes masked_output = 9; + */ + maskedOutput?: Uint8Array; + /** + * @generated from protobuf field: optional string mac_address = 10; + */ + macAddress?: string; + /** + * @generated from protobuf field: optional string hostname = 11; + */ + hostname?: string; + /** + * @generated from protobuf field: optional string platform = 12; + */ + platform?: string; + /** + * @generated from protobuf field: optional string release = 13; + */ + release?: string; + /** + * @generated from protobuf field: optional string arch = 14; + */ + arch?: string; + /** + * @generated from protobuf field: optional string vendor = 15; + */ + vendor?: string; + /** + * @generated from protobuf field: optional string shell = 16; + */ + shell?: string; + /** + * @generated from protobuf field: optional string vs_app_host = 17; + */ + vsAppHost?: string; + /** + * @generated from protobuf field: optional string vs_app_name = 18; + */ + vsAppName?: string; + /** + * @generated from protobuf field: optional string vs_app_session_id = 19; + */ + vsAppSessionId?: string; + /** + * @generated from protobuf field: optional string vs_machine_id = 20; + */ + vsMachineId?: string; + /** + * @generated from protobuf field: map vs_metadata = 21; + */ + vsMetadata: { + [key: string]: string; + }; +} +/** + * @generated from protobuf message runme.reporter.v1alpha1.TransformResponse + */ +export interface TransformResponse { + /** + * @generated from protobuf field: runme.parser.v1.Notebook notebook = 1; + */ + notebook?: Notebook; + /** + * @generated from protobuf field: runme.reporter.v1alpha1.ReporterExtension extension = 2; + */ + extension?: ReporterExtension; +} +/** + * @generated from protobuf message runme.reporter.v1alpha1.ReporterExtension + */ +export interface ReporterExtension { + /** + * @generated from protobuf field: bool auto_save = 1; + */ + autoSave: boolean; + /** + * @generated from protobuf field: runme.reporter.v1alpha1.ReporterGit git = 2; + */ + git?: ReporterGit; + /** + * @generated from protobuf field: runme.reporter.v1alpha1.ReporterFile file = 3; + */ + file?: ReporterFile; + /** + * @generated from protobuf field: runme.reporter.v1alpha1.ReporterSession session = 4; + */ + session?: ReporterSession; + /** + * @generated from protobuf field: runme.reporter.v1alpha1.ReporterDevice device = 5; + */ + device?: ReporterDevice; +} +/** + * @generated from protobuf message runme.reporter.v1alpha1.ReporterGit + */ +export interface ReporterGit { + /** + * @generated from protobuf field: string repository = 1; + */ + repository: string; + /** + * @generated from protobuf field: string branch = 2; + */ + branch: string; + /** + * @generated from protobuf field: string commit = 3; + */ + commit: string; +} +/** + * @generated from protobuf message runme.reporter.v1alpha1.ReporterSession + */ +export interface ReporterSession { + /** + * @generated from protobuf field: bytes plain_output = 1; + */ + plainOutput: Uint8Array; + /** + * @generated from protobuf field: bytes masked_output = 2; + */ + maskedOutput: Uint8Array; +} +/** + * @generated from protobuf message runme.reporter.v1alpha1.ReporterFile + */ +export interface ReporterFile { + /** + * @generated from protobuf field: string path = 1; + */ + path: string; + /** + * @generated from protobuf field: bytes content = 2; + */ + content: Uint8Array; +} +/** + * @generated from protobuf message runme.reporter.v1alpha1.ReporterDevice + */ +export interface ReporterDevice { + /** + * @generated from protobuf field: string mac_address = 1; + */ + macAddress: string; + /** + * @generated from protobuf field: string hostname = 2; + */ + hostname: string; + /** + * @generated from protobuf field: string platform = 3; + */ + platform: string; + /** + * @generated from protobuf field: string release = 4; + */ + release: string; + /** + * @generated from protobuf field: string arch = 5; + */ + arch: string; + /** + * @generated from protobuf field: string vendor = 6; + */ + vendor: string; + /** + * @generated from protobuf field: string shell = 7; + */ + shell: string; + /** + * @generated from protobuf field: string vs_app_host = 8; + */ + vsAppHost: string; + /** + * @generated from protobuf field: string vs_app_name = 9; + */ + vsAppName: string; + /** + * @generated from protobuf field: string vs_app_session_id = 10; + */ + vsAppSessionId: string; + /** + * @generated from protobuf field: string vs_machine_id = 11; + */ + vsMachineId: string; + /** + * @generated from protobuf field: map vs_metadata = 12; + */ + vsMetadata: { + [key: string]: string; + }; +} +declare class TransformRequest$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.TransformRequest + */ +export declare const TransformRequest: TransformRequest$Type; +declare class TransformRequestExtension$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.TransformRequestExtension + */ +export declare const TransformRequestExtension: TransformRequestExtension$Type; +declare class TransformResponse$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.TransformResponse + */ +export declare const TransformResponse: TransformResponse$Type; +declare class ReporterExtension$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterExtension + */ +export declare const ReporterExtension: ReporterExtension$Type; +declare class ReporterGit$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterGit + */ +export declare const ReporterGit: ReporterGit$Type; +declare class ReporterSession$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterSession + */ +export declare const ReporterSession: ReporterSession$Type; +declare class ReporterFile$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterFile + */ +export declare const ReporterFile: ReporterFile$Type; +declare class ReporterDevice$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterDevice + */ +export declare const ReporterDevice: ReporterDevice$Type; +/** + * @generated ServiceType for protobuf service runme.reporter.v1alpha1.ReporterService + */ +export declare const ReporterService: any; +export {}; diff --git a/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.js b/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.js new file mode 100644 index 000000000..1d9f95083 --- /dev/null +++ b/pkg/api/gen/proto/ts/runme/reporter/v1alpha1/reporter_pb.js @@ -0,0 +1,155 @@ +/* eslint-disable */ +// @generated by protobuf-ts 2.9.4 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable +// @generated from protobuf file "runme/reporter/v1alpha1/reporter.proto" (package "runme.reporter.v1alpha1", syntax proto3) +// tslint:disable +// @ts-nocheck +/* eslint-disable */ +// @generated by protobuf-ts 2.9.4 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable +// @generated from protobuf file "runme/reporter/v1alpha1/reporter.proto" (package "runme.reporter.v1alpha1", syntax proto3) +// tslint:disable +// @ts-nocheck +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import { MessageType } from "@protobuf-ts/runtime"; +import { Notebook } from "../../parser/v1/parser_pb"; +// @generated message type with reflection information, may provide speed optimized methods +class TransformRequest$Type extends MessageType { + constructor() { + super("runme.reporter.v1alpha1.TransformRequest", [ + { no: 1, name: "notebook", kind: "message", T: () => Notebook }, + { no: 2, name: "extension", kind: "message", T: () => TransformRequestExtension } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.TransformRequest + */ +export const TransformRequest = new TransformRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TransformRequestExtension$Type extends MessageType { + constructor() { + super("runme.reporter.v1alpha1.TransformRequestExtension", [ + { no: 2, name: "auto_save", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "repository", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "branch", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "commit", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "file_path", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "file_content", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, + { no: 8, name: "plain_output", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, + { no: 9, name: "masked_output", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, + { no: 10, name: "mac_address", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "hostname", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "platform", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: "release", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 14, name: "arch", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: "vendor", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 16, name: "shell", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 17, name: "vs_app_host", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 18, name: "vs_app_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 19, name: "vs_app_session_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 20, name: "vs_machine_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 21, name: "vs_metadata", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.TransformRequestExtension + */ +export const TransformRequestExtension = new TransformRequestExtension$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TransformResponse$Type extends MessageType { + constructor() { + super("runme.reporter.v1alpha1.TransformResponse", [ + { no: 1, name: "notebook", kind: "message", T: () => Notebook }, + { no: 2, name: "extension", kind: "message", T: () => ReporterExtension } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.TransformResponse + */ +export const TransformResponse = new TransformResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReporterExtension$Type extends MessageType { + constructor() { + super("runme.reporter.v1alpha1.ReporterExtension", [ + { no: 1, name: "auto_save", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "git", kind: "message", T: () => ReporterGit }, + { no: 3, name: "file", kind: "message", T: () => ReporterFile }, + { no: 4, name: "session", kind: "message", T: () => ReporterSession }, + { no: 5, name: "device", kind: "message", T: () => ReporterDevice } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterExtension + */ +export const ReporterExtension = new ReporterExtension$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReporterGit$Type extends MessageType { + constructor() { + super("runme.reporter.v1alpha1.ReporterGit", [ + { no: 1, name: "repository", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "branch", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "commit", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterGit + */ +export const ReporterGit = new ReporterGit$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReporterSession$Type extends MessageType { + constructor() { + super("runme.reporter.v1alpha1.ReporterSession", [ + { no: 1, name: "plain_output", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "masked_output", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterSession + */ +export const ReporterSession = new ReporterSession$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReporterFile$Type extends MessageType { + constructor() { + super("runme.reporter.v1alpha1.ReporterFile", [ + { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "content", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterFile + */ +export const ReporterFile = new ReporterFile$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReporterDevice$Type extends MessageType { + constructor() { + super("runme.reporter.v1alpha1.ReporterDevice", [ + { no: 1, name: "mac_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "hostname", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "platform", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "release", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "arch", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "vendor", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "shell", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "vs_app_host", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "vs_app_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "vs_app_session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "vs_machine_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "vs_metadata", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.reporter.v1alpha1.ReporterDevice + */ +export const ReporterDevice = new ReporterDevice$Type(); +/** + * @generated ServiceType for protobuf service runme.reporter.v1alpha1.ReporterService + */ +export const ReporterService = new ServiceType("runme.reporter.v1alpha1.ReporterService", [ + { name: "Transform", options: {}, I: TransformRequest, O: TransformResponse } +]); diff --git a/pkg/api/proto/runme/reporter/v1alpha1/reporter.proto b/pkg/api/proto/runme/reporter/v1alpha1/reporter.proto new file mode 100644 index 000000000..bd5640115 --- /dev/null +++ b/pkg/api/proto/runme/reporter/v1alpha1/reporter.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package runme.reporter.v1alpha1; + +import "runme/parser/v1/parser.proto"; + +option go_package = "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/reporter/v1alpha1;reporterv1alpha1"; + +message TransformRequest { + runme.parser.v1.Notebook notebook = 1; + TransformRequestExtension extension = 2; +} + +message TransformRequestExtension { + optional bool auto_save = 2; + optional string repository = 3; + optional string branch = 4; + optional string commit = 5; + optional string file_path = 6; + optional bytes file_content = 7; + optional bytes plain_output = 8; + optional bytes masked_output = 9; + optional string mac_address = 10; + optional string hostname = 11; + optional string platform = 12; + optional string release = 13; + optional string arch = 14; + optional string vendor = 15; + optional string shell = 16; + optional string vs_app_host = 17; + optional string vs_app_name = 18; + optional string vs_app_session_id = 19; + optional string vs_machine_id = 20; + map vs_metadata = 21; +} + +message TransformResponse { + runme.parser.v1.Notebook notebook = 1; + ReporterExtension extension = 2; +} + +message ReporterExtension { + bool auto_save = 1; + ReporterGit git = 2; + ReporterFile file = 3; + ReporterSession session = 4; + ReporterDevice device = 5; +} + +message ReporterGit { + string repository = 1; + string branch = 2; + string commit = 3; +} + +message ReporterSession { + bytes plain_output = 1; + bytes masked_output = 2; +} + +message ReporterFile { + string path = 1; + bytes content = 2; +} + +message ReporterDevice { + string mac_address = 1; + string hostname = 2; + string platform = 3; + string release = 4; + string arch = 5; + string vendor = 6; + string shell = 7; + string vs_app_host = 8; + string vs_app_name = 9; + string vs_app_session_id = 10; + string vs_machine_id = 11; + map vs_metadata = 12; +} + +service ReporterService { + rpc Transform(TransformRequest) returns (TransformResponse); +} diff --git a/pkg/document/editor/reporterservice/service.go b/pkg/document/editor/reporterservice/service.go new file mode 100644 index 000000000..c5eb1ef41 --- /dev/null +++ b/pkg/document/editor/reporterservice/service.go @@ -0,0 +1,94 @@ +package reporterservice + +import ( + "context" + + "go.uber.org/zap" + + parserv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/parser/v1" + reporterv1alpha1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/reporter/v1alpha1" +) + +type reporterServiceServer struct { + reporterv1alpha1.UnimplementedReporterServiceServer + + logger *zap.Logger +} + +func NewReporterServiceServer(logger *zap.Logger) reporterv1alpha1.ReporterServiceServer { + return &reporterServiceServer{logger: logger} +} + +func (s *reporterServiceServer) Transform(ctx context.Context, req *reporterv1alpha1.TransformRequest) (*reporterv1alpha1.TransformResponse, error) { + + var notebook = &parserv1.Notebook{ + Metadata: req.Notebook.Metadata, + Frontmatter: req.Notebook.Frontmatter, + Cells: make([]*parserv1.Cell, len(req.Notebook.Cells)), + } + + for i, cell := range req.Notebook.Cells { + notebook.Cells[i] = &parserv1.Cell{ + Kind: cell.Kind, + Value: cell.Value, + LanguageId: cell.LanguageId, + Metadata: cell.Metadata, + TextRange: cell.TextRange, + ExecutionSummary: cell.ExecutionSummary, + Outputs: make([]*parserv1.CellOutput, len(cell.Outputs)), + } + + for j, output := range cell.Outputs { + var filteredItems []*parserv1.CellOutputItem + + for _, item := range output.Items { + // Only keep stdout items + if item.Mime == "application/vnd.code.notebook.stdout" { + filteredItems = append(filteredItems, item) + } + } + + notebook.Cells[i].Outputs[j] = &parserv1.CellOutput{ + ProcessInfo: output.ProcessInfo, + Metadata: output.Metadata, + Items: filteredItems, + } + + } + + } + + return &reporterv1alpha1.TransformResponse{ + Notebook: notebook, + Extension: &reporterv1alpha1.ReporterExtension{ + AutoSave: *req.Extension.AutoSave, + Git: &reporterv1alpha1.ReporterGit{ + Repository: *req.Extension.Repository, + Branch: *req.Extension.Branch, + Commit: *req.Extension.Commit, + }, + File: &reporterv1alpha1.ReporterFile{ + Path: *req.Extension.FilePath, + Content: req.Extension.FileContent, + }, + Session: &reporterv1alpha1.ReporterSession{ + PlainOutput: req.Extension.PlainOutput, + MaskedOutput: req.Extension.MaskedOutput, + }, + Device: &reporterv1alpha1.ReporterDevice{ + MacAddress: *req.Extension.MacAddress, + Hostname: *req.Extension.Hostname, + Platform: *req.Extension.Platform, + Release: *req.Extension.Release, + Arch: *req.Extension.Arch, + Vendor: *req.Extension.Vendor, + Shell: *req.Extension.Shell, + VsAppHost: *req.Extension.VsAppHost, + VsAppName: *req.Extension.VsAppName, + VsAppSessionId: *req.Extension.VsAppSessionId, + VsMachineId: *req.Extension.VsMachineId, + VsMetadata: req.Extension.VsMetadata, + }, + }, + }, nil +} diff --git a/pkg/document/editor/reporterservice/service_test.go b/pkg/document/editor/reporterservice/service_test.go new file mode 100644 index 000000000..eee779622 --- /dev/null +++ b/pkg/document/editor/reporterservice/service_test.go @@ -0,0 +1,159 @@ +package reporterservice + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "go.uber.org/zap/zaptest" + "google.golang.org/protobuf/types/known/wrapperspb" + + parserv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/parser/v1" + reporterv1alpha1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/reporter/v1alpha1" +) + +func TestTransform(t *testing.T) { + logger := zaptest.NewLogger(t) + server := NewReporterServiceServer(logger) + + req := &reporterv1alpha1.TransformRequest{ + Notebook: &parserv1.Notebook{ + Metadata: map[string]string{ + "key1": "value1", + }, + Frontmatter: &parserv1.Frontmatter{ + Shell: "shell", + Cwd: "/path/to/cwd", + SkipPrompts: false, + Runme: &parserv1.FrontmatterRunme{ + Id: "runme-id", + Version: "runme-version", + Session: &parserv1.RunmeSession{ + Id: "session-id", + Document: &parserv1.RunmeSessionDocument{ + RelativePath: "relative-path", + }, + }, + }, + Category: "category", + TerminalRows: "10", + }, + Cells: []*parserv1.Cell{ + { + Kind: 1, + Value: "print('hello world')", + LanguageId: "python", + Metadata: map[string]string{"key1": "value1"}, + TextRange: &parserv1.TextRange{ + Start: uint32(1), + End: uint32(2), + }, + ExecutionSummary: &parserv1.CellExecutionSummary{ + ExecutionOrder: wrapperspb.UInt32(1), + Success: &wrapperspb.BoolValue{Value: true}, + Timing: &parserv1.ExecutionSummaryTiming{ + StartTime: &wrapperspb.Int64Value{ + Value: 1630454400, + }, + EndTime: &wrapperspb.Int64Value{ + Value: 1630454400, + }, + }, + }, + Outputs: []*parserv1.CellOutput{ + { + ProcessInfo: &parserv1.CellOutputProcessInfo{ + Pid: &wrapperspb.Int64Value{ + Value: 123, + }, + ExitReason: &parserv1.ProcessInfoExitReason{ + Type: "success", + Code: &wrapperspb.UInt32Value{ + Value: 0, + }, + }, + }, + Metadata: map[string]string{"key1": "value1"}, + Items: []*parserv1.CellOutputItem{ + { + Mime: "application/vnd.code.notebook.stdout", + Data: []byte("output-data-1"), + }, + { + Mime: "application/vnd.code.notebook.stderr", + Data: []byte("output-data-2"), + }, + }, + }, + }, + }, + }, + }, + Extension: &reporterv1alpha1.TransformRequestExtension{ + AutoSave: boolPtr(true), + Repository: stringPtr("repo-url"), + Branch: stringPtr("main"), + Commit: stringPtr("commit-id"), + FilePath: stringPtr("/path/to/file"), + FileContent: []byte("file-content"), + PlainOutput: []byte("plain-output"), + MaskedOutput: []byte("masked-output"), + MacAddress: stringPtr("00:00:00:00:00:00"), + Hostname: stringPtr("hostname"), + Platform: stringPtr("platform"), + Release: stringPtr("release"), + Arch: stringPtr("arch"), + Vendor: stringPtr("vendor"), + Shell: stringPtr("shell"), + VsAppHost: stringPtr("host"), + VsAppName: stringPtr("VSCode"), + VsAppSessionId: stringPtr("session-id"), + VsMachineId: stringPtr("machine-id"), + VsMetadata: map[string]string{ + "key1": "value1", + "key2": "value2", + }, + }, + } + + resp, err := server.Transform(context.Background(), req) + + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.Equal(t, req.Notebook.Metadata, resp.Notebook.Metadata) + assert.Equal(t, req.Notebook.Frontmatter, resp.Notebook.Frontmatter) + assert.Equal(t, len(req.Notebook.Cells), len(resp.Notebook.Cells)) + + // It should only include "application/vnd.code.notebook.stdout" mime type items + assert.Equal(t, 1, len(resp.Notebook.Cells[0].Outputs[0].Items)) + assert.Equal(t, "application/vnd.code.notebook.stdout", resp.Notebook.Cells[0].Outputs[0].Items[0].Mime) + + assert.Equal(t, req.Extension.AutoSave, &resp.Extension.AutoSave) + assert.Equal(t, req.Extension.Repository, &resp.Extension.Git.Repository) + assert.Equal(t, req.Extension.Branch, &resp.Extension.Git.Branch) + assert.Equal(t, req.Extension.Commit, &resp.Extension.Git.Commit) + assert.Equal(t, req.Extension.FilePath, &resp.Extension.File.Path) + assert.Equal(t, req.Extension.FileContent, resp.Extension.File.Content) + assert.Equal(t, req.Extension.PlainOutput, resp.Extension.Session.PlainOutput) + assert.Equal(t, req.Extension.MaskedOutput, resp.Extension.Session.MaskedOutput) + assert.Equal(t, req.Extension.MacAddress, &resp.Extension.Device.MacAddress) + assert.Equal(t, req.Extension.Hostname, &resp.Extension.Device.Hostname) + assert.Equal(t, req.Extension.Platform, &resp.Extension.Device.Platform) + assert.Equal(t, req.Extension.Release, &resp.Extension.Device.Release) + assert.Equal(t, req.Extension.Arch, &resp.Extension.Device.Arch) + assert.Equal(t, req.Extension.Vendor, &resp.Extension.Device.Vendor) + assert.Equal(t, req.Extension.Shell, &resp.Extension.Device.Shell) + assert.Equal(t, req.Extension.VsAppHost, &resp.Extension.Device.VsAppHost) + assert.Equal(t, req.Extension.VsAppName, &resp.Extension.Device.VsAppName) + assert.Equal(t, req.Extension.VsAppSessionId, &resp.Extension.Device.VsAppSessionId) + assert.Equal(t, req.Extension.VsMachineId, &resp.Extension.Device.VsMachineId) + assert.Equal(t, req.Extension.VsMetadata, resp.Extension.Device.VsMetadata) +} + +func boolPtr(b bool) *bool { + return &b +} + +func stringPtr(s string) *string { + return &s +}