UNPKG

rapida-react

Version:

An easy to use react client for building generative ai application using Rapida platform.

1,476 lines (1,475 loc) 403 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/clients/protos/common_pb.js var require_common_pb = __commonJS({ "src/clients/protos/common_pb.js"(exports2) { "use strict"; var jspb = require("google-protobuf"); var goog = jspb; var global = function() { return this || window || global || self || Function("return this")(); }.call(null); var google_protobuf_timestamp_pb = require("google-protobuf/google/protobuf/timestamp_pb.js"); goog.object.extend(proto, google_protobuf_timestamp_pb); var google_protobuf_struct_pb = require("google-protobuf/google/protobuf/struct_pb.js"); goog.object.extend(proto, google_protobuf_struct_pb); goog.exportSymbol("proto.AgentPromptTemplate", null, global); goog.exportSymbol("proto.AssistantConversation", null, global); goog.exportSymbol("proto.AssistantConversationContext", null, global); goog.exportSymbol("proto.AssistantConversationMessage", null, global); goog.exportSymbol("proto.AssistantMessageStage", null, global); goog.exportSymbol("proto.BaseResponse", null, global); goog.exportSymbol("proto.Content", null, global); goog.exportSymbol("proto.Criteria", null, global); goog.exportSymbol("proto.Error", null, global); goog.exportSymbol("proto.Event", null, global); goog.exportSymbol("proto.FilePrompt", null, global); goog.exportSymbol("proto.FunctionCall", null, global); goog.exportSymbol("proto.GetAllAssistantConversationRequest", null, global); goog.exportSymbol("proto.GetAllAssistantConversationResponse", null, global); goog.exportSymbol("proto.GetAllConversationMessageRequest", null, global); goog.exportSymbol("proto.GetAllConversationMessageResponse", null, global); goog.exportSymbol("proto.Knowledge", null, global); goog.exportSymbol("proto.Message", null, global); goog.exportSymbol("proto.Metadata", null, global); goog.exportSymbol("proto.Metric", null, global); goog.exportSymbol("proto.Ordering", null, global); goog.exportSymbol("proto.Organization", null, global); goog.exportSymbol("proto.Paginate", null, global); goog.exportSymbol("proto.Paginated", null, global); goog.exportSymbol("proto.Provider", null, global); goog.exportSymbol("proto.ProviderModel", null, global); goog.exportSymbol("proto.ProviderModelParameter", null, global); goog.exportSymbol("proto.ProviderModelVariable", null, global); goog.exportSymbol("proto.Source", null, global); goog.exportSymbol("proto.SpeechToTextPrompt", null, global); goog.exportSymbol("proto.Tag", null, global); goog.exportSymbol("proto.TextChatCompletePrompt", null, global); goog.exportSymbol("proto.TextCompletePrompt", null, global); goog.exportSymbol("proto.TextPrompt", null, global); goog.exportSymbol("proto.TextToImagePrompt", null, global); goog.exportSymbol("proto.TextToSpeechPrompt", null, global); goog.exportSymbol("proto.ToolCall", null, global); goog.exportSymbol("proto.User", null, global); goog.exportSymbol("proto.Variable", null, global); proto.Criteria = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Criteria, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Criteria.displayName = "proto.Criteria"; } proto.Error = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Error, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Error.displayName = "proto.Error"; } proto.Paginate = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Paginate, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Paginate.displayName = "proto.Paginate"; } proto.Paginated = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Paginated, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Paginated.displayName = "proto.Paginated"; } proto.Ordering = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Ordering, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Ordering.displayName = "proto.Ordering"; } proto.User = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.User, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.User.displayName = "proto.User"; } proto.BaseResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.BaseResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.BaseResponse.displayName = "proto.BaseResponse"; } proto.Metadata = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Metadata, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Metadata.displayName = "proto.Metadata"; } proto.Variable = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Variable, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Variable.displayName = "proto.Variable"; } proto.ProviderModelParameter = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.ProviderModelParameter, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.ProviderModelParameter.displayName = "proto.ProviderModelParameter"; } proto.Provider = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.Provider.repeatedFields_, null); }; goog.inherits(proto.Provider, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Provider.displayName = "proto.Provider"; } proto.ProviderModelVariable = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.ProviderModelVariable.repeatedFields_, null); }; goog.inherits(proto.ProviderModelVariable, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.ProviderModelVariable.displayName = "proto.ProviderModelVariable"; } proto.ProviderModel = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.ProviderModel.repeatedFields_, null); }; goog.inherits(proto.ProviderModel, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.ProviderModel.displayName = "proto.ProviderModel"; } proto.Tag = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.Tag.repeatedFields_, null); }; goog.inherits(proto.Tag, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Tag.displayName = "proto.Tag"; } proto.Organization = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Organization, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Organization.displayName = "proto.Organization"; } proto.Metric = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Metric, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Metric.displayName = "proto.Metric"; } proto.Content = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Content, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Content.displayName = "proto.Content"; } proto.Message = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.Message.repeatedFields_, null); }; goog.inherits(proto.Message, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Message.displayName = "proto.Message"; } proto.Event = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Event, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Event.displayName = "proto.Event"; } proto.ToolCall = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.ToolCall, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.ToolCall.displayName = "proto.ToolCall"; } proto.FunctionCall = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.FunctionCall, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.FunctionCall.displayName = "proto.FunctionCall"; } proto.Knowledge = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Knowledge, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Knowledge.displayName = "proto.Knowledge"; } proto.AgentPromptTemplate = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.AgentPromptTemplate.repeatedFields_, null); }; goog.inherits(proto.AgentPromptTemplate, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.AgentPromptTemplate.displayName = "proto.AgentPromptTemplate"; } proto.TextPrompt = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.TextPrompt, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.TextPrompt.displayName = "proto.TextPrompt"; } proto.FilePrompt = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.FilePrompt, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.FilePrompt.displayName = "proto.FilePrompt"; } proto.TextChatCompletePrompt = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.TextChatCompletePrompt.repeatedFields_, null); }; goog.inherits(proto.TextChatCompletePrompt, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.TextChatCompletePrompt.displayName = "proto.TextChatCompletePrompt"; } proto.TextCompletePrompt = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.TextCompletePrompt.repeatedFields_, null); }; goog.inherits(proto.TextCompletePrompt, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.TextCompletePrompt.displayName = "proto.TextCompletePrompt"; } proto.TextToImagePrompt = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.TextToImagePrompt.repeatedFields_, null); }; goog.inherits(proto.TextToImagePrompt, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.TextToImagePrompt.displayName = "proto.TextToImagePrompt"; } proto.TextToSpeechPrompt = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.TextToSpeechPrompt.repeatedFields_, null); }; goog.inherits(proto.TextToSpeechPrompt, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.TextToSpeechPrompt.displayName = "proto.TextToSpeechPrompt"; } proto.SpeechToTextPrompt = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.SpeechToTextPrompt.repeatedFields_, null); }; goog.inherits(proto.SpeechToTextPrompt, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.SpeechToTextPrompt.displayName = "proto.SpeechToTextPrompt"; } proto.AssistantMessageStage = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.AssistantMessageStage, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.AssistantMessageStage.displayName = "proto.AssistantMessageStage"; } proto.AssistantConversationMessage = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.AssistantConversationMessage.repeatedFields_, null); }; goog.inherits(proto.AssistantConversationMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.AssistantConversationMessage.displayName = "proto.AssistantConversationMessage"; } proto.AssistantConversationContext = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.AssistantConversationContext, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.AssistantConversationContext.displayName = "proto.AssistantConversationContext"; } proto.AssistantConversation = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.AssistantConversation.repeatedFields_, null); }; goog.inherits(proto.AssistantConversation, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.AssistantConversation.displayName = "proto.AssistantConversation"; } proto.GetAllAssistantConversationRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.GetAllAssistantConversationRequest.repeatedFields_, null); }; goog.inherits(proto.GetAllAssistantConversationRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.GetAllAssistantConversationRequest.displayName = "proto.GetAllAssistantConversationRequest"; } proto.GetAllAssistantConversationResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.GetAllAssistantConversationResponse.repeatedFields_, null); }; goog.inherits(proto.GetAllAssistantConversationResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.GetAllAssistantConversationResponse.displayName = "proto.GetAllAssistantConversationResponse"; } proto.GetAllConversationMessageRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.GetAllConversationMessageRequest.repeatedFields_, null); }; goog.inherits(proto.GetAllConversationMessageRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.GetAllConversationMessageRequest.displayName = "proto.GetAllConversationMessageRequest"; } proto.GetAllConversationMessageResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.GetAllConversationMessageResponse.repeatedFields_, null); }; goog.inherits(proto.GetAllConversationMessageResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.GetAllConversationMessageResponse.displayName = "proto.GetAllConversationMessageResponse"; } if (jspb.Message.GENERATE_TO_OBJECT) { proto.Criteria.prototype.toObject = function(opt_includeInstance) { return proto.Criteria.toObject(opt_includeInstance, this); }; proto.Criteria.toObject = function(includeInstance, msg) { var f, obj = { key: jspb.Message.getFieldWithDefault(msg, 1, ""), value: jspb.Message.getFieldWithDefault(msg, 2, ""), logic: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.Criteria.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Criteria(); return proto.Criteria.deserializeBinaryFromReader(msg, reader); }; proto.Criteria.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.setKey(value); break; case 2: var value = ( /** @type {string} */ reader.readString() ); msg.setValue(value); break; case 3: var value = ( /** @type {string} */ reader.readString() ); msg.setLogic(value); break; default: reader.skipField(); break; } } return msg; }; proto.Criteria.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.Criteria.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.Criteria.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getKey(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getValue(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getLogic(); if (f.length > 0) { writer.writeString( 3, f ); } }; proto.Criteria.prototype.getKey = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 1, "") ); }; proto.Criteria.prototype.setKey = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; proto.Criteria.prototype.getValue = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 2, "") ); }; proto.Criteria.prototype.setValue = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; proto.Criteria.prototype.getLogic = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 3, "") ); }; proto.Criteria.prototype.setLogic = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { proto.Error.prototype.toObject = function(opt_includeInstance) { return proto.Error.toObject(opt_includeInstance, this); }; proto.Error.toObject = function(includeInstance, msg) { var f, obj = { errorcode: jspb.Message.getFieldWithDefault(msg, 1, "0"), errormessage: jspb.Message.getFieldWithDefault(msg, 2, ""), humanmessage: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.Error.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Error(); return proto.Error.deserializeBinaryFromReader(msg, reader); }; proto.Error.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = ( /** @type {string} */ reader.readUint64String() ); msg.setErrorcode(value); break; case 2: var value = ( /** @type {string} */ reader.readString() ); msg.setErrormessage(value); break; case 3: var value = ( /** @type {string} */ reader.readString() ); msg.setHumanmessage(value); break; default: reader.skipField(); break; } } return msg; }; proto.Error.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.Error.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.Error.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getErrorcode(); if (parseInt(f, 10) !== 0) { writer.writeUint64String( 1, f ); } f = message.getErrormessage(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getHumanmessage(); if (f.length > 0) { writer.writeString( 3, f ); } }; proto.Error.prototype.getErrorcode = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 1, "0") ); }; proto.Error.prototype.setErrorcode = function(value) { return jspb.Message.setProto3StringIntField(this, 1, value); }; proto.Error.prototype.getErrormessage = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 2, "") ); }; proto.Error.prototype.setErrormessage = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; proto.Error.prototype.getHumanmessage = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 3, "") ); }; proto.Error.prototype.setHumanmessage = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { proto.Paginate.prototype.toObject = function(opt_includeInstance) { return proto.Paginate.toObject(opt_includeInstance, this); }; proto.Paginate.toObject = function(includeInstance, msg) { var f, obj = { page: jspb.Message.getFieldWithDefault(msg, 1, 0), pagesize: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.Paginate.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Paginate(); return proto.Paginate.deserializeBinaryFromReader(msg, reader); }; proto.Paginate.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = ( /** @type {number} */ reader.readUint32() ); msg.setPage(value); break; case 2: var value = ( /** @type {number} */ reader.readUint32() ); msg.setPagesize(value); break; default: reader.skipField(); break; } } return msg; }; proto.Paginate.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.Paginate.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.Paginate.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getPage(); if (f !== 0) { writer.writeUint32( 1, f ); } f = message.getPagesize(); if (f !== 0) { writer.writeUint32( 2, f ); } }; proto.Paginate.prototype.getPage = function() { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 1, 0) ); }; proto.Paginate.prototype.setPage = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; proto.Paginate.prototype.getPagesize = function() { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 2, 0) ); }; proto.Paginate.prototype.setPagesize = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { proto.Paginated.prototype.toObject = function(opt_includeInstance) { return proto.Paginated.toObject(opt_includeInstance, this); }; proto.Paginated.toObject = function(includeInstance, msg) { var f, obj = { currentpage: jspb.Message.getFieldWithDefault(msg, 1, 0), totalitem: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.Paginated.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Paginated(); return proto.Paginated.deserializeBinaryFromReader(msg, reader); }; proto.Paginated.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = ( /** @type {number} */ reader.readUint32() ); msg.setCurrentpage(value); break; case 2: var value = ( /** @type {number} */ reader.readUint32() ); msg.setTotalitem(value); break; default: reader.skipField(); break; } } return msg; }; proto.Paginated.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.Paginated.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.Paginated.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getCurrentpage(); if (f !== 0) { writer.writeUint32( 1, f ); } f = message.getTotalitem(); if (f !== 0) { writer.writeUint32( 2, f ); } }; proto.Paginated.prototype.getCurrentpage = function() { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 1, 0) ); }; proto.Paginated.prototype.setCurrentpage = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; proto.Paginated.prototype.getTotalitem = function() { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 2, 0) ); }; proto.Paginated.prototype.setTotalitem = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { proto.Ordering.prototype.toObject = function(opt_includeInstance) { return proto.Ordering.toObject(opt_includeInstance, this); }; proto.Ordering.toObject = function(includeInstance, msg) { var f, obj = { column: jspb.Message.getFieldWithDefault(msg, 1, ""), order: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.Ordering.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Ordering(); return proto.Ordering.deserializeBinaryFromReader(msg, reader); }; proto.Ordering.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.setColumn(value); break; case 2: var value = ( /** @type {string} */ reader.readString() ); msg.setOrder(value); break; default: reader.skipField(); break; } } return msg; }; proto.Ordering.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.Ordering.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.Ordering.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getColumn(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOrder(); if (f.length > 0) { writer.writeString( 2, f ); } }; proto.Ordering.prototype.getColumn = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 1, "") ); }; proto.Ordering.prototype.setColumn = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; proto.Ordering.prototype.getOrder = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 2, "") ); }; proto.Ordering.prototype.setOrder = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { proto.User.prototype.toObject = function(opt_includeInstance) { return proto.User.toObject(opt_includeInstance, this); }; proto.User.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, "0"), name: jspb.Message.getFieldWithDefault(msg, 2, ""), email: jspb.Message.getFieldWithDefault(msg, 3, ""), role: jspb.Message.getFieldWithDefault(msg, 4, ""), createddate: (f = msg.getCreateddate()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), status: jspb.Message.getFieldWithDefault(msg, 5, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.User.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.User(); return proto.User.deserializeBinaryFromReader(msg, reader); }; proto.User.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = ( /** @type {string} */ reader.readUint64String() ); msg.setId(value); break; case 2: var value = ( /** @type {string} */ reader.readString() ); msg.setName(value); break; case 3: var value = ( /** @type {string} */ reader.readString() ); msg.setEmail(value); break; case 4: var value = ( /** @type {string} */ reader.readString() ); msg.setRole(value); break; case 6: var value = new google_protobuf_timestamp_pb.Timestamp(); reader.readMessage(value, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setCreateddate(value); break; case 5: var value = ( /** @type {string} */ reader.readString() ); msg.setStatus(value); break; default: reader.skipField(); break; } } return msg; }; proto.User.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.User.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.User.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getId(); if (parseInt(f, 10) !== 0) { writer.writeUint64String( 1, f ); } f = message.getName(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getEmail(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getRole(); if (f.length > 0) { writer.writeString( 4, f ); } f = message.getCreateddate(); if (f != null) { writer.writeMessage( 6, f, google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } f = message.getStatus(); if (f.length > 0) { writer.writeString( 5, f ); } }; proto.User.prototype.getId = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 1, "0") ); }; proto.User.prototype.setId = function(value) { return jspb.Message.setProto3StringIntField(this, 1, value); }; proto.User.prototype.getName = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 2, "") ); }; proto.User.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; proto.User.prototype.getEmail = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 3, "") ); }; proto.User.prototype.setEmail = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; proto.User.prototype.getRole = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 4, "") ); }; proto.User.prototype.setRole = function(value) { return jspb.Message.setProto3StringField(this, 4, value); }; proto.User.prototype.getCreateddate = function() { return ( /** @type{?proto.google.protobuf.Timestamp} */ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 6) ); }; proto.User.prototype.setCreateddate = function(value) { return jspb.Message.setWrapperField(this, 6, value); }; proto.User.prototype.clearCreateddate = function() { return this.setCreateddate(void 0); }; proto.User.prototype.hasCreateddate = function() { return jspb.Message.getField(this, 6) != null; }; proto.User.prototype.getStatus = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 5, "") ); }; proto.User.prototype.setStatus = function(value) { return jspb.Message.setProto3StringField(this, 5, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { proto.BaseResponse.prototype.toObject = function(opt_includeInstance) { return proto.BaseResponse.toObject(opt_includeInstance, this); }; proto.BaseResponse.toObject = function(includeInstance, msg) { var f, obj = { code: jspb.Message.getFieldWithDefault(msg, 1, 0), success: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), dataMap: (f = msg.getDataMap()) ? f.toObject(includeInstance, void 0) : [], error: (f = msg.getError()) && proto.Error.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.BaseResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.BaseResponse(); return proto.BaseResponse.deserializeBinaryFromReader(msg, reader); }; proto.BaseResponse.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.setCode(value); break; case 2: var value = ( /** @type {boolean} */ reader.readBool() ); msg.setSuccess(value); break; case 3: var value = msg.getDataMap(); reader.readMessage(value, function(message, reader2) { jspb.Map.deserializeBinary(message, reader2, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); }); break; case 4: var value = new proto.Error(); reader.readMessage(value, proto.Error.deserializeBinaryFromReader); msg.setError(value); break; default: reader.skipField(); break; } } return msg; }; proto.BaseResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.BaseResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.BaseResponse.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getCode(); if (f !== 0) { writer.writeInt32( 1, f ); } f = message.getSuccess(); if (f) { writer.writeBool( 2, f ); } f = message.getDataMap(true); if (f && f.getLength() > 0) { f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } f = message.getError(); if (f != null) { writer.writeMessage( 4, f, proto.Error.serializeBinaryToWriter ); } }; proto.BaseResponse.prototype.getCode = function() { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 1, 0) ); }; proto.BaseResponse.prototype.setCode = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; proto.BaseResponse.prototype.getSuccess = function() { return ( /** @type {boolean} */ jspb.Message.getBooleanFieldWithDefault(this, 2, false) ); }; proto.BaseResponse.prototype.setSuccess = function(value) { return jspb.Message.setProto3BooleanField(this, 2, value); }; proto.BaseResponse.prototype.getDataMap = function(opt_noLazyCreate) { return ( /** @type {!jspb.Map<string,string>} */ jspb.Message.getMapField( this, 3, opt_noLazyCreate, null ) ); }; proto.BaseResponse.prototype.clearDataMap = function() { this.getDataMap().clear(); return this; }; proto.BaseResponse.prototype.getError = function() { return ( /** @type{?proto.Error} */ jspb.Message.getWrapperField(this, proto.Error, 4) ); }; proto.BaseResponse.prototype.setError = function(value) { return jspb.Message.setWrapperField(this, 4, value); }; proto.BaseResponse.prototype.clearError = function() { return this.setError(void 0); }; proto.BaseResponse.prototype.hasError = function() { return jspb.Message.getField(this, 4) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { proto.Metadata.prototype.toObject = function(opt_includeInstance) { return proto.Metadata.toObject(opt_includeInstance, this); }; proto.Metadata.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, "0"), key: jspb.Message.getFieldWithDefault(msg, 2, ""), value: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.Metadata.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Metadata(); return proto.Metadata.deserializeBinaryFromReader(msg, reader); }; proto.Metadata.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = ( /** @type {string} */ reader.readUint64String() ); msg.setId(value); break; case 2: var value = ( /** @type {string} */ reader.readString() ); msg.setKey(value); break; case 3: var value = ( /** @type {string} */ reader.readString() ); msg.setValue(value); break; default: reader.skipField(); break; } } return msg; }; proto.Metadata.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.Metadata.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.Metadata.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getId(); if (parseInt(f, 10) !== 0) { writer.writeUint64String( 1, f ); } f = message.getKey(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getValue(); if (f.length > 0) { writer.writeString( 3, f ); } }; proto.Metadata.prototype.getId = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 1, "0") ); }; proto.Metadata.prototype.setId = function(value) { return jspb.Message.setProto3StringIntField(this, 1, value); }; proto.Metadata.prototype.getKey = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 2, "") ); }; proto.Metadata.prototype.setKey = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; proto.Metadata.prototype.getValue = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 3, "") ); }; proto.Metadata.prototype.setValue = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { proto.Variable.prototype.toObject = function(opt_includeInstance) { return proto.Variable.toObject(opt_includeInstance, this); }; proto.Variable.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, "0"), name: jspb.Message.getFieldWithDefault(msg, 2, ""), type: jspb.Message.getFieldWithDefault(msg, 3, ""), defaultvalue: jspb.Message.getFieldWithDefault(msg, 4, ""), pb_in: jspb.Message.getFieldWithDefault(msg, 5, ""), required: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), label: jspb.Message.getFieldWithDefault(msg, 7, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } proto.Variable.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Variable(); return proto.Variable.deserializeBinaryFromReader(msg, reader); }; proto.Variable.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = ( /** @type {string} */ reader.readUint64String() ); msg.setId(value); break; case 2: var value = ( /** @type {string} */ reader.readString() ); msg.setName(value); break; case 3: var value = ( /** @type {string} */ reader.readString() ); msg.setType(value); break; case 4: var value = ( /** @type {string} */ reader.readString() ); msg.setDefaultvalue(value); break; case 5: var value = ( /** @type {string} */ reader.readString() ); msg.setIn(value); break; case 6: var value = ( /** @type {boolean} */ reader.readBool() ); msg.setRequired(value); break; case 7: var value = ( /** @type {string} */ reader.readString() ); msg.setLabel(value); break; default: reader.skipField(); break; } } return msg; }; proto.Variable.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.Variable.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; proto.Variable.serializeBinaryToWriter = function(message, writer) { var f = void 0; f = message.getId(); if (parseInt(f, 10) !== 0) { writer.writeUint64String( 1, f ); } f = message.getName(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getType(); if (f.length > 0) { writer.writeString( 3, f ); } f = /** @type {string} */ jspb.Message.getField(message, 4); if (f != null) { writer.writeString( 4, f ); } f = /** @type {string} */ jspb.Message.getField(message, 5); if (f != null) { writer.writeString( 5, f ); } f = message.getRequired(); if (f) { writer.writeBool( 6, f ); } f = /** @type {string} */ jspb.Message.getField(message, 7); if (f != null) { writer.writeString( 7, f ); } }; proto.Variable.prototype.getId = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 1, "0") ); }; proto.Variable.prototype.setId = function(value) { return jspb.Message.setProto3StringIntField(this, 1, value); }; proto.Variable.prototype.getName = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 2, "") ); }; proto.Variable.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; proto.Variable.prototype.getType = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 3, "") ); }; proto.Variable.prototype.setType = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; proto.Variable.prototype.getDefaultvalue = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 4, "") ); }; proto.Variable.prototype.setDefaultvalue = function(value) { return jspb.Message.setField(this, 4, value); }; proto.Variable.prototype.clearDefaultvalue = function() { return jspb.Message.setField(this, 4, void 0); }; proto.Variable.prototype.hasDefaultvalue = function() { return jspb.Message.getField(this, 4) != null; }; proto.Variable.prototype.getIn = function() { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this,