Add stdio sources (#17)
This commit is contained in:
@ -45,6 +45,11 @@ message IdentifySessionMessage {
|
||||
message WriteToSessionMessage {
|
||||
uint64 id = 1;
|
||||
bytes data = 2;
|
||||
enum Source {
|
||||
Stdin = 0;
|
||||
Ipc = 1;
|
||||
}
|
||||
Source source = 3;
|
||||
}
|
||||
|
||||
// Resizes the TTY of the session identified by the id.
|
||||
@ -67,11 +72,12 @@ message ShutdownSessionMessage {
|
||||
// SessionOutputMessage carries data read from the stdout or stderr of the session identified by the id.
|
||||
message SessionOutputMessage {
|
||||
uint64 id = 1;
|
||||
enum FD {
|
||||
enum Source {
|
||||
Stdout = 0;
|
||||
Stderr = 1;
|
||||
Ipc = 2;
|
||||
}
|
||||
FD fd = 2;
|
||||
Source source = 2;
|
||||
bytes data = 3;
|
||||
}
|
||||
|
||||
|
18
packages/protocol/src/proto/command_pb.d.ts
vendored
18
packages/protocol/src/proto/command_pb.d.ts
vendored
@ -144,6 +144,9 @@ export class WriteToSessionMessage extends jspb.Message {
|
||||
getData_asB64(): string;
|
||||
setData(value: Uint8Array | string): void;
|
||||
|
||||
getSource(): WriteToSessionMessage.Source;
|
||||
setSource(value: WriteToSessionMessage.Source): void;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): WriteToSessionMessage.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: WriteToSessionMessage): WriteToSessionMessage.AsObject;
|
||||
@ -158,6 +161,12 @@ export namespace WriteToSessionMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
data: Uint8Array | string,
|
||||
source: WriteToSessionMessage.Source,
|
||||
}
|
||||
|
||||
export enum Source {
|
||||
STDIN = 0,
|
||||
IPC = 1,
|
||||
}
|
||||
}
|
||||
|
||||
@ -235,8 +244,8 @@ export class SessionOutputMessage extends jspb.Message {
|
||||
getId(): number;
|
||||
setId(value: number): void;
|
||||
|
||||
getFd(): SessionOutputMessage.FD;
|
||||
setFd(value: SessionOutputMessage.FD): void;
|
||||
getSource(): SessionOutputMessage.Source;
|
||||
setSource(value: SessionOutputMessage.Source): void;
|
||||
|
||||
getData(): Uint8Array | string;
|
||||
getData_asU8(): Uint8Array;
|
||||
@ -256,13 +265,14 @@ export class SessionOutputMessage extends jspb.Message {
|
||||
export namespace SessionOutputMessage {
|
||||
export type AsObject = {
|
||||
id: number,
|
||||
fd: SessionOutputMessage.FD,
|
||||
source: SessionOutputMessage.Source,
|
||||
data: Uint8Array | string,
|
||||
}
|
||||
|
||||
export enum FD {
|
||||
export enum Source {
|
||||
STDOUT = 0,
|
||||
STDERR = 1,
|
||||
IPC = 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,10 +22,11 @@ goog.exportSymbol('proto.NewSessionMessage', null, global);
|
||||
goog.exportSymbol('proto.ResizeSessionTTYMessage', null, global);
|
||||
goog.exportSymbol('proto.SessionDoneMessage', null, global);
|
||||
goog.exportSymbol('proto.SessionOutputMessage', null, global);
|
||||
goog.exportSymbol('proto.SessionOutputMessage.FD', null, global);
|
||||
goog.exportSymbol('proto.SessionOutputMessage.Source', null, global);
|
||||
goog.exportSymbol('proto.ShutdownSessionMessage', null, global);
|
||||
goog.exportSymbol('proto.TTYDimensions', null, global);
|
||||
goog.exportSymbol('proto.WriteToSessionMessage', null, global);
|
||||
goog.exportSymbol('proto.WriteToSessionMessage.Source', null, global);
|
||||
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
@ -1047,7 +1048,8 @@ proto.WriteToSessionMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
proto.WriteToSessionMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
id: msg.getId(),
|
||||
data: msg.getData_asB64()
|
||||
data: msg.getData_asB64(),
|
||||
source: msg.getSource()
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@ -1092,6 +1094,10 @@ proto.WriteToSessionMessage.deserializeBinaryFromReader = function(msg, reader)
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
msg.setData(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {!proto.WriteToSessionMessage.Source} */ (reader.readEnum());
|
||||
msg.setSource(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@ -1144,6 +1150,13 @@ proto.WriteToSessionMessage.prototype.serializeBinaryToWriter = function (writer
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getSource();
|
||||
if (f !== 0.0) {
|
||||
writer.writeEnum(
|
||||
3,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1210,6 +1223,29 @@ proto.WriteToSessionMessage.prototype.setData = function(value) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional Source source = 3;
|
||||
* @return {!proto.WriteToSessionMessage.Source}
|
||||
*/
|
||||
proto.WriteToSessionMessage.prototype.getSource = function() {
|
||||
return /** @type {!proto.WriteToSessionMessage.Source} */ (jspb.Message.getFieldProto3(this, 3, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {!proto.WriteToSessionMessage.Source} value */
|
||||
proto.WriteToSessionMessage.prototype.setSource = function(value) {
|
||||
jspb.Message.setField(this, 3, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.WriteToSessionMessage.Source = {
|
||||
STDIN: 0,
|
||||
IPC: 1
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
@ -1805,7 +1841,7 @@ proto.SessionOutputMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
proto.SessionOutputMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
id: msg.getId(),
|
||||
fd: msg.getFd(),
|
||||
source: msg.getSource(),
|
||||
data: msg.getData_asB64()
|
||||
};
|
||||
|
||||
@ -1848,8 +1884,8 @@ proto.SessionOutputMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
msg.setId(value);
|
||||
break;
|
||||
case 2:
|
||||
var value = /** @type {!proto.SessionOutputMessage.FD} */ (reader.readEnum());
|
||||
msg.setFd(value);
|
||||
var value = /** @type {!proto.SessionOutputMessage.Source} */ (reader.readEnum());
|
||||
msg.setSource(value);
|
||||
break;
|
||||
case 3:
|
||||
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
||||
@ -1900,7 +1936,7 @@ proto.SessionOutputMessage.prototype.serializeBinaryToWriter = function (writer)
|
||||
f
|
||||
);
|
||||
}
|
||||
f = this.getFd();
|
||||
f = this.getSource();
|
||||
if (f !== 0.0) {
|
||||
writer.writeEnum(
|
||||
2,
|
||||
@ -1942,16 +1978,16 @@ proto.SessionOutputMessage.prototype.setId = function(value) {
|
||||
|
||||
|
||||
/**
|
||||
* optional FD fd = 2;
|
||||
* @return {!proto.SessionOutputMessage.FD}
|
||||
* optional Source source = 2;
|
||||
* @return {!proto.SessionOutputMessage.Source}
|
||||
*/
|
||||
proto.SessionOutputMessage.prototype.getFd = function() {
|
||||
return /** @type {!proto.SessionOutputMessage.FD} */ (jspb.Message.getFieldProto3(this, 2, 0));
|
||||
proto.SessionOutputMessage.prototype.getSource = function() {
|
||||
return /** @type {!proto.SessionOutputMessage.Source} */ (jspb.Message.getFieldProto3(this, 2, 0));
|
||||
};
|
||||
|
||||
|
||||
/** @param {!proto.SessionOutputMessage.FD} value */
|
||||
proto.SessionOutputMessage.prototype.setFd = function(value) {
|
||||
/** @param {!proto.SessionOutputMessage.Source} value */
|
||||
proto.SessionOutputMessage.prototype.setSource = function(value) {
|
||||
jspb.Message.setField(this, 2, value);
|
||||
};
|
||||
|
||||
@ -1998,9 +2034,10 @@ proto.SessionOutputMessage.prototype.setData = function(value) {
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
proto.SessionOutputMessage.FD = {
|
||||
proto.SessionOutputMessage.Source = {
|
||||
STDOUT: 0,
|
||||
STDERR: 1
|
||||
STDERR: 1,
|
||||
IPC: 2
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user