Implement fs module (#3)
* Implements the fs module * Add stats object * Add not implemented to createWriteStream * Update mkdtemp to use tmp dir * Unexport Stats * Add client web socket for commands and restructure
This commit is contained in:
31
packages/protocol/src/proto/client.proto
Normal file
31
packages/protocol/src/proto/client.proto
Normal file
@ -0,0 +1,31 @@
|
||||
syntax = "proto3";
|
||||
import "command.proto";
|
||||
import "node.proto";
|
||||
|
||||
message ClientMessage {
|
||||
oneof msg {
|
||||
// command.proto
|
||||
NewSessionMessage new_session = 1;
|
||||
ShutdownSessionMessage shutdown_session = 2;
|
||||
WriteToSessionMessage write_to_session = 3;
|
||||
CloseSessionInputMessage close_session_input = 4;
|
||||
ResizeSessionTTYMessage resize_session_tty = 5;
|
||||
|
||||
// node.proto
|
||||
NewEvalMessage new_eval = 6;
|
||||
}
|
||||
}
|
||||
|
||||
message ServerMessage {
|
||||
oneof msg {
|
||||
// command.proto
|
||||
NewSessionFailureMessage new_session_failure = 1;
|
||||
SessionDoneMessage session_done = 2;
|
||||
SessionOutputMessage session_output = 3;
|
||||
IdentifySessionMessage identify_session = 4;
|
||||
|
||||
// node.proto
|
||||
EvalFailedMessage eval_failed = 5;
|
||||
EvalDoneMessage eval_done = 6;
|
||||
}
|
||||
}
|
133
packages/protocol/src/proto/client_pb.d.ts
vendored
Normal file
133
packages/protocol/src/proto/client_pb.d.ts
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
// package:
|
||||
// file: client.proto
|
||||
|
||||
import * as jspb from "google-protobuf";
|
||||
import * as command_pb from "./command_pb";
|
||||
import * as node_pb from "./node_pb";
|
||||
|
||||
export class ClientMessage extends jspb.Message {
|
||||
hasNewSession(): boolean;
|
||||
clearNewSession(): void;
|
||||
getNewSession(): command_pb.NewSessionMessage | undefined;
|
||||
setNewSession(value?: command_pb.NewSessionMessage): void;
|
||||
|
||||
hasShutdownSession(): boolean;
|
||||
clearShutdownSession(): void;
|
||||
getShutdownSession(): command_pb.ShutdownSessionMessage | undefined;
|
||||
setShutdownSession(value?: command_pb.ShutdownSessionMessage): void;
|
||||
|
||||
hasWriteToSession(): boolean;
|
||||
clearWriteToSession(): void;
|
||||
getWriteToSession(): command_pb.WriteToSessionMessage | undefined;
|
||||
setWriteToSession(value?: command_pb.WriteToSessionMessage): void;
|
||||
|
||||
hasCloseSessionInput(): boolean;
|
||||
clearCloseSessionInput(): void;
|
||||
getCloseSessionInput(): command_pb.CloseSessionInputMessage | undefined;
|
||||
setCloseSessionInput(value?: command_pb.CloseSessionInputMessage): void;
|
||||
|
||||
hasResizeSessionTty(): boolean;
|
||||
clearResizeSessionTty(): void;
|
||||
getResizeSessionTty(): command_pb.ResizeSessionTTYMessage | undefined;
|
||||
setResizeSessionTty(value?: command_pb.ResizeSessionTTYMessage): void;
|
||||
|
||||
hasNewEval(): boolean;
|
||||
clearNewEval(): void;
|
||||
getNewEval(): node_pb.NewEvalMessage | undefined;
|
||||
setNewEval(value?: node_pb.NewEvalMessage): void;
|
||||
|
||||
getMsgCase(): ClientMessage.MsgCase;
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ClientMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ClientMessage;
|
||||
static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage;
|
||||
}
|
||||
|
||||
export namespace ClientMessage {
|
||||
export type AsObject = {
|
||||
newSession?: command_pb.NewSessionMessage.AsObject,
|
||||
shutdownSession?: command_pb.ShutdownSessionMessage.AsObject,
|
||||
writeToSession?: command_pb.WriteToSessionMessage.AsObject,
|
||||
closeSessionInput?: command_pb.CloseSessionInputMessage.AsObject,
|
||||
resizeSessionTty?: command_pb.ResizeSessionTTYMessage.AsObject,
|
||||
newEval?: node_pb.NewEvalMessage.AsObject,
|
||||
}
|
||||
|
||||
export enum MsgCase {
|
||||
MSG_NOT_SET = 0,
|
||||
NEW_SESSION = 1,
|
||||
SHUTDOWN_SESSION = 2,
|
||||
WRITE_TO_SESSION = 3,
|
||||
CLOSE_SESSION_INPUT = 4,
|
||||
RESIZE_SESSION_TTY = 5,
|
||||
NEW_EVAL = 6,
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerMessage extends jspb.Message {
|
||||
hasNewSessionFailure(): boolean;
|
||||
clearNewSessionFailure(): void;
|
||||
getNewSessionFailure(): command_pb.NewSessionFailureMessage | undefined;
|
||||
setNewSessionFailure(value?: command_pb.NewSessionFailureMessage): void;
|
||||
|
||||
hasSessionDone(): boolean;
|
||||
clearSessionDone(): void;
|
||||
getSessionDone(): command_pb.SessionDoneMessage | undefined;
|
||||
setSessionDone(value?: command_pb.SessionDoneMessage): void;
|
||||
|
||||
hasSessionOutput(): boolean;
|
||||
clearSessionOutput(): void;
|
||||
getSessionOutput(): command_pb.SessionOutputMessage | undefined;
|
||||
setSessionOutput(value?: command_pb.SessionOutputMessage): void;
|
||||
|
||||
hasIdentifySession(): boolean;
|
||||
clearIdentifySession(): void;
|
||||
getIdentifySession(): command_pb.IdentifySessionMessage | undefined;
|
||||
setIdentifySession(value?: command_pb.IdentifySessionMessage): void;
|
||||
|
||||
hasEvalFailed(): boolean;
|
||||
clearEvalFailed(): void;
|
||||
getEvalFailed(): node_pb.EvalFailedMessage | undefined;
|
||||
setEvalFailed(value?: node_pb.EvalFailedMessage): void;
|
||||
|
||||
hasEvalDone(): boolean;
|
||||
clearEvalDone(): void;
|
||||
getEvalDone(): node_pb.EvalDoneMessage | undefined;
|
||||
setEvalDone(value?: node_pb.EvalDoneMessage): void;
|
||||
|
||||
getMsgCase(): ServerMessage.MsgCase;
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ServerMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ServerMessage;
|
||||
static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage;
|
||||
}
|
||||
|
||||
export namespace ServerMessage {
|
||||
export type AsObject = {
|
||||
newSessionFailure?: command_pb.NewSessionFailureMessage.AsObject,
|
||||
sessionDone?: command_pb.SessionDoneMessage.AsObject,
|
||||
sessionOutput?: command_pb.SessionOutputMessage.AsObject,
|
||||
identifySession?: command_pb.IdentifySessionMessage.AsObject,
|
||||
evalFailed?: node_pb.EvalFailedMessage.AsObject,
|
||||
evalDone?: node_pb.EvalDoneMessage.AsObject,
|
||||
}
|
||||
|
||||
export enum MsgCase {
|
||||
MSG_NOT_SET = 0,
|
||||
NEW_SESSION_FAILURE = 1,
|
||||
SESSION_DONE = 2,
|
||||
SESSION_OUTPUT = 3,
|
||||
IDENTIFY_SESSION = 4,
|
||||
EVAL_FAILED = 5,
|
||||
EVAL_DONE = 6,
|
||||
}
|
||||
}
|
||||
|
868
packages/protocol/src/proto/client_pb.js
Normal file
868
packages/protocol/src/proto/client_pb.js
Normal file
@ -0,0 +1,868 @@
|
||||
/**
|
||||
* @fileoverview
|
||||
* @enhanceable
|
||||
* @public
|
||||
*/
|
||||
// GENERATED CODE -- DO NOT EDIT!
|
||||
|
||||
var jspb = require('google-protobuf');
|
||||
var goog = jspb;
|
||||
var global = Function('return this')();
|
||||
|
||||
var command_pb = require('./command_pb.js');
|
||||
var node_pb = require('./node_pb.js');
|
||||
goog.exportSymbol('proto.ClientMessage', null, global);
|
||||
goog.exportSymbol('proto.ServerMessage', 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.ClientMessage = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ClientMessage.oneofGroups_);
|
||||
};
|
||||
goog.inherits(proto.ClientMessage, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
proto.ClientMessage.displayName = 'proto.ClientMessage';
|
||||
}
|
||||
/**
|
||||
* Oneof group definitions for this message. Each group defines the field
|
||||
* numbers belonging to that group. When of these fields' value is set, all
|
||||
* other fields in the group are cleared. During deserialization, if multiple
|
||||
* fields are encountered for a group, only the last value seen will be kept.
|
||||
* @private {!Array<!Array<number>>}
|
||||
* @const
|
||||
*/
|
||||
proto.ClientMessage.oneofGroups_ = [[1,2,3,4,5,6]];
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.ClientMessage.MsgCase = {
|
||||
MSG_NOT_SET: 0,
|
||||
NEW_SESSION: 1,
|
||||
SHUTDOWN_SESSION: 2,
|
||||
WRITE_TO_SESSION: 3,
|
||||
CLOSE_SESSION_INPUT: 4,
|
||||
RESIZE_SESSION_TTY: 5,
|
||||
NEW_EVAL: 6
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {proto.ClientMessage.MsgCase}
|
||||
*/
|
||||
proto.ClientMessage.prototype.getMsgCase = function() {
|
||||
return /** @type {proto.ClientMessage.MsgCase} */(jspb.Message.computeOneofCase(this, proto.ClientMessage.oneofGroups_[0]));
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto suitable for use in Soy templates.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.ClientMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.ClientMessage.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
||||
* instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.ClientMessage} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.ClientMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
newSession: (f = msg.getNewSession()) && command_pb.NewSessionMessage.toObject(includeInstance, f),
|
||||
shutdownSession: (f = msg.getShutdownSession()) && command_pb.ShutdownSessionMessage.toObject(includeInstance, f),
|
||||
writeToSession: (f = msg.getWriteToSession()) && command_pb.WriteToSessionMessage.toObject(includeInstance, f),
|
||||
closeSessionInput: (f = msg.getCloseSessionInput()) && command_pb.CloseSessionInputMessage.toObject(includeInstance, f),
|
||||
resizeSessionTty: (f = msg.getResizeSessionTty()) && command_pb.ResizeSessionTTYMessage.toObject(includeInstance, f),
|
||||
newEval: (f = msg.getNewEval()) && node_pb.NewEvalMessage.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.ClientMessage}
|
||||
*/
|
||||
proto.ClientMessage.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.ClientMessage;
|
||||
return proto.ClientMessage.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.ClientMessage} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.ClientMessage}
|
||||
*/
|
||||
proto.ClientMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = new command_pb.NewSessionMessage;
|
||||
reader.readMessage(value,command_pb.NewSessionMessage.deserializeBinaryFromReader);
|
||||
msg.setNewSession(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = new command_pb.ShutdownSessionMessage;
|
||||
reader.readMessage(value,command_pb.ShutdownSessionMessage.deserializeBinaryFromReader);
|
||||
msg.setShutdownSession(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = new command_pb.WriteToSessionMessage;
|
||||
reader.readMessage(value,command_pb.WriteToSessionMessage.deserializeBinaryFromReader);
|
||||
msg.setWriteToSession(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = new command_pb.CloseSessionInputMessage;
|
||||
reader.readMessage(value,command_pb.CloseSessionInputMessage.deserializeBinaryFromReader);
|
||||
msg.setCloseSessionInput(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = new command_pb.ResizeSessionTTYMessage;
|
||||
reader.readMessage(value,command_pb.ResizeSessionTTYMessage.deserializeBinaryFromReader);
|
||||
msg.setResizeSessionTty(value);
|
||||
break;
|
||||
case 6:
|
||||
var value = new node_pb.NewEvalMessage;
|
||||
reader.readMessage(value,node_pb.NewEvalMessage.deserializeBinaryFromReader);
|
||||
msg.setNewEval(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class method variant: serializes the given message to binary data
|
||||
* (in protobuf wire format), writing to the given BinaryWriter.
|
||||
* @param {!proto.ClientMessage} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.ClientMessage.serializeBinaryToWriter = function(message, writer) {
|
||||
message.serializeBinaryToWriter(writer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.ClientMessage.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
this.serializeBinaryToWriter(writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format),
|
||||
* writing to the given BinaryWriter.
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.ClientMessage.prototype.serializeBinaryToWriter = function (writer) {
|
||||
var f = undefined;
|
||||
f = this.getNewSession();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
1,
|
||||
f,
|
||||
command_pb.NewSessionMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getShutdownSession();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
2,
|
||||
f,
|
||||
command_pb.ShutdownSessionMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getWriteToSession();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
3,
|
||||
f,
|
||||
command_pb.WriteToSessionMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getCloseSessionInput();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
4,
|
||||
f,
|
||||
command_pb.CloseSessionInputMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getResizeSessionTty();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
5,
|
||||
f,
|
||||
command_pb.ResizeSessionTTYMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getNewEval();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
6,
|
||||
f,
|
||||
node_pb.NewEvalMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a deep clone of this proto. No data is shared with the original.
|
||||
* @return {!proto.ClientMessage} The clone.
|
||||
*/
|
||||
proto.ClientMessage.prototype.cloneMessage = function() {
|
||||
return /** @type {!proto.ClientMessage} */ (jspb.Message.cloneMessage(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional NewSessionMessage new_session = 1;
|
||||
* @return {proto.NewSessionMessage}
|
||||
*/
|
||||
proto.ClientMessage.prototype.getNewSession = function() {
|
||||
return /** @type{proto.NewSessionMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.NewSessionMessage, 1));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.NewSessionMessage|undefined} value */
|
||||
proto.ClientMessage.prototype.setNewSession = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 1, proto.ClientMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ClientMessage.prototype.clearNewSession = function() {
|
||||
this.setNewSession(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ClientMessage.prototype.hasNewSession = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional ShutdownSessionMessage shutdown_session = 2;
|
||||
* @return {proto.ShutdownSessionMessage}
|
||||
*/
|
||||
proto.ClientMessage.prototype.getShutdownSession = function() {
|
||||
return /** @type{proto.ShutdownSessionMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.ShutdownSessionMessage, 2));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.ShutdownSessionMessage|undefined} value */
|
||||
proto.ClientMessage.prototype.setShutdownSession = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 2, proto.ClientMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ClientMessage.prototype.clearShutdownSession = function() {
|
||||
this.setShutdownSession(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ClientMessage.prototype.hasShutdownSession = function() {
|
||||
return jspb.Message.getField(this, 2) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional WriteToSessionMessage write_to_session = 3;
|
||||
* @return {proto.WriteToSessionMessage}
|
||||
*/
|
||||
proto.ClientMessage.prototype.getWriteToSession = function() {
|
||||
return /** @type{proto.WriteToSessionMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.WriteToSessionMessage, 3));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.WriteToSessionMessage|undefined} value */
|
||||
proto.ClientMessage.prototype.setWriteToSession = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 3, proto.ClientMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ClientMessage.prototype.clearWriteToSession = function() {
|
||||
this.setWriteToSession(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ClientMessage.prototype.hasWriteToSession = function() {
|
||||
return jspb.Message.getField(this, 3) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional CloseSessionInputMessage close_session_input = 4;
|
||||
* @return {proto.CloseSessionInputMessage}
|
||||
*/
|
||||
proto.ClientMessage.prototype.getCloseSessionInput = function() {
|
||||
return /** @type{proto.CloseSessionInputMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.CloseSessionInputMessage, 4));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.CloseSessionInputMessage|undefined} value */
|
||||
proto.ClientMessage.prototype.setCloseSessionInput = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 4, proto.ClientMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ClientMessage.prototype.clearCloseSessionInput = function() {
|
||||
this.setCloseSessionInput(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ClientMessage.prototype.hasCloseSessionInput = function() {
|
||||
return jspb.Message.getField(this, 4) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional ResizeSessionTTYMessage resize_session_tty = 5;
|
||||
* @return {proto.ResizeSessionTTYMessage}
|
||||
*/
|
||||
proto.ClientMessage.prototype.getResizeSessionTty = function() {
|
||||
return /** @type{proto.ResizeSessionTTYMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.ResizeSessionTTYMessage, 5));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.ResizeSessionTTYMessage|undefined} value */
|
||||
proto.ClientMessage.prototype.setResizeSessionTty = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 5, proto.ClientMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ClientMessage.prototype.clearResizeSessionTty = function() {
|
||||
this.setResizeSessionTty(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ClientMessage.prototype.hasResizeSessionTty = function() {
|
||||
return jspb.Message.getField(this, 5) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional NewEvalMessage new_eval = 6;
|
||||
* @return {proto.NewEvalMessage}
|
||||
*/
|
||||
proto.ClientMessage.prototype.getNewEval = function() {
|
||||
return /** @type{proto.NewEvalMessage} */ (
|
||||
jspb.Message.getWrapperField(this, node_pb.NewEvalMessage, 6));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.NewEvalMessage|undefined} value */
|
||||
proto.ClientMessage.prototype.setNewEval = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 6, proto.ClientMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ClientMessage.prototype.clearNewEval = function() {
|
||||
this.setNewEval(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ClientMessage.prototype.hasNewEval = function() {
|
||||
return jspb.Message.getField(this, 6) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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.ServerMessage = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ServerMessage.oneofGroups_);
|
||||
};
|
||||
goog.inherits(proto.ServerMessage, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
proto.ServerMessage.displayName = 'proto.ServerMessage';
|
||||
}
|
||||
/**
|
||||
* Oneof group definitions for this message. Each group defines the field
|
||||
* numbers belonging to that group. When of these fields' value is set, all
|
||||
* other fields in the group are cleared. During deserialization, if multiple
|
||||
* fields are encountered for a group, only the last value seen will be kept.
|
||||
* @private {!Array<!Array<number>>}
|
||||
* @const
|
||||
*/
|
||||
proto.ServerMessage.oneofGroups_ = [[1,2,3,4,5,6]];
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.ServerMessage.MsgCase = {
|
||||
MSG_NOT_SET: 0,
|
||||
NEW_SESSION_FAILURE: 1,
|
||||
SESSION_DONE: 2,
|
||||
SESSION_OUTPUT: 3,
|
||||
IDENTIFY_SESSION: 4,
|
||||
EVAL_FAILED: 5,
|
||||
EVAL_DONE: 6
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {proto.ServerMessage.MsgCase}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getMsgCase = function() {
|
||||
return /** @type {proto.ServerMessage.MsgCase} */(jspb.Message.computeOneofCase(this, proto.ServerMessage.oneofGroups_[0]));
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto suitable for use in Soy templates.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.ServerMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.ServerMessage.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
||||
* instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.ServerMessage} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.ServerMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
newSessionFailure: (f = msg.getNewSessionFailure()) && command_pb.NewSessionFailureMessage.toObject(includeInstance, f),
|
||||
sessionDone: (f = msg.getSessionDone()) && command_pb.SessionDoneMessage.toObject(includeInstance, f),
|
||||
sessionOutput: (f = msg.getSessionOutput()) && command_pb.SessionOutputMessage.toObject(includeInstance, f),
|
||||
identifySession: (f = msg.getIdentifySession()) && command_pb.IdentifySessionMessage.toObject(includeInstance, f),
|
||||
evalFailed: (f = msg.getEvalFailed()) && node_pb.EvalFailedMessage.toObject(includeInstance, f),
|
||||
evalDone: (f = msg.getEvalDone()) && node_pb.EvalDoneMessage.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.ServerMessage}
|
||||
*/
|
||||
proto.ServerMessage.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.ServerMessage;
|
||||
return proto.ServerMessage.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.ServerMessage} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.ServerMessage}
|
||||
*/
|
||||
proto.ServerMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = new command_pb.NewSessionFailureMessage;
|
||||
reader.readMessage(value,command_pb.NewSessionFailureMessage.deserializeBinaryFromReader);
|
||||
msg.setNewSessionFailure(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = new command_pb.SessionDoneMessage;
|
||||
reader.readMessage(value,command_pb.SessionDoneMessage.deserializeBinaryFromReader);
|
||||
msg.setSessionDone(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = new command_pb.SessionOutputMessage;
|
||||
reader.readMessage(value,command_pb.SessionOutputMessage.deserializeBinaryFromReader);
|
||||
msg.setSessionOutput(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = new command_pb.IdentifySessionMessage;
|
||||
reader.readMessage(value,command_pb.IdentifySessionMessage.deserializeBinaryFromReader);
|
||||
msg.setIdentifySession(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = new node_pb.EvalFailedMessage;
|
||||
reader.readMessage(value,node_pb.EvalFailedMessage.deserializeBinaryFromReader);
|
||||
msg.setEvalFailed(value);
|
||||
break;
|
||||
case 6:
|
||||
var value = new node_pb.EvalDoneMessage;
|
||||
reader.readMessage(value,node_pb.EvalDoneMessage.deserializeBinaryFromReader);
|
||||
msg.setEvalDone(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class method variant: serializes the given message to binary data
|
||||
* (in protobuf wire format), writing to the given BinaryWriter.
|
||||
* @param {!proto.ServerMessage} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.ServerMessage.serializeBinaryToWriter = function(message, writer) {
|
||||
message.serializeBinaryToWriter(writer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.ServerMessage.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
this.serializeBinaryToWriter(writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format),
|
||||
* writing to the given BinaryWriter.
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.ServerMessage.prototype.serializeBinaryToWriter = function (writer) {
|
||||
var f = undefined;
|
||||
f = this.getNewSessionFailure();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
1,
|
||||
f,
|
||||
command_pb.NewSessionFailureMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getSessionDone();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
2,
|
||||
f,
|
||||
command_pb.SessionDoneMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getSessionOutput();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
3,
|
||||
f,
|
||||
command_pb.SessionOutputMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getIdentifySession();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
4,
|
||||
f,
|
||||
command_pb.IdentifySessionMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getEvalFailed();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
5,
|
||||
f,
|
||||
node_pb.EvalFailedMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getEvalDone();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
6,
|
||||
f,
|
||||
node_pb.EvalDoneMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a deep clone of this proto. No data is shared with the original.
|
||||
* @return {!proto.ServerMessage} The clone.
|
||||
*/
|
||||
proto.ServerMessage.prototype.cloneMessage = function() {
|
||||
return /** @type {!proto.ServerMessage} */ (jspb.Message.cloneMessage(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional NewSessionFailureMessage new_session_failure = 1;
|
||||
* @return {proto.NewSessionFailureMessage}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getNewSessionFailure = function() {
|
||||
return /** @type{proto.NewSessionFailureMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.NewSessionFailureMessage, 1));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.NewSessionFailureMessage|undefined} value */
|
||||
proto.ServerMessage.prototype.setNewSessionFailure = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 1, proto.ServerMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ServerMessage.prototype.clearNewSessionFailure = function() {
|
||||
this.setNewSessionFailure(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ServerMessage.prototype.hasNewSessionFailure = function() {
|
||||
return jspb.Message.getField(this, 1) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional SessionDoneMessage session_done = 2;
|
||||
* @return {proto.SessionDoneMessage}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getSessionDone = function() {
|
||||
return /** @type{proto.SessionDoneMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.SessionDoneMessage, 2));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.SessionDoneMessage|undefined} value */
|
||||
proto.ServerMessage.prototype.setSessionDone = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 2, proto.ServerMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ServerMessage.prototype.clearSessionDone = function() {
|
||||
this.setSessionDone(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ServerMessage.prototype.hasSessionDone = function() {
|
||||
return jspb.Message.getField(this, 2) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional SessionOutputMessage session_output = 3;
|
||||
* @return {proto.SessionOutputMessage}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getSessionOutput = function() {
|
||||
return /** @type{proto.SessionOutputMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.SessionOutputMessage, 3));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.SessionOutputMessage|undefined} value */
|
||||
proto.ServerMessage.prototype.setSessionOutput = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 3, proto.ServerMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ServerMessage.prototype.clearSessionOutput = function() {
|
||||
this.setSessionOutput(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ServerMessage.prototype.hasSessionOutput = function() {
|
||||
return jspb.Message.getField(this, 3) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional IdentifySessionMessage identify_session = 4;
|
||||
* @return {proto.IdentifySessionMessage}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getIdentifySession = function() {
|
||||
return /** @type{proto.IdentifySessionMessage} */ (
|
||||
jspb.Message.getWrapperField(this, command_pb.IdentifySessionMessage, 4));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.IdentifySessionMessage|undefined} value */
|
||||
proto.ServerMessage.prototype.setIdentifySession = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 4, proto.ServerMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ServerMessage.prototype.clearIdentifySession = function() {
|
||||
this.setIdentifySession(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ServerMessage.prototype.hasIdentifySession = function() {
|
||||
return jspb.Message.getField(this, 4) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional EvalFailedMessage eval_failed = 5;
|
||||
* @return {proto.EvalFailedMessage}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getEvalFailed = function() {
|
||||
return /** @type{proto.EvalFailedMessage} */ (
|
||||
jspb.Message.getWrapperField(this, node_pb.EvalFailedMessage, 5));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.EvalFailedMessage|undefined} value */
|
||||
proto.ServerMessage.prototype.setEvalFailed = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 5, proto.ServerMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ServerMessage.prototype.clearEvalFailed = function() {
|
||||
this.setEvalFailed(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ServerMessage.prototype.hasEvalFailed = function() {
|
||||
return jspb.Message.getField(this, 5) != null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional EvalDoneMessage eval_done = 6;
|
||||
* @return {proto.EvalDoneMessage}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getEvalDone = function() {
|
||||
return /** @type{proto.EvalDoneMessage} */ (
|
||||
jspb.Message.getWrapperField(this, node_pb.EvalDoneMessage, 6));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.EvalDoneMessage|undefined} value */
|
||||
proto.ServerMessage.prototype.setEvalDone = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 6, proto.ServerMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ServerMessage.prototype.clearEvalDone = function() {
|
||||
this.setEvalDone(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ServerMessage.prototype.hasEvalDone = function() {
|
||||
return jspb.Message.getField(this, 6) != null;
|
||||
};
|
||||
|
||||
|
||||
goog.object.extend(exports, proto);
|
78
packages/protocol/src/proto/command.proto
Normal file
78
packages/protocol/src/proto/command.proto
Normal file
@ -0,0 +1,78 @@
|
||||
syntax = "proto3";
|
||||
|
||||
// Executes a command.
|
||||
// Ensure the id field is unique for each new session. If a client reuses the id of an existing
|
||||
// session, the connection will be closed.
|
||||
// If env is provided, the environment variables will be set.
|
||||
// If tty_dimensions is included, we will spawn a tty for the command using the given dimensions.
|
||||
message NewSessionMessage {
|
||||
uint64 id = 1;
|
||||
string command = 2;
|
||||
repeated string args = 3;
|
||||
map<string, string> env = 4;
|
||||
string cwd = 5;
|
||||
TTYDimensions tty_dimensions = 6;
|
||||
bool is_fork = 7;
|
||||
}
|
||||
|
||||
// Sent when starting a session failed.
|
||||
message NewSessionFailureMessage {
|
||||
uint64 id = 1;
|
||||
enum Reason {
|
||||
Prohibited = 0;
|
||||
ResourceShortage = 1;
|
||||
}
|
||||
Reason reason = 2;
|
||||
string message = 3;
|
||||
}
|
||||
|
||||
// Sent when a session has completed
|
||||
message SessionDoneMessage {
|
||||
uint64 id = 1;
|
||||
int64 exit_status = 2;
|
||||
}
|
||||
|
||||
// Identifies a session with a PID.
|
||||
message IdentifySessionMessage {
|
||||
uint64 id = 1;
|
||||
uint64 pid = 2;
|
||||
}
|
||||
|
||||
// Writes data to a session.
|
||||
message WriteToSessionMessage {
|
||||
uint64 id = 1;
|
||||
bytes data = 2;
|
||||
}
|
||||
|
||||
// Resizes the TTY of the session identified by the id.
|
||||
// The connection will be closed if a TTY was not requested when the session was created.
|
||||
message ResizeSessionTTYMessage {
|
||||
uint64 id = 1;
|
||||
TTYDimensions tty_dimensions = 2;
|
||||
}
|
||||
|
||||
// CloseSessionInputMessage closes the stdin of the session by the ID.
|
||||
message CloseSessionInputMessage {
|
||||
uint64 id = 1;
|
||||
}
|
||||
|
||||
message ShutdownSessionMessage {
|
||||
uint64 id = 1;
|
||||
string signal = 2;
|
||||
}
|
||||
|
||||
// SessionOutputMessage carries data read from the stdout or stderr of the session identified by the id.
|
||||
message SessionOutputMessage {
|
||||
uint64 id = 1;
|
||||
enum FD {
|
||||
Stdout = 0;
|
||||
Stderr = 1;
|
||||
}
|
||||
FD fd = 2;
|
||||
bytes data = 3;
|
||||
}
|
||||
|
||||
message TTYDimensions {
|
||||
uint32 height = 1;
|
||||
uint32 width = 2;
|
||||
}
|
288
packages/protocol/src/proto/command_pb.d.ts
vendored
Normal file
288
packages/protocol/src/proto/command_pb.d.ts
vendored
Normal file
@ -0,0 +1,288 @@
|
||||
// package:
|
||||
// file: command.proto
|
||||
|
||||
import * as jspb from "google-protobuf";
|
||||
|
||||
export class NewSessionMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getCommand(): string;
|
||||
setCommand(value: string): void;
|
||||
|
||||
clearArgsList(): void;
|
||||
getArgsList(): Array<string>;
|
||||
setArgsList(value: Array<string>): void;
|
||||
addArgs(value: string, index?: number): string;
|
||||
|
||||
getEnvMap(): jspb.Map<string, string>;
|
||||
clearEnvMap(): void;
|
||||
getCwd(): string;
|
||||
setCwd(value: string): void;
|
||||
|
||||
hasTtyDimensions(): boolean;
|
||||
clearTtyDimensions(): void;
|
||||
getTtyDimensions(): TTYDimensions | undefined;
|
||||
setTtyDimensions(value?: TTYDimensions): void;
|
||||
|
||||
getIsFork(): boolean;
|
||||
setIsFork(value: boolean): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): NewSessionMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: NewSessionMessage): NewSessionMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: NewSessionMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): NewSessionMessage;
|
||||
static deserializeBinaryFromReader(message: NewSessionMessage, reader: jspb.BinaryReader): NewSessionMessage;
|
||||
}
|
||||
|
||||
export namespace NewSessionMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
command: string,
|
||||
argsList: Array<string>,
|
||||
envMap: Array<[string, string]>,
|
||||
cwd: string,
|
||||
ttyDimensions?: TTYDimensions.AsObject,
|
||||
isFork: boolean,
|
||||
}
|
||||
}
|
||||
|
||||
export class NewSessionFailureMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getReason(): NewSessionFailureMessage.Reason;
|
||||
setReason(value: NewSessionFailureMessage.Reason): void;
|
||||
|
||||
getMessage(): string;
|
||||
setMessage(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): NewSessionFailureMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: NewSessionFailureMessage): NewSessionFailureMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: NewSessionFailureMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): NewSessionFailureMessage;
|
||||
static deserializeBinaryFromReader(message: NewSessionFailureMessage, reader: jspb.BinaryReader): NewSessionFailureMessage;
|
||||
}
|
||||
|
||||
export namespace NewSessionFailureMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
reason: NewSessionFailureMessage.Reason,
|
||||
message: string,
|
||||
}
|
||||
|
||||
export enum Reason {
|
||||
PROHIBITED = 0,
|
||||
RESOURCESHORTAGE = 1,
|
||||
}
|
||||
}
|
||||
|
||||
export class SessionDoneMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getExitStatus(): number;
|
||||
setExitStatus(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SessionDoneMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SessionDoneMessage): SessionDoneMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SessionDoneMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SessionDoneMessage;
|
||||
static deserializeBinaryFromReader(message: SessionDoneMessage, reader: jspb.BinaryReader): SessionDoneMessage;
|
||||
}
|
||||
|
||||
export namespace SessionDoneMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
exitStatus: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class IdentifySessionMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getPid(): number;
|
||||
setPid(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): IdentifySessionMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: IdentifySessionMessage): IdentifySessionMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: IdentifySessionMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): IdentifySessionMessage;
|
||||
static deserializeBinaryFromReader(message: IdentifySessionMessage, reader: jspb.BinaryReader): IdentifySessionMessage;
|
||||
}
|
||||
|
||||
export namespace IdentifySessionMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
pid: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class WriteToSessionMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getData(): Uint8Array | string;
|
||||
getData_asU8(): Uint8Array;
|
||||
getData_asB64(): string;
|
||||
setData(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): WriteToSessionMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: WriteToSessionMessage): WriteToSessionMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: WriteToSessionMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): WriteToSessionMessage;
|
||||
static deserializeBinaryFromReader(message: WriteToSessionMessage, reader: jspb.BinaryReader): WriteToSessionMessage;
|
||||
}
|
||||
|
||||
export namespace WriteToSessionMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
data: Uint8Array | string,
|
||||
}
|
||||
}
|
||||
|
||||
export class ResizeSessionTTYMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
hasTtyDimensions(): boolean;
|
||||
clearTtyDimensions(): void;
|
||||
getTtyDimensions(): TTYDimensions | undefined;
|
||||
setTtyDimensions(value?: TTYDimensions): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ResizeSessionTTYMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ResizeSessionTTYMessage): ResizeSessionTTYMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ResizeSessionTTYMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ResizeSessionTTYMessage;
|
||||
static deserializeBinaryFromReader(message: ResizeSessionTTYMessage, reader: jspb.BinaryReader): ResizeSessionTTYMessage;
|
||||
}
|
||||
|
||||
export namespace ResizeSessionTTYMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
ttyDimensions?: TTYDimensions.AsObject,
|
||||
}
|
||||
}
|
||||
|
||||
export class CloseSessionInputMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): CloseSessionInputMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: CloseSessionInputMessage): CloseSessionInputMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: CloseSessionInputMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): CloseSessionInputMessage;
|
||||
static deserializeBinaryFromReader(message: CloseSessionInputMessage, reader: jspb.BinaryReader): CloseSessionInputMessage;
|
||||
}
|
||||
|
||||
export namespace CloseSessionInputMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class ShutdownSessionMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getSignal(): string;
|
||||
setSignal(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ShutdownSessionMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: ShutdownSessionMessage): ShutdownSessionMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: ShutdownSessionMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): ShutdownSessionMessage;
|
||||
static deserializeBinaryFromReader(message: ShutdownSessionMessage, reader: jspb.BinaryReader): ShutdownSessionMessage;
|
||||
}
|
||||
|
||||
export namespace ShutdownSessionMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
signal: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SessionOutputMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getFd(): SessionOutputMessage.FD;
|
||||
setFd(value: SessionOutputMessage.FD): void;
|
||||
|
||||
getData(): Uint8Array | string;
|
||||
getData_asU8(): Uint8Array;
|
||||
getData_asB64(): string;
|
||||
setData(value: Uint8Array | string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): SessionOutputMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: SessionOutputMessage): SessionOutputMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: SessionOutputMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): SessionOutputMessage;
|
||||
static deserializeBinaryFromReader(message: SessionOutputMessage, reader: jspb.BinaryReader): SessionOutputMessage;
|
||||
}
|
||||
|
||||
export namespace SessionOutputMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
fd: SessionOutputMessage.FD,
|
||||
data: Uint8Array | string,
|
||||
}
|
||||
|
||||
export enum FD {
|
||||
STDOUT = 0,
|
||||
STDERR = 1,
|
||||
}
|
||||
}
|
||||
|
||||
export class TTYDimensions extends jspb.Message {
|
||||
getHeight(): number;
|
||||
setHeight(value: number): void;
|
||||
|
||||
getWidth(): number;
|
||||
setWidth(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): TTYDimensions.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: TTYDimensions): TTYDimensions.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: TTYDimensions, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): TTYDimensions;
|
||||
static deserializeBinaryFromReader(message: TTYDimensions, reader: jspb.BinaryReader): TTYDimensions;
|
||||
}
|
||||
|
||||
export namespace TTYDimensions {
|
||||
export type AsObject = {
|
||||
height: number,
|
||||
width: number,
|
||||
}
|
||||
}
|
||||
|
2158
packages/protocol/src/proto/command_pb.js
Normal file
2158
packages/protocol/src/proto/command_pb.js
Normal file
File diff suppressed because it is too large
Load Diff
3
packages/protocol/src/proto/index.ts
Normal file
3
packages/protocol/src/proto/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export * from "./client_pb";
|
||||
export * from "./command_pb";
|
||||
export * from "./node_pb";
|
36
packages/protocol/src/proto/node.proto
Normal file
36
packages/protocol/src/proto/node.proto
Normal file
@ -0,0 +1,36 @@
|
||||
syntax = "proto3";
|
||||
|
||||
message TypedValue {
|
||||
enum Type {
|
||||
String = 0;
|
||||
Number = 1;
|
||||
Object = 2;
|
||||
Boolean = 3;
|
||||
}
|
||||
Type type = 1;
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
message NewEvalMessage {
|
||||
uint64 id = 1;
|
||||
string function = 2;
|
||||
repeated string args = 3;
|
||||
// Timeout in ms
|
||||
uint32 timeout = 4;
|
||||
}
|
||||
|
||||
message EvalFailedMessage {
|
||||
uint64 id = 1;
|
||||
enum Reason {
|
||||
Timeout = 0;
|
||||
Exception = 1;
|
||||
Conflict = 2;
|
||||
}
|
||||
Reason reason = 2;
|
||||
string message = 3;
|
||||
}
|
||||
|
||||
message EvalDoneMessage {
|
||||
uint64 id = 1;
|
||||
TypedValue response = 2;
|
||||
}
|
130
packages/protocol/src/proto/node_pb.d.ts
vendored
Normal file
130
packages/protocol/src/proto/node_pb.d.ts
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
// package:
|
||||
// file: node.proto
|
||||
|
||||
import * as jspb from "google-protobuf";
|
||||
|
||||
export class TypedValue extends jspb.Message {
|
||||
getType(): TypedValue.Type;
|
||||
setType(value: TypedValue.Type): void;
|
||||
|
||||
getValue(): string;
|
||||
setValue(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): TypedValue.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: TypedValue): TypedValue.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: TypedValue, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): TypedValue;
|
||||
static deserializeBinaryFromReader(message: TypedValue, reader: jspb.BinaryReader): TypedValue;
|
||||
}
|
||||
|
||||
export namespace TypedValue {
|
||||
export type AsObject = {
|
||||
type: TypedValue.Type,
|
||||
value: string,
|
||||
}
|
||||
|
||||
export enum Type {
|
||||
STRING = 0,
|
||||
NUMBER = 1,
|
||||
OBJECT = 2,
|
||||
BOOLEAN = 3,
|
||||
}
|
||||
}
|
||||
|
||||
export class NewEvalMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getFunction(): string;
|
||||
setFunction(value: string): void;
|
||||
|
||||
clearArgsList(): void;
|
||||
getArgsList(): Array<string>;
|
||||
setArgsList(value: Array<string>): void;
|
||||
addArgs(value: string, index?: number): string;
|
||||
|
||||
getTimeout(): number;
|
||||
setTimeout(value: number): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): NewEvalMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: NewEvalMessage): NewEvalMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: NewEvalMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): NewEvalMessage;
|
||||
static deserializeBinaryFromReader(message: NewEvalMessage, reader: jspb.BinaryReader): NewEvalMessage;
|
||||
}
|
||||
|
||||
export namespace NewEvalMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
pb_function: string,
|
||||
argsList: Array<string>,
|
||||
timeout: number,
|
||||
}
|
||||
}
|
||||
|
||||
export class EvalFailedMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getReason(): EvalFailedMessage.Reason;
|
||||
setReason(value: EvalFailedMessage.Reason): void;
|
||||
|
||||
getMessage(): string;
|
||||
setMessage(value: string): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): EvalFailedMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: EvalFailedMessage): EvalFailedMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: EvalFailedMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): EvalFailedMessage;
|
||||
static deserializeBinaryFromReader(message: EvalFailedMessage, reader: jspb.BinaryReader): EvalFailedMessage;
|
||||
}
|
||||
|
||||
export namespace EvalFailedMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
reason: EvalFailedMessage.Reason,
|
||||
message: string,
|
||||
}
|
||||
|
||||
export enum Reason {
|
||||
TIMEOUT = 0,
|
||||
EXCEPTION = 1,
|
||||
CONFLICT = 2,
|
||||
}
|
||||
}
|
||||
|
||||
export class EvalDoneMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
hasResponse(): boolean;
|
||||
clearResponse(): void;
|
||||
getResponse(): TypedValue | undefined;
|
||||
setResponse(value?: TypedValue): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): EvalDoneMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: EvalDoneMessage): EvalDoneMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: EvalDoneMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): EvalDoneMessage;
|
||||
static deserializeBinaryFromReader(message: EvalDoneMessage, reader: jspb.BinaryReader): EvalDoneMessage;
|
||||
}
|
||||
|
||||
export namespace EvalDoneMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
response?: TypedValue.AsObject,
|
||||
}
|
||||
}
|
||||
|
894
packages/protocol/src/proto/node_pb.js
Normal file
894
packages/protocol/src/proto/node_pb.js
Normal file
@ -0,0 +1,894 @@
|
||||
/**
|
||||
* @fileoverview
|
||||
* @enhanceable
|
||||
* @public
|
||||
*/
|
||||
// GENERATED CODE -- DO NOT EDIT!
|
||||
|
||||
var jspb = require('google-protobuf');
|
||||
var goog = jspb;
|
||||
var global = Function('return this')();
|
||||
|
||||
goog.exportSymbol('proto.EvalDoneMessage', null, global);
|
||||
goog.exportSymbol('proto.EvalFailedMessage', null, global);
|
||||
goog.exportSymbol('proto.EvalFailedMessage.Reason', null, global);
|
||||
goog.exportSymbol('proto.NewEvalMessage', null, global);
|
||||
goog.exportSymbol('proto.TypedValue', null, global);
|
||||
goog.exportSymbol('proto.TypedValue.Type', 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.TypedValue = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.TypedValue, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
proto.TypedValue.displayName = 'proto.TypedValue';
|
||||
}
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto suitable for use in Soy templates.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.TypedValue.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.TypedValue.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
||||
* instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.TypedValue} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.TypedValue.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
type: msg.getType(),
|
||||
value: msg.getValue()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.TypedValue}
|
||||
*/
|
||||
proto.TypedValue.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.TypedValue;
|
||||
return proto.TypedValue.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.TypedValue} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.TypedValue}
|
||||
*/
|
||||
proto.TypedValue.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {!proto.TypedValue.Type} */ (reader.readEnum());
|
||||
msg.setType(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setValue(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class method variant: serializes the given message to binary data
|
||||
* (in protobuf wire format), writing to the given BinaryWriter.
|
||||
* @param {!proto.TypedValue} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.TypedValue.serializeBinaryToWriter = function(message, writer) {
|
||||
message.serializeBinaryToWriter(writer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.TypedValue.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
this.serializeBinaryToWriter(writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format),
|
||||
* writing to the given BinaryWriter.
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.TypedValue.prototype.serializeBinaryToWriter = function (writer) {
|
||||
var f = undefined;
|
||||
f = this.getType();
|
||||
if (f !== 0.0) {
|
||||
writer.writeEnum(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getValue();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a deep clone of this proto. No data is shared with the original.
|
||||
* @return {!proto.TypedValue} The clone.
|
||||
*/
|
||||
proto.TypedValue.prototype.cloneMessage = function() {
|
||||
return /** @type {!proto.TypedValue} */ (jspb.Message.cloneMessage(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional Type type = 1;
|
||||
* @return {!proto.TypedValue.Type}
|
||||
*/
|
||||
proto.TypedValue.prototype.getType = function() {
|
||||
return /** @type {!proto.TypedValue.Type} */ (jspb.Message.getFieldProto3(this, 1, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {!proto.TypedValue.Type} value */
|
||||
proto.TypedValue.prototype.setType = function(value) {
|
||||
jspb.Message.setField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string value = 2;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.TypedValue.prototype.getValue = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 2, ""));
|
||||
};
|
||||
|
||||
|
||||
/** @param {string} value */
|
||||
proto.TypedValue.prototype.setValue = function(value) {
|
||||
jspb.Message.setField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.TypedValue.Type = {
|
||||
STRING: 0,
|
||||
NUMBER: 1,
|
||||
OBJECT: 2,
|
||||
BOOLEAN: 3
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 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.NewEvalMessage = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, proto.NewEvalMessage.repeatedFields_, null);
|
||||
};
|
||||
goog.inherits(proto.NewEvalMessage, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
proto.NewEvalMessage.displayName = 'proto.NewEvalMessage';
|
||||
}
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.NewEvalMessage.repeatedFields_ = [3];
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto suitable for use in Soy templates.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.NewEvalMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.NewEvalMessage.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
||||
* instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.NewEvalMessage} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.NewEvalMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
id: msg.getId(),
|
||||
pb_function: msg.getFunction(),
|
||||
argsList: jspb.Message.getField(msg, 3),
|
||||
timeout: msg.getTimeout()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.NewEvalMessage}
|
||||
*/
|
||||
proto.NewEvalMessage.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.NewEvalMessage;
|
||||
return proto.NewEvalMessage.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.NewEvalMessage} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.NewEvalMessage}
|
||||
*/
|
||||
proto.NewEvalMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {number} */ (reader.readUint64());
|
||||
msg.setId(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setFunction(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.getArgsList().push(value);
|
||||
msg.setArgsList(msg.getArgsList());
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {number} */ (reader.readUint32());
|
||||
msg.setTimeout(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class method variant: serializes the given message to binary data
|
||||
* (in protobuf wire format), writing to the given BinaryWriter.
|
||||
* @param {!proto.NewEvalMessage} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.NewEvalMessage.serializeBinaryToWriter = function(message, writer) {
|
||||
message.serializeBinaryToWriter(writer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.NewEvalMessage.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
this.serializeBinaryToWriter(writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format),
|
||||
* writing to the given BinaryWriter.
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.NewEvalMessage.prototype.serializeBinaryToWriter = function (writer) {
|
||||
var f = undefined;
|
||||
f = this.getId();
|
||||
if (f !== 0) {
|
||||
writer.writeUint64(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getFunction();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getArgsList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getTimeout();
|
||||
if (f !== 0) {
|
||||
writer.writeUint32(
|
||||
4,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a deep clone of this proto. No data is shared with the original.
|
||||
* @return {!proto.NewEvalMessage} The clone.
|
||||
*/
|
||||
proto.NewEvalMessage.prototype.cloneMessage = function() {
|
||||
return /** @type {!proto.NewEvalMessage} */ (jspb.Message.cloneMessage(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional uint64 id = 1;
|
||||
* @return {number}
|
||||
*/
|
||||
proto.NewEvalMessage.prototype.getId = function() {
|
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {number} value */
|
||||
proto.NewEvalMessage.prototype.setId = function(value) {
|
||||
jspb.Message.setField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string function = 2;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.NewEvalMessage.prototype.getFunction = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 2, ""));
|
||||
};
|
||||
|
||||
|
||||
/** @param {string} value */
|
||||
proto.NewEvalMessage.prototype.setFunction = function(value) {
|
||||
jspb.Message.setField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated string args = 3;
|
||||
* If you change this array by adding, removing or replacing elements, or if you
|
||||
* replace the array itself, then you must call the setter to update it.
|
||||
* @return {!Array.<string>}
|
||||
*/
|
||||
proto.NewEvalMessage.prototype.getArgsList = function() {
|
||||
return /** @type {!Array.<string>} */ (jspb.Message.getField(this, 3));
|
||||
};
|
||||
|
||||
|
||||
/** @param {Array.<string>} value */
|
||||
proto.NewEvalMessage.prototype.setArgsList = function(value) {
|
||||
jspb.Message.setField(this, 3, value || []);
|
||||
};
|
||||
|
||||
|
||||
proto.NewEvalMessage.prototype.clearArgsList = function() {
|
||||
jspb.Message.setField(this, 3, []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional uint32 timeout = 4;
|
||||
* @return {number}
|
||||
*/
|
||||
proto.NewEvalMessage.prototype.getTimeout = function() {
|
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 4, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {number} value */
|
||||
proto.NewEvalMessage.prototype.setTimeout = function(value) {
|
||||
jspb.Message.setField(this, 4, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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.EvalFailedMessage = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.EvalFailedMessage, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
proto.EvalFailedMessage.displayName = 'proto.EvalFailedMessage';
|
||||
}
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto suitable for use in Soy templates.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.EvalFailedMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.EvalFailedMessage.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
||||
* instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.EvalFailedMessage} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.EvalFailedMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
id: msg.getId(),
|
||||
reason: msg.getReason(),
|
||||
message: msg.getMessage()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.EvalFailedMessage}
|
||||
*/
|
||||
proto.EvalFailedMessage.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.EvalFailedMessage;
|
||||
return proto.EvalFailedMessage.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.EvalFailedMessage} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.EvalFailedMessage}
|
||||
*/
|
||||
proto.EvalFailedMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {number} */ (reader.readUint64());
|
||||
msg.setId(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {!proto.EvalFailedMessage.Reason} */ (reader.readEnum());
|
||||
msg.setReason(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setMessage(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class method variant: serializes the given message to binary data
|
||||
* (in protobuf wire format), writing to the given BinaryWriter.
|
||||
* @param {!proto.EvalFailedMessage} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.EvalFailedMessage.serializeBinaryToWriter = function(message, writer) {
|
||||
message.serializeBinaryToWriter(writer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.EvalFailedMessage.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
this.serializeBinaryToWriter(writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format),
|
||||
* writing to the given BinaryWriter.
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.EvalFailedMessage.prototype.serializeBinaryToWriter = function (writer) {
|
||||
var f = undefined;
|
||||
f = this.getId();
|
||||
if (f !== 0) {
|
||||
writer.writeUint64(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getReason();
|
||||
if (f !== 0.0) {
|
||||
writer.writeEnum(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getMessage();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a deep clone of this proto. No data is shared with the original.
|
||||
* @return {!proto.EvalFailedMessage} The clone.
|
||||
*/
|
||||
proto.EvalFailedMessage.prototype.cloneMessage = function() {
|
||||
return /** @type {!proto.EvalFailedMessage} */ (jspb.Message.cloneMessage(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional uint64 id = 1;
|
||||
* @return {number}
|
||||
*/
|
||||
proto.EvalFailedMessage.prototype.getId = function() {
|
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {number} value */
|
||||
proto.EvalFailedMessage.prototype.setId = function(value) {
|
||||
jspb.Message.setField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional Reason reason = 2;
|
||||
* @return {!proto.EvalFailedMessage.Reason}
|
||||
*/
|
||||
proto.EvalFailedMessage.prototype.getReason = function() {
|
||||
return /** @type {!proto.EvalFailedMessage.Reason} */ (jspb.Message.getFieldProto3(this, 2, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {!proto.EvalFailedMessage.Reason} value */
|
||||
proto.EvalFailedMessage.prototype.setReason = function(value) {
|
||||
jspb.Message.setField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string message = 3;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.EvalFailedMessage.prototype.getMessage = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 3, ""));
|
||||
};
|
||||
|
||||
|
||||
/** @param {string} value */
|
||||
proto.EvalFailedMessage.prototype.setMessage = function(value) {
|
||||
jspb.Message.setField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.EvalFailedMessage.Reason = {
|
||||
TIMEOUT: 0,
|
||||
EXCEPTION: 1,
|
||||
CONFLICT: 2
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 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.EvalDoneMessage = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.EvalDoneMessage, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
proto.EvalDoneMessage.displayName = 'proto.EvalDoneMessage';
|
||||
}
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
/**
|
||||
* Creates an object representation of this proto suitable for use in Soy templates.
|
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||
* For the list of reserved names please see:
|
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
|
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
|
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.EvalDoneMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.EvalDoneMessage.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Static version of the {@see toObject} method.
|
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB
|
||||
* instance for transitional soy proto support:
|
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.EvalDoneMessage} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.EvalDoneMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
id: msg.getId(),
|
||||
response: (f = msg.getResponse()) && proto.TypedValue.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.EvalDoneMessage}
|
||||
*/
|
||||
proto.EvalDoneMessage.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.EvalDoneMessage;
|
||||
return proto.EvalDoneMessage.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.EvalDoneMessage} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.EvalDoneMessage}
|
||||
*/
|
||||
proto.EvalDoneMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
var field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
var value = /** @type {number} */ (reader.readUint64());
|
||||
msg.setId(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = new proto.TypedValue;
|
||||
reader.readMessage(value,proto.TypedValue.deserializeBinaryFromReader);
|
||||
msg.setResponse(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class method variant: serializes the given message to binary data
|
||||
* (in protobuf wire format), writing to the given BinaryWriter.
|
||||
* @param {!proto.EvalDoneMessage} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.EvalDoneMessage.serializeBinaryToWriter = function(message, writer) {
|
||||
message.serializeBinaryToWriter(writer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.EvalDoneMessage.prototype.serializeBinary = function() {
|
||||
var writer = new jspb.BinaryWriter();
|
||||
this.serializeBinaryToWriter(writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format),
|
||||
* writing to the given BinaryWriter.
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.EvalDoneMessage.prototype.serializeBinaryToWriter = function (writer) {
|
||||
var f = undefined;
|
||||
f = this.getId();
|
||||
if (f !== 0) {
|
||||
writer.writeUint64(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getResponse();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
2,
|
||||
f,
|
||||
proto.TypedValue.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a deep clone of this proto. No data is shared with the original.
|
||||
* @return {!proto.EvalDoneMessage} The clone.
|
||||
*/
|
||||
proto.EvalDoneMessage.prototype.cloneMessage = function() {
|
||||
return /** @type {!proto.EvalDoneMessage} */ (jspb.Message.cloneMessage(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional uint64 id = 1;
|
||||
* @return {number}
|
||||
*/
|
||||
proto.EvalDoneMessage.prototype.getId = function() {
|
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {number} value */
|
||||
proto.EvalDoneMessage.prototype.setId = function(value) {
|
||||
jspb.Message.setField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional TypedValue response = 2;
|
||||
* @return {proto.TypedValue}
|
||||
*/
|
||||
proto.EvalDoneMessage.prototype.getResponse = function() {
|
||||
return /** @type{proto.TypedValue} */ (
|
||||
jspb.Message.getWrapperField(this, proto.TypedValue, 2));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.TypedValue|undefined} value */
|
||||
proto.EvalDoneMessage.prototype.setResponse = function(value) {
|
||||
jspb.Message.setWrapperField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
proto.EvalDoneMessage.prototype.clearResponse = function() {
|
||||
this.setResponse(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.EvalDoneMessage.prototype.hasResponse = function() {
|
||||
return jspb.Message.getField(this, 2) != null;
|
||||
};
|
||||
|
||||
|
||||
goog.object.extend(exports, proto);
|
Reference in New Issue
Block a user