@gitpod/supervisor-api-grpcweb 0.1.5-pd-ssh-gateway-test.5 → 0.1.5-pd-ssh-gateway.10

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.
@@ -39,3 +39,39 @@ export namespace ExposePortResponse {
39
39
  }
40
40
  }
41
41
 
42
+ export class CreateSSHKeyPairRequest extends jspb.Message {
43
+ serializeBinary(): Uint8Array;
44
+ toObject(includeInstance?: boolean): CreateSSHKeyPairRequest.AsObject;
45
+ static toObject(includeInstance: boolean, msg: CreateSSHKeyPairRequest): CreateSSHKeyPairRequest.AsObject;
46
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
47
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
48
+ static serializeBinaryToWriter(message: CreateSSHKeyPairRequest, writer: jspb.BinaryWriter): void;
49
+ static deserializeBinary(bytes: Uint8Array): CreateSSHKeyPairRequest;
50
+ static deserializeBinaryFromReader(message: CreateSSHKeyPairRequest, reader: jspb.BinaryReader): CreateSSHKeyPairRequest;
51
+ }
52
+
53
+ export namespace CreateSSHKeyPairRequest {
54
+ export type AsObject = {
55
+ }
56
+ }
57
+
58
+ export class CreateSSHKeyPairResponse extends jspb.Message {
59
+ getPrivateKey(): string;
60
+ setPrivateKey(value: string): void;
61
+
62
+ serializeBinary(): Uint8Array;
63
+ toObject(includeInstance?: boolean): CreateSSHKeyPairResponse.AsObject;
64
+ static toObject(includeInstance: boolean, msg: CreateSSHKeyPairResponse): CreateSSHKeyPairResponse.AsObject;
65
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
66
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
67
+ static serializeBinaryToWriter(message: CreateSSHKeyPairResponse, writer: jspb.BinaryWriter): void;
68
+ static deserializeBinary(bytes: Uint8Array): CreateSSHKeyPairResponse;
69
+ static deserializeBinaryFromReader(message: CreateSSHKeyPairResponse, reader: jspb.BinaryReader): CreateSSHKeyPairResponse;
70
+ }
71
+
72
+ export namespace CreateSSHKeyPairResponse {
73
+ export type AsObject = {
74
+ privateKey: string,
75
+ }
76
+ }
77
+
package/lib/control_pb.js CHANGED
@@ -21,6 +21,8 @@ var global = (function() {
21
21
  return Function('return this')();
22
22
  }.call(null));
23
23
 
24
+ goog.exportSymbol('proto.supervisor.CreateSSHKeyPairRequest', null, global);
25
+ goog.exportSymbol('proto.supervisor.CreateSSHKeyPairResponse', null, global);
24
26
  goog.exportSymbol('proto.supervisor.ExposePortRequest', null, global);
25
27
  goog.exportSymbol('proto.supervisor.ExposePortResponse', null, global);
26
28
  /**
@@ -65,6 +67,48 @@ if (goog.DEBUG && !COMPILED) {
65
67
  */
66
68
  proto.supervisor.ExposePortResponse.displayName = 'proto.supervisor.ExposePortResponse';
67
69
  }
70
+ /**
71
+ * Generated by JsPbCodeGenerator.
72
+ * @param {Array=} opt_data Optional initial data array, typically from a
73
+ * server response, or constructed directly in Javascript. The array is used
74
+ * in place and becomes part of the constructed object. It is not cloned.
75
+ * If no data is provided, the constructed object will be empty, but still
76
+ * valid.
77
+ * @extends {jspb.Message}
78
+ * @constructor
79
+ */
80
+ proto.supervisor.CreateSSHKeyPairRequest = function(opt_data) {
81
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
82
+ };
83
+ goog.inherits(proto.supervisor.CreateSSHKeyPairRequest, jspb.Message);
84
+ if (goog.DEBUG && !COMPILED) {
85
+ /**
86
+ * @public
87
+ * @override
88
+ */
89
+ proto.supervisor.CreateSSHKeyPairRequest.displayName = 'proto.supervisor.CreateSSHKeyPairRequest';
90
+ }
91
+ /**
92
+ * Generated by JsPbCodeGenerator.
93
+ * @param {Array=} opt_data Optional initial data array, typically from a
94
+ * server response, or constructed directly in Javascript. The array is used
95
+ * in place and becomes part of the constructed object. It is not cloned.
96
+ * If no data is provided, the constructed object will be empty, but still
97
+ * valid.
98
+ * @extends {jspb.Message}
99
+ * @constructor
100
+ */
101
+ proto.supervisor.CreateSSHKeyPairResponse = function(opt_data) {
102
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
103
+ };
104
+ goog.inherits(proto.supervisor.CreateSSHKeyPairResponse, jspb.Message);
105
+ if (goog.DEBUG && !COMPILED) {
106
+ /**
107
+ * @public
108
+ * @override
109
+ */
110
+ proto.supervisor.CreateSSHKeyPairResponse.displayName = 'proto.supervisor.CreateSSHKeyPairResponse';
111
+ }
68
112
 
