Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
Adding update connection method to user interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjosh committed Aug 28, 2020
1 parent 5d74b94 commit 21946e2
Show file tree
Hide file tree
Showing 6 changed files with 404 additions and 248 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "casty-proto",
"version": "1.3.4",
"version": "1.3.5",
"description": "This repository contains common protocol definitions for casty services around gRPC such as user, authentication, theater etc...",
"scripts": {
"compile": "pbjs -t static-module -w commonjs -o pbjs/proto.js protofiles/*.proto"
Expand Down
94 changes: 87 additions & 7 deletions pbjs/grpc.user_grpc_web_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -1361,16 +1361,16 @@ proto.proto.UserServicePromiseClient.prototype.getFriends =
/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.proto.GetConnectionRequest,
* !proto.proto.ConnectionRequest,
* !proto.proto.ConnectionsResponse>}
*/
const methodDescriptor_UserService_GetConnection = new grpc.web.MethodDescriptor(
'/proto.UserService/GetConnection',
grpc.web.MethodType.UNARY,
proto.proto.GetConnectionRequest,
proto.proto.ConnectionRequest,
grpc_connection_pb.ConnectionsResponse,
/**
* @param {!proto.proto.GetConnectionRequest} request
* @param {!proto.proto.ConnectionRequest} request
* @return {!Uint8Array}
*/
function(request) {
Expand All @@ -1383,13 +1383,13 @@ const methodDescriptor_UserService_GetConnection = new grpc.web.MethodDescriptor
/**
* @const
* @type {!grpc.web.AbstractClientBase.MethodInfo<
* !proto.proto.GetConnectionRequest,
* !proto.proto.ConnectionRequest,
* !proto.proto.ConnectionsResponse>}
*/
const methodInfo_UserService_GetConnection = new grpc.web.AbstractClientBase.MethodInfo(
grpc_connection_pb.ConnectionsResponse,
/**
* @param {!proto.proto.GetConnectionRequest} request
* @param {!proto.proto.ConnectionRequest} request
* @return {!Uint8Array}
*/
function(request) {
Expand All @@ -1400,7 +1400,7 @@ const methodInfo_UserService_GetConnection = new grpc.web.AbstractClientBase.Met


/**
* @param {!proto.proto.GetConnectionRequest} request The
* @param {!proto.proto.ConnectionRequest} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
Expand All @@ -1421,7 +1421,7 @@ proto.proto.UserServiceClient.prototype.getConnection =


/**
* @param {!proto.proto.GetConnectionRequest} request The
* @param {!proto.proto.ConnectionRequest} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
Expand Down Expand Up @@ -1518,6 +1518,86 @@ proto.proto.UserServicePromiseClient.prototype.getConnections =
};


/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.proto.ConnectionRequest,
* !proto.proto.ConnectionsResponse>}
*/
const methodDescriptor_UserService_UpdateConnection = new grpc.web.MethodDescriptor(
'/proto.UserService/UpdateConnection',
grpc.web.MethodType.UNARY,
proto.proto.ConnectionRequest,
grpc_connection_pb.ConnectionsResponse,
/**
* @param {!proto.proto.ConnectionRequest} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
grpc_connection_pb.ConnectionsResponse.deserializeBinary
);


/**
* @const
* @type {!grpc.web.AbstractClientBase.MethodInfo<
* !proto.proto.ConnectionRequest,
* !proto.proto.ConnectionsResponse>}
*/
const methodInfo_UserService_UpdateConnection = new grpc.web.AbstractClientBase.MethodInfo(
grpc_connection_pb.ConnectionsResponse,
/**
* @param {!proto.proto.ConnectionRequest} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
grpc_connection_pb.ConnectionsResponse.deserializeBinary
);


/**
* @param {!proto.proto.ConnectionRequest} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
* @param {function(?grpc.web.Error, ?proto.proto.ConnectionsResponse)}
* callback The callback function(error, response)
* @return {!grpc.web.ClientReadableStream<!proto.proto.ConnectionsResponse>|undefined}
* The XHR Node Readable Stream
*/
proto.proto.UserServiceClient.prototype.updateConnection =
function(request, metadata, callback) {
return this.client_.rpcCall(this.hostname_ +
'/proto.UserService/UpdateConnection',
request,
metadata || {},
methodDescriptor_UserService_UpdateConnection,
callback);
};


/**
* @param {!proto.proto.ConnectionRequest} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
* @return {!Promise<!proto.proto.ConnectionsResponse>}
* A native promise that resolves to the response
*/
proto.proto.UserServicePromiseClient.prototype.updateConnection =
function(request, metadata) {
return this.client_.unaryCall(this.hostname_ +
'/proto.UserService/UpdateConnection',
request,
metadata || {},
methodDescriptor_UserService_UpdateConnection);
};


/**
* @const
* @type {!grpc.web.MethodDescriptor<
Expand Down
62 changes: 31 additions & 31 deletions pbjs/grpc.user_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ goog.object.extend(proto, grpc_connection_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
goog.exportSymbol('proto.proto.Activity', null, global);
goog.exportSymbol('proto.proto.ConnectionRequest', null, global);
goog.exportSymbol('proto.proto.CreateNotificationRequest', null, global);
goog.exportSymbol('proto.proto.CreateUserRequest', null, global);
goog.exportSymbol('proto.proto.Friend', null, global);
goog.exportSymbol('proto.proto.FriendRequest', null, global);
goog.exportSymbol('proto.proto.FriendResponse', null, global);
goog.exportSymbol('proto.proto.FriendsResponse', null, global);
goog.exportSymbol('proto.proto.GetConnectionRequest', null, global);
goog.exportSymbol('proto.proto.GetFriendRequest', null, global);
goog.exportSymbol('proto.proto.GetUserResponse', null, global);
goog.exportSymbol('proto.proto.Notification', null, global);
Expand Down Expand Up @@ -494,16 +494,16 @@ if (goog.DEBUG && !COMPILED) {
* @extends {jspb.Message}
* @constructor
*/
proto.proto.GetConnectionRequest = function(opt_data) {
proto.proto.ConnectionRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.proto.GetConnectionRequest, jspb.Message);
goog.inherits(proto.proto.ConnectionRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.proto.GetConnectionRequest.displayName = 'proto.proto.GetConnectionRequest';
proto.proto.ConnectionRequest.displayName = 'proto.proto.ConnectionRequest';
}


Expand Down Expand Up @@ -6018,8 +6018,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.proto.GetConnectionRequest.prototype.toObject = function(opt_includeInstance) {
return proto.proto.GetConnectionRequest.toObject(opt_includeInstance, this);
proto.proto.ConnectionRequest.prototype.toObject = function(opt_includeInstance) {
return proto.proto.ConnectionRequest.toObject(opt_includeInstance, this);
};


Expand All @@ -6028,11 +6028,11 @@ proto.proto.GetConnectionRequest.prototype.toObject = function(opt_includeInstan
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.proto.GetConnectionRequest} msg The msg instance to transform.
* @param {!proto.proto.ConnectionRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.proto.GetConnectionRequest.toObject = function(includeInstance, msg) {
proto.proto.ConnectionRequest.toObject = function(includeInstance, msg) {
var f, obj = {
connection: (f = msg.getConnection()) && grpc_connection_pb.Connection.toObject(includeInstance, f),
authRequest: (f = msg.getAuthRequest()) && grpc_base_pb.AuthenticateRequest.toObject(includeInstance, f)
Expand All @@ -6049,23 +6049,23 @@ proto.proto.GetConnectionRequest.toObject = function(includeInstance, msg) {
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.proto.GetConnectionRequest}
* @return {!proto.proto.ConnectionRequest}
*/
proto.proto.GetConnectionRequest.deserializeBinary = function(bytes) {
proto.proto.ConnectionRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.proto.GetConnectionRequest;
return proto.proto.GetConnectionRequest.deserializeBinaryFromReader(msg, reader);
var msg = new proto.proto.ConnectionRequest;
return proto.proto.ConnectionRequest.deserializeBinaryFromReader(msg, reader);
};


/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.proto.GetConnectionRequest} msg The message object to deserialize into.
* @param {!proto.proto.ConnectionRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.proto.GetConnectionRequest}
* @return {!proto.proto.ConnectionRequest}
*/
proto.proto.GetConnectionRequest.deserializeBinaryFromReader = function(msg, reader) {
proto.proto.ConnectionRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
Expand Down Expand Up @@ -6095,21 +6095,21 @@ proto.proto.GetConnectionRequest.deserializeBinaryFromReader = function(msg, rea
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.proto.GetConnectionRequest.prototype.serializeBinary = function() {
proto.proto.ConnectionRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.proto.GetConnectionRequest.serializeBinaryToWriter(this, writer);
proto.proto.ConnectionRequest.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.GetConnectionRequest} message
* @param {!proto.proto.ConnectionRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.proto.GetConnectionRequest.serializeBinaryToWriter = function(message, writer) {
proto.proto.ConnectionRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getConnection();
if (f != null) {
Expand All @@ -6134,26 +6134,26 @@ proto.proto.GetConnectionRequest.serializeBinaryToWriter = function(message, wri
* optional Connection connection = 1;
* @return {?proto.proto.Connection}
*/
proto.proto.GetConnectionRequest.prototype.getConnection = function() {
proto.proto.ConnectionRequest.prototype.getConnection = function() {
return /** @type{?proto.proto.Connection} */ (
jspb.Message.getWrapperField(this, grpc_connection_pb.Connection, 1));
};


/**
* @param {?proto.proto.Connection|undefined} value
* @return {!proto.proto.GetConnectionRequest} returns this
* @return {!proto.proto.ConnectionRequest} returns this
*/
proto.proto.GetConnectionRequest.prototype.setConnection = function(value) {
proto.proto.ConnectionRequest.prototype.setConnection = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.proto.GetConnectionRequest} returns this
* @return {!proto.proto.ConnectionRequest} returns this
*/
proto.proto.GetConnectionRequest.prototype.clearConnection = function() {
proto.proto.ConnectionRequest.prototype.clearConnection = function() {
return this.setConnection(undefined);
};

Expand All @@ -6162,7 +6162,7 @@ proto.proto.GetConnectionRequest.prototype.clearConnection = function() {
* Returns whether this field is set.
* @return {boolean}
*/
proto.proto.GetConnectionRequest.prototype.hasConnection = function() {
proto.proto.ConnectionRequest.prototype.hasConnection = function() {
return jspb.Message.getField(this, 1) != null;
};

Expand All @@ -6171,26 +6171,26 @@ proto.proto.GetConnectionRequest.prototype.hasConnection = function() {
* optional AuthenticateRequest auth_request = 2;
* @return {?proto.proto.AuthenticateRequest}
*/
proto.proto.GetConnectionRequest.prototype.getAuthRequest = function() {
proto.proto.ConnectionRequest.prototype.getAuthRequest = function() {
return /** @type{?proto.proto.AuthenticateRequest} */ (
jspb.Message.getWrapperField(this, grpc_base_pb.AuthenticateRequest, 2));
};


/**
* @param {?proto.proto.AuthenticateRequest|undefined} value
* @return {!proto.proto.GetConnectionRequest} returns this
* @return {!proto.proto.ConnectionRequest} returns this
*/
proto.proto.GetConnectionRequest.prototype.setAuthRequest = function(value) {
proto.proto.ConnectionRequest.prototype.setAuthRequest = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.proto.GetConnectionRequest} returns this
* @return {!proto.proto.ConnectionRequest} returns this
*/
proto.proto.GetConnectionRequest.prototype.clearAuthRequest = function() {
proto.proto.ConnectionRequest.prototype.clearAuthRequest = function() {
return this.setAuthRequest(undefined);
};

Expand All @@ -6199,7 +6199,7 @@ proto.proto.GetConnectionRequest.prototype.clearAuthRequest = function() {
* Returns whether this field is set.
* @return {boolean}
*/
proto.proto.GetConnectionRequest.prototype.hasAuthRequest = function() {
proto.proto.ConnectionRequest.prototype.hasAuthRequest = function() {
return jspb.Message.getField(this, 2) != null;
};

Expand Down
Loading

0 comments on commit 21946e2

Please sign in to comment.