@rstreamlabs/webtty 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.d.mts +146 -0
- package/dist/index.d.ts +146 -0
- package/dist/index.js +2143 -0
- package/dist/index.mjs +2106 -0
- package/package.json +37 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
WebTTY: () => WebTTY
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// .generated/protobuf/webtty.js
|
|
38
|
+
var $protobuf = __toESM(require("protobufjs/minimal"));
|
|
39
|
+
var $Reader = $protobuf.Reader;
|
|
40
|
+
var $Writer = $protobuf.Writer;
|
|
41
|
+
var $util = $protobuf.util;
|
|
42
|
+
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
|
|
43
|
+
var rstream = $root.rstream = (() => {
|
|
44
|
+
const rstream2 = {};
|
|
45
|
+
rstream2.webtty = function() {
|
|
46
|
+
const webtty = {};
|
|
47
|
+
webtty.protobuf = function() {
|
|
48
|
+
const protobuf = {};
|
|
49
|
+
protobuf.Options = function() {
|
|
50
|
+
function Options(properties) {
|
|
51
|
+
if (properties) {
|
|
52
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
53
|
+
if (properties[keys[i]] != null)
|
|
54
|
+
this[keys[i]] = properties[keys[i]];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
Options.prototype.interactive = false;
|
|
58
|
+
Options.prototype.allocateTty = false;
|
|
59
|
+
Options.prototype.sendHeartbeat = false;
|
|
60
|
+
Options.create = function create(properties) {
|
|
61
|
+
return new Options(properties);
|
|
62
|
+
};
|
|
63
|
+
Options.encode = function encode(message, writer) {
|
|
64
|
+
if (!writer)
|
|
65
|
+
writer = $Writer.create();
|
|
66
|
+
if (message.interactive != null && Object.hasOwnProperty.call(message, "interactive"))
|
|
67
|
+
writer.uint32(
|
|
68
|
+
/* id 1, wireType 0 =*/
|
|
69
|
+
8
|
|
70
|
+
).bool(message.interactive);
|
|
71
|
+
if (message.allocateTty != null && Object.hasOwnProperty.call(message, "allocateTty"))
|
|
72
|
+
writer.uint32(
|
|
73
|
+
/* id 2, wireType 0 =*/
|
|
74
|
+
16
|
|
75
|
+
).bool(message.allocateTty);
|
|
76
|
+
if (message.sendHeartbeat != null && Object.hasOwnProperty.call(message, "sendHeartbeat"))
|
|
77
|
+
writer.uint32(
|
|
78
|
+
/* id 3, wireType 0 =*/
|
|
79
|
+
24
|
|
80
|
+
).bool(message.sendHeartbeat);
|
|
81
|
+
return writer;
|
|
82
|
+
};
|
|
83
|
+
Options.encodeDelimited = function encodeDelimited(message, writer) {
|
|
84
|
+
return this.encode(message, writer).ldelim();
|
|
85
|
+
};
|
|
86
|
+
Options.decode = function decode(reader, length, error) {
|
|
87
|
+
if (!(reader instanceof $Reader))
|
|
88
|
+
reader = $Reader.create(reader);
|
|
89
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Options();
|
|
90
|
+
while (reader.pos < end) {
|
|
91
|
+
let tag = reader.uint32();
|
|
92
|
+
if (tag === error)
|
|
93
|
+
break;
|
|
94
|
+
switch (tag >>> 3) {
|
|
95
|
+
case 1: {
|
|
96
|
+
message.interactive = reader.bool();
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case 2: {
|
|
100
|
+
message.allocateTty = reader.bool();
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case 3: {
|
|
104
|
+
message.sendHeartbeat = reader.bool();
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
default:
|
|
108
|
+
reader.skipType(tag & 7);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return message;
|
|
113
|
+
};
|
|
114
|
+
Options.decodeDelimited = function decodeDelimited(reader) {
|
|
115
|
+
if (!(reader instanceof $Reader))
|
|
116
|
+
reader = new $Reader(reader);
|
|
117
|
+
return this.decode(reader, reader.uint32());
|
|
118
|
+
};
|
|
119
|
+
Options.verify = function verify(message) {
|
|
120
|
+
if (typeof message !== "object" || message === null)
|
|
121
|
+
return "object expected";
|
|
122
|
+
if (message.interactive != null && message.hasOwnProperty("interactive")) {
|
|
123
|
+
if (typeof message.interactive !== "boolean")
|
|
124
|
+
return "interactive: boolean expected";
|
|
125
|
+
}
|
|
126
|
+
if (message.allocateTty != null && message.hasOwnProperty("allocateTty")) {
|
|
127
|
+
if (typeof message.allocateTty !== "boolean")
|
|
128
|
+
return "allocateTty: boolean expected";
|
|
129
|
+
}
|
|
130
|
+
if (message.sendHeartbeat != null && message.hasOwnProperty("sendHeartbeat")) {
|
|
131
|
+
if (typeof message.sendHeartbeat !== "boolean")
|
|
132
|
+
return "sendHeartbeat: boolean expected";
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
};
|
|
136
|
+
Options.fromObject = function fromObject(object) {
|
|
137
|
+
if (object instanceof $root.rstream.webtty.protobuf.Options)
|
|
138
|
+
return object;
|
|
139
|
+
let message = new $root.rstream.webtty.protobuf.Options();
|
|
140
|
+
if (object.interactive != null)
|
|
141
|
+
message.interactive = Boolean(object.interactive);
|
|
142
|
+
if (object.allocateTty != null)
|
|
143
|
+
message.allocateTty = Boolean(object.allocateTty);
|
|
144
|
+
if (object.sendHeartbeat != null)
|
|
145
|
+
message.sendHeartbeat = Boolean(object.sendHeartbeat);
|
|
146
|
+
return message;
|
|
147
|
+
};
|
|
148
|
+
Options.toObject = function toObject(message, options) {
|
|
149
|
+
if (!options)
|
|
150
|
+
options = {};
|
|
151
|
+
let object = {};
|
|
152
|
+
if (options.defaults) {
|
|
153
|
+
object.interactive = false;
|
|
154
|
+
object.allocateTty = false;
|
|
155
|
+
object.sendHeartbeat = false;
|
|
156
|
+
}
|
|
157
|
+
if (message.interactive != null && message.hasOwnProperty("interactive"))
|
|
158
|
+
object.interactive = message.interactive;
|
|
159
|
+
if (message.allocateTty != null && message.hasOwnProperty("allocateTty"))
|
|
160
|
+
object.allocateTty = message.allocateTty;
|
|
161
|
+
if (message.sendHeartbeat != null && message.hasOwnProperty("sendHeartbeat"))
|
|
162
|
+
object.sendHeartbeat = message.sendHeartbeat;
|
|
163
|
+
return object;
|
|
164
|
+
};
|
|
165
|
+
Options.prototype.toJSON = function toJSON() {
|
|
166
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
167
|
+
};
|
|
168
|
+
Options.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
169
|
+
if (typeUrlPrefix === void 0) {
|
|
170
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
171
|
+
}
|
|
172
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Options";
|
|
173
|
+
};
|
|
174
|
+
return Options;
|
|
175
|
+
}();
|
|
176
|
+
protobuf.Environment = function() {
|
|
177
|
+
function Environment(properties) {
|
|
178
|
+
if (properties) {
|
|
179
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
180
|
+
if (properties[keys[i]] != null)
|
|
181
|
+
this[keys[i]] = properties[keys[i]];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
Environment.prototype.key = "";
|
|
185
|
+
Environment.prototype.value = "";
|
|
186
|
+
Environment.create = function create(properties) {
|
|
187
|
+
return new Environment(properties);
|
|
188
|
+
};
|
|
189
|
+
Environment.encode = function encode(message, writer) {
|
|
190
|
+
if (!writer)
|
|
191
|
+
writer = $Writer.create();
|
|
192
|
+
if (message.key != null && Object.hasOwnProperty.call(message, "key"))
|
|
193
|
+
writer.uint32(
|
|
194
|
+
/* id 1, wireType 2 =*/
|
|
195
|
+
10
|
|
196
|
+
).string(message.key);
|
|
197
|
+
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
|
198
|
+
writer.uint32(
|
|
199
|
+
/* id 2, wireType 2 =*/
|
|
200
|
+
18
|
|
201
|
+
).string(message.value);
|
|
202
|
+
return writer;
|
|
203
|
+
};
|
|
204
|
+
Environment.encodeDelimited = function encodeDelimited(message, writer) {
|
|
205
|
+
return this.encode(message, writer).ldelim();
|
|
206
|
+
};
|
|
207
|
+
Environment.decode = function decode(reader, length, error) {
|
|
208
|
+
if (!(reader instanceof $Reader))
|
|
209
|
+
reader = $Reader.create(reader);
|
|
210
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Environment();
|
|
211
|
+
while (reader.pos < end) {
|
|
212
|
+
let tag = reader.uint32();
|
|
213
|
+
if (tag === error)
|
|
214
|
+
break;
|
|
215
|
+
switch (tag >>> 3) {
|
|
216
|
+
case 1: {
|
|
217
|
+
message.key = reader.string();
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
case 2: {
|
|
221
|
+
message.value = reader.string();
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
default:
|
|
225
|
+
reader.skipType(tag & 7);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return message;
|
|
230
|
+
};
|
|
231
|
+
Environment.decodeDelimited = function decodeDelimited(reader) {
|
|
232
|
+
if (!(reader instanceof $Reader))
|
|
233
|
+
reader = new $Reader(reader);
|
|
234
|
+
return this.decode(reader, reader.uint32());
|
|
235
|
+
};
|
|
236
|
+
Environment.verify = function verify(message) {
|
|
237
|
+
if (typeof message !== "object" || message === null)
|
|
238
|
+
return "object expected";
|
|
239
|
+
if (message.key != null && message.hasOwnProperty("key")) {
|
|
240
|
+
if (!$util.isString(message.key))
|
|
241
|
+
return "key: string expected";
|
|
242
|
+
}
|
|
243
|
+
if (message.value != null && message.hasOwnProperty("value")) {
|
|
244
|
+
if (!$util.isString(message.value))
|
|
245
|
+
return "value: string expected";
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
};
|
|
249
|
+
Environment.fromObject = function fromObject(object) {
|
|
250
|
+
if (object instanceof $root.rstream.webtty.protobuf.Environment)
|
|
251
|
+
return object;
|
|
252
|
+
let message = new $root.rstream.webtty.protobuf.Environment();
|
|
253
|
+
if (object.key != null)
|
|
254
|
+
message.key = String(object.key);
|
|
255
|
+
if (object.value != null)
|
|
256
|
+
message.value = String(object.value);
|
|
257
|
+
return message;
|
|
258
|
+
};
|
|
259
|
+
Environment.toObject = function toObject(message, options) {
|
|
260
|
+
if (!options)
|
|
261
|
+
options = {};
|
|
262
|
+
let object = {};
|
|
263
|
+
if (options.defaults) {
|
|
264
|
+
object.key = "";
|
|
265
|
+
object.value = "";
|
|
266
|
+
}
|
|
267
|
+
if (message.key != null && message.hasOwnProperty("key"))
|
|
268
|
+
object.key = message.key;
|
|
269
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
|
270
|
+
object.value = message.value;
|
|
271
|
+
return object;
|
|
272
|
+
};
|
|
273
|
+
Environment.prototype.toJSON = function toJSON() {
|
|
274
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
275
|
+
};
|
|
276
|
+
Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
277
|
+
if (typeUrlPrefix === void 0) {
|
|
278
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
279
|
+
}
|
|
280
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Environment";
|
|
281
|
+
};
|
|
282
|
+
return Environment;
|
|
283
|
+
}();
|
|
284
|
+
protobuf.Username = function() {
|
|
285
|
+
function Username(properties) {
|
|
286
|
+
if (properties) {
|
|
287
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
288
|
+
if (properties[keys[i]] != null)
|
|
289
|
+
this[keys[i]] = properties[keys[i]];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
Username.prototype.name = null;
|
|
293
|
+
Username.prototype.id = null;
|
|
294
|
+
let $oneOfFields;
|
|
295
|
+
Object.defineProperty(Username.prototype, "payload", {
|
|
296
|
+
get: $util.oneOfGetter($oneOfFields = ["name", "id"]),
|
|
297
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
298
|
+
});
|
|
299
|
+
Username.create = function create(properties) {
|
|
300
|
+
return new Username(properties);
|
|
301
|
+
};
|
|
302
|
+
Username.encode = function encode(message, writer) {
|
|
303
|
+
if (!writer)
|
|
304
|
+
writer = $Writer.create();
|
|
305
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
306
|
+
writer.uint32(
|
|
307
|
+
/* id 1, wireType 2 =*/
|
|
308
|
+
10
|
|
309
|
+
).string(message.name);
|
|
310
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
311
|
+
writer.uint32(
|
|
312
|
+
/* id 2, wireType 0 =*/
|
|
313
|
+
16
|
|
314
|
+
).uint32(message.id);
|
|
315
|
+
return writer;
|
|
316
|
+
};
|
|
317
|
+
Username.encodeDelimited = function encodeDelimited(message, writer) {
|
|
318
|
+
return this.encode(message, writer).ldelim();
|
|
319
|
+
};
|
|
320
|
+
Username.decode = function decode(reader, length, error) {
|
|
321
|
+
if (!(reader instanceof $Reader))
|
|
322
|
+
reader = $Reader.create(reader);
|
|
323
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Username();
|
|
324
|
+
while (reader.pos < end) {
|
|
325
|
+
let tag = reader.uint32();
|
|
326
|
+
if (tag === error)
|
|
327
|
+
break;
|
|
328
|
+
switch (tag >>> 3) {
|
|
329
|
+
case 1: {
|
|
330
|
+
message.name = reader.string();
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
case 2: {
|
|
334
|
+
message.id = reader.uint32();
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
default:
|
|
338
|
+
reader.skipType(tag & 7);
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return message;
|
|
343
|
+
};
|
|
344
|
+
Username.decodeDelimited = function decodeDelimited(reader) {
|
|
345
|
+
if (!(reader instanceof $Reader))
|
|
346
|
+
reader = new $Reader(reader);
|
|
347
|
+
return this.decode(reader, reader.uint32());
|
|
348
|
+
};
|
|
349
|
+
Username.verify = function verify(message) {
|
|
350
|
+
if (typeof message !== "object" || message === null)
|
|
351
|
+
return "object expected";
|
|
352
|
+
let properties = {};
|
|
353
|
+
if (message.name != null && message.hasOwnProperty("name")) {
|
|
354
|
+
properties.payload = 1;
|
|
355
|
+
if (!$util.isString(message.name))
|
|
356
|
+
return "name: string expected";
|
|
357
|
+
}
|
|
358
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
359
|
+
if (properties.payload === 1)
|
|
360
|
+
return "payload: multiple values";
|
|
361
|
+
properties.payload = 1;
|
|
362
|
+
if (!$util.isInteger(message.id))
|
|
363
|
+
return "id: integer expected";
|
|
364
|
+
}
|
|
365
|
+
return null;
|
|
366
|
+
};
|
|
367
|
+
Username.fromObject = function fromObject(object) {
|
|
368
|
+
if (object instanceof $root.rstream.webtty.protobuf.Username)
|
|
369
|
+
return object;
|
|
370
|
+
let message = new $root.rstream.webtty.protobuf.Username();
|
|
371
|
+
if (object.name != null)
|
|
372
|
+
message.name = String(object.name);
|
|
373
|
+
if (object.id != null)
|
|
374
|
+
message.id = object.id >>> 0;
|
|
375
|
+
return message;
|
|
376
|
+
};
|
|
377
|
+
Username.toObject = function toObject(message, options) {
|
|
378
|
+
if (!options)
|
|
379
|
+
options = {};
|
|
380
|
+
let object = {};
|
|
381
|
+
if (message.name != null && message.hasOwnProperty("name")) {
|
|
382
|
+
object.name = message.name;
|
|
383
|
+
if (options.oneofs)
|
|
384
|
+
object.payload = "name";
|
|
385
|
+
}
|
|
386
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
387
|
+
object.id = message.id;
|
|
388
|
+
if (options.oneofs)
|
|
389
|
+
object.payload = "id";
|
|
390
|
+
}
|
|
391
|
+
return object;
|
|
392
|
+
};
|
|
393
|
+
Username.prototype.toJSON = function toJSON() {
|
|
394
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
395
|
+
};
|
|
396
|
+
Username.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
397
|
+
if (typeUrlPrefix === void 0) {
|
|
398
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
399
|
+
}
|
|
400
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Username";
|
|
401
|
+
};
|
|
402
|
+
return Username;
|
|
403
|
+
}();
|
|
404
|
+
protobuf.Workdir = function() {
|
|
405
|
+
function Workdir(properties) {
|
|
406
|
+
if (properties) {
|
|
407
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
408
|
+
if (properties[keys[i]] != null)
|
|
409
|
+
this[keys[i]] = properties[keys[i]];
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
Workdir.prototype.value = "";
|
|
413
|
+
Workdir.create = function create(properties) {
|
|
414
|
+
return new Workdir(properties);
|
|
415
|
+
};
|
|
416
|
+
Workdir.encode = function encode(message, writer) {
|
|
417
|
+
if (!writer)
|
|
418
|
+
writer = $Writer.create();
|
|
419
|
+
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
|
420
|
+
writer.uint32(
|
|
421
|
+
/* id 1, wireType 2 =*/
|
|
422
|
+
10
|
|
423
|
+
).string(message.value);
|
|
424
|
+
return writer;
|
|
425
|
+
};
|
|
426
|
+
Workdir.encodeDelimited = function encodeDelimited(message, writer) {
|
|
427
|
+
return this.encode(message, writer).ldelim();
|
|
428
|
+
};
|
|
429
|
+
Workdir.decode = function decode(reader, length, error) {
|
|
430
|
+
if (!(reader instanceof $Reader))
|
|
431
|
+
reader = $Reader.create(reader);
|
|
432
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Workdir();
|
|
433
|
+
while (reader.pos < end) {
|
|
434
|
+
let tag = reader.uint32();
|
|
435
|
+
if (tag === error)
|
|
436
|
+
break;
|
|
437
|
+
switch (tag >>> 3) {
|
|
438
|
+
case 1: {
|
|
439
|
+
message.value = reader.string();
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
default:
|
|
443
|
+
reader.skipType(tag & 7);
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
return message;
|
|
448
|
+
};
|
|
449
|
+
Workdir.decodeDelimited = function decodeDelimited(reader) {
|
|
450
|
+
if (!(reader instanceof $Reader))
|
|
451
|
+
reader = new $Reader(reader);
|
|
452
|
+
return this.decode(reader, reader.uint32());
|
|
453
|
+
};
|
|
454
|
+
Workdir.verify = function verify(message) {
|
|
455
|
+
if (typeof message !== "object" || message === null)
|
|
456
|
+
return "object expected";
|
|
457
|
+
if (message.value != null && message.hasOwnProperty("value")) {
|
|
458
|
+
if (!$util.isString(message.value))
|
|
459
|
+
return "value: string expected";
|
|
460
|
+
}
|
|
461
|
+
return null;
|
|
462
|
+
};
|
|
463
|
+
Workdir.fromObject = function fromObject(object) {
|
|
464
|
+
if (object instanceof $root.rstream.webtty.protobuf.Workdir)
|
|
465
|
+
return object;
|
|
466
|
+
let message = new $root.rstream.webtty.protobuf.Workdir();
|
|
467
|
+
if (object.value != null)
|
|
468
|
+
message.value = String(object.value);
|
|
469
|
+
return message;
|
|
470
|
+
};
|
|
471
|
+
Workdir.toObject = function toObject(message, options) {
|
|
472
|
+
if (!options)
|
|
473
|
+
options = {};
|
|
474
|
+
let object = {};
|
|
475
|
+
if (options.defaults)
|
|
476
|
+
object.value = "";
|
|
477
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
|
478
|
+
object.value = message.value;
|
|
479
|
+
return object;
|
|
480
|
+
};
|
|
481
|
+
Workdir.prototype.toJSON = function toJSON() {
|
|
482
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
483
|
+
};
|
|
484
|
+
Workdir.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
485
|
+
if (typeUrlPrefix === void 0) {
|
|
486
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
487
|
+
}
|
|
488
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Workdir";
|
|
489
|
+
};
|
|
490
|
+
return Workdir;
|
|
491
|
+
}();
|
|
492
|
+
protobuf.Config = function() {
|
|
493
|
+
function Config(properties) {
|
|
494
|
+
this.cmdArgs = [];
|
|
495
|
+
this.envVars = [];
|
|
496
|
+
if (properties) {
|
|
497
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
498
|
+
if (properties[keys[i]] != null)
|
|
499
|
+
this[keys[i]] = properties[keys[i]];
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
Config.prototype.options = null;
|
|
503
|
+
Config.prototype.cmdArgs = $util.emptyArray;
|
|
504
|
+
Config.prototype.envVars = $util.emptyArray;
|
|
505
|
+
Config.prototype.workdir = null;
|
|
506
|
+
Config.prototype.username = null;
|
|
507
|
+
Config.create = function create(properties) {
|
|
508
|
+
return new Config(properties);
|
|
509
|
+
};
|
|
510
|
+
Config.encode = function encode(message, writer) {
|
|
511
|
+
if (!writer)
|
|
512
|
+
writer = $Writer.create();
|
|
513
|
+
if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
|
514
|
+
$root.rstream.webtty.protobuf.Options.encode(message.options, writer.uint32(
|
|
515
|
+
/* id 1, wireType 2 =*/
|
|
516
|
+
10
|
|
517
|
+
).fork()).ldelim();
|
|
518
|
+
if (message.cmdArgs != null && message.cmdArgs.length)
|
|
519
|
+
for (let i = 0; i < message.cmdArgs.length; ++i)
|
|
520
|
+
writer.uint32(
|
|
521
|
+
/* id 2, wireType 2 =*/
|
|
522
|
+
18
|
|
523
|
+
).string(message.cmdArgs[i]);
|
|
524
|
+
if (message.envVars != null && message.envVars.length)
|
|
525
|
+
for (let i = 0; i < message.envVars.length; ++i)
|
|
526
|
+
$root.rstream.webtty.protobuf.Environment.encode(message.envVars[i], writer.uint32(
|
|
527
|
+
/* id 3, wireType 2 =*/
|
|
528
|
+
26
|
|
529
|
+
).fork()).ldelim();
|
|
530
|
+
if (message.workdir != null && Object.hasOwnProperty.call(message, "workdir"))
|
|
531
|
+
$root.rstream.webtty.protobuf.Workdir.encode(message.workdir, writer.uint32(
|
|
532
|
+
/* id 4, wireType 2 =*/
|
|
533
|
+
34
|
|
534
|
+
).fork()).ldelim();
|
|
535
|
+
if (message.username != null && Object.hasOwnProperty.call(message, "username"))
|
|
536
|
+
$root.rstream.webtty.protobuf.Username.encode(message.username, writer.uint32(
|
|
537
|
+
/* id 5, wireType 2 =*/
|
|
538
|
+
42
|
|
539
|
+
).fork()).ldelim();
|
|
540
|
+
return writer;
|
|
541
|
+
};
|
|
542
|
+
Config.encodeDelimited = function encodeDelimited(message, writer) {
|
|
543
|
+
return this.encode(message, writer).ldelim();
|
|
544
|
+
};
|
|
545
|
+
Config.decode = function decode(reader, length, error) {
|
|
546
|
+
if (!(reader instanceof $Reader))
|
|
547
|
+
reader = $Reader.create(reader);
|
|
548
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Config();
|
|
549
|
+
while (reader.pos < end) {
|
|
550
|
+
let tag = reader.uint32();
|
|
551
|
+
if (tag === error)
|
|
552
|
+
break;
|
|
553
|
+
switch (tag >>> 3) {
|
|
554
|
+
case 1: {
|
|
555
|
+
message.options = $root.rstream.webtty.protobuf.Options.decode(reader, reader.uint32());
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
558
|
+
case 2: {
|
|
559
|
+
if (!(message.cmdArgs && message.cmdArgs.length))
|
|
560
|
+
message.cmdArgs = [];
|
|
561
|
+
message.cmdArgs.push(reader.string());
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
case 3: {
|
|
565
|
+
if (!(message.envVars && message.envVars.length))
|
|
566
|
+
message.envVars = [];
|
|
567
|
+
message.envVars.push($root.rstream.webtty.protobuf.Environment.decode(reader, reader.uint32()));
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
case 4: {
|
|
571
|
+
message.workdir = $root.rstream.webtty.protobuf.Workdir.decode(reader, reader.uint32());
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
case 5: {
|
|
575
|
+
message.username = $root.rstream.webtty.protobuf.Username.decode(reader, reader.uint32());
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
default:
|
|
579
|
+
reader.skipType(tag & 7);
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return message;
|
|
584
|
+
};
|
|
585
|
+
Config.decodeDelimited = function decodeDelimited(reader) {
|
|
586
|
+
if (!(reader instanceof $Reader))
|
|
587
|
+
reader = new $Reader(reader);
|
|
588
|
+
return this.decode(reader, reader.uint32());
|
|
589
|
+
};
|
|
590
|
+
Config.verify = function verify(message) {
|
|
591
|
+
if (typeof message !== "object" || message === null)
|
|
592
|
+
return "object expected";
|
|
593
|
+
if (message.options != null && message.hasOwnProperty("options")) {
|
|
594
|
+
let error = $root.rstream.webtty.protobuf.Options.verify(message.options);
|
|
595
|
+
if (error)
|
|
596
|
+
return "options." + error;
|
|
597
|
+
}
|
|
598
|
+
if (message.cmdArgs != null && message.hasOwnProperty("cmdArgs")) {
|
|
599
|
+
if (!Array.isArray(message.cmdArgs))
|
|
600
|
+
return "cmdArgs: array expected";
|
|
601
|
+
for (let i = 0; i < message.cmdArgs.length; ++i)
|
|
602
|
+
if (!$util.isString(message.cmdArgs[i]))
|
|
603
|
+
return "cmdArgs: string[] expected";
|
|
604
|
+
}
|
|
605
|
+
if (message.envVars != null && message.hasOwnProperty("envVars")) {
|
|
606
|
+
if (!Array.isArray(message.envVars))
|
|
607
|
+
return "envVars: array expected";
|
|
608
|
+
for (let i = 0; i < message.envVars.length; ++i) {
|
|
609
|
+
let error = $root.rstream.webtty.protobuf.Environment.verify(message.envVars[i]);
|
|
610
|
+
if (error)
|
|
611
|
+
return "envVars." + error;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
if (message.workdir != null && message.hasOwnProperty("workdir")) {
|
|
615
|
+
let error = $root.rstream.webtty.protobuf.Workdir.verify(message.workdir);
|
|
616
|
+
if (error)
|
|
617
|
+
return "workdir." + error;
|
|
618
|
+
}
|
|
619
|
+
if (message.username != null && message.hasOwnProperty("username")) {
|
|
620
|
+
let error = $root.rstream.webtty.protobuf.Username.verify(message.username);
|
|
621
|
+
if (error)
|
|
622
|
+
return "username." + error;
|
|
623
|
+
}
|
|
624
|
+
return null;
|
|
625
|
+
};
|
|
626
|
+
Config.fromObject = function fromObject(object) {
|
|
627
|
+
if (object instanceof $root.rstream.webtty.protobuf.Config)
|
|
628
|
+
return object;
|
|
629
|
+
let message = new $root.rstream.webtty.protobuf.Config();
|
|
630
|
+
if (object.options != null) {
|
|
631
|
+
if (typeof object.options !== "object")
|
|
632
|
+
throw TypeError(".rstream.webtty.protobuf.Config.options: object expected");
|
|
633
|
+
message.options = $root.rstream.webtty.protobuf.Options.fromObject(object.options);
|
|
634
|
+
}
|
|
635
|
+
if (object.cmdArgs) {
|
|
636
|
+
if (!Array.isArray(object.cmdArgs))
|
|
637
|
+
throw TypeError(".rstream.webtty.protobuf.Config.cmdArgs: array expected");
|
|
638
|
+
message.cmdArgs = [];
|
|
639
|
+
for (let i = 0; i < object.cmdArgs.length; ++i)
|
|
640
|
+
message.cmdArgs[i] = String(object.cmdArgs[i]);
|
|
641
|
+
}
|
|
642
|
+
if (object.envVars) {
|
|
643
|
+
if (!Array.isArray(object.envVars))
|
|
644
|
+
throw TypeError(".rstream.webtty.protobuf.Config.envVars: array expected");
|
|
645
|
+
message.envVars = [];
|
|
646
|
+
for (let i = 0; i < object.envVars.length; ++i) {
|
|
647
|
+
if (typeof object.envVars[i] !== "object")
|
|
648
|
+
throw TypeError(".rstream.webtty.protobuf.Config.envVars: object expected");
|
|
649
|
+
message.envVars[i] = $root.rstream.webtty.protobuf.Environment.fromObject(object.envVars[i]);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
if (object.workdir != null) {
|
|
653
|
+
if (typeof object.workdir !== "object")
|
|
654
|
+
throw TypeError(".rstream.webtty.protobuf.Config.workdir: object expected");
|
|
655
|
+
message.workdir = $root.rstream.webtty.protobuf.Workdir.fromObject(object.workdir);
|
|
656
|
+
}
|
|
657
|
+
if (object.username != null) {
|
|
658
|
+
if (typeof object.username !== "object")
|
|
659
|
+
throw TypeError(".rstream.webtty.protobuf.Config.username: object expected");
|
|
660
|
+
message.username = $root.rstream.webtty.protobuf.Username.fromObject(object.username);
|
|
661
|
+
}
|
|
662
|
+
return message;
|
|
663
|
+
};
|
|
664
|
+
Config.toObject = function toObject(message, options) {
|
|
665
|
+
if (!options)
|
|
666
|
+
options = {};
|
|
667
|
+
let object = {};
|
|
668
|
+
if (options.arrays || options.defaults) {
|
|
669
|
+
object.cmdArgs = [];
|
|
670
|
+
object.envVars = [];
|
|
671
|
+
}
|
|
672
|
+
if (options.defaults) {
|
|
673
|
+
object.options = null;
|
|
674
|
+
object.workdir = null;
|
|
675
|
+
object.username = null;
|
|
676
|
+
}
|
|
677
|
+
if (message.options != null && message.hasOwnProperty("options"))
|
|
678
|
+
object.options = $root.rstream.webtty.protobuf.Options.toObject(message.options, options);
|
|
679
|
+
if (message.cmdArgs && message.cmdArgs.length) {
|
|
680
|
+
object.cmdArgs = [];
|
|
681
|
+
for (let j = 0; j < message.cmdArgs.length; ++j)
|
|
682
|
+
object.cmdArgs[j] = message.cmdArgs[j];
|
|
683
|
+
}
|
|
684
|
+
if (message.envVars && message.envVars.length) {
|
|
685
|
+
object.envVars = [];
|
|
686
|
+
for (let j = 0; j < message.envVars.length; ++j)
|
|
687
|
+
object.envVars[j] = $root.rstream.webtty.protobuf.Environment.toObject(message.envVars[j], options);
|
|
688
|
+
}
|
|
689
|
+
if (message.workdir != null && message.hasOwnProperty("workdir"))
|
|
690
|
+
object.workdir = $root.rstream.webtty.protobuf.Workdir.toObject(message.workdir, options);
|
|
691
|
+
if (message.username != null && message.hasOwnProperty("username"))
|
|
692
|
+
object.username = $root.rstream.webtty.protobuf.Username.toObject(message.username, options);
|
|
693
|
+
return object;
|
|
694
|
+
};
|
|
695
|
+
Config.prototype.toJSON = function toJSON() {
|
|
696
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
697
|
+
};
|
|
698
|
+
Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
699
|
+
if (typeUrlPrefix === void 0) {
|
|
700
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
701
|
+
}
|
|
702
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Config";
|
|
703
|
+
};
|
|
704
|
+
return Config;
|
|
705
|
+
}();
|
|
706
|
+
protobuf.Open = function() {
|
|
707
|
+
function Open(properties) {
|
|
708
|
+
if (properties) {
|
|
709
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
710
|
+
if (properties[keys[i]] != null)
|
|
711
|
+
this[keys[i]] = properties[keys[i]];
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
Open.prototype.config = null;
|
|
715
|
+
Open.create = function create(properties) {
|
|
716
|
+
return new Open(properties);
|
|
717
|
+
};
|
|
718
|
+
Open.encode = function encode(message, writer) {
|
|
719
|
+
if (!writer)
|
|
720
|
+
writer = $Writer.create();
|
|
721
|
+
if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
|
722
|
+
$root.rstream.webtty.protobuf.Config.encode(message.config, writer.uint32(
|
|
723
|
+
/* id 1, wireType 2 =*/
|
|
724
|
+
10
|
|
725
|
+
).fork()).ldelim();
|
|
726
|
+
return writer;
|
|
727
|
+
};
|
|
728
|
+
Open.encodeDelimited = function encodeDelimited(message, writer) {
|
|
729
|
+
return this.encode(message, writer).ldelim();
|
|
730
|
+
};
|
|
731
|
+
Open.decode = function decode(reader, length, error) {
|
|
732
|
+
if (!(reader instanceof $Reader))
|
|
733
|
+
reader = $Reader.create(reader);
|
|
734
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Open();
|
|
735
|
+
while (reader.pos < end) {
|
|
736
|
+
let tag = reader.uint32();
|
|
737
|
+
if (tag === error)
|
|
738
|
+
break;
|
|
739
|
+
switch (tag >>> 3) {
|
|
740
|
+
case 1: {
|
|
741
|
+
message.config = $root.rstream.webtty.protobuf.Config.decode(reader, reader.uint32());
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
default:
|
|
745
|
+
reader.skipType(tag & 7);
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
return message;
|
|
750
|
+
};
|
|
751
|
+
Open.decodeDelimited = function decodeDelimited(reader) {
|
|
752
|
+
if (!(reader instanceof $Reader))
|
|
753
|
+
reader = new $Reader(reader);
|
|
754
|
+
return this.decode(reader, reader.uint32());
|
|
755
|
+
};
|
|
756
|
+
Open.verify = function verify(message) {
|
|
757
|
+
if (typeof message !== "object" || message === null)
|
|
758
|
+
return "object expected";
|
|
759
|
+
if (message.config != null && message.hasOwnProperty("config")) {
|
|
760
|
+
let error = $root.rstream.webtty.protobuf.Config.verify(message.config);
|
|
761
|
+
if (error)
|
|
762
|
+
return "config." + error;
|
|
763
|
+
}
|
|
764
|
+
return null;
|
|
765
|
+
};
|
|
766
|
+
Open.fromObject = function fromObject(object) {
|
|
767
|
+
if (object instanceof $root.rstream.webtty.protobuf.Open)
|
|
768
|
+
return object;
|
|
769
|
+
let message = new $root.rstream.webtty.protobuf.Open();
|
|
770
|
+
if (object.config != null) {
|
|
771
|
+
if (typeof object.config !== "object")
|
|
772
|
+
throw TypeError(".rstream.webtty.protobuf.Open.config: object expected");
|
|
773
|
+
message.config = $root.rstream.webtty.protobuf.Config.fromObject(object.config);
|
|
774
|
+
}
|
|
775
|
+
return message;
|
|
776
|
+
};
|
|
777
|
+
Open.toObject = function toObject(message, options) {
|
|
778
|
+
if (!options)
|
|
779
|
+
options = {};
|
|
780
|
+
let object = {};
|
|
781
|
+
if (options.defaults)
|
|
782
|
+
object.config = null;
|
|
783
|
+
if (message.config != null && message.hasOwnProperty("config"))
|
|
784
|
+
object.config = $root.rstream.webtty.protobuf.Config.toObject(message.config, options);
|
|
785
|
+
return object;
|
|
786
|
+
};
|
|
787
|
+
Open.prototype.toJSON = function toJSON() {
|
|
788
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
789
|
+
};
|
|
790
|
+
Open.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
791
|
+
if (typeUrlPrefix === void 0) {
|
|
792
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
793
|
+
}
|
|
794
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Open";
|
|
795
|
+
};
|
|
796
|
+
return Open;
|
|
797
|
+
}();
|
|
798
|
+
protobuf.Ack = function() {
|
|
799
|
+
function Ack(properties) {
|
|
800
|
+
if (properties) {
|
|
801
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
802
|
+
if (properties[keys[i]] != null)
|
|
803
|
+
this[keys[i]] = properties[keys[i]];
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
Ack.create = function create(properties) {
|
|
807
|
+
return new Ack(properties);
|
|
808
|
+
};
|
|
809
|
+
Ack.encode = function encode(message, writer) {
|
|
810
|
+
if (!writer)
|
|
811
|
+
writer = $Writer.create();
|
|
812
|
+
return writer;
|
|
813
|
+
};
|
|
814
|
+
Ack.encodeDelimited = function encodeDelimited(message, writer) {
|
|
815
|
+
return this.encode(message, writer).ldelim();
|
|
816
|
+
};
|
|
817
|
+
Ack.decode = function decode(reader, length, error) {
|
|
818
|
+
if (!(reader instanceof $Reader))
|
|
819
|
+
reader = $Reader.create(reader);
|
|
820
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Ack();
|
|
821
|
+
while (reader.pos < end) {
|
|
822
|
+
let tag = reader.uint32();
|
|
823
|
+
if (tag === error)
|
|
824
|
+
break;
|
|
825
|
+
switch (tag >>> 3) {
|
|
826
|
+
default:
|
|
827
|
+
reader.skipType(tag & 7);
|
|
828
|
+
break;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
return message;
|
|
832
|
+
};
|
|
833
|
+
Ack.decodeDelimited = function decodeDelimited(reader) {
|
|
834
|
+
if (!(reader instanceof $Reader))
|
|
835
|
+
reader = new $Reader(reader);
|
|
836
|
+
return this.decode(reader, reader.uint32());
|
|
837
|
+
};
|
|
838
|
+
Ack.verify = function verify(message) {
|
|
839
|
+
if (typeof message !== "object" || message === null)
|
|
840
|
+
return "object expected";
|
|
841
|
+
return null;
|
|
842
|
+
};
|
|
843
|
+
Ack.fromObject = function fromObject(object) {
|
|
844
|
+
if (object instanceof $root.rstream.webtty.protobuf.Ack)
|
|
845
|
+
return object;
|
|
846
|
+
return new $root.rstream.webtty.protobuf.Ack();
|
|
847
|
+
};
|
|
848
|
+
Ack.toObject = function toObject() {
|
|
849
|
+
return {};
|
|
850
|
+
};
|
|
851
|
+
Ack.prototype.toJSON = function toJSON() {
|
|
852
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
853
|
+
};
|
|
854
|
+
Ack.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
855
|
+
if (typeUrlPrefix === void 0) {
|
|
856
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
857
|
+
}
|
|
858
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Ack";
|
|
859
|
+
};
|
|
860
|
+
return Ack;
|
|
861
|
+
}();
|
|
862
|
+
protobuf.Error = function() {
|
|
863
|
+
function Error2(properties) {
|
|
864
|
+
if (properties) {
|
|
865
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
866
|
+
if (properties[keys[i]] != null)
|
|
867
|
+
this[keys[i]] = properties[keys[i]];
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
Error2.prototype.code = 0;
|
|
871
|
+
Error2.create = function create(properties) {
|
|
872
|
+
return new Error2(properties);
|
|
873
|
+
};
|
|
874
|
+
Error2.encode = function encode(message, writer) {
|
|
875
|
+
if (!writer)
|
|
876
|
+
writer = $Writer.create();
|
|
877
|
+
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
|
|
878
|
+
writer.uint32(
|
|
879
|
+
/* id 1, wireType 0 =*/
|
|
880
|
+
8
|
|
881
|
+
).int32(message.code);
|
|
882
|
+
return writer;
|
|
883
|
+
};
|
|
884
|
+
Error2.encodeDelimited = function encodeDelimited(message, writer) {
|
|
885
|
+
return this.encode(message, writer).ldelim();
|
|
886
|
+
};
|
|
887
|
+
Error2.decode = function decode(reader, length, error) {
|
|
888
|
+
if (!(reader instanceof $Reader))
|
|
889
|
+
reader = $Reader.create(reader);
|
|
890
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Error();
|
|
891
|
+
while (reader.pos < end) {
|
|
892
|
+
let tag = reader.uint32();
|
|
893
|
+
if (tag === error)
|
|
894
|
+
break;
|
|
895
|
+
switch (tag >>> 3) {
|
|
896
|
+
case 1: {
|
|
897
|
+
message.code = reader.int32();
|
|
898
|
+
break;
|
|
899
|
+
}
|
|
900
|
+
default:
|
|
901
|
+
reader.skipType(tag & 7);
|
|
902
|
+
break;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
return message;
|
|
906
|
+
};
|
|
907
|
+
Error2.decodeDelimited = function decodeDelimited(reader) {
|
|
908
|
+
if (!(reader instanceof $Reader))
|
|
909
|
+
reader = new $Reader(reader);
|
|
910
|
+
return this.decode(reader, reader.uint32());
|
|
911
|
+
};
|
|
912
|
+
Error2.verify = function verify(message) {
|
|
913
|
+
if (typeof message !== "object" || message === null)
|
|
914
|
+
return "object expected";
|
|
915
|
+
if (message.code != null && message.hasOwnProperty("code")) {
|
|
916
|
+
if (!$util.isInteger(message.code))
|
|
917
|
+
return "code: integer expected";
|
|
918
|
+
}
|
|
919
|
+
return null;
|
|
920
|
+
};
|
|
921
|
+
Error2.fromObject = function fromObject(object) {
|
|
922
|
+
if (object instanceof $root.rstream.webtty.protobuf.Error)
|
|
923
|
+
return object;
|
|
924
|
+
let message = new $root.rstream.webtty.protobuf.Error();
|
|
925
|
+
if (object.code != null)
|
|
926
|
+
message.code = object.code | 0;
|
|
927
|
+
return message;
|
|
928
|
+
};
|
|
929
|
+
Error2.toObject = function toObject(message, options) {
|
|
930
|
+
if (!options)
|
|
931
|
+
options = {};
|
|
932
|
+
let object = {};
|
|
933
|
+
if (options.defaults)
|
|
934
|
+
object.code = 0;
|
|
935
|
+
if (message.code != null && message.hasOwnProperty("code"))
|
|
936
|
+
object.code = message.code;
|
|
937
|
+
return object;
|
|
938
|
+
};
|
|
939
|
+
Error2.prototype.toJSON = function toJSON() {
|
|
940
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
941
|
+
};
|
|
942
|
+
Error2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
943
|
+
if (typeUrlPrefix === void 0) {
|
|
944
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
945
|
+
}
|
|
946
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Error";
|
|
947
|
+
};
|
|
948
|
+
return Error2;
|
|
949
|
+
}();
|
|
950
|
+
protobuf.Close = function() {
|
|
951
|
+
function Close(properties) {
|
|
952
|
+
if (properties) {
|
|
953
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
954
|
+
if (properties[keys[i]] != null)
|
|
955
|
+
this[keys[i]] = properties[keys[i]];
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
Close.prototype.returnCode = 0;
|
|
959
|
+
Close.create = function create(properties) {
|
|
960
|
+
return new Close(properties);
|
|
961
|
+
};
|
|
962
|
+
Close.encode = function encode(message, writer) {
|
|
963
|
+
if (!writer)
|
|
964
|
+
writer = $Writer.create();
|
|
965
|
+
if (message.returnCode != null && Object.hasOwnProperty.call(message, "returnCode"))
|
|
966
|
+
writer.uint32(
|
|
967
|
+
/* id 1, wireType 0 =*/
|
|
968
|
+
8
|
|
969
|
+
).int32(message.returnCode);
|
|
970
|
+
return writer;
|
|
971
|
+
};
|
|
972
|
+
Close.encodeDelimited = function encodeDelimited(message, writer) {
|
|
973
|
+
return this.encode(message, writer).ldelim();
|
|
974
|
+
};
|
|
975
|
+
Close.decode = function decode(reader, length, error) {
|
|
976
|
+
if (!(reader instanceof $Reader))
|
|
977
|
+
reader = $Reader.create(reader);
|
|
978
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Close();
|
|
979
|
+
while (reader.pos < end) {
|
|
980
|
+
let tag = reader.uint32();
|
|
981
|
+
if (tag === error)
|
|
982
|
+
break;
|
|
983
|
+
switch (tag >>> 3) {
|
|
984
|
+
case 1: {
|
|
985
|
+
message.returnCode = reader.int32();
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
default:
|
|
989
|
+
reader.skipType(tag & 7);
|
|
990
|
+
break;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
return message;
|
|
994
|
+
};
|
|
995
|
+
Close.decodeDelimited = function decodeDelimited(reader) {
|
|
996
|
+
if (!(reader instanceof $Reader))
|
|
997
|
+
reader = new $Reader(reader);
|
|
998
|
+
return this.decode(reader, reader.uint32());
|
|
999
|
+
};
|
|
1000
|
+
Close.verify = function verify(message) {
|
|
1001
|
+
if (typeof message !== "object" || message === null)
|
|
1002
|
+
return "object expected";
|
|
1003
|
+
if (message.returnCode != null && message.hasOwnProperty("returnCode")) {
|
|
1004
|
+
if (!$util.isInteger(message.returnCode))
|
|
1005
|
+
return "returnCode: integer expected";
|
|
1006
|
+
}
|
|
1007
|
+
return null;
|
|
1008
|
+
};
|
|
1009
|
+
Close.fromObject = function fromObject(object) {
|
|
1010
|
+
if (object instanceof $root.rstream.webtty.protobuf.Close)
|
|
1011
|
+
return object;
|
|
1012
|
+
let message = new $root.rstream.webtty.protobuf.Close();
|
|
1013
|
+
if (object.returnCode != null)
|
|
1014
|
+
message.returnCode = object.returnCode | 0;
|
|
1015
|
+
return message;
|
|
1016
|
+
};
|
|
1017
|
+
Close.toObject = function toObject(message, options) {
|
|
1018
|
+
if (!options)
|
|
1019
|
+
options = {};
|
|
1020
|
+
let object = {};
|
|
1021
|
+
if (options.defaults)
|
|
1022
|
+
object.returnCode = 0;
|
|
1023
|
+
if (message.returnCode != null && message.hasOwnProperty("returnCode"))
|
|
1024
|
+
object.returnCode = message.returnCode;
|
|
1025
|
+
return object;
|
|
1026
|
+
};
|
|
1027
|
+
Close.prototype.toJSON = function toJSON() {
|
|
1028
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1029
|
+
};
|
|
1030
|
+
Close.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1031
|
+
if (typeUrlPrefix === void 0) {
|
|
1032
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1033
|
+
}
|
|
1034
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Close";
|
|
1035
|
+
};
|
|
1036
|
+
return Close;
|
|
1037
|
+
}();
|
|
1038
|
+
protobuf.EndOfStream = function() {
|
|
1039
|
+
function EndOfStream(properties) {
|
|
1040
|
+
if (properties) {
|
|
1041
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1042
|
+
if (properties[keys[i]] != null)
|
|
1043
|
+
this[keys[i]] = properties[keys[i]];
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
EndOfStream.create = function create(properties) {
|
|
1047
|
+
return new EndOfStream(properties);
|
|
1048
|
+
};
|
|
1049
|
+
EndOfStream.encode = function encode(message, writer) {
|
|
1050
|
+
if (!writer)
|
|
1051
|
+
writer = $Writer.create();
|
|
1052
|
+
return writer;
|
|
1053
|
+
};
|
|
1054
|
+
EndOfStream.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1055
|
+
return this.encode(message, writer).ldelim();
|
|
1056
|
+
};
|
|
1057
|
+
EndOfStream.decode = function decode(reader, length, error) {
|
|
1058
|
+
if (!(reader instanceof $Reader))
|
|
1059
|
+
reader = $Reader.create(reader);
|
|
1060
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.EndOfStream();
|
|
1061
|
+
while (reader.pos < end) {
|
|
1062
|
+
let tag = reader.uint32();
|
|
1063
|
+
if (tag === error)
|
|
1064
|
+
break;
|
|
1065
|
+
switch (tag >>> 3) {
|
|
1066
|
+
default:
|
|
1067
|
+
reader.skipType(tag & 7);
|
|
1068
|
+
break;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
return message;
|
|
1072
|
+
};
|
|
1073
|
+
EndOfStream.decodeDelimited = function decodeDelimited(reader) {
|
|
1074
|
+
if (!(reader instanceof $Reader))
|
|
1075
|
+
reader = new $Reader(reader);
|
|
1076
|
+
return this.decode(reader, reader.uint32());
|
|
1077
|
+
};
|
|
1078
|
+
EndOfStream.verify = function verify(message) {
|
|
1079
|
+
if (typeof message !== "object" || message === null)
|
|
1080
|
+
return "object expected";
|
|
1081
|
+
return null;
|
|
1082
|
+
};
|
|
1083
|
+
EndOfStream.fromObject = function fromObject(object) {
|
|
1084
|
+
if (object instanceof $root.rstream.webtty.protobuf.EndOfStream)
|
|
1085
|
+
return object;
|
|
1086
|
+
return new $root.rstream.webtty.protobuf.EndOfStream();
|
|
1087
|
+
};
|
|
1088
|
+
EndOfStream.toObject = function toObject() {
|
|
1089
|
+
return {};
|
|
1090
|
+
};
|
|
1091
|
+
EndOfStream.prototype.toJSON = function toJSON() {
|
|
1092
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1093
|
+
};
|
|
1094
|
+
EndOfStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1095
|
+
if (typeUrlPrefix === void 0) {
|
|
1096
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1097
|
+
}
|
|
1098
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.EndOfStream";
|
|
1099
|
+
};
|
|
1100
|
+
return EndOfStream;
|
|
1101
|
+
}();
|
|
1102
|
+
protobuf.Data = function() {
|
|
1103
|
+
function Data(properties) {
|
|
1104
|
+
if (properties) {
|
|
1105
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1106
|
+
if (properties[keys[i]] != null)
|
|
1107
|
+
this[keys[i]] = properties[keys[i]];
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
Data.prototype.type = 0;
|
|
1111
|
+
Data.prototype.data = null;
|
|
1112
|
+
Data.prototype.eos = null;
|
|
1113
|
+
let $oneOfFields;
|
|
1114
|
+
Object.defineProperty(Data.prototype, "payload", {
|
|
1115
|
+
get: $util.oneOfGetter($oneOfFields = ["data", "eos"]),
|
|
1116
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1117
|
+
});
|
|
1118
|
+
Data.create = function create(properties) {
|
|
1119
|
+
return new Data(properties);
|
|
1120
|
+
};
|
|
1121
|
+
Data.encode = function encode(message, writer) {
|
|
1122
|
+
if (!writer)
|
|
1123
|
+
writer = $Writer.create();
|
|
1124
|
+
if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
|
1125
|
+
writer.uint32(
|
|
1126
|
+
/* id 1, wireType 0 =*/
|
|
1127
|
+
8
|
|
1128
|
+
).int32(message.type);
|
|
1129
|
+
if (message.data != null && Object.hasOwnProperty.call(message, "data"))
|
|
1130
|
+
writer.uint32(
|
|
1131
|
+
/* id 2, wireType 2 =*/
|
|
1132
|
+
18
|
|
1133
|
+
).bytes(message.data);
|
|
1134
|
+
if (message.eos != null && Object.hasOwnProperty.call(message, "eos"))
|
|
1135
|
+
$root.rstream.webtty.protobuf.EndOfStream.encode(message.eos, writer.uint32(
|
|
1136
|
+
/* id 3, wireType 2 =*/
|
|
1137
|
+
26
|
|
1138
|
+
).fork()).ldelim();
|
|
1139
|
+
return writer;
|
|
1140
|
+
};
|
|
1141
|
+
Data.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1142
|
+
return this.encode(message, writer).ldelim();
|
|
1143
|
+
};
|
|
1144
|
+
Data.decode = function decode(reader, length, error) {
|
|
1145
|
+
if (!(reader instanceof $Reader))
|
|
1146
|
+
reader = $Reader.create(reader);
|
|
1147
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Data();
|
|
1148
|
+
while (reader.pos < end) {
|
|
1149
|
+
let tag = reader.uint32();
|
|
1150
|
+
if (tag === error)
|
|
1151
|
+
break;
|
|
1152
|
+
switch (tag >>> 3) {
|
|
1153
|
+
case 1: {
|
|
1154
|
+
message.type = reader.int32();
|
|
1155
|
+
break;
|
|
1156
|
+
}
|
|
1157
|
+
case 2: {
|
|
1158
|
+
message.data = reader.bytes();
|
|
1159
|
+
break;
|
|
1160
|
+
}
|
|
1161
|
+
case 3: {
|
|
1162
|
+
message.eos = $root.rstream.webtty.protobuf.EndOfStream.decode(reader, reader.uint32());
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
default:
|
|
1166
|
+
reader.skipType(tag & 7);
|
|
1167
|
+
break;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
return message;
|
|
1171
|
+
};
|
|
1172
|
+
Data.decodeDelimited = function decodeDelimited(reader) {
|
|
1173
|
+
if (!(reader instanceof $Reader))
|
|
1174
|
+
reader = new $Reader(reader);
|
|
1175
|
+
return this.decode(reader, reader.uint32());
|
|
1176
|
+
};
|
|
1177
|
+
Data.verify = function verify(message) {
|
|
1178
|
+
if (typeof message !== "object" || message === null)
|
|
1179
|
+
return "object expected";
|
|
1180
|
+
let properties = {};
|
|
1181
|
+
if (message.type != null && message.hasOwnProperty("type"))
|
|
1182
|
+
switch (message.type) {
|
|
1183
|
+
default:
|
|
1184
|
+
return "type: enum value expected";
|
|
1185
|
+
case 0:
|
|
1186
|
+
case 1:
|
|
1187
|
+
case 2:
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
if (message.data != null && message.hasOwnProperty("data")) {
|
|
1191
|
+
properties.payload = 1;
|
|
1192
|
+
if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data)))
|
|
1193
|
+
return "data: buffer expected";
|
|
1194
|
+
}
|
|
1195
|
+
if (message.eos != null && message.hasOwnProperty("eos")) {
|
|
1196
|
+
if (properties.payload === 1)
|
|
1197
|
+
return "payload: multiple values";
|
|
1198
|
+
properties.payload = 1;
|
|
1199
|
+
{
|
|
1200
|
+
let error = $root.rstream.webtty.protobuf.EndOfStream.verify(message.eos);
|
|
1201
|
+
if (error)
|
|
1202
|
+
return "eos." + error;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
return null;
|
|
1206
|
+
};
|
|
1207
|
+
Data.fromObject = function fromObject(object) {
|
|
1208
|
+
if (object instanceof $root.rstream.webtty.protobuf.Data)
|
|
1209
|
+
return object;
|
|
1210
|
+
let message = new $root.rstream.webtty.protobuf.Data();
|
|
1211
|
+
switch (object.type) {
|
|
1212
|
+
default:
|
|
1213
|
+
if (typeof object.type === "number") {
|
|
1214
|
+
message.type = object.type;
|
|
1215
|
+
break;
|
|
1216
|
+
}
|
|
1217
|
+
break;
|
|
1218
|
+
case "TYPE_STDIN":
|
|
1219
|
+
case 0:
|
|
1220
|
+
message.type = 0;
|
|
1221
|
+
break;
|
|
1222
|
+
case "TYPE_STDOUT":
|
|
1223
|
+
case 1:
|
|
1224
|
+
message.type = 1;
|
|
1225
|
+
break;
|
|
1226
|
+
case "TYPE_STDERR":
|
|
1227
|
+
case 2:
|
|
1228
|
+
message.type = 2;
|
|
1229
|
+
break;
|
|
1230
|
+
}
|
|
1231
|
+
if (object.data != null) {
|
|
1232
|
+
if (typeof object.data === "string")
|
|
1233
|
+
$util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);
|
|
1234
|
+
else if (object.data.length >= 0)
|
|
1235
|
+
message.data = object.data;
|
|
1236
|
+
}
|
|
1237
|
+
if (object.eos != null) {
|
|
1238
|
+
if (typeof object.eos !== "object")
|
|
1239
|
+
throw TypeError(".rstream.webtty.protobuf.Data.eos: object expected");
|
|
1240
|
+
message.eos = $root.rstream.webtty.protobuf.EndOfStream.fromObject(object.eos);
|
|
1241
|
+
}
|
|
1242
|
+
return message;
|
|
1243
|
+
};
|
|
1244
|
+
Data.toObject = function toObject(message, options) {
|
|
1245
|
+
if (!options)
|
|
1246
|
+
options = {};
|
|
1247
|
+
let object = {};
|
|
1248
|
+
if (options.defaults)
|
|
1249
|
+
object.type = options.enums === String ? "TYPE_STDIN" : 0;
|
|
1250
|
+
if (message.type != null && message.hasOwnProperty("type"))
|
|
1251
|
+
object.type = options.enums === String ? $root.rstream.webtty.protobuf.Data.Type[message.type] === void 0 ? message.type : $root.rstream.webtty.protobuf.Data.Type[message.type] : message.type;
|
|
1252
|
+
if (message.data != null && message.hasOwnProperty("data")) {
|
|
1253
|
+
object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;
|
|
1254
|
+
if (options.oneofs)
|
|
1255
|
+
object.payload = "data";
|
|
1256
|
+
}
|
|
1257
|
+
if (message.eos != null && message.hasOwnProperty("eos")) {
|
|
1258
|
+
object.eos = $root.rstream.webtty.protobuf.EndOfStream.toObject(message.eos, options);
|
|
1259
|
+
if (options.oneofs)
|
|
1260
|
+
object.payload = "eos";
|
|
1261
|
+
}
|
|
1262
|
+
return object;
|
|
1263
|
+
};
|
|
1264
|
+
Data.prototype.toJSON = function toJSON() {
|
|
1265
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1266
|
+
};
|
|
1267
|
+
Data.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1268
|
+
if (typeUrlPrefix === void 0) {
|
|
1269
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1270
|
+
}
|
|
1271
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Data";
|
|
1272
|
+
};
|
|
1273
|
+
Data.Type = function() {
|
|
1274
|
+
const valuesById = {}, values = Object.create(valuesById);
|
|
1275
|
+
values[valuesById[0] = "TYPE_STDIN"] = 0;
|
|
1276
|
+
values[valuesById[1] = "TYPE_STDOUT"] = 1;
|
|
1277
|
+
values[valuesById[2] = "TYPE_STDERR"] = 2;
|
|
1278
|
+
return values;
|
|
1279
|
+
}();
|
|
1280
|
+
return Data;
|
|
1281
|
+
}();
|
|
1282
|
+
protobuf.TerminalSize = function() {
|
|
1283
|
+
function TerminalSize(properties) {
|
|
1284
|
+
if (properties) {
|
|
1285
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1286
|
+
if (properties[keys[i]] != null)
|
|
1287
|
+
this[keys[i]] = properties[keys[i]];
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
TerminalSize.prototype.row = 0;
|
|
1291
|
+
TerminalSize.prototype.col = 0;
|
|
1292
|
+
TerminalSize.prototype.xpixel = 0;
|
|
1293
|
+
TerminalSize.prototype.ypixel = 0;
|
|
1294
|
+
TerminalSize.create = function create(properties) {
|
|
1295
|
+
return new TerminalSize(properties);
|
|
1296
|
+
};
|
|
1297
|
+
TerminalSize.encode = function encode(message, writer) {
|
|
1298
|
+
if (!writer)
|
|
1299
|
+
writer = $Writer.create();
|
|
1300
|
+
if (message.row != null && Object.hasOwnProperty.call(message, "row"))
|
|
1301
|
+
writer.uint32(
|
|
1302
|
+
/* id 1, wireType 0 =*/
|
|
1303
|
+
8
|
|
1304
|
+
).uint32(message.row);
|
|
1305
|
+
if (message.col != null && Object.hasOwnProperty.call(message, "col"))
|
|
1306
|
+
writer.uint32(
|
|
1307
|
+
/* id 2, wireType 0 =*/
|
|
1308
|
+
16
|
|
1309
|
+
).uint32(message.col);
|
|
1310
|
+
if (message.xpixel != null && Object.hasOwnProperty.call(message, "xpixel"))
|
|
1311
|
+
writer.uint32(
|
|
1312
|
+
/* id 3, wireType 0 =*/
|
|
1313
|
+
24
|
|
1314
|
+
).uint32(message.xpixel);
|
|
1315
|
+
if (message.ypixel != null && Object.hasOwnProperty.call(message, "ypixel"))
|
|
1316
|
+
writer.uint32(
|
|
1317
|
+
/* id 4, wireType 0 =*/
|
|
1318
|
+
32
|
|
1319
|
+
).uint32(message.ypixel);
|
|
1320
|
+
return writer;
|
|
1321
|
+
};
|
|
1322
|
+
TerminalSize.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1323
|
+
return this.encode(message, writer).ldelim();
|
|
1324
|
+
};
|
|
1325
|
+
TerminalSize.decode = function decode(reader, length, error) {
|
|
1326
|
+
if (!(reader instanceof $Reader))
|
|
1327
|
+
reader = $Reader.create(reader);
|
|
1328
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.TerminalSize();
|
|
1329
|
+
while (reader.pos < end) {
|
|
1330
|
+
let tag = reader.uint32();
|
|
1331
|
+
if (tag === error)
|
|
1332
|
+
break;
|
|
1333
|
+
switch (tag >>> 3) {
|
|
1334
|
+
case 1: {
|
|
1335
|
+
message.row = reader.uint32();
|
|
1336
|
+
break;
|
|
1337
|
+
}
|
|
1338
|
+
case 2: {
|
|
1339
|
+
message.col = reader.uint32();
|
|
1340
|
+
break;
|
|
1341
|
+
}
|
|
1342
|
+
case 3: {
|
|
1343
|
+
message.xpixel = reader.uint32();
|
|
1344
|
+
break;
|
|
1345
|
+
}
|
|
1346
|
+
case 4: {
|
|
1347
|
+
message.ypixel = reader.uint32();
|
|
1348
|
+
break;
|
|
1349
|
+
}
|
|
1350
|
+
default:
|
|
1351
|
+
reader.skipType(tag & 7);
|
|
1352
|
+
break;
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
return message;
|
|
1356
|
+
};
|
|
1357
|
+
TerminalSize.decodeDelimited = function decodeDelimited(reader) {
|
|
1358
|
+
if (!(reader instanceof $Reader))
|
|
1359
|
+
reader = new $Reader(reader);
|
|
1360
|
+
return this.decode(reader, reader.uint32());
|
|
1361
|
+
};
|
|
1362
|
+
TerminalSize.verify = function verify(message) {
|
|
1363
|
+
if (typeof message !== "object" || message === null)
|
|
1364
|
+
return "object expected";
|
|
1365
|
+
if (message.row != null && message.hasOwnProperty("row")) {
|
|
1366
|
+
if (!$util.isInteger(message.row))
|
|
1367
|
+
return "row: integer expected";
|
|
1368
|
+
}
|
|
1369
|
+
if (message.col != null && message.hasOwnProperty("col")) {
|
|
1370
|
+
if (!$util.isInteger(message.col))
|
|
1371
|
+
return "col: integer expected";
|
|
1372
|
+
}
|
|
1373
|
+
if (message.xpixel != null && message.hasOwnProperty("xpixel")) {
|
|
1374
|
+
if (!$util.isInteger(message.xpixel))
|
|
1375
|
+
return "xpixel: integer expected";
|
|
1376
|
+
}
|
|
1377
|
+
if (message.ypixel != null && message.hasOwnProperty("ypixel")) {
|
|
1378
|
+
if (!$util.isInteger(message.ypixel))
|
|
1379
|
+
return "ypixel: integer expected";
|
|
1380
|
+
}
|
|
1381
|
+
return null;
|
|
1382
|
+
};
|
|
1383
|
+
TerminalSize.fromObject = function fromObject(object) {
|
|
1384
|
+
if (object instanceof $root.rstream.webtty.protobuf.TerminalSize)
|
|
1385
|
+
return object;
|
|
1386
|
+
let message = new $root.rstream.webtty.protobuf.TerminalSize();
|
|
1387
|
+
if (object.row != null)
|
|
1388
|
+
message.row = object.row >>> 0;
|
|
1389
|
+
if (object.col != null)
|
|
1390
|
+
message.col = object.col >>> 0;
|
|
1391
|
+
if (object.xpixel != null)
|
|
1392
|
+
message.xpixel = object.xpixel >>> 0;
|
|
1393
|
+
if (object.ypixel != null)
|
|
1394
|
+
message.ypixel = object.ypixel >>> 0;
|
|
1395
|
+
return message;
|
|
1396
|
+
};
|
|
1397
|
+
TerminalSize.toObject = function toObject(message, options) {
|
|
1398
|
+
if (!options)
|
|
1399
|
+
options = {};
|
|
1400
|
+
let object = {};
|
|
1401
|
+
if (options.defaults) {
|
|
1402
|
+
object.row = 0;
|
|
1403
|
+
object.col = 0;
|
|
1404
|
+
object.xpixel = 0;
|
|
1405
|
+
object.ypixel = 0;
|
|
1406
|
+
}
|
|
1407
|
+
if (message.row != null && message.hasOwnProperty("row"))
|
|
1408
|
+
object.row = message.row;
|
|
1409
|
+
if (message.col != null && message.hasOwnProperty("col"))
|
|
1410
|
+
object.col = message.col;
|
|
1411
|
+
if (message.xpixel != null && message.hasOwnProperty("xpixel"))
|
|
1412
|
+
object.xpixel = message.xpixel;
|
|
1413
|
+
if (message.ypixel != null && message.hasOwnProperty("ypixel"))
|
|
1414
|
+
object.ypixel = message.ypixel;
|
|
1415
|
+
return object;
|
|
1416
|
+
};
|
|
1417
|
+
TerminalSize.prototype.toJSON = function toJSON() {
|
|
1418
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1419
|
+
};
|
|
1420
|
+
TerminalSize.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1421
|
+
if (typeUrlPrefix === void 0) {
|
|
1422
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1423
|
+
}
|
|
1424
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.TerminalSize";
|
|
1425
|
+
};
|
|
1426
|
+
return TerminalSize;
|
|
1427
|
+
}();
|
|
1428
|
+
protobuf.Parameter = function() {
|
|
1429
|
+
function Parameter(properties) {
|
|
1430
|
+
if (properties) {
|
|
1431
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1432
|
+
if (properties[keys[i]] != null)
|
|
1433
|
+
this[keys[i]] = properties[keys[i]];
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
Parameter.prototype.terminalSize = null;
|
|
1437
|
+
let $oneOfFields;
|
|
1438
|
+
Object.defineProperty(Parameter.prototype, "parameter", {
|
|
1439
|
+
get: $util.oneOfGetter($oneOfFields = ["terminalSize"]),
|
|
1440
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1441
|
+
});
|
|
1442
|
+
Parameter.create = function create(properties) {
|
|
1443
|
+
return new Parameter(properties);
|
|
1444
|
+
};
|
|
1445
|
+
Parameter.encode = function encode(message, writer) {
|
|
1446
|
+
if (!writer)
|
|
1447
|
+
writer = $Writer.create();
|
|
1448
|
+
if (message.terminalSize != null && Object.hasOwnProperty.call(message, "terminalSize"))
|
|
1449
|
+
$root.rstream.webtty.protobuf.TerminalSize.encode(message.terminalSize, writer.uint32(
|
|
1450
|
+
/* id 1, wireType 2 =*/
|
|
1451
|
+
10
|
|
1452
|
+
).fork()).ldelim();
|
|
1453
|
+
return writer;
|
|
1454
|
+
};
|
|
1455
|
+
Parameter.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1456
|
+
return this.encode(message, writer).ldelim();
|
|
1457
|
+
};
|
|
1458
|
+
Parameter.decode = function decode(reader, length, error) {
|
|
1459
|
+
if (!(reader instanceof $Reader))
|
|
1460
|
+
reader = $Reader.create(reader);
|
|
1461
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Parameter();
|
|
1462
|
+
while (reader.pos < end) {
|
|
1463
|
+
let tag = reader.uint32();
|
|
1464
|
+
if (tag === error)
|
|
1465
|
+
break;
|
|
1466
|
+
switch (tag >>> 3) {
|
|
1467
|
+
case 1: {
|
|
1468
|
+
message.terminalSize = $root.rstream.webtty.protobuf.TerminalSize.decode(reader, reader.uint32());
|
|
1469
|
+
break;
|
|
1470
|
+
}
|
|
1471
|
+
default:
|
|
1472
|
+
reader.skipType(tag & 7);
|
|
1473
|
+
break;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
return message;
|
|
1477
|
+
};
|
|
1478
|
+
Parameter.decodeDelimited = function decodeDelimited(reader) {
|
|
1479
|
+
if (!(reader instanceof $Reader))
|
|
1480
|
+
reader = new $Reader(reader);
|
|
1481
|
+
return this.decode(reader, reader.uint32());
|
|
1482
|
+
};
|
|
1483
|
+
Parameter.verify = function verify(message) {
|
|
1484
|
+
if (typeof message !== "object" || message === null)
|
|
1485
|
+
return "object expected";
|
|
1486
|
+
let properties = {};
|
|
1487
|
+
if (message.terminalSize != null && message.hasOwnProperty("terminalSize")) {
|
|
1488
|
+
properties.parameter = 1;
|
|
1489
|
+
{
|
|
1490
|
+
let error = $root.rstream.webtty.protobuf.TerminalSize.verify(message.terminalSize);
|
|
1491
|
+
if (error)
|
|
1492
|
+
return "terminalSize." + error;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
return null;
|
|
1496
|
+
};
|
|
1497
|
+
Parameter.fromObject = function fromObject(object) {
|
|
1498
|
+
if (object instanceof $root.rstream.webtty.protobuf.Parameter)
|
|
1499
|
+
return object;
|
|
1500
|
+
let message = new $root.rstream.webtty.protobuf.Parameter();
|
|
1501
|
+
if (object.terminalSize != null) {
|
|
1502
|
+
if (typeof object.terminalSize !== "object")
|
|
1503
|
+
throw TypeError(".rstream.webtty.protobuf.Parameter.terminalSize: object expected");
|
|
1504
|
+
message.terminalSize = $root.rstream.webtty.protobuf.TerminalSize.fromObject(object.terminalSize);
|
|
1505
|
+
}
|
|
1506
|
+
return message;
|
|
1507
|
+
};
|
|
1508
|
+
Parameter.toObject = function toObject(message, options) {
|
|
1509
|
+
if (!options)
|
|
1510
|
+
options = {};
|
|
1511
|
+
let object = {};
|
|
1512
|
+
if (message.terminalSize != null && message.hasOwnProperty("terminalSize")) {
|
|
1513
|
+
object.terminalSize = $root.rstream.webtty.protobuf.TerminalSize.toObject(message.terminalSize, options);
|
|
1514
|
+
if (options.oneofs)
|
|
1515
|
+
object.parameter = "terminalSize";
|
|
1516
|
+
}
|
|
1517
|
+
return object;
|
|
1518
|
+
};
|
|
1519
|
+
Parameter.prototype.toJSON = function toJSON() {
|
|
1520
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1521
|
+
};
|
|
1522
|
+
Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1523
|
+
if (typeUrlPrefix === void 0) {
|
|
1524
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1525
|
+
}
|
|
1526
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Parameter";
|
|
1527
|
+
};
|
|
1528
|
+
return Parameter;
|
|
1529
|
+
}();
|
|
1530
|
+
protobuf.Heartbeat = function() {
|
|
1531
|
+
function Heartbeat(properties) {
|
|
1532
|
+
if (properties) {
|
|
1533
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1534
|
+
if (properties[keys[i]] != null)
|
|
1535
|
+
this[keys[i]] = properties[keys[i]];
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
Heartbeat.create = function create(properties) {
|
|
1539
|
+
return new Heartbeat(properties);
|
|
1540
|
+
};
|
|
1541
|
+
Heartbeat.encode = function encode(message, writer) {
|
|
1542
|
+
if (!writer)
|
|
1543
|
+
writer = $Writer.create();
|
|
1544
|
+
return writer;
|
|
1545
|
+
};
|
|
1546
|
+
Heartbeat.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1547
|
+
return this.encode(message, writer).ldelim();
|
|
1548
|
+
};
|
|
1549
|
+
Heartbeat.decode = function decode(reader, length, error) {
|
|
1550
|
+
if (!(reader instanceof $Reader))
|
|
1551
|
+
reader = $Reader.create(reader);
|
|
1552
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Heartbeat();
|
|
1553
|
+
while (reader.pos < end) {
|
|
1554
|
+
let tag = reader.uint32();
|
|
1555
|
+
if (tag === error)
|
|
1556
|
+
break;
|
|
1557
|
+
switch (tag >>> 3) {
|
|
1558
|
+
default:
|
|
1559
|
+
reader.skipType(tag & 7);
|
|
1560
|
+
break;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
return message;
|
|
1564
|
+
};
|
|
1565
|
+
Heartbeat.decodeDelimited = function decodeDelimited(reader) {
|
|
1566
|
+
if (!(reader instanceof $Reader))
|
|
1567
|
+
reader = new $Reader(reader);
|
|
1568
|
+
return this.decode(reader, reader.uint32());
|
|
1569
|
+
};
|
|
1570
|
+
Heartbeat.verify = function verify(message) {
|
|
1571
|
+
if (typeof message !== "object" || message === null)
|
|
1572
|
+
return "object expected";
|
|
1573
|
+
return null;
|
|
1574
|
+
};
|
|
1575
|
+
Heartbeat.fromObject = function fromObject(object) {
|
|
1576
|
+
if (object instanceof $root.rstream.webtty.protobuf.Heartbeat)
|
|
1577
|
+
return object;
|
|
1578
|
+
return new $root.rstream.webtty.protobuf.Heartbeat();
|
|
1579
|
+
};
|
|
1580
|
+
Heartbeat.toObject = function toObject() {
|
|
1581
|
+
return {};
|
|
1582
|
+
};
|
|
1583
|
+
Heartbeat.prototype.toJSON = function toJSON() {
|
|
1584
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1585
|
+
};
|
|
1586
|
+
Heartbeat.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1587
|
+
if (typeUrlPrefix === void 0) {
|
|
1588
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1589
|
+
}
|
|
1590
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Heartbeat";
|
|
1591
|
+
};
|
|
1592
|
+
return Heartbeat;
|
|
1593
|
+
}();
|
|
1594
|
+
protobuf.Message = function() {
|
|
1595
|
+
function Message(properties) {
|
|
1596
|
+
if (properties) {
|
|
1597
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1598
|
+
if (properties[keys[i]] != null)
|
|
1599
|
+
this[keys[i]] = properties[keys[i]];
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
Message.prototype.open = null;
|
|
1603
|
+
Message.prototype.ack = null;
|
|
1604
|
+
Message.prototype.error = null;
|
|
1605
|
+
Message.prototype.close = null;
|
|
1606
|
+
Message.prototype.data = null;
|
|
1607
|
+
Message.prototype.parameter = null;
|
|
1608
|
+
Message.prototype.heartbeat = null;
|
|
1609
|
+
let $oneOfFields;
|
|
1610
|
+
Object.defineProperty(Message.prototype, "payload", {
|
|
1611
|
+
get: $util.oneOfGetter($oneOfFields = ["open", "ack", "error", "close", "data", "parameter", "heartbeat"]),
|
|
1612
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
1613
|
+
});
|
|
1614
|
+
Message.create = function create(properties) {
|
|
1615
|
+
return new Message(properties);
|
|
1616
|
+
};
|
|
1617
|
+
Message.encode = function encode(message, writer) {
|
|
1618
|
+
if (!writer)
|
|
1619
|
+
writer = $Writer.create();
|
|
1620
|
+
if (message.open != null && Object.hasOwnProperty.call(message, "open"))
|
|
1621
|
+
$root.rstream.webtty.protobuf.Open.encode(message.open, writer.uint32(
|
|
1622
|
+
/* id 1, wireType 2 =*/
|
|
1623
|
+
10
|
|
1624
|
+
).fork()).ldelim();
|
|
1625
|
+
if (message.ack != null && Object.hasOwnProperty.call(message, "ack"))
|
|
1626
|
+
$root.rstream.webtty.protobuf.Ack.encode(message.ack, writer.uint32(
|
|
1627
|
+
/* id 2, wireType 2 =*/
|
|
1628
|
+
18
|
|
1629
|
+
).fork()).ldelim();
|
|
1630
|
+
if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
|
1631
|
+
$root.rstream.webtty.protobuf.Error.encode(message.error, writer.uint32(
|
|
1632
|
+
/* id 3, wireType 2 =*/
|
|
1633
|
+
26
|
|
1634
|
+
).fork()).ldelim();
|
|
1635
|
+
if (message.close != null && Object.hasOwnProperty.call(message, "close"))
|
|
1636
|
+
$root.rstream.webtty.protobuf.Close.encode(message.close, writer.uint32(
|
|
1637
|
+
/* id 4, wireType 2 =*/
|
|
1638
|
+
34
|
|
1639
|
+
).fork()).ldelim();
|
|
1640
|
+
if (message.data != null && Object.hasOwnProperty.call(message, "data"))
|
|
1641
|
+
$root.rstream.webtty.protobuf.Data.encode(message.data, writer.uint32(
|
|
1642
|
+
/* id 5, wireType 2 =*/
|
|
1643
|
+
42
|
|
1644
|
+
).fork()).ldelim();
|
|
1645
|
+
if (message.parameter != null && Object.hasOwnProperty.call(message, "parameter"))
|
|
1646
|
+
$root.rstream.webtty.protobuf.Parameter.encode(message.parameter, writer.uint32(
|
|
1647
|
+
/* id 6, wireType 2 =*/
|
|
1648
|
+
50
|
|
1649
|
+
).fork()).ldelim();
|
|
1650
|
+
if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat"))
|
|
1651
|
+
$root.rstream.webtty.protobuf.Heartbeat.encode(message.heartbeat, writer.uint32(
|
|
1652
|
+
/* id 7, wireType 2 =*/
|
|
1653
|
+
58
|
|
1654
|
+
).fork()).ldelim();
|
|
1655
|
+
return writer;
|
|
1656
|
+
};
|
|
1657
|
+
Message.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1658
|
+
return this.encode(message, writer).ldelim();
|
|
1659
|
+
};
|
|
1660
|
+
Message.decode = function decode(reader, length, error) {
|
|
1661
|
+
if (!(reader instanceof $Reader))
|
|
1662
|
+
reader = $Reader.create(reader);
|
|
1663
|
+
let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.rstream.webtty.protobuf.Message();
|
|
1664
|
+
while (reader.pos < end) {
|
|
1665
|
+
let tag = reader.uint32();
|
|
1666
|
+
if (tag === error)
|
|
1667
|
+
break;
|
|
1668
|
+
switch (tag >>> 3) {
|
|
1669
|
+
case 1: {
|
|
1670
|
+
message.open = $root.rstream.webtty.protobuf.Open.decode(reader, reader.uint32());
|
|
1671
|
+
break;
|
|
1672
|
+
}
|
|
1673
|
+
case 2: {
|
|
1674
|
+
message.ack = $root.rstream.webtty.protobuf.Ack.decode(reader, reader.uint32());
|
|
1675
|
+
break;
|
|
1676
|
+
}
|
|
1677
|
+
case 3: {
|
|
1678
|
+
message.error = $root.rstream.webtty.protobuf.Error.decode(reader, reader.uint32());
|
|
1679
|
+
break;
|
|
1680
|
+
}
|
|
1681
|
+
case 4: {
|
|
1682
|
+
message.close = $root.rstream.webtty.protobuf.Close.decode(reader, reader.uint32());
|
|
1683
|
+
break;
|
|
1684
|
+
}
|
|
1685
|
+
case 5: {
|
|
1686
|
+
message.data = $root.rstream.webtty.protobuf.Data.decode(reader, reader.uint32());
|
|
1687
|
+
break;
|
|
1688
|
+
}
|
|
1689
|
+
case 6: {
|
|
1690
|
+
message.parameter = $root.rstream.webtty.protobuf.Parameter.decode(reader, reader.uint32());
|
|
1691
|
+
break;
|
|
1692
|
+
}
|
|
1693
|
+
case 7: {
|
|
1694
|
+
message.heartbeat = $root.rstream.webtty.protobuf.Heartbeat.decode(reader, reader.uint32());
|
|
1695
|
+
break;
|
|
1696
|
+
}
|
|
1697
|
+
default:
|
|
1698
|
+
reader.skipType(tag & 7);
|
|
1699
|
+
break;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
return message;
|
|
1703
|
+
};
|
|
1704
|
+
Message.decodeDelimited = function decodeDelimited(reader) {
|
|
1705
|
+
if (!(reader instanceof $Reader))
|
|
1706
|
+
reader = new $Reader(reader);
|
|
1707
|
+
return this.decode(reader, reader.uint32());
|
|
1708
|
+
};
|
|
1709
|
+
Message.verify = function verify(message) {
|
|
1710
|
+
if (typeof message !== "object" || message === null)
|
|
1711
|
+
return "object expected";
|
|
1712
|
+
let properties = {};
|
|
1713
|
+
if (message.open != null && message.hasOwnProperty("open")) {
|
|
1714
|
+
properties.payload = 1;
|
|
1715
|
+
{
|
|
1716
|
+
let error = $root.rstream.webtty.protobuf.Open.verify(message.open);
|
|
1717
|
+
if (error)
|
|
1718
|
+
return "open." + error;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
if (message.ack != null && message.hasOwnProperty("ack")) {
|
|
1722
|
+
if (properties.payload === 1)
|
|
1723
|
+
return "payload: multiple values";
|
|
1724
|
+
properties.payload = 1;
|
|
1725
|
+
{
|
|
1726
|
+
let error = $root.rstream.webtty.protobuf.Ack.verify(message.ack);
|
|
1727
|
+
if (error)
|
|
1728
|
+
return "ack." + error;
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
if (message.error != null && message.hasOwnProperty("error")) {
|
|
1732
|
+
if (properties.payload === 1)
|
|
1733
|
+
return "payload: multiple values";
|
|
1734
|
+
properties.payload = 1;
|
|
1735
|
+
{
|
|
1736
|
+
let error = $root.rstream.webtty.protobuf.Error.verify(message.error);
|
|
1737
|
+
if (error)
|
|
1738
|
+
return "error." + error;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
if (message.close != null && message.hasOwnProperty("close")) {
|
|
1742
|
+
if (properties.payload === 1)
|
|
1743
|
+
return "payload: multiple values";
|
|
1744
|
+
properties.payload = 1;
|
|
1745
|
+
{
|
|
1746
|
+
let error = $root.rstream.webtty.protobuf.Close.verify(message.close);
|
|
1747
|
+
if (error)
|
|
1748
|
+
return "close." + error;
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
if (message.data != null && message.hasOwnProperty("data")) {
|
|
1752
|
+
if (properties.payload === 1)
|
|
1753
|
+
return "payload: multiple values";
|
|
1754
|
+
properties.payload = 1;
|
|
1755
|
+
{
|
|
1756
|
+
let error = $root.rstream.webtty.protobuf.Data.verify(message.data);
|
|
1757
|
+
if (error)
|
|
1758
|
+
return "data." + error;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
if (message.parameter != null && message.hasOwnProperty("parameter")) {
|
|
1762
|
+
if (properties.payload === 1)
|
|
1763
|
+
return "payload: multiple values";
|
|
1764
|
+
properties.payload = 1;
|
|
1765
|
+
{
|
|
1766
|
+
let error = $root.rstream.webtty.protobuf.Parameter.verify(message.parameter);
|
|
1767
|
+
if (error)
|
|
1768
|
+
return "parameter." + error;
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) {
|
|
1772
|
+
if (properties.payload === 1)
|
|
1773
|
+
return "payload: multiple values";
|
|
1774
|
+
properties.payload = 1;
|
|
1775
|
+
{
|
|
1776
|
+
let error = $root.rstream.webtty.protobuf.Heartbeat.verify(message.heartbeat);
|
|
1777
|
+
if (error)
|
|
1778
|
+
return "heartbeat." + error;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
return null;
|
|
1782
|
+
};
|
|
1783
|
+
Message.fromObject = function fromObject(object) {
|
|
1784
|
+
if (object instanceof $root.rstream.webtty.protobuf.Message)
|
|
1785
|
+
return object;
|
|
1786
|
+
let message = new $root.rstream.webtty.protobuf.Message();
|
|
1787
|
+
if (object.open != null) {
|
|
1788
|
+
if (typeof object.open !== "object")
|
|
1789
|
+
throw TypeError(".rstream.webtty.protobuf.Message.open: object expected");
|
|
1790
|
+
message.open = $root.rstream.webtty.protobuf.Open.fromObject(object.open);
|
|
1791
|
+
}
|
|
1792
|
+
if (object.ack != null) {
|
|
1793
|
+
if (typeof object.ack !== "object")
|
|
1794
|
+
throw TypeError(".rstream.webtty.protobuf.Message.ack: object expected");
|
|
1795
|
+
message.ack = $root.rstream.webtty.protobuf.Ack.fromObject(object.ack);
|
|
1796
|
+
}
|
|
1797
|
+
if (object.error != null) {
|
|
1798
|
+
if (typeof object.error !== "object")
|
|
1799
|
+
throw TypeError(".rstream.webtty.protobuf.Message.error: object expected");
|
|
1800
|
+
message.error = $root.rstream.webtty.protobuf.Error.fromObject(object.error);
|
|
1801
|
+
}
|
|
1802
|
+
if (object.close != null) {
|
|
1803
|
+
if (typeof object.close !== "object")
|
|
1804
|
+
throw TypeError(".rstream.webtty.protobuf.Message.close: object expected");
|
|
1805
|
+
message.close = $root.rstream.webtty.protobuf.Close.fromObject(object.close);
|
|
1806
|
+
}
|
|
1807
|
+
if (object.data != null) {
|
|
1808
|
+
if (typeof object.data !== "object")
|
|
1809
|
+
throw TypeError(".rstream.webtty.protobuf.Message.data: object expected");
|
|
1810
|
+
message.data = $root.rstream.webtty.protobuf.Data.fromObject(object.data);
|
|
1811
|
+
}
|
|
1812
|
+
if (object.parameter != null) {
|
|
1813
|
+
if (typeof object.parameter !== "object")
|
|
1814
|
+
throw TypeError(".rstream.webtty.protobuf.Message.parameter: object expected");
|
|
1815
|
+
message.parameter = $root.rstream.webtty.protobuf.Parameter.fromObject(object.parameter);
|
|
1816
|
+
}
|
|
1817
|
+
if (object.heartbeat != null) {
|
|
1818
|
+
if (typeof object.heartbeat !== "object")
|
|
1819
|
+
throw TypeError(".rstream.webtty.protobuf.Message.heartbeat: object expected");
|
|
1820
|
+
message.heartbeat = $root.rstream.webtty.protobuf.Heartbeat.fromObject(object.heartbeat);
|
|
1821
|
+
}
|
|
1822
|
+
return message;
|
|
1823
|
+
};
|
|
1824
|
+
Message.toObject = function toObject(message, options) {
|
|
1825
|
+
if (!options)
|
|
1826
|
+
options = {};
|
|
1827
|
+
let object = {};
|
|
1828
|
+
if (message.open != null && message.hasOwnProperty("open")) {
|
|
1829
|
+
object.open = $root.rstream.webtty.protobuf.Open.toObject(message.open, options);
|
|
1830
|
+
if (options.oneofs)
|
|
1831
|
+
object.payload = "open";
|
|
1832
|
+
}
|
|
1833
|
+
if (message.ack != null && message.hasOwnProperty("ack")) {
|
|
1834
|
+
object.ack = $root.rstream.webtty.protobuf.Ack.toObject(message.ack, options);
|
|
1835
|
+
if (options.oneofs)
|
|
1836
|
+
object.payload = "ack";
|
|
1837
|
+
}
|
|
1838
|
+
if (message.error != null && message.hasOwnProperty("error")) {
|
|
1839
|
+
object.error = $root.rstream.webtty.protobuf.Error.toObject(message.error, options);
|
|
1840
|
+
if (options.oneofs)
|
|
1841
|
+
object.payload = "error";
|
|
1842
|
+
}
|
|
1843
|
+
if (message.close != null && message.hasOwnProperty("close")) {
|
|
1844
|
+
object.close = $root.rstream.webtty.protobuf.Close.toObject(message.close, options);
|
|
1845
|
+
if (options.oneofs)
|
|
1846
|
+
object.payload = "close";
|
|
1847
|
+
}
|
|
1848
|
+
if (message.data != null && message.hasOwnProperty("data")) {
|
|
1849
|
+
object.data = $root.rstream.webtty.protobuf.Data.toObject(message.data, options);
|
|
1850
|
+
if (options.oneofs)
|
|
1851
|
+
object.payload = "data";
|
|
1852
|
+
}
|
|
1853
|
+
if (message.parameter != null && message.hasOwnProperty("parameter")) {
|
|
1854
|
+
object.parameter = $root.rstream.webtty.protobuf.Parameter.toObject(message.parameter, options);
|
|
1855
|
+
if (options.oneofs)
|
|
1856
|
+
object.payload = "parameter";
|
|
1857
|
+
}
|
|
1858
|
+
if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) {
|
|
1859
|
+
object.heartbeat = $root.rstream.webtty.protobuf.Heartbeat.toObject(message.heartbeat, options);
|
|
1860
|
+
if (options.oneofs)
|
|
1861
|
+
object.payload = "heartbeat";
|
|
1862
|
+
}
|
|
1863
|
+
return object;
|
|
1864
|
+
};
|
|
1865
|
+
Message.prototype.toJSON = function toJSON() {
|
|
1866
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1867
|
+
};
|
|
1868
|
+
Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1869
|
+
if (typeUrlPrefix === void 0) {
|
|
1870
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1871
|
+
}
|
|
1872
|
+
return typeUrlPrefix + "/rstream.webtty.protobuf.Message";
|
|
1873
|
+
};
|
|
1874
|
+
return Message;
|
|
1875
|
+
}();
|
|
1876
|
+
return protobuf;
|
|
1877
|
+
}();
|
|
1878
|
+
return webtty;
|
|
1879
|
+
}();
|
|
1880
|
+
return rstream2;
|
|
1881
|
+
})();
|
|
1882
|
+
|
|
1883
|
+
// src/webtty.ts
|
|
1884
|
+
var WebTTY = class {
|
|
1885
|
+
ws = null;
|
|
1886
|
+
connectionState = "preparing";
|
|
1887
|
+
heartbeatTimer = null;
|
|
1888
|
+
clientConfig;
|
|
1889
|
+
execConfig;
|
|
1890
|
+
events;
|
|
1891
|
+
/**
|
|
1892
|
+
* Creates a new WebTTY instance.
|
|
1893
|
+
*
|
|
1894
|
+
* @param clientConfig - WebSocket connection configuration.
|
|
1895
|
+
* @param execConfig - Execution parameters.
|
|
1896
|
+
* @param events - Event callbacks for the session.
|
|
1897
|
+
*/
|
|
1898
|
+
constructor(clientConfig, execConfig, events) {
|
|
1899
|
+
this.clientConfig = {
|
|
1900
|
+
sendHeartbeat: true,
|
|
1901
|
+
heartbeatIntervalMs: 5e3,
|
|
1902
|
+
...clientConfig
|
|
1903
|
+
};
|
|
1904
|
+
this.execConfig = {
|
|
1905
|
+
allocateTty: true,
|
|
1906
|
+
interactive: true,
|
|
1907
|
+
envVars: [],
|
|
1908
|
+
...execConfig
|
|
1909
|
+
};
|
|
1910
|
+
this.events = events || {};
|
|
1911
|
+
}
|
|
1912
|
+
/**
|
|
1913
|
+
* Connects to the WebTTY server and starts the session.
|
|
1914
|
+
*/
|
|
1915
|
+
connect() {
|
|
1916
|
+
if (this.connectionState !== "preparing") {
|
|
1917
|
+
throw new Error("Invalid state for connect().");
|
|
1918
|
+
}
|
|
1919
|
+
this.connectionState = "connecting";
|
|
1920
|
+
const wsUrl = typeof this.clientConfig.url === "string" ? this.clientConfig.url : this.clientConfig.url.toString();
|
|
1921
|
+
this.ws = new WebSocket(wsUrl);
|
|
1922
|
+
this.ws.binaryType = "arraybuffer";
|
|
1923
|
+
this.ws.addEventListener("open", this.handleOpen);
|
|
1924
|
+
this.ws.addEventListener("message", this.handleMessage);
|
|
1925
|
+
this.ws.addEventListener("error", this.handleError);
|
|
1926
|
+
this.ws.addEventListener("close", this.handleClose);
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* Sends data to the remote server's STDIN.
|
|
1930
|
+
*
|
|
1931
|
+
* @param data - The data to send.
|
|
1932
|
+
*/
|
|
1933
|
+
writeStdin(data) {
|
|
1934
|
+
if (this.connectionState !== "connected" || !this.ws) {
|
|
1935
|
+
throw new Error("Invalid state for writeStdin().");
|
|
1936
|
+
}
|
|
1937
|
+
if (this.execConfig.interactive === false) {
|
|
1938
|
+
throw new Error("STDIN is unavailable in non-interactive mode.");
|
|
1939
|
+
}
|
|
1940
|
+
this.send(
|
|
1941
|
+
new rstream.webtty.protobuf.Message({
|
|
1942
|
+
data: new rstream.webtty.protobuf.Data({
|
|
1943
|
+
type: rstream.webtty.protobuf.Data.Type.TYPE_STDIN,
|
|
1944
|
+
data
|
|
1945
|
+
})
|
|
1946
|
+
})
|
|
1947
|
+
);
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* Closes the remote STDIN stream (EOF).
|
|
1951
|
+
*/
|
|
1952
|
+
closeStdin() {
|
|
1953
|
+
if (this.connectionState !== "connected" || !this.ws) {
|
|
1954
|
+
throw new Error("Invalid state for closeStdin().");
|
|
1955
|
+
}
|
|
1956
|
+
if (this.execConfig.interactive === false) {
|
|
1957
|
+
throw new Error("STDIN is unavailable in non-interactive mode.");
|
|
1958
|
+
}
|
|
1959
|
+
this.send(
|
|
1960
|
+
new rstream.webtty.protobuf.Message({
|
|
1961
|
+
data: new rstream.webtty.protobuf.Data({
|
|
1962
|
+
type: rstream.webtty.protobuf.Data.Type.TYPE_STDIN,
|
|
1963
|
+
eos: new rstream.webtty.protobuf.EndOfStream()
|
|
1964
|
+
})
|
|
1965
|
+
})
|
|
1966
|
+
);
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Sends a "resize" request to the remote TTY with the provided rows and columns (and optional pixel sizes).
|
|
1970
|
+
*/
|
|
1971
|
+
resize(rows, cols, xpixel = 0, ypixel = 0) {
|
|
1972
|
+
if (this.connectionState !== "connected" || !this.ws) {
|
|
1973
|
+
throw new Error("Invalid state for resize().");
|
|
1974
|
+
}
|
|
1975
|
+
if (this.execConfig.allocateTty === false) {
|
|
1976
|
+
throw new Error("Resize is unavailable in non-TTY mode.");
|
|
1977
|
+
}
|
|
1978
|
+
const parameter = new rstream.webtty.protobuf.TerminalSize({
|
|
1979
|
+
row: rows,
|
|
1980
|
+
col: cols,
|
|
1981
|
+
xpixel,
|
|
1982
|
+
ypixel
|
|
1983
|
+
});
|
|
1984
|
+
const payload = new rstream.webtty.protobuf.Parameter({
|
|
1985
|
+
terminalSize: parameter
|
|
1986
|
+
});
|
|
1987
|
+
const msg = new rstream.webtty.protobuf.Message({
|
|
1988
|
+
parameter: payload
|
|
1989
|
+
});
|
|
1990
|
+
this.send(msg);
|
|
1991
|
+
}
|
|
1992
|
+
/**
|
|
1993
|
+
* Terminates the WebTTY session immediately.
|
|
1994
|
+
*/
|
|
1995
|
+
disconnect() {
|
|
1996
|
+
this.close("Session terminated by client.");
|
|
1997
|
+
}
|
|
1998
|
+
// ---------------------------------------------------------------------------------------------
|
|
1999
|
+
// Internal Handlers
|
|
2000
|
+
// ---------------------------------------------------------------------------------------------
|
|
2001
|
+
handleOpen = () => {
|
|
2002
|
+
if (this.connectionState !== "connecting") {
|
|
2003
|
+
return;
|
|
2004
|
+
}
|
|
2005
|
+
const opts = new rstream.webtty.protobuf.Options({
|
|
2006
|
+
interactive: this.execConfig.interactive,
|
|
2007
|
+
allocateTty: this.execConfig.allocateTty,
|
|
2008
|
+
sendHeartbeat: this.clientConfig.sendHeartbeat
|
|
2009
|
+
});
|
|
2010
|
+
const config = new rstream.webtty.protobuf.Config({
|
|
2011
|
+
options: opts,
|
|
2012
|
+
cmdArgs: this.execConfig.cmdArgs,
|
|
2013
|
+
envVars: this.execConfig.envVars.map(
|
|
2014
|
+
(e) => new rstream.webtty.protobuf.Environment({
|
|
2015
|
+
key: e.key,
|
|
2016
|
+
value: e.value
|
|
2017
|
+
})
|
|
2018
|
+
),
|
|
2019
|
+
workdir: this.execConfig.workdir ? new rstream.webtty.protobuf.Workdir({
|
|
2020
|
+
value: this.execConfig.workdir
|
|
2021
|
+
}) : void 0,
|
|
2022
|
+
username: typeof this.execConfig.username === "string" ? new rstream.webtty.protobuf.Username({
|
|
2023
|
+
name: this.execConfig.username
|
|
2024
|
+
}) : this.execConfig.username !== void 0 ? new rstream.webtty.protobuf.Username({
|
|
2025
|
+
id: this.execConfig.username
|
|
2026
|
+
}) : void 0
|
|
2027
|
+
});
|
|
2028
|
+
this.send(
|
|
2029
|
+
new rstream.webtty.protobuf.Message({
|
|
2030
|
+
open: new rstream.webtty.protobuf.Open({ config })
|
|
2031
|
+
})
|
|
2032
|
+
);
|
|
2033
|
+
};
|
|
2034
|
+
handleMessage = (evt) => {
|
|
2035
|
+
if (!evt.data) return;
|
|
2036
|
+
if (this.connectionState === "preparing" || this.connectionState === "closed")
|
|
2037
|
+
return;
|
|
2038
|
+
try {
|
|
2039
|
+
const message = rstream.webtty.protobuf.Message.decode(
|
|
2040
|
+
new Uint8Array(evt.data)
|
|
2041
|
+
);
|
|
2042
|
+
if (message.error) {
|
|
2043
|
+
this.close(`Server error: code=${message.error.code}`);
|
|
2044
|
+
} else if (message.ack) {
|
|
2045
|
+
if (this.connectionState === "connecting") {
|
|
2046
|
+
this.connectionState = "connected";
|
|
2047
|
+
this.events.onConnect?.();
|
|
2048
|
+
if (this.clientConfig.sendHeartbeat) {
|
|
2049
|
+
this.heartbeatTimer = setInterval(
|
|
2050
|
+
() => this.sendHeartbeat(),
|
|
2051
|
+
this.clientConfig.heartbeatIntervalMs
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2054
|
+
} else {
|
|
2055
|
+
this.close("Unexpected ACK message.");
|
|
2056
|
+
}
|
|
2057
|
+
} else if (message.close) {
|
|
2058
|
+
this.close(message.close.returnCode ?? 0);
|
|
2059
|
+
} else if (message.data) {
|
|
2060
|
+
if (this.connectionState === "connected") {
|
|
2061
|
+
if (message.data.type === rstream.webtty.protobuf.Data.Type.TYPE_STDOUT) {
|
|
2062
|
+
if (message.data.data) {
|
|
2063
|
+
this.events.onStdout?.(message.data.data);
|
|
2064
|
+
}
|
|
2065
|
+
if (message.data.eos) {
|
|
2066
|
+
this.events.onStdoutEos?.();
|
|
2067
|
+
}
|
|
2068
|
+
} else if (message.data.type === rstream.webtty.protobuf.Data.Type.TYPE_STDERR) {
|
|
2069
|
+
if (message.data.data) {
|
|
2070
|
+
this.events.onStderr?.(message.data.data);
|
|
2071
|
+
}
|
|
2072
|
+
if (message.data.eos) {
|
|
2073
|
+
this.events.onStderrEos?.();
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
} else {
|
|
2077
|
+
this.close("Unexpected data message.");
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
} catch (err) {
|
|
2081
|
+
this.close(`Failed to decode message: ${err.message}`);
|
|
2082
|
+
}
|
|
2083
|
+
};
|
|
2084
|
+
handleClose = () => {
|
|
2085
|
+
if (this.connectionState !== "closed") {
|
|
2086
|
+
this.close("WebSocket was closed unexpectedly.");
|
|
2087
|
+
}
|
|
2088
|
+
};
|
|
2089
|
+
handleError = () => {
|
|
2090
|
+
if (this.connectionState !== "closed") {
|
|
2091
|
+
this.close("WebSocket encountered an error.");
|
|
2092
|
+
}
|
|
2093
|
+
};
|
|
2094
|
+
sendHeartbeat() {
|
|
2095
|
+
this.send(
|
|
2096
|
+
new rstream.webtty.protobuf.Message({
|
|
2097
|
+
heartbeat: new rstream.webtty.protobuf.Heartbeat()
|
|
2098
|
+
})
|
|
2099
|
+
);
|
|
2100
|
+
}
|
|
2101
|
+
send(message) {
|
|
2102
|
+
if (!this.ws) return;
|
|
2103
|
+
if (this.connectionState === "preparing" || this.connectionState === "closed")
|
|
2104
|
+
return;
|
|
2105
|
+
const buffer = rstream.webtty.protobuf.Message.encode(message).finish();
|
|
2106
|
+
this.ws.send(buffer);
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* Closes the WebTTY session and fires exactly one of:
|
|
2110
|
+
* - onComplete(exitCode) // if a number is passed
|
|
2111
|
+
* - onError(errorMessage) // if a string is passed
|
|
2112
|
+
* If no argument is given, treat as an unknown error scenario.
|
|
2113
|
+
*/
|
|
2114
|
+
close(result) {
|
|
2115
|
+
if (this.connectionState === "closed") {
|
|
2116
|
+
return;
|
|
2117
|
+
}
|
|
2118
|
+
this.connectionState = "closed";
|
|
2119
|
+
if (this.heartbeatTimer) {
|
|
2120
|
+
clearInterval(this.heartbeatTimer);
|
|
2121
|
+
this.heartbeatTimer = null;
|
|
2122
|
+
}
|
|
2123
|
+
if (this.ws) {
|
|
2124
|
+
this.ws.removeEventListener("open", this.handleOpen);
|
|
2125
|
+
this.ws.removeEventListener("message", this.handleMessage);
|
|
2126
|
+
this.ws.removeEventListener("error", this.handleError);
|
|
2127
|
+
this.ws.removeEventListener("close", this.handleClose);
|
|
2128
|
+
this.ws.close();
|
|
2129
|
+
this.ws = null;
|
|
2130
|
+
}
|
|
2131
|
+
if (typeof result === "number") {
|
|
2132
|
+
this.events.onComplete?.(result);
|
|
2133
|
+
} else if (typeof result === "string") {
|
|
2134
|
+
this.events.onError?.(result);
|
|
2135
|
+
} else {
|
|
2136
|
+
this.events.onError?.("Connection closed without a known reason.");
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2141
|
+
0 && (module.exports = {
|
|
2142
|
+
WebTTY
|
|
2143
|
+
});
|