69
113
 
70
114
 
@@ -296,4 +340,235 @@ proto.supervisor.ExposePortResponse.serializeBinaryToWriter = function(message,
296
340
  };
297
341
 
298
342
 
343
+
344
+
345
+
346
+ if (jspb.Message.GENERATE_TO_OBJECT) {
347
+ /**
348
+ * Creates an object representation of this proto.
349
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
350
+ * Optional fields that are not set will be set to undefined.
351
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
352
+ * For the list of reserved names please see:
353
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
354
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
355
+ * JSPB instance for transitional soy proto support:
356
+ * http://goto/soy-param-migration
357
+ * @return {!Object}
358
+ */
359
+ proto.supervisor.CreateSSHKeyPairRequest.prototype.toObject = function(opt_includeInstance) {
360
+ return proto.supervisor.CreateSSHKeyPairRequest.toObject(opt_includeInstance, this);
361
+ };
362
+
363
+
364
+ /**
365
+ * Static version of the {@see toObject} method.
366
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
367
+ * the JSPB instance for transitional soy proto support:
368
+ * http://goto/soy-param-migration
369
+ * @param {!proto.supervisor.CreateSSHKeyPairRequest} msg The msg instance to transform.
370
+ * @return {!Object}
371
+ * @suppress {unusedLocalVariables} f is only used for nested messages
372
+ */
373
+ proto.supervisor.CreateSSHKeyPairRequest.toObject = function(includeInstance, msg) {
374
+ var f, obj = {
375
+
376
+ };
377
+
378
+ if (includeInstance) {
379
+ obj.$jspbMessageInstance = msg;
380
+ }
381
+ return obj;
382
+ };
383
+ }
384
+
385
+
386
+ /**
387
+ * Deserializes binary data (in protobuf wire format).
388
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
389
+ * @return {!proto.supervisor.CreateSSHKeyPairRequest}
390
+ */
391
+ proto.supervisor.CreateSSHKeyPairRequest.deserializeBinary = function(bytes) {
392
+ var reader = new jspb.BinaryReader(bytes);
393
+ var msg = new proto.supervisor.CreateSSHKeyPairRequest;
394
+ return proto.supervisor.CreateSSHKeyPairRequest.deserializeBinaryFromReader(msg, reader);
395
+ };
396
+
397
+
398
+ /**
399
+ * Deserializes binary data (in protobuf wire format) from the
400
+ * given reader into the given message object.
401
+ * @param {!proto.supervisor.CreateSSHKeyPairRequest} msg The message object to deserialize into.
402
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
403
+ * @return {!proto.supervisor.CreateSSHKeyPairRequest}
404
+ */
405
+ proto.supervisor.CreateSSHKeyPairRequest.deserializeBinaryFromReader = function(msg, reader) {
406
+ while (reader.nextField()) {
407
+ if (reader.isEndGroup()) {
408
+ break;
409
+ }
410
+ var field = reader.getFieldNumber();
411
+ switch (field) {
412
+ default:
413
+ reader.skipField();
414
+ break;
415
+ }
416
+ }
417
+ return msg;
418
+ };
419
+
420
+
421
+ /**
422
+ * Serializes the message to binary data (in protobuf wire format).
423
+ * @return {!Uint8Array}
424
+ */
425
+ proto.supervisor.CreateSSHKeyPairRequest.prototype.serializeBinary = function() {
426
+ var writer = new jspb.BinaryWriter();
427
+ proto.supervisor.CreateSSHKeyPairRequest.serializeBinaryToWriter(this, writer);
428
+ return writer.getResultBuffer();
429
+ };
430
+
431
+
432
+ /**
433
+ * Serializes the given message to binary data (in protobuf wire
434
+ * format), writing to the given BinaryWriter.
435
+ * @param {!proto.supervisor.CreateSSHKeyPairRequest} message
436
+ * @param {!jspb.BinaryWriter} writer
437
+ * @suppress {unusedLocalVariables} f is only used for nested messages
438
+ */
439
+ proto.supervisor.CreateSSHKeyPairRequest.serializeBinaryToWriter = function(message, writer) {
440
+ var f = undefined;
441
+ };
442
+
443
+
444
+
445
+
446
+
447
+ if (jspb.Message.GENERATE_TO_OBJECT) {
448
+ /**
449
+ * Creates an object representation of this proto.
450
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
451
+ * Optional fields that are not set will be set to undefined.
452
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
453
+ * For the list of reserved names please see:
454
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
455
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
456
+ * JSPB instance for transitional soy proto support:
457
+ * http://goto/soy-param-migration
458
+ * @return {!Object}
459
+ */
460
+ proto.supervisor.CreateSSHKeyPairResponse.prototype.toObject = function(opt_includeInstance) {
461
+ return proto.supervisor.CreateSSHKeyPairResponse.toObject(opt_includeInstance, this);
462
+ };
463
+
464
+
465
+ /**
466
+ * Static version of the {@see toObject} method.
467
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
468
+ * the JSPB instance for transitional soy proto support:
469
+ * http://goto/soy-param-migration
470
+ * @param {!proto.supervisor.CreateSSHKeyPairResponse} msg The msg instance to transform.
471
+ * @return {!Object}
472
+ * @suppress {unusedLocalVariables} f is only used for nested messages
473
+ */
474
+ proto.supervisor.CreateSSHKeyPairResponse.toObject = function(includeInstance, msg) {
475
+ var f, obj = {
476
+ privateKey: jspb.Message.getFieldWithDefault(msg, 1, "")
477
+ };
478
+
479
+ if (includeInstance) {
480
+ obj.$jspbMessageInstance = msg;
481
+ }
482
+ return obj;
483
+ };
484
+ }
485
+
486
+
487
+ /**
488
+ * Deserializes binary data (in protobuf wire format).
489
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
490
+ * @return {!proto.supervisor.CreateSSHKeyPairResponse}
491
+ */
492
+ proto.supervisor.CreateSSHKeyPairResponse.deserializeBinary = function(bytes) {
493
+ var reader = new jspb.BinaryReader(bytes);
494
+ var msg = new proto.supervisor.CreateSSHKeyPairResponse;
495
+ return proto.supervisor.CreateSSHKeyPairResponse.deserializeBinaryFromReader(msg, reader);
496
+ };
497
+
498
+
499
+ /**
500
+ * Deserializes binary data (in protobuf wire format) from the
501
+ * given reader into the given message object.
502
+ * @param {!proto.supervisor.CreateSSHKeyPairResponse} msg The message object to deserialize into.
503
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
504
+ * @return {!proto.supervisor.CreateSSHKeyPairResponse}
505
+ */
506
+ proto.supervisor.CreateSSHKeyPairResponse.deserializeBinaryFromReader = function(msg, reader) {
507
+ while (reader.nextField()) {
508
+ if (reader.isEndGroup()) {
509
+ break;
510
+ }
511
+ var field = reader.getFieldNumber();
512
+ switch (field) {
513
+ case 1:
514
+ var value = /** @type {string} */ (reader.readString());
515
+ msg.setPrivateKey(value);
516
+ break;
517
+ default:
518
+ reader.skipField();
519
+ break;
520
+ }
521
+ }
522
+ return msg;
523
+ };
524
+
525
+
526
+ /**
527
+ * Serializes the message to binary data (in protobuf wire format).
528
+ * @return {!Uint8Array}
529
+ */
530
+ proto.supervisor.CreateSSHKeyPairResponse.prototype.serializeBinary = function() {
531
+ var writer = new jspb.BinaryWriter();
532
+ proto.supervisor.CreateSSHKeyPairResponse.serializeBinaryToWriter(this, writer);
533
+ return writer.getResultBuffer();
534
+ };
535
+
536
+
537
+ /**
538
+ * Serializes the given message to binary data (in protobuf wire
539
+ * format), writing to the given BinaryWriter.
540
+ * @param {!proto.supervisor.CreateSSHKeyPairResponse} message
541
+ * @param {!jspb.BinaryWriter} writer
542
+ * @suppress {unusedLocalVariables} f is only used for nested messages
543
+ */
544
+ proto.supervisor.CreateSSHKeyPairResponse.serializeBinaryToWriter = function(message, writer) {
545
+ var f = undefined;
546
+ f = message.getPrivateKey();
547
+ if (f.length > 0) {
548
+ writer.writeString(
549
+ 1,
550
+ f
551
+ );
552
+ }
553
+ };
554
+
555
+
556
+ /**
557
+ * optional string private_key = 1;
558
+ * @return {string}
559
+ */
560
+ proto.supervisor.CreateSSHKeyPairResponse.prototype.getPrivateKey = function() {
561
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
562
+ };
563
+
564
+
565
+ /**
566
+ * @param {string} value
567
+ * @return {!proto.supervisor.CreateSSHKeyPairResponse} returns this
568
+ */
569
+ proto.supervisor.CreateSSHKeyPairResponse.prototype.setPrivateKey = function(value) {
570
+ return jspb.Message.setProto3StringField(this, 1, value);
571
+ };
572
+
573
+
299
574
  goog.object.extend(exports, proto.supervisor);
