remove Button Field

This commit is contained in:
hiddify
2024-09-30 21:27:18 +02:00
parent 99e39c2302
commit 3bcfc11a80
9 changed files with 643 additions and 106 deletions

View File

@@ -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<string, string>} 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<string, string>=} metadata User defined
* call metadata

View File

@@ -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_<name>, 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<string, string> data = 3;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,string>}
*/
proto.hiddifyrpc.SendExtensionDataRequest.prototype.getDataMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,string>} */ (
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.