starpc 0.32.8 → 0.32.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.
package/Makefile CHANGED
@@ -68,6 +68,7 @@ node_modules:
68
68
  genproto: vendor node_modules $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTOC_GEN_STARPC)
69
69
  shopt -s globstar; \
70
70
  set -eo pipefail; \
71
+ export PROTOBUF_GO_TYPES_PKG=github.com/aperturerobotics/protobuf-go-lite/types; \
71
72
  export PROJECT=$$(go list -m); \
72
73
  export PATH=$$(pwd)/hack/bin:$${PATH}; \
73
74
  export OUT=./vendor; \
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "@aptre/protobuf-es-lite";
2
- import { Message } from "@aptre/protobuf-es-lite";
1
+ import type { MessageType } from '@aptre/protobuf-es-lite';
2
+ import { Message } from '@aptre/protobuf-es-lite';
3
3
  export declare const protobufPackage = "e2e.mock";
4
4
  /**
5
5
  * MockMsg is the mock message body.
@@ -1,13 +1,13 @@
1
1
  // @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/starpc/e2e/mock/mock.proto (package e2e.mock, syntax proto3)
3
3
  /* eslint-disable */
4
- import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
5
- export const protobufPackage = "e2e.mock";
4
+ import { createMessageType, ScalarType } from '@aptre/protobuf-es-lite';
5
+ export const protobufPackage = 'e2e.mock';
6
6
  // MockMsg contains the message type declaration for MockMsg.
7
7
  export const MockMsg = createMessageType({
8
- typeName: "e2e.mock.MockMsg",
8
+ typeName: 'e2e.mock.MockMsg',
9
9
  fields: [
10
- { no: 1, name: "body", kind: "scalar", T: ScalarType.STRING },
10
+ { no: 1, name: 'body', kind: 'scalar', T: ScalarType.STRING },
11
11
  ],
12
12
  packedByDefault: true,
13
13
  });
@@ -1,6 +1,6 @@
1
- import { MockMsg } from "./mock.pb.js";
2
- import { Message, MethodKind } from "@aptre/protobuf-es-lite";
3
- import { ProtoRpc } from "starpc";
1
+ import { MockMsg } from './mock.pb.js';
2
+ import { Message, MethodKind } from '@aptre/protobuf-es-lite';
3
+ import { ProtoRpc } from 'starpc';
4
4
  /**
5
5
  * Mock service mocks some RPCs for the e2e tests.
6
6
  *
@@ -1,15 +1,15 @@
1
1
  // @generated by protoc-gen-es-starpc none with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/starpc/e2e/mock/mock.proto (package e2e.mock, syntax proto3)
3
3
  /* eslint-disable */
4
- import { MockMsg } from "./mock.pb.js";
5
- import { MethodKind } from "@aptre/protobuf-es-lite";
4
+ import { MockMsg } from './mock.pb.js';
5
+ import { MethodKind } from '@aptre/protobuf-es-lite';
6
6
  /**
7
7
  * Mock service mocks some RPCs for the e2e tests.
8
8
  *
9
9
  * @generated from service e2e.mock.Mock
10
10
  */
11
11
  export const MockDefinition = {
12
- typeName: "e2e.mock.Mock",
12
+ typeName: 'e2e.mock.Mock',
13
13
  methods: {
14
14
  /**
15
15
  * MockRequest runs a mock unary request.
@@ -17,12 +17,12 @@ export const MockDefinition = {
17
17
  * @generated from rpc e2e.mock.Mock.MockRequest
18
18
  */
19
19
  MockRequest: {
20
- name: "MockRequest",
20
+ name: 'MockRequest',
21
21
  I: MockMsg,
22
22
  O: MockMsg,
23
23
  kind: MethodKind.Unary,
24
24
  },
25
- }
25
+ },
26
26
  };
27
27
  export const MockServiceName = MockDefinition.typeName;
28
28
  export class MockClient {
@@ -9,6 +9,11 @@ export async function runClientTest(client) {
9
9
  body: 'Hello world!',
10
10
  });
11
11
  console.log('success: output', result.body);
12
+ console.log('Calling Echo: unary call with empty request/response...');
13
+ await demoServiceClient.DoNothing({
14
+ body: 'Hello world!',
15
+ });
16
+ console.log('success');
12
17
  // observable for client requests
