Create initial server layout (#11)
* Create initial server layout * Adjust command name to entry * Add @oclif/config as dependency * Implement build process for outputting single binary * Add init message * Remove unused import, add tsconfig.json to .gitignore * Accidently pushed wacky change to output host FS files * Add options to createApp
This commit is contained in:
@ -27,5 +27,20 @@ message ServerMessage {
|
||||
// node.proto
|
||||
EvalFailedMessage eval_failed = 5;
|
||||
EvalDoneMessage eval_done = 6;
|
||||
|
||||
InitMessage init = 7;
|
||||
}
|
||||
}
|
||||
|
||||
message InitMessage {
|
||||
string home_directory = 1;
|
||||
string tmp_directory = 2;
|
||||
string data_directory = 3;
|
||||
string working_directory = 4;
|
||||
enum OperatingSystem {
|
||||
Windows = 0;
|
||||
Linux = 1;
|
||||
Mac = 2;
|
||||
}
|
||||
OperatingSystem operating_system = 5;
|
||||
}
|
49
packages/protocol/src/proto/client_pb.d.ts
vendored
49
packages/protocol/src/proto/client_pb.d.ts
vendored
@ -99,6 +99,11 @@ export class ServerMessage extends jspb.Message {
|
||||
getEvalDone(): node_pb.EvalDoneMessage | undefined;
|
||||
setEvalDone(value?: node_pb.EvalDoneMessage): void;
|
||||
|
||||
hasInit(): boolean;
|
||||
clearInit(): void;
|
||||
getInit(): InitMessage | undefined;
|
||||
setInit(value?: InitMessage): void;
|
||||
|
||||
getMsgCase(): ServerMessage.MsgCase;
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): ServerMessage.AsObject;
|
||||
@ -118,6 +123,7 @@ export namespace ServerMessage {
|
||||
identifySession?: command_pb.IdentifySessionMessage.AsObject,
|
||||
evalFailed?: node_pb.EvalFailedMessage.AsObject,
|
||||
evalDone?: node_pb.EvalDoneMessage.AsObject,
|
||||
init?: InitMessage.AsObject,
|
||||
}
|
||||
|
||||
export enum MsgCase {
|
||||
@ -128,6 +134,49 @@ export namespace ServerMessage {
|
||||
IDENTIFY_SESSION = 4,
|
||||
EVAL_FAILED = 5,
|
||||
EVAL_DONE = 6,
|
||||
INIT = 7,
|
||||
}
|
||||
}
|
||||
|
||||
export class InitMessage extends jspb.Message {
|
||||
getHomeDirectory(): string;
|
||||
setHomeDirectory(value: string): void;
|
||||
|
||||
getTmpDirectory(): string;
|
||||
setTmpDirectory(value: string): void;
|
||||
|
||||
getDataDirectory(): string;
|
||||
setDataDirectory(value: string): void;
|
||||
|
||||
getWorkingDirectory(): string;
|
||||
setWorkingDirectory(value: string): void;
|
||||
|
||||
getOperatingSystem(): InitMessage.OperatingSystem;
|
||||
setOperatingSystem(value: InitMessage.OperatingSystem): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): InitMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: InitMessage): InitMessage.AsObject;
|
||||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||
static serializeBinaryToWriter(message: InitMessage, writer: jspb.BinaryWriter): void;
|
||||
static deserializeBinary(bytes: Uint8Array): InitMessage;
|
||||
static deserializeBinaryFromReader(message: InitMessage, reader: jspb.BinaryReader): InitMessage;
|
||||
}
|
||||
|
||||
export namespace InitMessage {
|
||||
export type AsObject = {
|
||||
homeDirectory: string,
|
||||
tmpDirectory: string,
|
||||
dataDirectory: string,
|
||||
workingDirectory: string,
|
||||
operatingSystem: InitMessage.OperatingSystem,
|
||||
}
|
||||
|
||||
export enum OperatingSystem {
|
||||
WINDOWS = 0,
|
||||
LINUX = 1,
|
||||
MAC = 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ 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.InitMessage', null, global);
|
||||
goog.exportSymbol('proto.InitMessage.OperatingSystem', null, global);
|
||||
goog.exportSymbol('proto.ServerMessage', null, global);
|
||||
|
||||
/**
|
||||
@ -465,7 +467,7 @@ if (goog.DEBUG && !COMPILED) {
|
||||
* @private {!Array<!Array<number>>}
|
||||
* @const
|
||||
*/
|
||||
proto.ServerMessage.oneofGroups_ = [[1,2,3,4,5,6]];
|
||||
proto.ServerMessage.oneofGroups_ = [[1,2,3,4,5,6,7]];
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
@ -477,7 +479,8 @@ proto.ServerMessage.MsgCase = {
|
||||
SESSION_OUTPUT: 3,
|
||||
IDENTIFY_SESSION: 4,
|
||||
EVAL_FAILED: 5,
|
||||
EVAL_DONE: 6
|
||||
EVAL_DONE: 6,
|
||||
INIT: 7
|
||||
};
|
||||
|
||||
/**
|
||||
@ -520,7 +523,8 @@ proto.ServerMessage.toObject = function(includeInstance, msg) {
|
||||
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)
|
||||
evalDone: (f = msg.getEvalDone()) && node_pb.EvalDoneMessage.toObject(includeInstance, f),
|
||||
init: (f = msg.getInit()) && proto.InitMessage.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@ -587,6 +591,11 @@ proto.ServerMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
reader.readMessage(value,node_pb.EvalDoneMessage.deserializeBinaryFromReader);
|
||||
msg.setEvalDone(value);
|
||||
break;
|
||||
case 7:
|
||||
var value = new proto.InitMessage;
|
||||
reader.readMessage(value,proto.InitMessage.deserializeBinaryFromReader);
|
||||
msg.setInit(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@ -673,6 +682,14 @@ proto.ServerMessage.prototype.serializeBinaryToWriter = function (writer) {
|
||||
node_pb.EvalDoneMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = this.getInit();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
7,
|
||||
f,
|
||||
proto.InitMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -865,4 +882,310 @@ proto.ServerMessage.prototype.hasEvalDone = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional InitMessage init = 7;
|
||||
* @return {proto.InitMessage}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getInit = function() {
|
||||
return /** @type{proto.InitMessage} */ (
|
||||
jspb.Message.getWrapperField(this, proto.InitMessage, 7));
|
||||
};
|
||||
|
||||
|
||||
/** @param {proto.InitMessage|undefined} value */
|
||||
proto.ServerMessage.prototype.setInit = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 7, proto.ServerMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ServerMessage.prototype.clearInit = function() {
|
||||
this.setInit(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return{!boolean}
|
||||
*/
|
||||
proto.ServerMessage.prototype.hasInit = function() {
|
||||
return jspb.Message.getField(this, 7) != 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.InitMessage = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
};
|
||||
goog.inherits(proto.InitMessage, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
proto.InitMessage.displayName = 'proto.InitMessage';
|
||||
}
|
||||
|
||||
|
||||
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.InitMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
return proto.InitMessage.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.InitMessage} msg The msg instance to transform.
|
||||
* @return {!Object}
|
||||
*/
|
||||
proto.InitMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
homeDirectory: msg.getHomeDirectory(),
|
||||
tmpDirectory: msg.getTmpDirectory(),
|
||||
dataDirectory: msg.getDataDirectory(),
|
||||
workingDirectory: msg.getWorkingDirectory(),
|
||||
operatingSystem: msg.getOperatingSystem()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
obj.$jspbMessageInstance = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format).
|
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||
* @return {!proto.InitMessage}
|
||||
*/
|
||||
proto.InitMessage.deserializeBinary = function(bytes) {
|
||||
var reader = new jspb.BinaryReader(bytes);
|
||||
var msg = new proto.InitMessage;
|
||||
return proto.InitMessage.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Deserializes binary data (in protobuf wire format) from the
|
||||
* given reader into the given message object.
|
||||
* @param {!proto.InitMessage} msg The message object to deserialize into.
|
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||
* @return {!proto.InitMessage}
|
||||
*/
|
||||
proto.InitMessage.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.setHomeDirectory(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setTmpDirectory(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setDataDirectory(value);
|
||||
break;
|
||||
case 4:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setWorkingDirectory(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = /** @type {!proto.InitMessage.OperatingSystem} */ (reader.readEnum());
|
||||
msg.setOperatingSystem(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.InitMessage} message
|
||||
* @param {!jspb.BinaryWriter} writer
|
||||
*/
|
||||
proto.InitMessage.serializeBinaryToWriter = function(message, writer) {
|
||||
message.serializeBinaryToWriter(writer);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Serializes the message to binary data (in protobuf wire format).
|
||||
* @return {!Uint8Array}
|
||||
*/
|
||||
proto.InitMessage.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.InitMessage.prototype.serializeBinaryToWriter = function (writer) {
|
||||
var f = undefined;
|
||||
f = this.getHomeDirectory();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
1,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getTmpDirectory();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
2,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getDataDirectory();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getWorkingDirectory();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
4,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getOperatingSystem();
|
||||
if (f !== 0.0) {
|
||||
writer.writeEnum(
|
||||
5,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a deep clone of this proto. No data is shared with the original.
|
||||
* @return {!proto.InitMessage} The clone.
|
||||
*/
|
||||
proto.InitMessage.prototype.cloneMessage = function() {
|
||||
return /** @type {!proto.InitMessage} */ (jspb.Message.cloneMessage(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string home_directory = 1;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.InitMessage.prototype.getHomeDirectory = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, ""));
|
||||
};
|
||||
|
||||
|
||||
/** @param {string} value */
|
||||
proto.InitMessage.prototype.setHomeDirectory = function(value) {
|
||||
jspb.Message.setField(this, 1, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string tmp_directory = 2;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.InitMessage.prototype.getTmpDirectory = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 2, ""));
|
||||
};
|
||||
|
||||
|
||||
/** @param {string} value */
|
||||
proto.InitMessage.prototype.setTmpDirectory = function(value) {
|
||||
jspb.Message.setField(this, 2, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string data_directory = 3;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.InitMessage.prototype.getDataDirectory = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 3, ""));
|
||||
};
|
||||
|
||||
|
||||
/** @param {string} value */
|
||||
proto.InitMessage.prototype.setDataDirectory = function(value) {
|
||||
jspb.Message.setField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string working_directory = 4;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.InitMessage.prototype.getWorkingDirectory = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 4, ""));
|
||||
};
|
||||
|
||||
|
||||
/** @param {string} value */
|
||||
proto.InitMessage.prototype.setWorkingDirectory = function(value) {
|
||||
jspb.Message.setField(this, 4, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional OperatingSystem operating_system = 5;
|
||||
* @return {!proto.InitMessage.OperatingSystem}
|
||||
*/
|
||||
proto.InitMessage.prototype.getOperatingSystem = function() {
|
||||
return /** @type {!proto.InitMessage.OperatingSystem} */ (jspb.Message.getFieldProto3(this, 5, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {!proto.InitMessage.OperatingSystem} value */
|
||||
proto.InitMessage.prototype.setOperatingSystem = function(value) {
|
||||
jspb.Message.setField(this, 5, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.InitMessage.OperatingSystem = {
|
||||
WINDOWS: 0,
|
||||
LINUX: 1,
|
||||
MAC: 2
|
||||
};
|
||||
|
||||
goog.object.extend(exports, proto);
|
||||
|
Reference in New Issue
Block a user