Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rpc/example/node/gorush_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var GorushService = exports.GorushService = {
},
};

exports.GorushClient = grpc.makeGenericClientConstructor(GorushService);
exports.GorushClient = grpc.makeGenericClientConstructor(GorushService, 'Gorush');
var HealthService = exports.HealthService = {
check: {
path: '/proto.Health/Check',
Expand All @@ -79,4 +79,4 @@ var HealthService = exports.HealthService = {
},
};

exports.HealthClient = grpc.makeGenericClientConstructor(HealthService);
exports.HealthClient = grpc.makeGenericClientConstructor(HealthService, 'Health');
277 changes: 243 additions & 34 deletions rpc/example/node/gorush_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global =
(typeof globalThis !== 'undefined' && globalThis) ||
(typeof window !== 'undefined' && window) ||
(typeof global !== 'undefined' && global) ||
(typeof self !== 'undefined' && self) ||
(function () { return this; }).call(null) ||
Function('return this')();

var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
goog.object.extend(proto, google_protobuf_struct_pb);
goog.exportSymbol('proto.proto.Alert', null, global);
goog.exportSymbol('proto.proto.FCMOptions', null, global);
goog.exportSymbol('proto.proto.HealthCheckRequest', null, global);
goog.exportSymbol('proto.proto.HealthCheckResponse', null, global);
goog.exportSymbol('proto.proto.HealthCheckResponse.ServingStatus', null, global);
Expand Down Expand Up @@ -66,6 +73,27 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.proto.NotificationRequest.displayName = 'proto.proto.NotificationRequest';
}
/**
* 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.proto.FCMOptions = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.proto.FCMOptions, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.proto.FCMOptions.displayName = 'proto.proto.FCMOptions';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
Expand Down Expand Up @@ -168,16 +196,16 @@ proto.proto.Alert.prototype.toObject = function(opt_includeInstance) {
*/
proto.proto.Alert.toObject = function(includeInstance, msg) {
var f, obj = {
title: jspb.Message.getFieldWithDefault(msg, 1, ""),
body: jspb.Message.getFieldWithDefault(msg, 2, ""),
subtitle: jspb.Message.getFieldWithDefault(msg, 3, ""),
action: jspb.Message.getFieldWithDefault(msg, 4, ""),
actionlockey: jspb.Message.getFieldWithDefault(msg, 5, ""),
launchimage: jspb.Message.getFieldWithDefault(msg, 6, ""),
lockey: jspb.Message.getFieldWithDefault(msg, 7, ""),
titlelockey: jspb.Message.getFieldWithDefault(msg, 8, ""),
locargsList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f,
titlelocargsList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f
title: jspb.Message.getFieldWithDefault(msg, 1, ""),
body: jspb.Message.getFieldWithDefault(msg, 2, ""),
subtitle: jspb.Message.getFieldWithDefault(msg, 3, ""),
action: jspb.Message.getFieldWithDefault(msg, 4, ""),
actionlockey: jspb.Message.getFieldWithDefault(msg, 5, ""),
launchimage: jspb.Message.getFieldWithDefault(msg, 6, ""),
lockey: jspb.Message.getFieldWithDefault(msg, 7, ""),
titlelockey: jspb.Message.getFieldWithDefault(msg, 8, ""),
locargsList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f,
titlelocargsList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f
};

if (includeInstance) {
Expand Down Expand Up @@ -613,25 +641,26 @@ proto.proto.NotificationRequest.prototype.toObject = function(opt_includeInstanc
*/
proto.proto.NotificationRequest.toObject = function(includeInstance, msg) {
var f, obj = {
tokensList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f,
platform: jspb.Message.getFieldWithDefault(msg, 2, 0),
message: jspb.Message.getFieldWithDefault(msg, 3, ""),
title: jspb.Message.getFieldWithDefault(msg, 4, ""),
topic: jspb.Message.getFieldWithDefault(msg, 5, ""),
key: jspb.Message.getFieldWithDefault(msg, 6, ""),
badge: jspb.Message.getFieldWithDefault(msg, 7, 0),
category: jspb.Message.getFieldWithDefault(msg, 8, ""),
alert: (f = msg.getAlert()) && proto.proto.Alert.toObject(includeInstance, f),
sound: jspb.Message.getFieldWithDefault(msg, 10, ""),
contentavailable: jspb.Message.getBooleanFieldWithDefault(msg, 11, false),
threadid: jspb.Message.getFieldWithDefault(msg, 12, ""),
mutablecontent: jspb.Message.getBooleanFieldWithDefault(msg, 13, false),
data: (f = msg.getData()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
image: jspb.Message.getFieldWithDefault(msg, 15, ""),
priority: jspb.Message.getFieldWithDefault(msg, 16, 0),
id: jspb.Message.getFieldWithDefault(msg, 17, ""),
pushtype: jspb.Message.getFieldWithDefault(msg, 18, ""),
development: jspb.Message.getBooleanFieldWithDefault(msg, 19, false)
tokensList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f,
platform: jspb.Message.getFieldWithDefault(msg, 2, 0),
message: jspb.Message.getFieldWithDefault(msg, 3, ""),
title: jspb.Message.getFieldWithDefault(msg, 4, ""),
topic: jspb.Message.getFieldWithDefault(msg, 5, ""),
key: jspb.Message.getFieldWithDefault(msg, 6, ""),
badge: jspb.Message.getFieldWithDefault(msg, 7, 0),
category: jspb.Message.getFieldWithDefault(msg, 8, ""),
alert: (f = msg.getAlert()) && proto.proto.Alert.toObject(includeInstance, f),
sound: jspb.Message.getFieldWithDefault(msg, 10, ""),
contentavailable: jspb.Message.getBooleanFieldWithDefault(msg, 11, false),
threadid: jspb.Message.getFieldWithDefault(msg, 12, ""),
mutablecontent: jspb.Message.getBooleanFieldWithDefault(msg, 13, false),
data: (f = msg.getData()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
image: jspb.Message.getFieldWithDefault(msg, 15, ""),
priority: jspb.Message.getFieldWithDefault(msg, 16, 0),
id: jspb.Message.getFieldWithDefault(msg, 17, ""),
pushtype: jspb.Message.getFieldWithDefault(msg, 18, ""),
development: jspb.Message.getBooleanFieldWithDefault(msg, 19, false),
fcmoptions: (f = msg.getFcmoptions()) && proto.proto.FCMOptions.toObject(includeInstance, f)
};

if (includeInstance) {
Expand Down Expand Up @@ -746,6 +775,11 @@ proto.proto.NotificationRequest.deserializeBinaryFromReader = function(msg, read
var value = /** @type {boolean} */ (reader.readBool());
msg.setDevelopment(value);
break;
case 20:
var value = new proto.proto.FCMOptions;
reader.readMessage(value,proto.proto.FCMOptions.deserializeBinaryFromReader);
msg.setFcmoptions(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -910,6 +944,14 @@ proto.proto.NotificationRequest.serializeBinaryToWriter = function(message, writ
f
);
}
f = message.getFcmoptions();
if (f != null) {
writer.writeMessage(
20,
f,
proto.proto.FCMOptions.serializeBinaryToWriter
);
}
};


Expand Down Expand Up @@ -1320,6 +1362,173 @@ proto.proto.NotificationRequest.prototype.setDevelopment = function(value) {
};


/**
* optional FCMOptions fcmOptions = 20;
* @return {?proto.proto.FCMOptions}
*/
proto.proto.NotificationRequest.prototype.getFcmoptions = function() {
return /** @type{?proto.proto.FCMOptions} */ (
jspb.Message.getWrapperField(this, proto.proto.FCMOptions, 20));
};


/**
* @param {?proto.proto.FCMOptions|undefined} value
* @return {!proto.proto.NotificationRequest} returns this
*/
proto.proto.NotificationRequest.prototype.setFcmoptions = function(value) {
return jspb.Message.setWrapperField(this, 20, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.proto.NotificationRequest} returns this
*/
proto.proto.NotificationRequest.prototype.clearFcmoptions = function() {
return this.setFcmoptions(undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.proto.NotificationRequest.prototype.hasFcmoptions = function() {
return jspb.Message.getField(this, 20) != null;
};





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.proto.FCMOptions.prototype.toObject = function(opt_includeInstance) {
return proto.proto.FCMOptions.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.proto.FCMOptions} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.proto.FCMOptions.toObject = function(includeInstance, msg) {
var f, obj = {
analyticslabel: jspb.Message.getFieldWithDefault(msg, 1, "")
};

if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}


/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.proto.FCMOptions}
*/
proto.proto.FCMOptions.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.proto.FCMOptions;
return proto.proto.FCMOptions.deserializeBinaryFromReader(msg, reader);
};


/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.proto.FCMOptions} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.proto.FCMOptions}
*/
proto.proto.FCMOptions.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.setAnalyticslabel(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};


/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.proto.FCMOptions.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.proto.FCMOptions.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};


/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.proto.FCMOptions} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.proto.FCMOptions.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAnalyticslabel();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};


/**
* optional string analyticsLabel = 1;
* @return {string}
*/
proto.proto.FCMOptions.prototype.getAnalyticslabel = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
* @param {string} value
* @return {!proto.proto.FCMOptions} returns this
*/
proto.proto.FCMOptions.prototype.setAnalyticslabel = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};





Expand Down Expand Up @@ -1352,8 +1561,8 @@ proto.proto.NotificationReply.prototype.toObject = function(opt_includeInstance)
*/
proto.proto.NotificationReply.toObject = function(includeInstance, msg) {
var f, obj = {
success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
counts: jspb.Message.getFieldWithDefault(msg, 2, 0)
success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
counts: jspb.Message.getFieldWithDefault(msg, 2, 0)
};

if (includeInstance) {
Expand Down Expand Up @@ -1512,7 +1721,7 @@ proto.proto.HealthCheckRequest.prototype.toObject = function(opt_includeInstance
*/
proto.proto.HealthCheckRequest.toObject = function(includeInstance, msg) {
var f, obj = {
service: jspb.Message.getFieldWithDefault(msg, 1, "")
service: jspb.Message.getFieldWithDefault(msg, 1, "")
};

if (includeInstance) {
Expand Down Expand Up @@ -1642,7 +1851,7 @@ proto.proto.HealthCheckResponse.prototype.toObject = function(opt_includeInstanc
*/
proto.proto.HealthCheckResponse.toObject = function(includeInstance, msg) {
var f, obj = {
status: jspb.Message.getFieldWithDefault(msg, 1, 0)
status: jspb.Message.getFieldWithDefault(msg, 1, 0)
};

if (includeInstance) {
Expand Down
Loading
Loading