13
18
  const clientRequestStream = pushable({
14
19
  objectMode: true,
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "@aptre/protobuf-es-lite";
2
- import { Message } from "@aptre/protobuf-es-lite";
1
+ import type { MessageType } from '@aptre/protobuf-es-lite';
2
+ import { Message } from '@aptre/protobuf-es-lite';
3
3
  export declare const protobufPackage = "echo";
4
4
  /**
5
5
  * EchoMsg is the message body for Echo.
@@ -1,13 +1,13 @@
1
1
  // @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/starpc/echo/echo.proto (package echo, syntax proto3)
3
3
  /* eslint-disable */
4
- import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
5
- export const protobufPackage = "echo";
4
+ import { createMessageType, ScalarType } from '@aptre/protobuf-es-lite';
5
+ export const protobufPackage = 'echo';
6
6
  // EchoMsg contains the message type declaration for EchoMsg.
7
7
  export const EchoMsg = createMessageType({
8
- typeName: "echo.EchoMsg",
8
+ typeName: 'echo.EchoMsg',
9
9
  fields: [
10
- { no: 1, name: "body", kind: "scalar", T: ScalarType.STRING },
10
+ { no: 1, name: 'body', kind: 'scalar', T: ScalarType.STRING },
11
11
  ],
12
12
  packedByDefault: true,
13
13
  });
@@ -1,7 +1,7 @@
1
- import { EchoMsg } from "./echo.pb.js";
2
- import { Message, MethodKind } from "@aptre/protobuf-es-lite";
3
- import { RpcStreamPacket } from "../rpcstream/rpcstream.pb.js";
4
- import { MessageStream, ProtoRpc } from "starpc";
1
+ import { EchoMsg } from './echo.pb.js';
2
+ import { Empty, Message, MethodKind } from '@aptre/protobuf-es-lite';
3
+ import { RpcStreamPacket } from '../rpcstream/rpcstream.pb.js';
4
+ import { MessageStream, ProtoRpc } from 'starpc';
5
5
  /**
6
6
  * Echoer service returns the given message.
7
7
  *
@@ -117,6 +117,17 @@ export declare const EchoerDefinition: {
117
117
  }>>;
118
118
  readonly kind: MethodKind.BiDiStreaming;
119
119
  };
120
+ /**
121
+ * DoNothing does nothing.
122
+ *
123
+ * @generated from rpc echo.Echoer.DoNothing
124
+ */
125
+ readonly DoNothing: {
126
+ readonly name: "DoNothing";
127
+ readonly I: import("@aptre/protobuf-es-lite").MessageType<Message<{}>>;
128
+ readonly O: import("@aptre/protobuf-es-lite").MessageType<Message<{}>>;
129
+ readonly kind: MethodKind.Unary;
130
+ };
120
131
  };
121
132
  };
122
133
  /**
@@ -155,6 +166,12 @@ export interface Echoer {
155
166
  * @generated from rpc echo.Echoer.RpcStream
156
167
  */
157
168
  RpcStream(request: MessageStream<RpcStreamPacket>, abortSignal?: AbortSignal): MessageStream<RpcStreamPacket>;
169
+ /**
170
+ * DoNothing does nothing.
171
+ *
172
+ * @generated from rpc echo.Echoer.DoNothing
173
+ */
174
+ DoNothing(request: Message<Empty>, abortSignal?: AbortSignal): Promise<Message<Empty>>;
158
175
  }
159
176
  export declare const EchoerServiceName: "echo.Echoer";