@@ -13,9 +13,19 @@ type ControlServiceExposePort = {
13
13
  readonly responseType: typeof control_pb.ExposePortResponse;
14
14
  };
15
15
 
16
+ type ControlServiceCreateSSHKeyPair = {
17
+ readonly methodName: string;
18
+ readonly service: typeof ControlService;
19
+ readonly requestStream: false;
20
+ readonly responseStream: false;
21
+ readonly requestType: typeof control_pb.CreateSSHKeyPairRequest;
22
+ readonly responseType: typeof control_pb.CreateSSHKeyPairResponse;
23
+ };
24
+
16
25
  export class ControlService {
17
26
  static readonly serviceName: string;
18
27
  static readonly ExposePort: ControlServiceExposePort;
28
+ static readonly CreateSSHKeyPair: ControlServiceCreateSSHKeyPair;
19
29
  }
20
30
 
21
31
  export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
@@ -59,5 +69,14 @@ export class ControlServiceClient {
59
69
  requestMessage: control_pb.ExposePortRequest,
60
70
  callback: (error: ServiceError|null, responseMessage: control_pb.ExposePortResponse|null) => void
61
71
  ): UnaryResponse;
72
+ createSSHKeyPair(
73
+ requestMessage: control_pb.CreateSSHKeyPairRequest,
74
+ metadata: grpc.Metadata,
75
+ callback: (error: ServiceError|null, responseMessage: control_pb.CreateSSHKeyPairResponse|null) => void
76
+ ): UnaryResponse;
77
+ createSSHKeyPair(
78
+ requestMessage: control_pb.CreateSSHKeyPairRequest,
79
+ callback: (error: ServiceError|null, responseMessage: control_pb.CreateSSHKeyPairResponse|null) => void
80
+ ): UnaryResponse;
62
81
  }
