From 3bcfc11a80c735e2880605d6c0165d6fb507ea25 Mon Sep 17 00:00:00 2001 From: hiddify <114227601+hiddify-com@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:27:18 +0200 Subject: [PATCH] remove Button Field --- extension/extension.go | 9 +- extension/extension_host.go | 4 +- extension/html/rpc.js | 226 ++++++++++++++++- extension/html/rpc/extension_grpc_web_pb.js | 10 +- extension/html/rpc/extension_pb.js | 216 ++++++++++++++++ extension/ui/base.go | 4 +- hiddifyrpc/extension.pb.go | 260 +++++++++++++------- hiddifyrpc/extension.proto | 8 +- hiddifyrpc/extension_grpc.pb.go | 12 +- 9 files changed, 643 insertions(+), 106 deletions(-) diff --git a/extension/extension.go b/extension/extension.go index c29c58a..454d602 100644 --- a/extension/extension.go +++ b/extension/extension.go @@ -88,7 +88,14 @@ func (e *Base[T]) ShowMessage(title string, msg string) error { return e.ShowDialog(ui.Form{ Title: title, Description: msg, - Buttons: []string{ui.Button_Ok}, + Fields: [][]ui.FormField{ + {{ + Type: ui.FieldButton, + Key: ui.Button_Ok, + Label: "Ok", + }}, + }, + // Buttons: []string{ui.Button_Ok}, }) } diff --git a/extension/extension_host.go b/extension/extension_host.go index 6d8902c..d6d5d82 100644 --- a/extension/extension_host.go +++ b/extension/extension_host.go @@ -72,7 +72,7 @@ func (e ExtensionHostService) Connect(req *pb.ExtensionRequest, stream grpc.Serv } } -func (e ExtensionHostService) SubmitForm(ctx context.Context, req *pb.ExtensionRequest) (*pb.ExtensionActionResult, error) { +func (e ExtensionHostService) SubmitForm(ctx context.Context, req *pb.SendExtensionDataRequest) (*pb.ExtensionActionResult, error) { extension, err := getExtension(req.GetExtensionId()) if err != nil { log.Println(err) @@ -82,7 +82,7 @@ func (e ExtensionHostService) SubmitForm(ctx context.Context, req *pb.ExtensionR Message: err.Error(), }, err } - (*extension).SubmitData(req.GetData()) + (*extension).SubmitData(req.Button, req.GetData()) return &pb.ExtensionActionResult{ ExtensionId: req.ExtensionId, diff --git a/extension/html/rpc.js b/extension/html/rpc.js index 1679b1f..9ab68f2 100644 --- a/extension/html/rpc.js +++ b/extension/html/rpc.js @@ -1039,16 +1039,16 @@ proto.hiddifyrpc.ExtensionHostServicePromiseClient.prototype.editExtension = /** * @const * @type {!grpc.web.MethodDescriptor< - * !proto.hiddifyrpc.ExtensionRequest, + * !proto.hiddifyrpc.SendExtensionDataRequest, * !proto.hiddifyrpc.ExtensionActionResult>} */ const methodDescriptor_ExtensionHostService_SubmitForm = new grpc.web.MethodDescriptor( '/hiddifyrpc.ExtensionHostService/SubmitForm', grpc.web.MethodType.UNARY, - proto.hiddifyrpc.ExtensionRequest, + proto.hiddifyrpc.SendExtensionDataRequest, proto.hiddifyrpc.ExtensionActionResult, /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request * @return {!Uint8Array} */ function(request) { @@ -1059,7 +1059,7 @@ const methodDescriptor_ExtensionHostService_SubmitForm = new grpc.web.MethodDesc /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request The * request proto * @param {?Object} metadata User defined * call metadata @@ -1080,7 +1080,7 @@ proto.hiddifyrpc.ExtensionHostServiceClient.prototype.submitForm = /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata @@ -1316,6 +1316,7 @@ goog.exportSymbol('proto.hiddifyrpc.ExtensionList', null, global); goog.exportSymbol('proto.hiddifyrpc.ExtensionRequest', null, global); goog.exportSymbol('proto.hiddifyrpc.ExtensionResponse', null, global); goog.exportSymbol('proto.hiddifyrpc.ExtensionResponseType', null, global); +goog.exportSymbol('proto.hiddifyrpc.SendExtensionDataRequest', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -1421,6 +1422,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.hiddifyrpc.ExtensionRequest.displayName = 'proto.hiddifyrpc.ExtensionRequest'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.hiddifyrpc.SendExtensionDataRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.hiddifyrpc.SendExtensionDataRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.hiddifyrpc.SendExtensionDataRequest.displayName = 'proto.hiddifyrpc.SendExtensionDataRequest'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -2339,6 +2361,200 @@ proto.hiddifyrpc.ExtensionRequest.prototype.clearDataMap = function() { +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.toObject = function(opt_includeInstance) { + return proto.hiddifyrpc.SendExtensionDataRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.hiddifyrpc.SendExtensionDataRequest.toObject = function(includeInstance, msg) { + var f, obj = { +extensionId: jspb.Message.getFieldWithDefault(msg, 1, ""), +button: jspb.Message.getFieldWithDefault(msg, 2, ""), +dataMap: (f = msg.getDataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} + */ +proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.hiddifyrpc.SendExtensionDataRequest; + return proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} + */ +proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setExtensionId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setButton(value); + break; + case 3: + var value = msg.getDataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.hiddifyrpc.SendExtensionDataRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.hiddifyrpc.SendExtensionDataRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getExtensionId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getButton(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string extension_id = 1; + * @return {string} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.getExtensionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.setExtensionId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string button = 2; + * @return {string} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.getButton = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.setButton = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map data = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.getDataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.clearDataMap = function() { + this.getDataMap().clear(); + return this; +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. diff --git a/extension/html/rpc/extension_grpc_web_pb.js b/extension/html/rpc/extension_grpc_web_pb.js index 4922c96..37c037c 100644 --- a/extension/html/rpc/extension_grpc_web_pb.js +++ b/extension/html/rpc/extension_grpc_web_pb.js @@ -257,16 +257,16 @@ proto.hiddifyrpc.ExtensionHostServicePromiseClient.prototype.editExtension = /** * @const * @type {!grpc.web.MethodDescriptor< - * !proto.hiddifyrpc.ExtensionRequest, + * !proto.hiddifyrpc.SendExtensionDataRequest, * !proto.hiddifyrpc.ExtensionActionResult>} */ const methodDescriptor_ExtensionHostService_SubmitForm = new grpc.web.MethodDescriptor( '/hiddifyrpc.ExtensionHostService/SubmitForm', grpc.web.MethodType.UNARY, - proto.hiddifyrpc.ExtensionRequest, + proto.hiddifyrpc.SendExtensionDataRequest, proto.hiddifyrpc.ExtensionActionResult, /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request * @return {!Uint8Array} */ function(request) { @@ -277,7 +277,7 @@ const methodDescriptor_ExtensionHostService_SubmitForm = new grpc.web.MethodDesc /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request The * request proto * @param {?Object} metadata User defined * call metadata @@ -298,7 +298,7 @@ proto.hiddifyrpc.ExtensionHostServiceClient.prototype.submitForm = /** - * @param {!proto.hiddifyrpc.ExtensionRequest} request The + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata diff --git a/extension/html/rpc/extension_pb.js b/extension/html/rpc/extension_pb.js index fb57522..a0ea9f7 100644 --- a/extension/html/rpc/extension_pb.js +++ b/extension/html/rpc/extension_pb.js @@ -30,6 +30,7 @@ goog.exportSymbol('proto.hiddifyrpc.ExtensionList', null, global); goog.exportSymbol('proto.hiddifyrpc.ExtensionRequest', null, global); goog.exportSymbol('proto.hiddifyrpc.ExtensionResponse', null, global); goog.exportSymbol('proto.hiddifyrpc.ExtensionResponseType', null, global); +goog.exportSymbol('proto.hiddifyrpc.SendExtensionDataRequest', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -135,6 +136,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.hiddifyrpc.ExtensionRequest.displayName = 'proto.hiddifyrpc.ExtensionRequest'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.hiddifyrpc.SendExtensionDataRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.hiddifyrpc.SendExtensionDataRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.hiddifyrpc.SendExtensionDataRequest.displayName = 'proto.hiddifyrpc.SendExtensionDataRequest'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -1053,6 +1075,200 @@ proto.hiddifyrpc.ExtensionRequest.prototype.clearDataMap = function() { +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.toObject = function(opt_includeInstance) { + return proto.hiddifyrpc.SendExtensionDataRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.hiddifyrpc.SendExtensionDataRequest.toObject = function(includeInstance, msg) { + var f, obj = { +extensionId: jspb.Message.getFieldWithDefault(msg, 1, ""), +button: jspb.Message.getFieldWithDefault(msg, 2, ""), +dataMap: (f = msg.getDataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} + */ +proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.hiddifyrpc.SendExtensionDataRequest; + return proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} + */ +proto.hiddifyrpc.SendExtensionDataRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setExtensionId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setButton(value); + break; + case 3: + var value = msg.getDataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.hiddifyrpc.SendExtensionDataRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.hiddifyrpc.SendExtensionDataRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.hiddifyrpc.SendExtensionDataRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getExtensionId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getButton(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string extension_id = 1; + * @return {string} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.getExtensionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.setExtensionId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string button = 2; + * @return {string} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.getButton = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.setButton = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map data = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.getDataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.hiddifyrpc.SendExtensionDataRequest} returns this + */ +proto.hiddifyrpc.SendExtensionDataRequest.prototype.clearDataMap = function() { + this.getDataMap().clear(); + return this; +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. diff --git a/extension/ui/base.go b/extension/ui/base.go index fb873c1..8cf7d25 100644 --- a/extension/ui/base.go +++ b/extension/ui/base.go @@ -24,8 +24,8 @@ const ( FieldButton string = "Button" ValidatorDigitsOnly string = "digitsOnly" - Button_Ok string = "Ok" Button_Submit string = "Submit" + Button_Ok string = "Ok" Button_Cancel string = "Cancel" ) @@ -63,7 +63,7 @@ type Form struct { Title string `json:"title"` Description string `json:"description"` Fields [][]FormField `json:"fields"` - Buttons []string `json:"buttons"` + // Buttons []string `json:"buttons"` } func (f *Form) ToJSON() string { diff --git a/hiddifyrpc/extension.pb.go b/hiddifyrpc/extension.pb.go index 385cdda..9f52a00 100644 --- a/hiddifyrpc/extension.pb.go +++ b/hiddifyrpc/extension.pb.go @@ -363,6 +363,69 @@ func (x *ExtensionRequest) GetData() map[string]string { return nil } +type SendExtensionDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"` + Button string `protobuf:"bytes,2,opt,name=button,proto3" json:"button,omitempty"` + Data map[string]string `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *SendExtensionDataRequest) Reset() { + *x = SendExtensionDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_extension_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendExtensionDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendExtensionDataRequest) ProtoMessage() {} + +func (x *SendExtensionDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_extension_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 SendExtensionDataRequest.ProtoReflect.Descriptor instead. +func (*SendExtensionDataRequest) Descriptor() ([]byte, []int) { + return file_extension_proto_rawDescGZIP(), []int{5} +} + +func (x *SendExtensionDataRequest) GetExtensionId() string { + if x != nil { + return x.ExtensionId + } + return "" +} + +func (x *SendExtensionDataRequest) GetButton() string { + if x != nil { + return x.Button + } + return "" +} + +func (x *SendExtensionDataRequest) GetData() map[string]string { + if x != nil { + return x.Data + } + return nil +} + type ExtensionResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -376,7 +439,7 @@ type ExtensionResponse struct { func (x *ExtensionResponse) Reset() { *x = ExtensionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_extension_proto_msgTypes[5] + mi := &file_extension_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -389,7 +452,7 @@ func (x *ExtensionResponse) String() string { func (*ExtensionResponse) ProtoMessage() {} func (x *ExtensionResponse) ProtoReflect() protoreflect.Message { - mi := &file_extension_proto_msgTypes[5] + mi := &file_extension_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -402,7 +465,7 @@ func (x *ExtensionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtensionResponse.ProtoReflect.Descriptor instead. func (*ExtensionResponse) Descriptor() ([]byte, []int) { - return file_extension_proto_rawDescGZIP(), []int{5} + return file_extension_proto_rawDescGZIP(), []int{6} } func (x *ExtensionResponse) GetType() ExtensionResponseType { @@ -467,57 +530,71 @@ var file_extension_proto_rawDesc = []byte{ 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, 0x22, 0x86, 0x01, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, - 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x02, 0x38, 0x01, 0x22, 0xd2, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x75, 0x69, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, 0x73, 0x6f, 0x6e, 0x55, 0x69, 0x2a, 0x4d, 0x0a, 0x15, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x54, 0x48, 0x49, 0x4e, 0x47, - 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x49, 0x10, - 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x48, 0x4f, 0x57, 0x5f, 0x44, 0x49, 0x41, 0x4c, 0x4f, 0x47, - 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x4e, 0x44, 0x10, 0x03, 0x32, 0xb1, 0x04, 0x0a, 0x14, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, - 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x68, 0x69, 0x64, 0x64, - 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x30, 0x01, 0x12, 0x56, 0x0a, 0x0d, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, - 0x2e, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, - 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0a, 0x53, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, - 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, - 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x06, 0x43, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, - 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, - 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, - 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, - 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x55, 0x49, 0x12, 0x1c, 0x2e, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x68, 0x69, 0x64, 0x64, + 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, + 0x37, 0x0a, 0x09, 0x44, 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, 0x22, 0x86, 0x01, 0x0a, 0x11, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x75, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, 0x73, 0x6f, 0x6e, 0x55, + 0x69, 0x2a, 0x4d, 0x0a, 0x15, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, + 0x54, 0x48, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x50, 0x44, 0x41, 0x54, + 0x45, 0x5f, 0x55, 0x49, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x48, 0x4f, 0x57, 0x5f, 0x44, + 0x49, 0x41, 0x4c, 0x4f, 0x47, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x4e, 0x44, 0x10, 0x03, + 0x32, 0xb9, 0x04, 0x0a, 0x14, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x6f, + 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x4c, 0x69, 0x73, + 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x11, 0x2e, 0x68, 0x69, + 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, + 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x07, 0x43, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, + 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, + 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x0d, 0x45, 0x64, 0x69, 0x74, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, + 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x42, - 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, + 0x57, 0x0a, 0x0a, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x12, 0x24, 0x2e, + 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, + 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1c, 0x2e, + 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, + 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, + 0x12, 0x4a, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x55, 0x49, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, + 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, + 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, + 0x2e, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -533,43 +610,46 @@ func file_extension_proto_rawDescGZIP() []byte { } var file_extension_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_extension_proto_goTypes = []any{ - (ExtensionResponseType)(0), // 0: hiddifyrpc.ExtensionResponseType - (*ExtensionActionResult)(nil), // 1: hiddifyrpc.ExtensionActionResult - (*ExtensionList)(nil), // 2: hiddifyrpc.ExtensionList - (*EditExtensionRequest)(nil), // 3: hiddifyrpc.EditExtensionRequest - (*Extension)(nil), // 4: hiddifyrpc.Extension - (*ExtensionRequest)(nil), // 5: hiddifyrpc.ExtensionRequest - (*ExtensionResponse)(nil), // 6: hiddifyrpc.ExtensionResponse - nil, // 7: hiddifyrpc.ExtensionRequest.DataEntry - (ResponseCode)(0), // 8: hiddifyrpc.ResponseCode - (*Empty)(nil), // 9: hiddifyrpc.Empty + (ExtensionResponseType)(0), // 0: hiddifyrpc.ExtensionResponseType + (*ExtensionActionResult)(nil), // 1: hiddifyrpc.ExtensionActionResult + (*ExtensionList)(nil), // 2: hiddifyrpc.ExtensionList + (*EditExtensionRequest)(nil), // 3: hiddifyrpc.EditExtensionRequest + (*Extension)(nil), // 4: hiddifyrpc.Extension + (*ExtensionRequest)(nil), // 5: hiddifyrpc.ExtensionRequest + (*SendExtensionDataRequest)(nil), // 6: hiddifyrpc.SendExtensionDataRequest + (*ExtensionResponse)(nil), // 7: hiddifyrpc.ExtensionResponse + nil, // 8: hiddifyrpc.ExtensionRequest.DataEntry + nil, // 9: hiddifyrpc.SendExtensionDataRequest.DataEntry + (ResponseCode)(0), // 10: hiddifyrpc.ResponseCode + (*Empty)(nil), // 11: hiddifyrpc.Empty } var file_extension_proto_depIdxs = []int32{ - 8, // 0: hiddifyrpc.ExtensionActionResult.code:type_name -> hiddifyrpc.ResponseCode + 10, // 0: hiddifyrpc.ExtensionActionResult.code:type_name -> hiddifyrpc.ResponseCode 4, // 1: hiddifyrpc.ExtensionList.extensions:type_name -> hiddifyrpc.Extension - 7, // 2: hiddifyrpc.ExtensionRequest.data:type_name -> hiddifyrpc.ExtensionRequest.DataEntry - 0, // 3: hiddifyrpc.ExtensionResponse.type:type_name -> hiddifyrpc.ExtensionResponseType - 9, // 4: hiddifyrpc.ExtensionHostService.ListExtensions:input_type -> hiddifyrpc.Empty - 5, // 5: hiddifyrpc.ExtensionHostService.Connect:input_type -> hiddifyrpc.ExtensionRequest - 3, // 6: hiddifyrpc.ExtensionHostService.EditExtension:input_type -> hiddifyrpc.EditExtensionRequest - 5, // 7: hiddifyrpc.ExtensionHostService.SubmitForm:input_type -> hiddifyrpc.ExtensionRequest - 5, // 8: hiddifyrpc.ExtensionHostService.Cancel:input_type -> hiddifyrpc.ExtensionRequest - 5, // 9: hiddifyrpc.ExtensionHostService.Stop:input_type -> hiddifyrpc.ExtensionRequest - 5, // 10: hiddifyrpc.ExtensionHostService.GetUI:input_type -> hiddifyrpc.ExtensionRequest - 2, // 11: hiddifyrpc.ExtensionHostService.ListExtensions:output_type -> hiddifyrpc.ExtensionList - 6, // 12: hiddifyrpc.ExtensionHostService.Connect:output_type -> hiddifyrpc.ExtensionResponse - 1, // 13: hiddifyrpc.ExtensionHostService.EditExtension:output_type -> hiddifyrpc.ExtensionActionResult - 1, // 14: hiddifyrpc.ExtensionHostService.SubmitForm:output_type -> hiddifyrpc.ExtensionActionResult - 1, // 15: hiddifyrpc.ExtensionHostService.Cancel:output_type -> hiddifyrpc.ExtensionActionResult - 1, // 16: hiddifyrpc.ExtensionHostService.Stop:output_type -> hiddifyrpc.ExtensionActionResult - 1, // 17: hiddifyrpc.ExtensionHostService.GetUI:output_type -> hiddifyrpc.ExtensionActionResult - 11, // [11:18] is the sub-list for method output_type - 4, // [4:11] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 8, // 2: hiddifyrpc.ExtensionRequest.data:type_name -> hiddifyrpc.ExtensionRequest.DataEntry + 9, // 3: hiddifyrpc.SendExtensionDataRequest.data:type_name -> hiddifyrpc.SendExtensionDataRequest.DataEntry + 0, // 4: hiddifyrpc.ExtensionResponse.type:type_name -> hiddifyrpc.ExtensionResponseType + 11, // 5: hiddifyrpc.ExtensionHostService.ListExtensions:input_type -> hiddifyrpc.Empty + 5, // 6: hiddifyrpc.ExtensionHostService.Connect:input_type -> hiddifyrpc.ExtensionRequest + 3, // 7: hiddifyrpc.ExtensionHostService.EditExtension:input_type -> hiddifyrpc.EditExtensionRequest + 6, // 8: hiddifyrpc.ExtensionHostService.SubmitForm:input_type -> hiddifyrpc.SendExtensionDataRequest + 5, // 9: hiddifyrpc.ExtensionHostService.Cancel:input_type -> hiddifyrpc.ExtensionRequest + 5, // 10: hiddifyrpc.ExtensionHostService.Stop:input_type -> hiddifyrpc.ExtensionRequest + 5, // 11: hiddifyrpc.ExtensionHostService.GetUI:input_type -> hiddifyrpc.ExtensionRequest + 2, // 12: hiddifyrpc.ExtensionHostService.ListExtensions:output_type -> hiddifyrpc.ExtensionList + 7, // 13: hiddifyrpc.ExtensionHostService.Connect:output_type -> hiddifyrpc.ExtensionResponse + 1, // 14: hiddifyrpc.ExtensionHostService.EditExtension:output_type -> hiddifyrpc.ExtensionActionResult + 1, // 15: hiddifyrpc.ExtensionHostService.SubmitForm:output_type -> hiddifyrpc.ExtensionActionResult + 1, // 16: hiddifyrpc.ExtensionHostService.Cancel:output_type -> hiddifyrpc.ExtensionActionResult + 1, // 17: hiddifyrpc.ExtensionHostService.Stop:output_type -> hiddifyrpc.ExtensionActionResult + 1, // 18: hiddifyrpc.ExtensionHostService.GetUI:output_type -> hiddifyrpc.ExtensionActionResult + 12, // [12:19] is the sub-list for method output_type + 5, // [5:12] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_extension_proto_init() } @@ -640,6 +720,18 @@ func file_extension_proto_init() { } } file_extension_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*SendExtensionDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_extension_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*ExtensionResponse); i { case 0: return &v.state @@ -658,7 +750,7 @@ func file_extension_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_extension_proto_rawDesc, NumEnums: 1, - NumMessages: 7, + NumMessages: 9, NumExtensions: 0, NumServices: 1, }, diff --git a/hiddifyrpc/extension.proto b/hiddifyrpc/extension.proto index ac92df4..35f4085 100644 --- a/hiddifyrpc/extension.proto +++ b/hiddifyrpc/extension.proto @@ -10,7 +10,7 @@ service ExtensionHostService { rpc ListExtensions (Empty) returns (ExtensionList) {} rpc Connect (ExtensionRequest) returns (stream ExtensionResponse) {} rpc EditExtension (EditExtensionRequest) returns (ExtensionActionResult) {} - rpc SubmitForm (ExtensionRequest) returns (ExtensionActionResult) {} + rpc SubmitForm (SendExtensionDataRequest) returns (ExtensionActionResult) {} rpc Cancel (ExtensionRequest) returns (ExtensionActionResult) {} rpc Stop (ExtensionRequest) returns (ExtensionActionResult) {} @@ -44,6 +44,12 @@ message ExtensionRequest { map data = 2; } +message SendExtensionDataRequest { + string extension_id = 1; + string button=2; + map data = 3; +} + message ExtensionResponse { ExtensionResponseType type = 1; string extension_id = 2; diff --git a/hiddifyrpc/extension_grpc.pb.go b/hiddifyrpc/extension_grpc.pb.go index 68a5036..720b0b4 100644 --- a/hiddifyrpc/extension_grpc.pb.go +++ b/hiddifyrpc/extension_grpc.pb.go @@ -35,7 +35,7 @@ type ExtensionHostServiceClient interface { ListExtensions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ExtensionList, error) Connect(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExtensionResponse], error) EditExtension(ctx context.Context, in *EditExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) - SubmitForm(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) + SubmitForm(ctx context.Context, in *SendExtensionDataRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) Cancel(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) Stop(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) GetUI(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) @@ -88,7 +88,7 @@ func (c *extensionHostServiceClient) EditExtension(ctx context.Context, in *Edit return out, nil } -func (c *extensionHostServiceClient) SubmitForm(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) { +func (c *extensionHostServiceClient) SubmitForm(ctx context.Context, in *SendExtensionDataRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ExtensionActionResult) err := c.cc.Invoke(ctx, ExtensionHostService_SubmitForm_FullMethodName, in, out, cOpts...) @@ -135,7 +135,7 @@ type ExtensionHostServiceServer interface { ListExtensions(context.Context, *Empty) (*ExtensionList, error) Connect(*ExtensionRequest, grpc.ServerStreamingServer[ExtensionResponse]) error EditExtension(context.Context, *EditExtensionRequest) (*ExtensionActionResult, error) - SubmitForm(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) + SubmitForm(context.Context, *SendExtensionDataRequest) (*ExtensionActionResult, error) Cancel(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) Stop(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) GetUI(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) @@ -158,7 +158,7 @@ func (UnimplementedExtensionHostServiceServer) Connect(*ExtensionRequest, grpc.S func (UnimplementedExtensionHostServiceServer) EditExtension(context.Context, *EditExtensionRequest) (*ExtensionActionResult, error) { return nil, status.Errorf(codes.Unimplemented, "method EditExtension not implemented") } -func (UnimplementedExtensionHostServiceServer) SubmitForm(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) { +func (UnimplementedExtensionHostServiceServer) SubmitForm(context.Context, *SendExtensionDataRequest) (*ExtensionActionResult, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitForm not implemented") } func (UnimplementedExtensionHostServiceServer) Cancel(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) { @@ -239,7 +239,7 @@ func _ExtensionHostService_EditExtension_Handler(srv interface{}, ctx context.Co } func _ExtensionHostService_SubmitForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExtensionRequest) + in := new(SendExtensionDataRequest) if err := dec(in); err != nil { return nil, err } @@ -251,7 +251,7 @@ func _ExtensionHostService_SubmitForm_Handler(srv interface{}, ctx context.Conte FullMethod: ExtensionHostService_SubmitForm_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExtensionHostServiceServer).SubmitForm(ctx, req.(*ExtensionRequest)) + return srv.(ExtensionHostServiceServer).SubmitForm(ctx, req.(*SendExtensionDataRequest)) } return interceptor(ctx, in, info, handler) }