160
177
  export declare class EchoerClient implements Echoer {
@@ -193,4 +210,10 @@ export declare class EchoerClient implements Echoer {
193
210
  * @generated from rpc echo.Echoer.RpcStream
194
211
  */
195
212
  RpcStream(request: MessageStream<RpcStreamPacket>, abortSignal?: AbortSignal): MessageStream<RpcStreamPacket>;
213
+ /**
214
+ * DoNothing does nothing.
215
+ *
216
+ * @generated from rpc echo.Echoer.DoNothing
217
+ */
218
+ DoNothing(request: Message<Empty>, abortSignal?: AbortSignal): Promise<Message<Empty>>;
196
219
  }
@@ -1,17 +1,17 @@
1
1
  // @generated by protoc-gen-es-starpc none with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/starpc/echo/echo.proto (package echo, syntax proto3)
3
3
  /* eslint-disable */
4
- import { EchoMsg } from "./echo.pb.js";
5
- import { MethodKind } from "@aptre/protobuf-es-lite";
6
- import { RpcStreamPacket } from "../rpcstream/rpcstream.pb.js";
7
- import { buildDecodeMessageTransform, buildEncodeMessageTransform } from "starpc";
4
+ import { EchoMsg } from './echo.pb.js';
5
+ import { Empty, MethodKind } from '@aptre/protobuf-es-lite';
6
+ import { RpcStreamPacket } from '../rpcstream/rpcstream.pb.js';
7
+ import { buildDecodeMessageTransform, buildEncodeMessageTransform, } from 'starpc';
8
8
  /**
9
9
  * Echoer service returns the given message.
10
10
  *
11
11
  * @generated from service echo.Echoer
12
12
  */
13
13
  export const EchoerDefinition = {
14
- typeName: "echo.Echoer",
14
+ typeName: 'echo.Echoer',
15
15
  methods: {
16
16
  /**
17
17
  * Echo returns the given message.
@@ -19,7 +19,7 @@ export const EchoerDefinition = {
19
19
  * @generated from rpc echo.Echoer.Echo
20
20
  */
21
21
  Echo: {
22
- name: "Echo",
22
+ name: 'Echo',
23
23
  I: EchoMsg,
24
24
  O: EchoMsg,
25
25
  kind: MethodKind.Unary,
@@ -30,7 +30,7 @@ export const EchoerDefinition = {
30
30
  * @generated from rpc echo.Echoer.EchoServerStream
31
31
  */
32
32
  EchoServerStream: {
33
- name: "EchoServerStream",
33
+ name: 'EchoServerStream',
34
34
  I: EchoMsg,
35
35
  O: EchoMsg,
36
36
  kind: MethodKind.ServerStreaming,
@@ -41,7 +41,7 @@ export const EchoerDefinition = {
41
41
  * @generated from rpc echo.Echoer.EchoClientStream
42
42
  */
43
43
  EchoClientStream: {
44
- name: "EchoClientStream",
44
+ name: 'EchoClientStream',
45
45
  I: EchoMsg,
46
46
  O: EchoMsg,
47
47
  kind: MethodKind.ClientStreaming,
@@ -52,7 +52,7 @@ export const EchoerDefinition = {
52
52
  * @generated from rpc echo.Echoer.EchoBidiStream
53
53
  */
54
54
  EchoBidiStream: {
55
- name: "EchoBidiStream",
55
+ name: 'EchoBidiStream',
56
56
  I: EchoMsg,
57
57
  O: EchoMsg,
58
58
  kind: MethodKind.BiDiStreaming,
@@ -63,12 +63,23 @@ export const EchoerDefinition = {
63
63
  * @generated from rpc echo.Echoer.RpcStream
64
64
  */
65
65
  RpcStream: {
66
- name: "RpcStream",
66
+ name: 'RpcStream',
67
67
  I: RpcStreamPacket,
68
68
  O: RpcStreamPacket,
69
69
  kind: MethodKind.BiDiStreaming,
70
70
  },
71
- }
71
+ /**
72
+ * DoNothing does nothing.
73
+ *
74
+ * @generated from rpc echo.Echoer.DoNothing
75
+ */
76
+ DoNothing: {
77
+ name: 'DoNothing',
78
+ I: Empty,
79
+ O: Empty,
80
+ kind: MethodKind.Unary,
81
+ },
82
+ },
72
83
  };
73
84
  export const EchoerServiceName = EchoerDefinition.typeName;
74
85
  export class EchoerClient {
@@ -82,6 +93,7 @@ export class EchoerClient {
82
93
  this.EchoClientStream = this.EchoClientStream.bind(this);
83
94
  this.EchoBidiStream = this.EchoBidiStream.bind(this);
84
95
  this.RpcStream = this.RpcStream.bind(this);
96
+ this.DoNothing = this.DoNothing.bind(this);
85
97
  }
86
98
  /**
87
99
  * Echo returns the given message.
@@ -130,4 +142,14 @@ export class EchoerClient {
130
142
  const result = this.rpc.bidirectionalStreamingRequest(this.service, EchoerDefinition.methods.RpcStream.name, buildEncodeMessageTransform(RpcStreamPacket)(request), abortSignal || undefined);
131
143
  return buildDecodeMessageTransform(RpcStreamPacket)(result);
132
144
  }
145
+ /**
146
+ * DoNothing does nothing.
147
+ *
148
+ * @generated from rpc echo.Echoer.DoNothing
149
+ */
150
+ async DoNothing(request, abortSignal) {
151
+ const requestMsg = Empty.create(request);
152
+ const result = await this.rpc.request(this.service, EchoerDefinition.methods.DoNothing.name, Empty.toBinary(requestMsg), abortSignal || undefined);
153
+ return Empty.fromBinary(result);
154
+ }
133
155
  }
@@ -1,4 +1,4 @@
1
- import { Message } from '@aptre/protobuf-es-lite';
1
+ import { Empty, Message } from '@aptre/protobuf-es-lite';
2
2
  import { EchoMsg } from './echo.pb.js';
3
3
  import { Server } from '../srpc/server.js';
4
4
  import { RpcStreamPacket } from '../rpcstream/rpcstream.pb.js';
@@ -12,4 +12,5 @@ export declare class EchoerServer implements Echoer {
12
12
  EchoClientStream(request: MessageStream<EchoMsg>): Promise<Message<EchoMsg>>;
13
13
  EchoBidiStream(request: MessageStream<EchoMsg>): MessageStream<EchoMsg>;
14
14
  RpcStream(request: MessageStream<RpcStreamPacket>): MessageStream<RpcStreamPacket>;
15
+ DoNothing(): Promise<Empty>;
15
16
  }
@@ -40,4 +40,7 @@ export class EchoerServer {
40
40
  return this.proxyServer.rpcStreamHandler;
41
41
  });
42
42
  }
43
+ async DoNothing() {
44
+ return {};
45
+ }
43
46
  }
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "@aptre/protobuf-es-lite";
2
- import { Message } from "@aptre/protobuf-es-lite";
1
+ import type { MessageType } from '@aptre/protobuf-es-lite';
2
+ import { Message } from '@aptre/protobuf-es-lite';
3
3
  export declare const protobufPackage = "rpcstream";
4
4
  /**
5
5
  * RpcStreamInit is the first message in a RPC stream.
@@ -49,7 +49,7 @@ export type RpcStreamPacket = Message<{
49
49
  * @generated from field: rpcstream.RpcStreamInit init = 1;
50
50
  */
51
51
  value: RpcStreamInit;
52
- case: "init";
52
+ case: 'init';
53
53
  } | {
54
54
  /**
55
55
  * Ack is sent in response to Init.
@@ -58,7 +58,7 @@ export type RpcStreamPacket = Message<{
58
58
  * @generated from field: rpcstream.RpcAck ack = 2;
59
59
  */
60
60
  value: RpcAck;
61
- case: "ack";
61
+ case: 'ack';
62
62
  } | {
63
63
  /**
64
64
  * Data is the encapsulated data packet.
@@ -66,7 +66,7 @@ export type RpcStreamPacket = Message<{
66
66
  * @generated from field: bytes data = 3;
67
67
  */
68
68
  value: Uint8Array;
69
- case: "data";
69
+ case: 'data';
70
70
  };
71
71
  }>;
72
72
  export declare const RpcStreamPacket: MessageType<RpcStreamPacket>;
@@ -1,31 +1,37 @@
1
1
  // @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/starpc/rpcstream/rpcstream.proto (package rpcstream, syntax proto3)
3
3
  /* eslint-disable */
4
- import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
5
- export const protobufPackage = "rpcstream";
4
+ import { createMessageType, ScalarType } from '@aptre/protobuf-es-lite';
5
+ export const protobufPackage = 'rpcstream';
6
6
  // RpcStreamInit contains the message type declaration for RpcStreamInit.
7
7
  export const RpcStreamInit = createMessageType({
8
- typeName: "rpcstream.RpcStreamInit",
8
+ typeName: 'rpcstream.RpcStreamInit',
9
9
  fields: [
10
- { no: 1, name: "component_id", kind: "scalar", T: ScalarType.STRING },
10
+ { no: 1, name: 'component_id', kind: 'scalar', T: ScalarType.STRING },
11
11
  ],
12
12
  packedByDefault: true,
13
13
  });
14
14
  // RpcAck contains the message type declaration for RpcAck.
15
15
  export const RpcAck = createMessageType({
16
- typeName: "rpcstream.RpcAck",
16
+ typeName: 'rpcstream.RpcAck',
17
17
  fields: [
18
- { no: 1, name: "error", kind: "scalar", T: ScalarType.STRING },
18
+ { no: 1, name: 'error', kind: 'scalar', T: ScalarType.STRING },
19
19
  ],
20
20
  packedByDefault: true,
21
21
  });
22
22
  // RpcStreamPacket contains the message type declaration for RpcStreamPacket.
23
23
  export const RpcStreamPacket = createMessageType({
24
- typeName: "rpcstream.RpcStreamPacket",
24
+ typeName: 'rpcstream.RpcStreamPacket',
25
25
  fields: [
26
- { no: 1, name: "init", kind: "message", T: () => RpcStreamInit, oneof: "body" },
27
- { no: 2, name: "ack", kind: "message", T: () => RpcAck, oneof: "body" },
28
- { no: 3, name: "data", kind: "scalar", T: ScalarType.BYTES, oneof: "body" },
26
+ {
27
+ no: 1,
28
+ name: 'init',
29
+ kind: 'message',
30
+ T: () => RpcStreamInit,
31
+ oneof: 'body',
32
+ },
33
+ { no: 2, name: 'ack', kind: 'message', T: () => RpcAck, oneof: 'body' },
34
+ { no: 3, name: 'data', kind: 'scalar', T: ScalarType.BYTES, oneof: 'body' },
29
35
  ],
30
36
  packedByDefault: true,
31
37
  });
@@ -1,5 +1,5 @@
1
- import type { MessageType } from "@aptre/protobuf-es-lite";
2
- import { Message } from "@aptre/protobuf-es-lite";
1
+ import type { MessageType } from '@aptre/protobuf-es-lite';
2
+ import { Message } from '@aptre/protobuf-es-lite';
3
3
  export declare const protobufPackage = "srpc";
4
4
  /**
5
5
  * CallStart requests starting a new RPC call.
@@ -90,7 +90,7 @@ export type Packet = Message<{
90
90
  * @generated from field: srpc.CallStart call_start = 1;
91
91
  */
92
92
  value: CallStart;
93
- case: "callStart";
93
+ case: 'callStart';
94
94
  } | {
95
95
  /**
96
96
  * CallData is a message in a streaming RPC sequence.
@@ -98,7 +98,7 @@ export type Packet = Message<{
98
98
  * @generated from field: srpc.CallData call_data = 2;
99
99
  */
100
100
  value: CallData;
101
- case: "callData";
101
+ case: 'callData';
102
102
  } | {
103
103
  /**
104
104
  * CallCancel cancels the call.
@@ -106,7 +106,7 @@ export type Packet = Message<{
106
106
  * @generated from field: bool call_cancel = 3;
107
107
  */
108
108
  value: boolean;
109
- case: "callCancel";
109
+ case: 'callCancel';
110
110
  };
111
111
  }>;
112
112
  export declare const Packet: MessageType<Packet>;
@@ -1,37 +1,55 @@
1
1
  // @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/starpc/srpc/rpcproto.proto (package srpc, syntax proto3)
3
3
  /* eslint-disable */
4
- import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
5
- export const protobufPackage = "srpc";
4
+ import { createMessageType, ScalarType } from '@aptre/protobuf-es-lite';
5
+ export const protobufPackage = 'srpc';
6
6
  // CallStart contains the message type declaration for CallStart.
7
7
  export const CallStart = createMessageType({
8
- typeName: "srpc.CallStart",
8
+ typeName: 'srpc.CallStart',
9
9
  fields: [
10
- { no: 1, name: "rpc_service", kind: "scalar", T: ScalarType.STRING },
11
- { no: 2, name: "rpc_method", kind: "scalar", T: ScalarType.STRING },
12
- { no: 3, name: "data", kind: "scalar", T: ScalarType.BYTES },
13
- { no: 4, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
10
+ { no: 1, name: 'rpc_service', kind: 'scalar', T: ScalarType.STRING },
11
+ { no: 2, name: 'rpc_method', kind: 'scalar', T: ScalarType.STRING },
12
+ { no: 3, name: 'data', kind: 'scalar', T: ScalarType.BYTES },
13
+ { no: 4, name: 'data_is_zero', kind: 'scalar', T: ScalarType.BOOL },
14
14
  ],
15
15
  packedByDefault: true,
16
16
  });
17
17
  // CallData contains the message type declaration for CallData.
18
18
  export const CallData = createMessageType({
19
- typeName: "srpc.CallData",
19
+ typeName: 'srpc.CallData',
20
20
  fields: [
21
- { no: 1, name: "data", kind: "scalar", T: ScalarType.BYTES },
22
- { no: 2, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
23
- { no: 3, name: "complete", kind: "scalar", T: ScalarType.BOOL },
24
- { no: 4, name: "error", kind: "scalar", T: ScalarType.STRING },
21
+ { no: 1, name: 'data', kind: 'scalar', T: ScalarType.BYTES },
22
+ { no: 2, name: 'data_is_zero', kind: 'scalar', T: ScalarType.BOOL },
23
+ { no: 3, name: 'complete', kind: 'scalar', T: ScalarType.BOOL },
24
+ { no: 4, name: 'error', kind: 'scalar', T: ScalarType.STRING },
25
25
  ],
26
26
  packedByDefault: true,
27
27
  });
28
28
  // Packet contains the message type declaration for Packet.
29
29
  export const Packet = createMessageType({
30
- typeName: "srpc.Packet",
30
+ typeName: 'srpc.Packet',
31
31
  fields: [
32
- { no: 1, name: "call_start", kind: "message", T: () => CallStart, oneof: "body" },
33
- { no: 2, name: "call_data", kind: "message", T: () => CallData, oneof: "body" },
34
- { no: 3, name: "call_cancel", kind: "scalar", T: ScalarType.BOOL, oneof: "body" },
32
+ {
33
+ no: 1,
34
+ name: 'call_start',
35
+ kind: 'message',
36
+ T: () => CallStart,
37
+ oneof: 'body',
38
+ },
39
+ {
40
+ no: 2,
41
+ name: 'call_data',
42
+ kind: 'message',
43
+ T: () => CallData,
44
+ oneof: 'body',
45
+ },
46
+ {
47
+ no: 3,
48
+ name: 'call_cancel',
49
+ kind: 'scalar',
50
+ T: ScalarType.BOOL,
51
+ oneof: 'body',
52
+ },
35
53
  ],
36
54
  packedByDefault: true,
37
55
  });
@@ -1,5 +1,5 @@
1
1
  // Code generated by protoc-gen-go-lite. DO NOT EDIT.
2
- // protoc-gen-go-lite version: v0.6.2
2
+ // protoc-gen-go-lite version: v0.6.5
3
3
  // source: github.com/aperturerobotics/starpc/e2e/mock/mock.proto
4
4
 
5
5
  package e2e_mock
@@ -2,10 +2,10 @@
2
2
  // @generated from file github.com/aperturerobotics/starpc/e2e/mock/mock.proto (package e2e.mock, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
- import type { MessageType, PartialFieldInfo } from "@aptre/protobuf-es-lite";
6
- import { createMessageType, Message, ScalarType } from "@aptre/protobuf-es-lite";
5
+ import type { MessageType, PartialFieldInfo } from '@aptre/protobuf-es-lite'
6
+ import { createMessageType, Message, ScalarType } from '@aptre/protobuf-es-lite'
7
7
 
8
- export const protobufPackage = "e2e.mock";
8
+ export const protobufPackage = 'e2e.mock'
9
9
 
10
10
  /**
11
11
  * MockMsg is the mock message body.
@@ -16,16 +16,14 @@ export type MockMsg = Message<{
16
16
  /**
17
17
  * @generated from field: string body = 1;
18
18
  */
19
- body?: string;
20
-
21
- }>;
19
+ body?: string
20
+ }>
22
21
 
23
22
  // MockMsg contains the message type declaration for MockMsg.
24
23
  export const MockMsg: MessageType<MockMsg> = createMessageType({
25
- typeName: "e2e.mock.MockMsg",
26
- fields: [
27
- { no: 1, name: "body", kind: "scalar", T: ScalarType.STRING },
28
- ] as readonly PartialFieldInfo[],
29
- packedByDefault: true,
30
- });
31
-
24
+ typeName: 'e2e.mock.MockMsg',
25
+ fields: [
26
+ { no: 1, name: 'body', kind: 'scalar', T: ScalarType.STRING },
27
+ ] as readonly PartialFieldInfo[],
28
+ packedByDefault: true,
29
+ })
@@ -2,9 +2,9 @@
2
2
  // @generated from file github.com/aperturerobotics/starpc/e2e/mock/mock.proto (package e2e.mock, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