63
82
 
@@ -19,6 +19,15 @@ ControlService.ExposePort = {
19
19
  responseType: control_pb.ExposePortResponse
20
20
  };
21
21
 
22
+ ControlService.CreateSSHKeyPair = {
23
+ methodName: "CreateSSHKeyPair",
24
+ service: ControlService,
25
+ requestStream: false,
26
+ responseStream: false,
27
+ requestType: control_pb.CreateSSHKeyPairRequest,
28
+ responseType: control_pb.CreateSSHKeyPairResponse
29
+ };
30
+
22
31
  exports.ControlService = ControlService;
23
32
 
24
33
  function ControlServiceClient(serviceHost, options) {
@@ -57,5 +66,36 @@ ControlServiceClient.prototype.exposePort = function exposePort(requestMessage,
57
66
  };
58
67
  };
59
68
 
69
+ ControlServiceClient.prototype.createSSHKeyPair = function createSSHKeyPair(requestMessage, metadata, callback) {
70
+ if (arguments.length === 2) {
71
+ callback = arguments[1];
72
+ }
73
+ var client = grpc.unary(ControlService.CreateSSHKeyPair, {
74
+ request: requestMessage,
75
+ host: this.serviceHost,
76
+ metadata: metadata,
77
+ transport: this.options.transport,
78
+ debug: this.options.debug,
79
+ onEnd: function (response) {
80
+ if (callback) {
81
+ if (response.status !== grpc.Code.OK) {
82
+ var err = new Error(response.statusMessage);
83
+ err.code = response.status;
84
+ err.metadata = response.trailers;
85
+ callback(err, null);
86
+ } else {
87
+ callback(null, response.message);
88
+ }
89
+ }
90
+ }
91
+ });
92
+ return {
93
+ cancel: function () {
94
+ callback = null;
95
+ client.close();
96
+ }
97
+ };
98
+ };
99
+
60
100
  exports.ControlServiceClient = ControlServiceClient;
61
101
 
package/package.json CHANGED
@@ -15,5 +15,5 @@
15
15
  "scripts": {
16
16
  "build": "sh build.sh"
17
17
  },
18
- "version": "0.1.5-pd-ssh-gateway-test.5"
18
+ "version": "0.1.5-pd-ssh-gateway.10"
19
19
  }
package/pkg-yarn.lock CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  "@gitpod/supervisor-api-grpcweb@0.1.5":
6
6
  version "0.1.5"
