From 81b4447c847fc1e251e1d82b527dc66cff450185 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Thu, 10 Jun 2021 14:15:33 +0000 Subject: [PATCH] Remove some proto js definitions from api --- api/_proto/dicebot_pb.d.ts | 214 ---- api/_proto/dicebot_pb.js | 1629 ---------------------------- api/_proto/dicebot_pb_service.d.ts | 120 -- api/_proto/dicebot_pb_service.js | 181 ---- api/_proto/web-api_pb.d.ts | 71 -- api/_proto/web-api_pb.js | 534 --------- api/_proto/web-api_pb_service.d.ts | 63 -- api/_proto/web-api_pb_service.js | 61 -- 8 files changed, 2873 deletions(-) delete mode 100644 api/_proto/dicebot_pb.d.ts delete mode 100644 api/_proto/dicebot_pb.js delete mode 100644 api/_proto/dicebot_pb_service.d.ts delete mode 100644 api/_proto/dicebot_pb_service.js delete mode 100644 api/_proto/web-api_pb.d.ts delete mode 100644 api/_proto/web-api_pb.js delete mode 100644 api/_proto/web-api_pb_service.d.ts delete mode 100644 api/_proto/web-api_pb_service.js diff --git a/api/_proto/dicebot_pb.d.ts b/api/_proto/dicebot_pb.d.ts deleted file mode 100644 index 8f8d2e3..0000000 --- a/api/_proto/dicebot_pb.d.ts +++ /dev/null @@ -1,214 +0,0 @@ -// package: dicebot -// file: dicebot.proto - -import * as jspb from "google-protobuf"; - -export class GetVariableRequest extends jspb.Message { - getUserId(): string; - setUserId(value: string): void; - - getRoomId(): string; - setRoomId(value: string): void; - - getVariableName(): string; - setVariableName(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetVariableRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetVariableRequest): GetVariableRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetVariableRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetVariableRequest; - static deserializeBinaryFromReader(message: GetVariableRequest, reader: jspb.BinaryReader): GetVariableRequest; -} - -export namespace GetVariableRequest { - export type AsObject = { - userId: string, - roomId: string, - variableName: string, - } -} - -export class GetVariableReply extends jspb.Message { - getValue(): number; - setValue(value: number): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetVariableReply.AsObject; - static toObject(includeInstance: boolean, msg: GetVariableReply): GetVariableReply.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetVariableReply, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetVariableReply; - static deserializeBinaryFromReader(message: GetVariableReply, reader: jspb.BinaryReader): GetVariableReply; -} - -export namespace GetVariableReply { - export type AsObject = { - value: number, - } -} - -export class GetAllVariablesRequest extends jspb.Message { - getUserId(): string; - setUserId(value: string): void; - - getRoomId(): string; - setRoomId(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetAllVariablesRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetAllVariablesRequest): GetAllVariablesRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetAllVariablesRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetAllVariablesRequest; - static deserializeBinaryFromReader(message: GetAllVariablesRequest, reader: jspb.BinaryReader): GetAllVariablesRequest; -} - -export namespace GetAllVariablesRequest { - export type AsObject = { - userId: string, - roomId: string, - } -} - -export class GetAllVariablesReply extends jspb.Message { - getVariablesMap(): jspb.Map; - clearVariablesMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetAllVariablesReply.AsObject; - static toObject(includeInstance: boolean, msg: GetAllVariablesReply): GetAllVariablesReply.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetAllVariablesReply, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetAllVariablesReply; - static deserializeBinaryFromReader(message: GetAllVariablesReply, reader: jspb.BinaryReader): GetAllVariablesReply; -} - -export namespace GetAllVariablesReply { - export type AsObject = { - variablesMap: Array<[string, number]>, - } -} - -export class SetVariableRequest extends jspb.Message { - getUserId(): string; - setUserId(value: string): void; - - getRoomId(): string; - setRoomId(value: string): void; - - getVariableName(): string; - setVariableName(value: string): void; - - getValue(): number; - setValue(value: number): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SetVariableRequest.AsObject; - static toObject(includeInstance: boolean, msg: SetVariableRequest): SetVariableRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SetVariableRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SetVariableRequest; - static deserializeBinaryFromReader(message: SetVariableRequest, reader: jspb.BinaryReader): SetVariableRequest; -} - -export namespace SetVariableRequest { - export type AsObject = { - userId: string, - roomId: string, - variableName: string, - value: number, - } -} - -export class SetVariableReply extends jspb.Message { - getSuccess(): boolean; - setSuccess(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SetVariableReply.AsObject; - static toObject(includeInstance: boolean, msg: SetVariableReply): SetVariableReply.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SetVariableReply, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SetVariableReply; - static deserializeBinaryFromReader(message: SetVariableReply, reader: jspb.BinaryReader): SetVariableReply; -} - -export namespace SetVariableReply { - export type AsObject = { - success: boolean, - } -} - -export class UserIdRequest extends jspb.Message { - getUserId(): string; - setUserId(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): UserIdRequest.AsObject; - static toObject(includeInstance: boolean, msg: UserIdRequest): UserIdRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: UserIdRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): UserIdRequest; - static deserializeBinaryFromReader(message: UserIdRequest, reader: jspb.BinaryReader): UserIdRequest; -} - -export namespace UserIdRequest { - export type AsObject = { - userId: string, - } -} - -export class RoomsListReply extends jspb.Message { - clearRoomsList(): void; - getRoomsList(): Array; - setRoomsList(value: Array): void; - addRooms(value?: RoomsListReply.Room, index?: number): RoomsListReply.Room; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): RoomsListReply.AsObject; - static toObject(includeInstance: boolean, msg: RoomsListReply): RoomsListReply.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: RoomsListReply, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): RoomsListReply; - static deserializeBinaryFromReader(message: RoomsListReply, reader: jspb.BinaryReader): RoomsListReply; -} - -export namespace RoomsListReply { - export type AsObject = { - roomsList: Array, - } - - export class Room extends jspb.Message { - getRoomId(): string; - setRoomId(value: string): void; - - getDisplayName(): string; - setDisplayName(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Room.AsObject; - static toObject(includeInstance: boolean, msg: Room): Room.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Room, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Room; - static deserializeBinaryFromReader(message: Room, reader: jspb.BinaryReader): Room; - } - - export namespace Room { - export type AsObject = { - roomId: string, - displayName: string, - } - } -} - diff --git a/api/_proto/dicebot_pb.js b/api/_proto/dicebot_pb.js deleted file mode 100644 index a1aedb3..0000000 --- a/api/_proto/dicebot_pb.js +++ /dev/null @@ -1,1629 +0,0 @@ -// source: dicebot.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.dicebot.GetAllVariablesReply', null, global); -goog.exportSymbol('proto.dicebot.GetAllVariablesRequest', null, global); -goog.exportSymbol('proto.dicebot.GetVariableReply', null, global); -goog.exportSymbol('proto.dicebot.GetVariableRequest', null, global); -goog.exportSymbol('proto.dicebot.RoomsListReply', null, global); -goog.exportSymbol('proto.dicebot.RoomsListReply.Room', null, global); -goog.exportSymbol('proto.dicebot.SetVariableReply', null, global); -goog.exportSymbol('proto.dicebot.SetVariableRequest', null, global); -goog.exportSymbol('proto.dicebot.UserIdRequest', null, global); -/** - * 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.dicebot.GetVariableRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.dicebot.GetVariableRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.GetVariableRequest.displayName = 'proto.dicebot.GetVariableRequest'; -} -/** - * 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.dicebot.GetVariableReply = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.dicebot.GetVariableReply, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.GetVariableReply.displayName = 'proto.dicebot.GetVariableReply'; -} -/** - * 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.dicebot.GetAllVariablesRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.dicebot.GetAllVariablesRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.GetAllVariablesRequest.displayName = 'proto.dicebot.GetAllVariablesRequest'; -} -/** - * 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.dicebot.GetAllVariablesReply = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.dicebot.GetAllVariablesReply, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.GetAllVariablesReply.displayName = 'proto.dicebot.GetAllVariablesReply'; -} -/** - * 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.dicebot.SetVariableRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.dicebot.SetVariableRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.SetVariableRequest.displayName = 'proto.dicebot.SetVariableRequest'; -} -/** - * 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.dicebot.SetVariableReply = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.dicebot.SetVariableReply, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.SetVariableReply.displayName = 'proto.dicebot.SetVariableReply'; -} -/** - * 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.dicebot.UserIdRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.dicebot.UserIdRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.UserIdRequest.displayName = 'proto.dicebot.UserIdRequest'; -} -/** - * 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.dicebot.RoomsListReply = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.dicebot.RoomsListReply.repeatedFields_, null); -}; -goog.inherits(proto.dicebot.RoomsListReply, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.RoomsListReply.displayName = 'proto.dicebot.RoomsListReply'; -} -/** - * 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.dicebot.RoomsListReply.Room = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.dicebot.RoomsListReply.Room, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.dicebot.RoomsListReply.Room.displayName = 'proto.dicebot.RoomsListReply.Room'; -} - - - -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.dicebot.GetVariableRequest.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.GetVariableRequest.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.dicebot.GetVariableRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.GetVariableRequest.toObject = function(includeInstance, msg) { - var f, obj = { - userId: jspb.Message.getFieldWithDefault(msg, 1, ""), - roomId: jspb.Message.getFieldWithDefault(msg, 2, ""), - variableName: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.dicebot.GetVariableRequest} - */ -proto.dicebot.GetVariableRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.GetVariableRequest; - return proto.dicebot.GetVariableRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.GetVariableRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.GetVariableRequest} - */ -proto.dicebot.GetVariableRequest.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.setUserId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setRoomId(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setVariableName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.GetVariableRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.GetVariableRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.GetVariableRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.GetVariableRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUserId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getRoomId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getVariableName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional string user_id = 1; - * @return {string} - */ -proto.dicebot.GetVariableRequest.prototype.getUserId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.GetVariableRequest} returns this - */ -proto.dicebot.GetVariableRequest.prototype.setUserId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string room_id = 2; - * @return {string} - */ -proto.dicebot.GetVariableRequest.prototype.getRoomId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.GetVariableRequest} returns this - */ -proto.dicebot.GetVariableRequest.prototype.setRoomId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string variable_name = 3; - * @return {string} - */ -proto.dicebot.GetVariableRequest.prototype.getVariableName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.GetVariableRequest} returns this - */ -proto.dicebot.GetVariableRequest.prototype.setVariableName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -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.dicebot.GetVariableReply.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.GetVariableReply.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.dicebot.GetVariableReply} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.GetVariableReply.toObject = function(includeInstance, msg) { - var f, obj = { - value: jspb.Message.getFieldWithDefault(msg, 1, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.dicebot.GetVariableReply} - */ -proto.dicebot.GetVariableReply.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.GetVariableReply; - return proto.dicebot.GetVariableReply.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.GetVariableReply} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.GetVariableReply} - */ -proto.dicebot.GetVariableReply.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.GetVariableReply.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.GetVariableReply.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.GetVariableReply} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.GetVariableReply.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValue(); - if (f !== 0) { - writer.writeInt32( - 1, - f - ); - } -}; - - -/** - * optional int32 value = 1; - * @return {number} - */ -proto.dicebot.GetVariableReply.prototype.getValue = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.dicebot.GetVariableReply} returns this - */ -proto.dicebot.GetVariableReply.prototype.setValue = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - - - - -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.dicebot.GetAllVariablesRequest.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.GetAllVariablesRequest.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.dicebot.GetAllVariablesRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.GetAllVariablesRequest.toObject = function(includeInstance, msg) { - var f, obj = { - userId: jspb.Message.getFieldWithDefault(msg, 1, ""), - roomId: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.dicebot.GetAllVariablesRequest} - */ -proto.dicebot.GetAllVariablesRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.GetAllVariablesRequest; - return proto.dicebot.GetAllVariablesRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.GetAllVariablesRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.GetAllVariablesRequest} - */ -proto.dicebot.GetAllVariablesRequest.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.setUserId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setRoomId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.GetAllVariablesRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.GetAllVariablesRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.GetAllVariablesRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.GetAllVariablesRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUserId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getRoomId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string user_id = 1; - * @return {string} - */ -proto.dicebot.GetAllVariablesRequest.prototype.getUserId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.GetAllVariablesRequest} returns this - */ -proto.dicebot.GetAllVariablesRequest.prototype.setUserId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string room_id = 2; - * @return {string} - */ -proto.dicebot.GetAllVariablesRequest.prototype.getRoomId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.GetAllVariablesRequest} returns this - */ -proto.dicebot.GetAllVariablesRequest.prototype.setRoomId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -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.dicebot.GetAllVariablesReply.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.GetAllVariablesReply.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.dicebot.GetAllVariablesReply} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.GetAllVariablesReply.toObject = function(includeInstance, msg) { - var f, obj = { - variablesMap: (f = msg.getVariablesMap()) ? 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.dicebot.GetAllVariablesReply} - */ -proto.dicebot.GetAllVariablesReply.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.GetAllVariablesReply; - return proto.dicebot.GetAllVariablesReply.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.GetAllVariablesReply} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.GetAllVariablesReply} - */ -proto.dicebot.GetAllVariablesReply.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getVariablesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt32, null, "", 0); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.GetAllVariablesReply.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.GetAllVariablesReply.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.GetAllVariablesReply} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.GetAllVariablesReply.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVariablesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt32); - } -}; - - -/** - * map variables = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.dicebot.GetAllVariablesReply.prototype.getVariablesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.dicebot.GetAllVariablesReply} returns this - */ -proto.dicebot.GetAllVariablesReply.prototype.clearVariablesMap = function() { - this.getVariablesMap().clear(); - return this;}; - - - - - -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.dicebot.SetVariableRequest.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.SetVariableRequest.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.dicebot.SetVariableRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.SetVariableRequest.toObject = function(includeInstance, msg) { - var f, obj = { - userId: jspb.Message.getFieldWithDefault(msg, 1, ""), - roomId: jspb.Message.getFieldWithDefault(msg, 2, ""), - variableName: jspb.Message.getFieldWithDefault(msg, 3, ""), - value: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.dicebot.SetVariableRequest} - */ -proto.dicebot.SetVariableRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.SetVariableRequest; - return proto.dicebot.SetVariableRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.SetVariableRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.SetVariableRequest} - */ -proto.dicebot.SetVariableRequest.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.setUserId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setRoomId(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setVariableName(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.SetVariableRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.SetVariableRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.SetVariableRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.SetVariableRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUserId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getRoomId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getVariableName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getValue(); - if (f !== 0) { - writer.writeInt32( - 4, - f - ); - } -}; - - -/** - * optional string user_id = 1; - * @return {string} - */ -proto.dicebot.SetVariableRequest.prototype.getUserId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.SetVariableRequest} returns this - */ -proto.dicebot.SetVariableRequest.prototype.setUserId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string room_id = 2; - * @return {string} - */ -proto.dicebot.SetVariableRequest.prototype.getRoomId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.SetVariableRequest} returns this - */ -proto.dicebot.SetVariableRequest.prototype.setRoomId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string variable_name = 3; - * @return {string} - */ -proto.dicebot.SetVariableRequest.prototype.getVariableName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.SetVariableRequest} returns this - */ -proto.dicebot.SetVariableRequest.prototype.setVariableName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional int32 value = 4; - * @return {number} - */ -proto.dicebot.SetVariableRequest.prototype.getValue = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.dicebot.SetVariableRequest} returns this - */ -proto.dicebot.SetVariableRequest.prototype.setValue = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - - - - - -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.dicebot.SetVariableReply.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.SetVariableReply.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.dicebot.SetVariableReply} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.SetVariableReply.toObject = function(includeInstance, msg) { - var f, obj = { - success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.dicebot.SetVariableReply} - */ -proto.dicebot.SetVariableReply.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.SetVariableReply; - return proto.dicebot.SetVariableReply.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.SetVariableReply} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.SetVariableReply} - */ -proto.dicebot.SetVariableReply.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSuccess(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.SetVariableReply.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.SetVariableReply.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.SetVariableReply} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.SetVariableReply.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSuccess(); - if (f) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool success = 1; - * @return {boolean} - */ -proto.dicebot.SetVariableReply.prototype.getSuccess = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.dicebot.SetVariableReply} returns this - */ -proto.dicebot.SetVariableReply.prototype.setSuccess = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - - - - -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.dicebot.UserIdRequest.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.UserIdRequest.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.dicebot.UserIdRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.UserIdRequest.toObject = function(includeInstance, msg) { - var f, obj = { - userId: 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.dicebot.UserIdRequest} - */ -proto.dicebot.UserIdRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.UserIdRequest; - return proto.dicebot.UserIdRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.UserIdRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.UserIdRequest} - */ -proto.dicebot.UserIdRequest.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.setUserId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.UserIdRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.UserIdRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.UserIdRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.UserIdRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUserId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string user_id = 1; - * @return {string} - */ -proto.dicebot.UserIdRequest.prototype.getUserId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.UserIdRequest} returns this - */ -proto.dicebot.UserIdRequest.prototype.setUserId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.dicebot.RoomsListReply.repeatedFields_ = [1]; - - - -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.dicebot.RoomsListReply.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.RoomsListReply.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.dicebot.RoomsListReply} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.RoomsListReply.toObject = function(includeInstance, msg) { - var f, obj = { - roomsList: jspb.Message.toObjectList(msg.getRoomsList(), - proto.dicebot.RoomsListReply.Room.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.dicebot.RoomsListReply} - */ -proto.dicebot.RoomsListReply.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.RoomsListReply; - return proto.dicebot.RoomsListReply.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.RoomsListReply} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.RoomsListReply} - */ -proto.dicebot.RoomsListReply.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.dicebot.RoomsListReply.Room; - reader.readMessage(value,proto.dicebot.RoomsListReply.Room.deserializeBinaryFromReader); - msg.addRooms(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.RoomsListReply.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.RoomsListReply.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.RoomsListReply} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.RoomsListReply.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRoomsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.dicebot.RoomsListReply.Room.serializeBinaryToWriter - ); - } -}; - - - - - -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.dicebot.RoomsListReply.Room.prototype.toObject = function(opt_includeInstance) { - return proto.dicebot.RoomsListReply.Room.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.dicebot.RoomsListReply.Room} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.RoomsListReply.Room.toObject = function(includeInstance, msg) { - var f, obj = { - roomId: jspb.Message.getFieldWithDefault(msg, 1, ""), - displayName: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.dicebot.RoomsListReply.Room} - */ -proto.dicebot.RoomsListReply.Room.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.dicebot.RoomsListReply.Room; - return proto.dicebot.RoomsListReply.Room.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.dicebot.RoomsListReply.Room} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.dicebot.RoomsListReply.Room} - */ -proto.dicebot.RoomsListReply.Room.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.setRoomId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDisplayName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.dicebot.RoomsListReply.Room.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.dicebot.RoomsListReply.Room.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.dicebot.RoomsListReply.Room} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.dicebot.RoomsListReply.Room.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRoomId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getDisplayName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string room_id = 1; - * @return {string} - */ -proto.dicebot.RoomsListReply.Room.prototype.getRoomId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.RoomsListReply.Room} returns this - */ -proto.dicebot.RoomsListReply.Room.prototype.setRoomId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string display_name = 2; - * @return {string} - */ -proto.dicebot.RoomsListReply.Room.prototype.getDisplayName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.dicebot.RoomsListReply.Room} returns this - */ -proto.dicebot.RoomsListReply.Room.prototype.setDisplayName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated Room rooms = 1; - * @return {!Array} - */ -proto.dicebot.RoomsListReply.prototype.getRoomsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.dicebot.RoomsListReply.Room, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.dicebot.RoomsListReply} returns this -*/ -proto.dicebot.RoomsListReply.prototype.setRoomsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.dicebot.RoomsListReply.Room=} opt_value - * @param {number=} opt_index - * @return {!proto.dicebot.RoomsListReply.Room} - */ -proto.dicebot.RoomsListReply.prototype.addRooms = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.dicebot.RoomsListReply.Room, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.dicebot.RoomsListReply} returns this - */ -proto.dicebot.RoomsListReply.prototype.clearRoomsList = function() { - return this.setRoomsList([]); -}; - - -goog.object.extend(exports, proto.dicebot); diff --git a/api/_proto/dicebot_pb_service.d.ts b/api/_proto/dicebot_pb_service.d.ts deleted file mode 100644 index 3f89c6d..0000000 --- a/api/_proto/dicebot_pb_service.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -// package: dicebot -// file: dicebot.proto - -import * as dicebot_pb from "./dicebot_pb"; -import {grpc} from "@improbable-eng/grpc-web"; - -type DicebotGetVariable = { - readonly methodName: string; - readonly service: typeof Dicebot; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof dicebot_pb.GetVariableRequest; - readonly responseType: typeof dicebot_pb.GetVariableReply; -}; - -type DicebotGetAllVariables = { - readonly methodName: string; - readonly service: typeof Dicebot; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof dicebot_pb.GetAllVariablesRequest; - readonly responseType: typeof dicebot_pb.GetAllVariablesReply; -}; - -type DicebotSetVariable = { - readonly methodName: string; - readonly service: typeof Dicebot; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof dicebot_pb.SetVariableRequest; - readonly responseType: typeof dicebot_pb.SetVariableReply; -}; - -type DicebotRoomsForUser = { - readonly methodName: string; - readonly service: typeof Dicebot; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof dicebot_pb.UserIdRequest; - readonly responseType: typeof dicebot_pb.RoomsListReply; -}; - -export class Dicebot { - static readonly serviceName: string; - static readonly GetVariable: DicebotGetVariable; - static readonly GetAllVariables: DicebotGetAllVariables; - static readonly SetVariable: DicebotSetVariable; - static readonly RoomsForUser: DicebotRoomsForUser; -} - -export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } -export type Status = { details: string, code: number; metadata: grpc.Metadata } - -interface UnaryResponse { - cancel(): void; -} -interface ResponseStream { - cancel(): void; - on(type: 'data', handler: (message: T) => void): ResponseStream; - on(type: 'end', handler: (status?: Status) => void): ResponseStream; - on(type: 'status', handler: (status: Status) => void): ResponseStream; -} -interface RequestStream { - write(message: T): RequestStream; - end(): void; - cancel(): void; - on(type: 'end', handler: (status?: Status) => void): RequestStream; - on(type: 'status', handler: (status: Status) => void): RequestStream; -} -interface BidirectionalStream { - write(message: ReqT): BidirectionalStream; - end(): void; - cancel(): void; - on(type: 'data', handler: (message: ResT) => void): BidirectionalStream; - on(type: 'end', handler: (status?: Status) => void): BidirectionalStream; - on(type: 'status', handler: (status: Status) => void): BidirectionalStream; -} - -export class DicebotClient { - readonly serviceHost: string; - - constructor(serviceHost: string, options?: grpc.RpcOptions); - getVariable( - requestMessage: dicebot_pb.GetVariableRequest, - metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: dicebot_pb.GetVariableReply|null) => void - ): UnaryResponse; - getVariable( - requestMessage: dicebot_pb.GetVariableRequest, - callback: (error: ServiceError|null, responseMessage: dicebot_pb.GetVariableReply|null) => void - ): UnaryResponse; - getAllVariables( - requestMessage: dicebot_pb.GetAllVariablesRequest, - metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: dicebot_pb.GetAllVariablesReply|null) => void - ): UnaryResponse; - getAllVariables( - requestMessage: dicebot_pb.GetAllVariablesRequest, - callback: (error: ServiceError|null, responseMessage: dicebot_pb.GetAllVariablesReply|null) => void - ): UnaryResponse; - setVariable( - requestMessage: dicebot_pb.SetVariableRequest, - metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: dicebot_pb.SetVariableReply|null) => void - ): UnaryResponse; - setVariable( - requestMessage: dicebot_pb.SetVariableRequest, - callback: (error: ServiceError|null, responseMessage: dicebot_pb.SetVariableReply|null) => void - ): UnaryResponse; - roomsForUser( - requestMessage: dicebot_pb.UserIdRequest, - metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: dicebot_pb.RoomsListReply|null) => void - ): UnaryResponse; - roomsForUser( - requestMessage: dicebot_pb.UserIdRequest, - callback: (error: ServiceError|null, responseMessage: dicebot_pb.RoomsListReply|null) => void - ): UnaryResponse; -} - diff --git a/api/_proto/dicebot_pb_service.js b/api/_proto/dicebot_pb_service.js deleted file mode 100644 index 2d29080..0000000 --- a/api/_proto/dicebot_pb_service.js +++ /dev/null @@ -1,181 +0,0 @@ -// package: dicebot -// file: dicebot.proto - -var dicebot_pb = require("./dicebot_pb"); -var grpc = require("@improbable-eng/grpc-web").grpc; - -var Dicebot = (function () { - function Dicebot() {} - Dicebot.serviceName = "dicebot.Dicebot"; - return Dicebot; -}()); - -Dicebot.GetVariable = { - methodName: "GetVariable", - service: Dicebot, - requestStream: false, - responseStream: false, - requestType: dicebot_pb.GetVariableRequest, - responseType: dicebot_pb.GetVariableReply -}; - -Dicebot.GetAllVariables = { - methodName: "GetAllVariables", - service: Dicebot, - requestStream: false, - responseStream: false, - requestType: dicebot_pb.GetAllVariablesRequest, - responseType: dicebot_pb.GetAllVariablesReply -}; - -Dicebot.SetVariable = { - methodName: "SetVariable", - service: Dicebot, - requestStream: false, - responseStream: false, - requestType: dicebot_pb.SetVariableRequest, - responseType: dicebot_pb.SetVariableReply -}; - -Dicebot.RoomsForUser = { - methodName: "RoomsForUser", - service: Dicebot, - requestStream: false, - responseStream: false, - requestType: dicebot_pb.UserIdRequest, - responseType: dicebot_pb.RoomsListReply -}; - -exports.Dicebot = Dicebot; - -function DicebotClient(serviceHost, options) { - this.serviceHost = serviceHost; - this.options = options || {}; -} - -DicebotClient.prototype.getVariable = function getVariable(requestMessage, metadata, callback) { - if (arguments.length === 2) { - callback = arguments[1]; - } - var client = grpc.unary(Dicebot.GetVariable, { - request: requestMessage, - host: this.serviceHost, - metadata: metadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (callback) { - if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); - } else { - callback(null, response.message); - } - } - } - }); - return { - cancel: function () { - callback = null; - client.close(); - } - }; -}; - -DicebotClient.prototype.getAllVariables = function getAllVariables(requestMessage, metadata, callback) { - if (arguments.length === 2) { - callback = arguments[1]; - } - var client = grpc.unary(Dicebot.GetAllVariables, { - request: requestMessage, - host: this.serviceHost, - metadata: metadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (callback) { - if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); - } else { - callback(null, response.message); - } - } - } - }); - return { - cancel: function () { - callback = null; - client.close(); - } - }; -}; - -DicebotClient.prototype.setVariable = function setVariable(requestMessage, metadata, callback) { - if (arguments.length === 2) { - callback = arguments[1]; - } - var client = grpc.unary(Dicebot.SetVariable, { - request: requestMessage, - host: this.serviceHost, - metadata: metadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (callback) { - if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); - } else { - callback(null, response.message); - } - } - } - }); - return { - cancel: function () { - callback = null; - client.close(); - } - }; -}; - -DicebotClient.prototype.roomsForUser = function roomsForUser(requestMessage, metadata, callback) { - if (arguments.length === 2) { - callback = arguments[1]; - } - var client = grpc.unary(Dicebot.RoomsForUser, { - request: requestMessage, - host: this.serviceHost, - metadata: metadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (callback) { - if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); - } else { - callback(null, response.message); - } - } - } - }); - return { - cancel: function () { - callback = null; - client.close(); - } - }; -}; - -exports.DicebotClient = DicebotClient; - diff --git a/api/_proto/web-api_pb.d.ts b/api/_proto/web-api_pb.d.ts deleted file mode 100644 index bd39a53..0000000 --- a/api/_proto/web-api_pb.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -// package: web_api -// file: web-api.proto - -import * as jspb from "google-protobuf"; - -export class UserIdRequest extends jspb.Message { - getUserId(): string; - setUserId(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): UserIdRequest.AsObject; - static toObject(includeInstance: boolean, msg: UserIdRequest): UserIdRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: UserIdRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): UserIdRequest; - static deserializeBinaryFromReader(message: UserIdRequest, reader: jspb.BinaryReader): UserIdRequest; -} - -export namespace UserIdRequest { - export type AsObject = { - userId: string, - } -} - -export class RoomsListReply extends jspb.Message { - clearRoomsList(): void; - getRoomsList(): Array; - setRoomsList(value: Array): void; - addRooms(value?: RoomsListReply.Room, index?: number): RoomsListReply.Room; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): RoomsListReply.AsObject; - static toObject(includeInstance: boolean, msg: RoomsListReply): RoomsListReply.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: RoomsListReply, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): RoomsListReply; - static deserializeBinaryFromReader(message: RoomsListReply, reader: jspb.BinaryReader): RoomsListReply; -} - -export namespace RoomsListReply { - export type AsObject = { - roomsList: Array, - } - - export class Room extends jspb.Message { - getRoomId(): string; - setRoomId(value: string): void; - - getDisplayName(): string; - setDisplayName(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Room.AsObject; - static toObject(includeInstance: boolean, msg: Room): Room.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Room, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Room; - static deserializeBinaryFromReader(message: Room, reader: jspb.BinaryReader): Room; - } - - export namespace Room { - export type AsObject = { - roomId: string, - displayName: string, - } - } -} - diff --git a/api/_proto/web-api_pb.js b/api/_proto/web-api_pb.js deleted file mode 100644 index d2d7096..0000000 --- a/api/_proto/web-api_pb.js +++ /dev/null @@ -1,534 +0,0 @@ -// source: web-api.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.web_api.RoomsListReply', null, global); -goog.exportSymbol('proto.web_api.RoomsListReply.Room', null, global); -goog.exportSymbol('proto.web_api.UserIdRequest', null, global); -/** - * 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.web_api.UserIdRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.web_api.UserIdRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.web_api.UserIdRequest.displayName = 'proto.web_api.UserIdRequest'; -} -/** - * 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.web_api.RoomsListReply = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.web_api.RoomsListReply.repeatedFields_, null); -}; -goog.inherits(proto.web_api.RoomsListReply, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.web_api.RoomsListReply.displayName = 'proto.web_api.RoomsListReply'; -} -/** - * 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.web_api.RoomsListReply.Room = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.web_api.RoomsListReply.Room, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.web_api.RoomsListReply.Room.displayName = 'proto.web_api.RoomsListReply.Room'; -} - - - -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.web_api.UserIdRequest.prototype.toObject = function(opt_includeInstance) { - return proto.web_api.UserIdRequest.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.web_api.UserIdRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.web_api.UserIdRequest.toObject = function(includeInstance, msg) { - var f, obj = { - userId: 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.web_api.UserIdRequest} - */ -proto.web_api.UserIdRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.web_api.UserIdRequest; - return proto.web_api.UserIdRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.web_api.UserIdRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.web_api.UserIdRequest} - */ -proto.web_api.UserIdRequest.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.setUserId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.web_api.UserIdRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.web_api.UserIdRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.web_api.UserIdRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.web_api.UserIdRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUserId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string user_id = 1; - * @return {string} - */ -proto.web_api.UserIdRequest.prototype.getUserId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.web_api.UserIdRequest} returns this - */ -proto.web_api.UserIdRequest.prototype.setUserId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.web_api.RoomsListReply.repeatedFields_ = [1]; - - - -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.web_api.RoomsListReply.prototype.toObject = function(opt_includeInstance) { - return proto.web_api.RoomsListReply.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.web_api.RoomsListReply} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.web_api.RoomsListReply.toObject = function(includeInstance, msg) { - var f, obj = { - roomsList: jspb.Message.toObjectList(msg.getRoomsList(), - proto.web_api.RoomsListReply.Room.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.web_api.RoomsListReply} - */ -proto.web_api.RoomsListReply.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.web_api.RoomsListReply; - return proto.web_api.RoomsListReply.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.web_api.RoomsListReply} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.web_api.RoomsListReply} - */ -proto.web_api.RoomsListReply.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.web_api.RoomsListReply.Room; - reader.readMessage(value,proto.web_api.RoomsListReply.Room.deserializeBinaryFromReader); - msg.addRooms(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.web_api.RoomsListReply.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.web_api.RoomsListReply.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.web_api.RoomsListReply} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.web_api.RoomsListReply.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRoomsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.web_api.RoomsListReply.Room.serializeBinaryToWriter - ); - } -}; - - - - - -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.web_api.RoomsListReply.Room.prototype.toObject = function(opt_includeInstance) { - return proto.web_api.RoomsListReply.Room.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.web_api.RoomsListReply.Room} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.web_api.RoomsListReply.Room.toObject = function(includeInstance, msg) { - var f, obj = { - roomId: jspb.Message.getFieldWithDefault(msg, 1, ""), - displayName: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.web_api.RoomsListReply.Room} - */ -proto.web_api.RoomsListReply.Room.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.web_api.RoomsListReply.Room; - return proto.web_api.RoomsListReply.Room.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.web_api.RoomsListReply.Room} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.web_api.RoomsListReply.Room} - */ -proto.web_api.RoomsListReply.Room.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.setRoomId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDisplayName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.web_api.RoomsListReply.Room.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.web_api.RoomsListReply.Room.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.web_api.RoomsListReply.Room} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.web_api.RoomsListReply.Room.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRoomId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getDisplayName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string room_id = 1; - * @return {string} - */ -proto.web_api.RoomsListReply.Room.prototype.getRoomId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.web_api.RoomsListReply.Room} returns this - */ -proto.web_api.RoomsListReply.Room.prototype.setRoomId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string display_name = 2; - * @return {string} - */ -proto.web_api.RoomsListReply.Room.prototype.getDisplayName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.web_api.RoomsListReply.Room} returns this - */ -proto.web_api.RoomsListReply.Room.prototype.setDisplayName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated Room rooms = 1; - * @return {!Array} - */ -proto.web_api.RoomsListReply.prototype.getRoomsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.web_api.RoomsListReply.Room, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.web_api.RoomsListReply} returns this -*/ -proto.web_api.RoomsListReply.prototype.setRoomsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.web_api.RoomsListReply.Room=} opt_value - * @param {number=} opt_index - * @return {!proto.web_api.RoomsListReply.Room} - */ -proto.web_api.RoomsListReply.prototype.addRooms = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.web_api.RoomsListReply.Room, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.web_api.RoomsListReply} returns this - */ -proto.web_api.RoomsListReply.prototype.clearRoomsList = function() { - return this.setRoomsList([]); -}; - - -goog.object.extend(exports, proto.web_api); diff --git a/api/_proto/web-api_pb_service.d.ts b/api/_proto/web-api_pb_service.d.ts deleted file mode 100644 index 89136fe..0000000 --- a/api/_proto/web-api_pb_service.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -// package: web_api -// file: web-api.proto - -import * as web_api_pb from "./web-api_pb"; -import {grpc} from "@improbable-eng/grpc-web"; - -type WebApiListRoom = { - readonly methodName: string; - readonly service: typeof WebApi; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof web_api_pb.UserIdRequest; - readonly responseType: typeof web_api_pb.RoomsListReply; -}; - -export class WebApi { - static readonly serviceName: string; - static readonly ListRoom: WebApiListRoom; -} - -export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } -export type Status = { details: string, code: number; metadata: grpc.Metadata } - -interface UnaryResponse { - cancel(): void; -} -interface ResponseStream { - cancel(): void; - on(type: 'data', handler: (message: T) => void): ResponseStream; - on(type: 'end', handler: (status?: Status) => void): ResponseStream; - on(type: 'status', handler: (status: Status) => void): ResponseStream; -} -interface RequestStream { - write(message: T): RequestStream; - end(): void; - cancel(): void; - on(type: 'end', handler: (status?: Status) => void): RequestStream; - on(type: 'status', handler: (status: Status) => void): RequestStream; -} -interface BidirectionalStream { - write(message: ReqT): BidirectionalStream; - end(): void; - cancel(): void; - on(type: 'data', handler: (message: ResT) => void): BidirectionalStream; - on(type: 'end', handler: (status?: Status) => void): BidirectionalStream; - on(type: 'status', handler: (status: Status) => void): BidirectionalStream; -} - -export class WebApiClient { - readonly serviceHost: string; - - constructor(serviceHost: string, options?: grpc.RpcOptions); - listRoom( - requestMessage: web_api_pb.UserIdRequest, - metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: web_api_pb.RoomsListReply|null) => void - ): UnaryResponse; - listRoom( - requestMessage: web_api_pb.UserIdRequest, - callback: (error: ServiceError|null, responseMessage: web_api_pb.RoomsListReply|null) => void - ): UnaryResponse; -} - diff --git a/api/_proto/web-api_pb_service.js b/api/_proto/web-api_pb_service.js deleted file mode 100644 index 5521cde..0000000 --- a/api/_proto/web-api_pb_service.js +++ /dev/null @@ -1,61 +0,0 @@ -// package: web_api -// file: web-api.proto - -var web_api_pb = require("./web-api_pb"); -var grpc = require("@improbable-eng/grpc-web").grpc; - -var WebApi = (function () { - function WebApi() {} - WebApi.serviceName = "web_api.WebApi"; - return WebApi; -}()); - -WebApi.ListRoom = { - methodName: "ListRoom", - service: WebApi, - requestStream: false, - responseStream: false, - requestType: web_api_pb.UserIdRequest, - responseType: web_api_pb.RoomsListReply -}; - -exports.WebApi = WebApi; - -function WebApiClient(serviceHost, options) { - this.serviceHost = serviceHost; - this.options = options || {}; -} - -WebApiClient.prototype.listRoom = function listRoom(requestMessage, metadata, callback) { - if (arguments.length === 2) { - callback = arguments[1]; - } - var client = grpc.unary(WebApi.ListRoom, { - request: requestMessage, - host: this.serviceHost, - metadata: metadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (callback) { - if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); - } else { - callback(null, response.message); - } - } - } - }); - return { - cancel: function () { - callback = null; - client.close(); - } - }; -}; - -exports.WebApiClient = WebApiClient; -