- import { MockMsg } from "./mock.pb.js";
6
- import { Message, MethodKind } from "@aptre/protobuf-es-lite";
7
- import { ProtoRpc } from "starpc";
5
+ import { MockMsg } from './mock.pb.js'
6
+ import { Message, MethodKind } from '@aptre/protobuf-es-lite'
7
+ import { ProtoRpc } from 'starpc'
8
8
 
9
9
  /**
10
10
  * Mock service mocks some RPCs for the e2e tests.
@@ -12,7 +12,7 @@ import { ProtoRpc } from "starpc";
12
12
  * @generated from service e2e.mock.Mock
13
13
  */
14
14
  export const MockDefinition = {
15
- typeName: "e2e.mock.Mock",
15
+ typeName: 'e2e.mock.Mock',
16
16
  methods: {
17
17
  /**
18
18
  * MockRequest runs a mock unary request.
@@ -20,13 +20,13 @@ export const MockDefinition = {
20
20
  * @generated from rpc e2e.mock.Mock.MockRequest
21
21
  */
22
22
  MockRequest: {
23
- name: "MockRequest",
23
+ name: 'MockRequest',
24
24
  I: MockMsg,
25
25
  O: MockMsg,
26
26
  kind: MethodKind.Unary,
27
27
  },
28
- }
29
- } as const;
28
+ },
29
+ } as const
30
30
 