7
- resolved "file:///tmp/cache/1d0c3eae22db826757ffa36625b41a56cfccda98.tar.gz"
7
+ resolved "file:///tmp/cache/9fc76b8eb981f5cbbaf533c1b6d7798a3ee28fb6.tar.gz"
8
8
  dependencies:
9
9
  "@improbable-eng/grpc-web" "^0.14.0"
10
10
 
@@ -1,41 +0,0 @@
1
- // package: supervisor
2
- // file: sshkey.proto
3
-
4
- import * as jspb from "google-protobuf";
5
-
6
- export class CreateSSHKeyPairRequest extends jspb.Message {
7
- serializeBinary(): Uint8Array;
8
- toObject(includeInstance?: boolean): CreateSSHKeyPairRequest.AsObject;
9
- static toObject(includeInstance: boolean, msg: CreateSSHKeyPairRequest): CreateSSHKeyPairRequest.AsObject;
10
- static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
11
- static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
12
- static serializeBinaryToWriter(message: CreateSSHKeyPairRequest, writer: jspb.BinaryWriter): void;
13
- static deserializeBinary(bytes: Uint8Array): CreateSSHKeyPairRequest;
14
- static deserializeBinaryFromReader(message: CreateSSHKeyPairRequest, reader: jspb.BinaryReader): CreateSSHKeyPairRequest;
15
- }
16
-
17
- export namespace CreateSSHKeyPairRequest {
18
- export type AsObject = {
19
- }
20
- }
21
-
22
- export class CreateSSHKeyPairResponse extends jspb.Message {
23
- getPrivateKey(): string;
24
- setPrivateKey(value: string): void;
25
-
26
- serializeBinary(): Uint8Array;
27
- toObject(includeInstance?: boolean): CreateSSHKeyPairResponse.AsObject;
28
- static toObject(includeInstance: boolean, msg: CreateSSHKeyPairResponse): CreateSSHKeyPairResponse.AsObject;
29
- static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
30
- static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
31
- static serializeBinaryToWriter(message: CreateSSHKeyPairResponse, writer: jspb.BinaryWriter): void;
32
- static deserializeBinary(bytes: Uint8Array): CreateSSHKeyPairResponse;
33
- static deserializeBinaryFromReader(message: CreateSSHKeyPairResponse, reader: jspb.BinaryReader): CreateSSHKeyPairResponse;
34
- }
35
-
36
- export namespace CreateSSHKeyPairResponse {
37
- export type AsObject = {
38
- privateKey: string,
39
- }
40
- }
41
-
package/lib/sshkey_pb.js DELETED
@@ -1,299 +0,0 @@
1
- // source: sshkey.proto
2
- /**
3
- * @fileoverview
4
- * @enhanceable
5
- * @suppress {missingRequire} reports error on implicit type usages.
6
- * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
- * field starts with 'MSG_' and isn't a translatable message.
8
- * @public
9
- */
10
- // GENERATED CODE -- DO NOT EDIT!
11
- /* eslint-disable */
12
- // @ts-nocheck
13
-
14
- var jspb = require('google-protobuf');
15
- var goog = jspb;
16
- var global = (function() {
17
- if (this) { return this; }
18
- if (typeof window !== 'undefined') { return window; }
19
- if (typeof global !== 'undefined') { return global; }
20
- if (typeof self !== 'undefined') { return self; }
21
- return Function('return this')();
22
- }.call(null));
23
-
24
- goog.exportSymbol('proto.supervisor.CreateSSHKeyPairRequest', null, global);
25
- goog.exportSymbol('proto.supervisor.CreateSSHKeyPairResponse', null, global);
26
- /**
27
- * Generated by JsPbCodeGenerator.
28
- * @param {Array=} opt_data Optional initial data array, typically from a
29
- * server response, or constructed directly in Javascript. The array is used
30
- * in place and becomes part of the constructed object. It is not cloned.
31
- * If no data is provided, the constructed object will be empty, but still
32
- * valid.
33
- * @extends {jspb.Message}
34
- * @constructor
35
- */
36
- proto.supervisor.CreateSSHKeyPairRequest = function(opt_data) {
37
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
38
- };
39
- goog.inherits(proto.supervisor.CreateSSHKeyPairRequest, jspb.Message);
40
- if (goog.DEBUG && !COMPILED) {
41
- /**
42
- * @public
43
- * @override
44
- */
45
- proto.supervisor.CreateSSHKeyPairRequest.displayName = 'proto.supervisor.CreateSSHKeyPairRequest';
46
- }
47
- /**
48
- * Generated by JsPbCodeGenerator.
49
- * @param {Array=} opt_data Optional initial data array, typically from a
50
- * server response, or constructed directly in Javascript. The array is used
51
- * in place and becomes part of the constructed object. It is not cloned.
52
- * If no data is provided, the constructed object will be empty, but still
53
- * valid.
54
- * @extends {jspb.Message}
55
- * @constructor
56
- */
57
- proto.supervisor.CreateSSHKeyPairResponse = function(opt_data) {
58
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
59
- };
60
- goog.inherits(proto.supervisor.CreateSSHKeyPairResponse, jspb.Message);
61
- if (goog.DEBUG && !COMPILED) {
62
- /**
63
- * @public
64
- * @override
65
- */
66
- proto.supervisor.CreateSSHKeyPairResponse.displayName = 'proto.supervisor.CreateSSHKeyPairResponse';
67
- }
68
-
69
-
70
-
71
- if (jspb.Message.GENERATE_TO_OBJECT) {
72
- /**
73
- * Creates an object representation of this proto.
74
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
75
- * Optional fields that are not set will be set to undefined.
76
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
77
- * For the list of reserved names please see:
78
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
79
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
80
- * JSPB instance for transitional soy proto support:
81
- * http://goto/soy-param-migration
82
- * @return {!Object}
83
- */
84
- proto.supervisor.CreateSSHKeyPairRequest.prototype.toObject = function(opt_includeInstance) {
85
- return proto.supervisor.CreateSSHKeyPairRequest.toObject(opt_includeInstance, this);
86
- };
87
-
88
-
89
- /**
90
- * Static version of the {@see toObject} method.
91
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
92
- * the JSPB instance for transitional soy proto support:
93
- * http://goto/soy-param-migration
94
- * @param {!proto.supervisor.CreateSSHKeyPairRequest} msg The msg instance to transform.
95
- * @return {!Object}
96
- * @suppress {unusedLocalVariables} f is only used for nested messages
97
- */
98
- proto.supervisor.CreateSSHKeyPairRequest.toObject = function(includeInstance, msg) {
99
- var f, obj = {
100
-
101
- };
102
-
103
- if (includeInstance) {
104
- obj.$jspbMessageInstance = msg;
105
- }
106
- return obj;
107
- };
108
- }
109
-
110
-
111
- /**
112
- * Deserializes binary data (in protobuf wire format).
113
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
114
- * @return {!proto.supervisor.CreateSSHKeyPairRequest}
115
- */
116
- proto.supervisor.CreateSSHKeyPairRequest.deserializeBinary = function(bytes) {
117
- var reader = new jspb.BinaryReader(bytes);
118
- var msg = new proto.supervisor.CreateSSHKeyPairRequest;
119
- return proto.supervisor.CreateSSHKeyPairRequest.deserializeBinaryFromReader(msg, reader);
120
- };
121
-
122
-
123
- /**
124
- * Deserializes binary data (in protobuf wire format) from the
125
- * given reader into the given message object.
126
- * @param {!proto.supervisor.CreateSSHKeyPairRequest} msg The message object to deserialize into.
127
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
128
- * @return {!proto.supervisor.CreateSSHKeyPairRequest}
129
- */
130
- proto.supervisor.CreateSSHKeyPairRequest.deserializeBinaryFromReader = function(msg, reader) {
131
- while (reader.nextField()) {
132
- if (reader.isEndGroup()) {
133
- break;
134
- }
135
- var field = reader.getFieldNumber();
136
- switch (field) {
137
- default:
138
- reader.skipField();
139
- break;
140
- }
141
- }
142
- return msg;
143
- };
144
-
145
-
146
- /**
147
- * Serializes the message to binary data (in protobuf wire format).
148
- * @return {!Uint8Array}
149
- */
150
- proto.supervisor.CreateSSHKeyPairRequest.prototype.serializeBinary = function() {
151
- var writer = new jspb.BinaryWriter();
152
- proto.supervisor.CreateSSHKeyPairRequest.serializeBinaryToWriter(this, writer);
153
- return writer.getResultBuffer();
154
- };
155
-
156
-
157
- /**
158
- * Serializes the given message to binary data (in protobuf wire
159
- * format), writing to the given BinaryWriter.
160
- * @param {!proto.supervisor.CreateSSHKeyPairRequest} message
161
- * @param {!jspb.BinaryWriter} writer
162
- * @suppress {unusedLocalVariables} f is only used for nested messages
163
- */
164
- proto.supervisor.CreateSSHKeyPairRequest.serializeBinaryToWriter = function(message, writer) {
165
- var f = undefined;
166
- };
167
-
168
-
169
-
170
-
171
-
172
- if (jspb.Message.GENERATE_TO_OBJECT) {
173
- /**
174
- * Creates an object representation of this proto.
175
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
176
- * Optional fields that are not set will be set to undefined.
177
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
178
- * For the list of reserved names please see:
179
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
180
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
181
- * JSPB instance for transitional soy proto support:
182
- * http://goto/soy-param-migration
183
- * @return {!Object}
184
- */
185
- proto.supervisor.CreateSSHKeyPairResponse.prototype.toObject = function(opt_includeInstance) {
186
- return proto.supervisor.CreateSSHKeyPairResponse.toObject(opt_includeInstance, this);
187
- };
188
-
189
-
190
- /**
191
- * Static version of the {@see toObject} method.
192
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
193
- * the JSPB instance for transitional soy proto support:
194
- * http://goto/soy-param-migration
195
- * @param {!proto.supervisor.CreateSSHKeyPairResponse} msg The msg instance to transform.
196
- * @return {!Object}
197
- * @suppress {unusedLocalVariables} f is only used for nested messages
198
- */
199
- proto.supervisor.CreateSSHKeyPairResponse.toObject = function(includeInstance, msg) {
200
- var f, obj = {
201
- privateKey: jspb.Message.getFieldWithDefault(msg, 1, "")
202
- };
203
-
204
- if (includeInstance) {
205
- obj.$jspbMessageInstance = msg;
206
- }
207
- return obj;
208
- };
209
- }
210
-
211
-
212
- /**
213
- * Deserializes binary data (in protobuf wire format).
214
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
215
- * @return {!proto.supervisor.CreateSSHKeyPairResponse}
216
- */
217
- proto.supervisor.CreateSSHKeyPairResponse.deserializeBinary = function(bytes) {
218
- var reader = new jspb.BinaryReader(bytes);
219
- var msg = new proto.supervisor.CreateSSHKeyPairResponse;
220
- return proto.supervisor.CreateSSHKeyPairResponse.deserializeBinaryFromReader(msg, reader);
221
- };
222
-
223
-
224
- /**
225
- * Deserializes binary data (in protobuf wire format) from the
226
- * given reader into the given message object.
227
- * @param {!proto.supervisor.CreateSSHKeyPairResponse} msg The message object to deserialize into.
228
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
229
- * @return {!proto.supervisor.CreateSSHKeyPairResponse}
230
- */
231
- proto.supervisor.CreateSSHKeyPairResponse.deserializeBinaryFromReader = function(msg, reader) {
232
- while (reader.nextField()) {
233
- if (reader.isEndGroup()) {
234
- break;
235
- }
236
- var field = reader.getFieldNumber();
237
- switch (field) {
238
- case 1:
239
- var value = /** @type {string} */ (reader.readString());
240
- msg.setPrivateKey(value);
241
- break;
242
- default:
243
- reader.skipField();
244
- break;
245
- }
246
- }
247
- return msg;
248
- };
249
-
250
-
251
- /**
252
- * Serializes the message to binary data (in protobuf wire format).
253
- * @return {!Uint8Array}
254
- */
255
- proto.supervisor.CreateSSHKeyPairResponse.prototype.serializeBinary = function() {
256
- var writer = new jspb.BinaryWriter();
257
- proto.supervisor.CreateSSHKeyPairResponse.serializeBinaryToWriter(this, writer);
258
- return writer.getResultBuffer();
259
- };
260
-
261
-
262
- /**
263
- * Serializes the given message to binary data (in protobuf wire
264
- * format), writing to the given BinaryWriter.
265
- * @param {!proto.supervisor.CreateSSHKeyPairResponse} message
266
- * @param {!jspb.BinaryWriter} writer
267
- * @suppress {unusedLocalVariables} f is only used for nested messages
268
- */
269
- proto.supervisor.CreateSSHKeyPairResponse.serializeBinaryToWriter = function(message, writer) {
270
- var f = undefined;
271
- f = message.getPrivateKey();
272
- if (f.length > 0) {
273
- writer.writeString(
274
- 1,
275
- f
276
- );
277
- }
278
- };
279
-
280
-
281
- /**
282
- * optional string private_key = 1;
283
- * @return {string}
284
- */
285
- proto.supervisor.CreateSSHKeyPairResponse.prototype.getPrivateKey = function() {
286
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
287
- };
288
-
289
-
290
- /**
291
- * @param {string} value
292
- * @return {!proto.supervisor.CreateSSHKeyPairResponse} returns this
293
- */
294
- proto.supervisor.CreateSSHKeyPairResponse.prototype.setPrivateKey = function(value) {
295
- return jspb.Message.setProto3StringField(this, 1, value);
296
- };
297
-
298
-
299
- goog.object.extend(exports, proto.supervisor);
@@ -1,63 +0,0 @@
1
- // package: supervisor
2
- // file: sshkey.proto
3
-
4
- import * as sshkey_pb from "./sshkey_pb";
5
- import {grpc} from "@improbable-eng/grpc-web";
6
-
7
- type SSHKeyServiceCreateSSHKeyPair = {
8
- readonly methodName: string;
9
- readonly service: typeof SSHKeyService;
10
- readonly requestStream: false;
11
- readonly responseStream: false;
12
- readonly requestType: typeof sshkey_pb.CreateSSHKeyPairRequest;
13
- readonly responseType: typeof sshkey_pb.CreateSSHKeyPairResponse;
14
- };
15
-
16
- export class SSHKeyService {
17
- static readonly serviceName: string;
18
- static readonly CreateSSHKeyPair: SSHKeyServiceCreateSSHKeyPair;
19
- }
20
-
21
- export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
22
- export type Status = { details: string, code: number; metadata: grpc.Metadata }
23
-
24
- interface UnaryResponse {
25
- cancel(): void;
26
- }
27
- interface ResponseStream<T> {
28
- cancel(): void;
29
- on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
30
- on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
31
- on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
32
- }
33
- interface RequestStream<T> {
34
- write(message: T): RequestStream<T>;
35
- end(): void;
36
- cancel(): void;
37
- on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
38
- on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
39
- }
40
- interface BidirectionalStream<ReqT, ResT> {
41
- write(message: ReqT): BidirectionalStream<ReqT, ResT>;
42
- end(): void;
43
- cancel(): void;
44
- on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
45
- on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
46
- on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
47
- }
48
-
49
- export class SSHKeyServiceClient {
50
- readonly serviceHost: string;
51
-
52
- constructor(serviceHost: string, options?: grpc.RpcOptions);
53
- createSSHKeyPair(
54
- requestMessage: sshkey_pb.CreateSSHKeyPairRequest,
55
- metadata: grpc.Metadata,
56
- callback: (error: ServiceError|null, responseMessage: sshkey_pb.CreateSSHKeyPairResponse|null) => void
57
- ): UnaryResponse;
58
- createSSHKeyPair(
59
- requestMessage: sshkey_pb.CreateSSHKeyPairRequest,
60
- callback: (error: ServiceError|null, responseMessage: sshkey_pb.CreateSSHKeyPairResponse|null) => void
61
- ): UnaryResponse;
62
- }
63
-
@@ -1,61 +0,0 @@
1
- // package: supervisor
2
- // file: sshkey.proto
3
-
4
- var sshkey_pb = require("./sshkey_pb");
5
- var grpc = require("@improbable-eng/grpc-web").grpc;
6
-
7
- var SSHKeyService = (function () {
8
- function SSHKeyService() {}
9
- SSHKeyService.serviceName = "supervisor.SSHKeyService";
10
- return SSHKeyService;
11
- }());
12
-
13
- SSHKeyService.CreateSSHKeyPair = {
14
- methodName: "CreateSSHKeyPair",
15
- service: SSHKeyService,
16
- requestStream: false,
17
- responseStream: false,
18
- requestType: sshkey_pb.CreateSSHKeyPairRequest,
19
- responseType: sshkey_pb.CreateSSHKeyPairResponse
20
- };
21
-
22
- exports.SSHKeyService = SSHKeyService;
23
-
24
- function SSHKeyServiceClient(serviceHost, options) {
25
- this.serviceHost = serviceHost;
26
- this.options = options || {};
27
- }
28
-
29
- SSHKeyServiceClient.prototype.createSSHKeyPair = function createSSHKeyPair(requestMessage, metadata, callback) {
30
- if (arguments.length === 2) {
31
- callback = arguments[1];
32
- }
33
- var client = grpc.unary(SSHKeyService.CreateSSHKeyPair, {
34
- request: requestMessage,
35
- host: this.serviceHost,
36
- metadata: metadata,
37
- transport: this.options.transport,
38
- debug: this.options.debug,
39
- onEnd: function (response) {
40
- if (callback) {
41
- if (response.status !== grpc.Code.OK) {
42
- var err = new Error(response.statusMessage);
43
- err.code = response.status;
44
- err.metadata = response.trailers;
45
- callback(err, null);
46
- } else {
47
- callback(null, response.message);
48
- }
49
- }
50
- }
51
- });
52
- return {
53
- cancel: function () {
54
- callback = null;
55
- client.close();
56
- }
57
- };
58
- };
59
-
60
- exports.SSHKeyServiceClient = SSHKeyServiceClient;
61
-