31
31
  /**
32
32
  * Mock service mocks some RPCs for the e2e tests.
@@ -40,10 +40,9 @@ export interface Mock {
40
40
  * @generated from rpc e2e.mock.Mock.MockRequest
41
41
  */
42
42
  MockRequest(
43
- request: Message<MockMsg>, abortSignal?: AbortSignal
44
- ):
45
- Promise<Message<MockMsg>>
46
-
43
+ request: Message<MockMsg>,
44
+ abortSignal?: AbortSignal,
45
+ ): Promise<Message<MockMsg>>
47
46
  }
48
47
 
49
48
  export const MockServiceName = MockDefinition.typeName
@@ -62,9 +61,9 @@ export class MockClient implements Mock {
62
61
  * @generated from rpc e2e.mock.Mock.MockRequest
63
62
  */
64
63
  async MockRequest(
65
- request: Message<MockMsg>, abortSignal?: AbortSignal
66
- ):
67
- Promise<Message<MockMsg>> {
64
+ request: Message<MockMsg>,
65
+ abortSignal?: AbortSignal,
66
+ ): Promise<Message<MockMsg>> {
68
67
  const requestMsg = MockMsg.create(request)
69
68
  const result = await this.rpc.request(
70
69
  this.service,
@@ -74,5 +73,4 @@ Promise<Message<MockMsg>> {
74
73
  )
75
74
  return MockMsg.fromBinary(result)
76
75
  }
77
-
78
76
  }
@@ -14,6 +14,12 @@ export async function runClientTest(client: Client) {
14
14
  })
15
15
  console.log('success: output', result.body)
16
16
 
17
+ console.log('Calling Echo: unary call with empty request/response...')
18
+ await demoServiceClient.DoNothing({
19
+ body: 'Hello world!',
20
+ })
21
+ console.log('success')
22
+
17
23
  // observable for client requests
18
24
  const clientRequestStream = pushable<Message<EchoMsg>>({
19
25
  objectMode: true,
package/echo/echo.pb.go CHANGED
@@ -1,5 +1,5 @@
1
1
  // Code generated by protoc-gen-go-lite. DO NOT EDIT.
2
- // protoc-gen-go-lite version: v0.6.2
2
+ // protoc-gen-go-lite version: v0.6.5
3
3
  // source: github.com/aperturerobotics/starpc/echo/echo.proto
4
4
 
5
5
  package echo
@@ -12,6 +12,7 @@ import (
12
12
 
13
13
  protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
14
14
  json "github.com/aperturerobotics/protobuf-go-lite/json"
15
+ _ "github.com/aperturerobotics/protobuf-go-lite/types/known/emptypb"
15
16
  _ "github.com/aperturerobotics/starpc/rpcstream"
16
17
  )
17
18