starpc 0.32.10 → 0.32.11
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/cmd/protoc-gen-es-starpc/typescript.ts +9 -9
- package/dist/cmd/protoc-gen-es-starpc/typescript.js +9 -9
- package/dist/e2e/mock/mock_srpc.pb.d.ts +5 -5
- package/dist/echo/echo_srpc.pb.d.ts +35 -27
- package/e2e/mock/mock_srpc.pb.go +1 -1
- package/e2e/mock/mock_srpc.pb.ts +4 -7
- package/echo/echo_srpc.pb.go +1 -1
- package/echo/echo_srpc.pb.ts +9 -21
- package/go.mod +2 -2
- package/go.sum +2 -2
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from '@aptre/protobuf-es-lite/protoplugin/ecmascript'
|
|
27
27
|
|
|
28
28
|
const MessageStream = createImportSymbol('MessageStream', 'starpc')
|
|
29
|
-
const Message = createImportSymbol('Message', '@aptre/protobuf-es-lite')
|
|
29
|
+
// const Message = createImportSymbol('Message', '@aptre/protobuf-es-lite')
|
|
30
30
|
|
|
31
31
|
export function generateTs(schema: Schema) {
|
|
32
32
|
for (const protoFile of schema.files) {
|
|
@@ -88,9 +88,9 @@ function generateService(
|
|
|
88
88
|
f.print(f.jsDoc(method, " "));
|
|
89
89
|
f.print(" ", method.name, "(");
|
|
90
90
|
if (method.methodKind === MethodKind.Unary) {
|
|
91
|
-
f.print("request: ",
|
|
91
|
+
f.print("request: ", method.input, ", abortSignal?: AbortSignal");
|
|
92
92
|
} else if (method.methodKind === MethodKind.ServerStreaming) {
|
|
93
|
-
f.print("request: ",
|
|
93
|
+
f.print("request: ", method.input, ", abortSignal?: AbortSignal");
|
|
94
94
|
} else if (method.methodKind === MethodKind.ClientStreaming) {
|
|
95
95
|
f.print("request: ", MessageStream, "<", method.input, ">, abortSignal?: AbortSignal");
|
|
96
96
|
} else if (method.methodKind === MethodKind.BiDiStreaming) {
|
|
@@ -98,11 +98,11 @@ function generateService(
|
|
|
98
98
|
}
|
|
99
99
|
f.print("): ");
|
|
100
100
|
if (method.methodKind === MethodKind.Unary) {
|
|
101
|
-
f.print("Promise<",
|
|
101
|
+
f.print("Promise<", method.output, ">");
|
|
102
102
|
} else if (method.methodKind === MethodKind.ServerStreaming) {
|
|
103
103
|
f.print(MessageStream, "<", method.output, ">");
|
|
104
104
|
} else if (method.methodKind === MethodKind.ClientStreaming) {
|
|
105
|
-
f.print("Promise<",
|
|
105
|
+
f.print("Promise<", method.output, ">");
|
|
106
106
|
} else if (method.methodKind === MethodKind.BiDiStreaming) {
|
|
107
107
|
f.print(MessageStream, "<", method.output, ">");
|
|
108
108
|
}
|
|
@@ -137,9 +137,9 @@ function generateService(
|
|
|
137
137
|
f.print(f.jsDoc(method, " "));
|
|
138
138
|
f.print(" ", method.methodKind === MethodKind.Unary || method.methodKind === MethodKind.ClientStreaming ? "async " : "", method.name, "(");
|
|
139
139
|
if (method.methodKind === MethodKind.Unary) {
|
|
140
|
-
f.print("request: ",
|
|
140
|
+
f.print("request: ", method.input, ", abortSignal?: AbortSignal");
|
|
141
141
|
} else if (method.methodKind === MethodKind.ServerStreaming) {
|
|
142
|
-
f.print("request: ",
|
|
142
|
+
f.print("request: ", method.input, ", abortSignal?: AbortSignal");
|
|
143
143
|
} else if (method.methodKind === MethodKind.ClientStreaming) {
|
|
144
144
|
f.print("request: ", MessageStream, "<", method.input, ">, abortSignal?: AbortSignal");
|
|
145
145
|
} else if (method.methodKind === MethodKind.BiDiStreaming) {
|
|
@@ -147,7 +147,7 @@ function generateService(
|
|
|
147
147
|
}
|
|
148
148
|
f.print("): ");
|
|
149
149
|
if (method.methodKind === MethodKind.Unary) {
|
|
150
|
-
f.print("Promise<",
|
|
150
|
+
f.print("Promise<", method.output, "> {");
|
|
151
151
|
f.print(" const requestMsg = ", method.input, ".create(request)");
|
|
152
152
|
f.print(" const result = await this.rpc.request(");
|
|
153
153
|
f.print(" this.service,");
|
|
@@ -169,7 +169,7 @@ function generateService(
|
|
|
169
169
|
f.print(" return ", buildDecodeMessageTransformSymbol, "(", method.output, ")(result)");
|
|
170
170
|
f.print(" }");
|
|
171
171
|
} else if (method.methodKind === MethodKind.ClientStreaming) {
|
|
172
|
-
f.print("Promise<",
|
|
172
|
+
f.print("Promise<", method.output, "> {");
|
|
173
173
|
f.print(" const result = await this.rpc.clientStreamingRequest(");
|
|
174
174
|
f.print(" this.service,");
|
|
175
175
|
f.print(" ", localName(service), "Definition.methods.", method.name, ".name,");
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { MethodIdempotency, MethodKind, localName, } from '@aptre/protobuf-es-lite';
|
|
16
16
|
import { createImportSymbol, } from '@aptre/protobuf-es-lite/protoplugin/ecmascript';
|
|
17
17
|
const MessageStream = createImportSymbol('MessageStream', 'starpc');
|
|
18
|
-
const Message = createImportSymbol('Message', '@aptre/protobuf-es-lite')
|
|
18
|
+
// const Message = createImportSymbol('Message', '@aptre/protobuf-es-lite')
|
|
19
19
|
export function generateTs(schema) {
|
|
20
20
|
for (const protoFile of schema.files) {
|
|
21
21
|
const file = schema.generateFile(protoFile.name + '_srpc.pb.ts');
|
|
@@ -56,10 +56,10 @@ function generateService(schema, f, service) {
|
|
|
56
56
|
f.print(f.jsDoc(method, " "));
|
|
57
57
|
f.print(" ", method.name, "(");
|
|
58
58
|
if (method.methodKind === MethodKind.Unary) {
|
|
59
|
-
f.print("request: ",
|
|
59
|
+
f.print("request: ", method.input, ", abortSignal?: AbortSignal");
|
|
60
60
|
}
|
|
61
61
|
else if (method.methodKind === MethodKind.ServerStreaming) {
|
|
62
|
-
f.print("request: ",
|
|
62
|
+
f.print("request: ", method.input, ", abortSignal?: AbortSignal");
|
|
63
63
|
}
|
|
64
64
|
else if (method.methodKind === MethodKind.ClientStreaming) {
|
|
65
65
|
f.print("request: ", MessageStream, "<", method.input, ">, abortSignal?: AbortSignal");
|
|
@@ -69,13 +69,13 @@ function generateService(schema, f, service) {
|
|
|
69
69
|
}
|
|
70
70
|
f.print("): ");
|
|
71
71
|
if (method.methodKind === MethodKind.Unary) {
|
|
72
|
-
f.print("Promise<",
|
|
72
|
+
f.print("Promise<", method.output, ">");
|
|
73
73
|
}
|
|
74
74
|
else if (method.methodKind === MethodKind.ServerStreaming) {
|
|
75
75
|
f.print(MessageStream, "<", method.output, ">");
|
|
76
76
|
}
|
|
77
77
|
else if (method.methodKind === MethodKind.ClientStreaming) {
|
|
78
|
-
f.print("Promise<",
|
|
78
|
+
f.print("Promise<", method.output, ">");
|
|
79
79
|
}
|
|
80
80
|
else if (method.methodKind === MethodKind.BiDiStreaming) {
|
|
81
81
|
f.print(MessageStream, "<", method.output, ">");
|
|
@@ -108,10 +108,10 @@ function generateService(schema, f, service) {
|
|
|
108
108
|
f.print(f.jsDoc(method, " "));
|
|
109
109
|
f.print(" ", method.methodKind === MethodKind.Unary || method.methodKind === MethodKind.ClientStreaming ? "async " : "", method.name, "(");
|
|
110
110
|
if (method.methodKind === MethodKind.Unary) {
|
|
111
|
-
f.print("request: ",
|
|
111
|
+
f.print("request: ", method.input, ", abortSignal?: AbortSignal");
|
|
112
112
|
}
|
|
113
113
|
else if (method.methodKind === MethodKind.ServerStreaming) {
|
|
114
|
-
f.print("request: ",
|
|
114
|
+
f.print("request: ", method.input, ", abortSignal?: AbortSignal");
|
|
115
115
|
}
|
|
116
116
|
else if (method.methodKind === MethodKind.ClientStreaming) {
|
|
117
117
|
f.print("request: ", MessageStream, "<", method.input, ">, abortSignal?: AbortSignal");
|
|
@@ -121,7 +121,7 @@ function generateService(schema, f, service) {
|
|
|
121
121
|
}
|
|
122
122
|
f.print("): ");
|
|
123
123
|
if (method.methodKind === MethodKind.Unary) {
|
|
124
|
-
f.print("Promise<",
|
|
124
|
+
f.print("Promise<", method.output, "> {");
|
|
125
125
|
f.print(" const requestMsg = ", method.input, ".create(request)");
|
|
126
126
|
f.print(" const result = await this.rpc.request(");
|
|
127
127
|
f.print(" this.service,");
|
|
@@ -145,7 +145,7 @@ function generateService(schema, f, service) {
|
|
|
145
145
|
f.print(" }");
|
|
146
146
|
}
|
|
147
147
|
else if (method.methodKind === MethodKind.ClientStreaming) {
|
|
148
|
-
f.print("Promise<",
|
|
148
|
+
f.print("Promise<", method.output, "> {");
|
|
149
149
|
f.print(" const result = await this.rpc.clientStreamingRequest(");
|
|
150
150
|
f.print(" this.service,");
|
|
151
151
|
f.print(" ", localName(service), "Definition.methods.", method.name, ".name,");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MockMsg } from './mock.pb.js';
|
|
2
|
-
import {
|
|
2
|
+
import { MethodKind } from '@aptre/protobuf-es-lite';
|
|
3
3
|
import { ProtoRpc } from 'starpc';
|
|
4
4
|
/**
|
|
5
5
|
* Mock service mocks some RPCs for the e2e tests.
|
|
@@ -16,10 +16,10 @@ export declare const MockDefinition: {
|
|
|
16
16
|
*/
|
|
17
17
|
readonly MockRequest: {
|
|
18
18
|
readonly name: "MockRequest";
|
|
19
|
-
readonly I: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
19
|
+
readonly I: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
20
20
|
body?: string | undefined;
|
|
21
21
|
}>>;
|
|
22
|
-
readonly O: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
22
|
+
readonly O: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
23
23
|
body?: string | undefined;
|
|
24
24
|
}>>;
|
|
25
25
|
readonly kind: MethodKind.Unary;
|
|
@@ -37,7 +37,7 @@ export interface Mock {
|
|
|
37
37
|
*
|
|
38
38
|
* @generated from rpc e2e.mock.Mock.MockRequest
|
|
39
39
|
*/
|
|
40
|
-
MockRequest(request:
|
|
40
|
+
MockRequest(request: MockMsg, abortSignal?: AbortSignal): Promise<MockMsg>;
|
|
41
41
|
}
|
|
42
42
|
export declare const MockServiceName: "e2e.mock.Mock";
|
|
43
43
|
export declare class MockClient implements Mock {
|
|
@@ -51,5 +51,5 @@ export declare class MockClient implements Mock {
|
|
|
51
51
|
*
|
|
52
52
|
* @generated from rpc e2e.mock.Mock.MockRequest
|
|
53
53
|
*/
|
|
54
|
-
MockRequest(request:
|
|
54
|
+
MockRequest(request: MockMsg, abortSignal?: AbortSignal): Promise<MockMsg>;
|
|
55
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EchoMsg } from './echo.pb.js';
|
|
2
|
-
import { Empty,
|
|
2
|
+
import { Empty, MethodKind } from '@aptre/protobuf-es-lite';
|
|
3
3
|
import { RpcStreamPacket } from '../rpcstream/rpcstream.pb.js';
|
|
4
4
|
import { MessageStream, ProtoRpc } from 'starpc';
|
|
5
5
|
/**
|
|
@@ -17,10 +17,10 @@ export declare const EchoerDefinition: {
|
|
|
17
17
|
*/
|
|
18
18
|
readonly Echo: {
|
|
19
19
|
readonly name: "Echo";
|
|
20
|
-
readonly I: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
20
|
+
readonly I: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
21
21
|
body?: string | undefined;
|
|
22
22
|
}>>;
|
|
23
|
-
readonly O: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
23
|
+
readonly O: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
24
24
|
body?: string | undefined;
|
|
25
25
|
}>>;
|
|
26
26
|
readonly kind: MethodKind.Unary;
|
|
@@ -32,10 +32,10 @@ export declare const EchoerDefinition: {
|
|
|
32
32
|
*/
|
|
33
33
|
readonly EchoServerStream: {
|
|
34
34
|
readonly name: "EchoServerStream";
|
|
35
|
-
readonly I: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
35
|
+
readonly I: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
36
36
|
body?: string | undefined;
|
|
37
37
|
}>>;
|
|
38
|
-
readonly O: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
38
|
+
readonly O: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
39
39
|
body?: string | undefined;
|
|
40
40
|
}>>;
|
|
41
41
|
readonly kind: MethodKind.ServerStreaming;
|
|
@@ -47,10 +47,10 @@ export declare const EchoerDefinition: {
|
|
|
47
47
|
*/
|
|
48
48
|
readonly EchoClientStream: {
|
|
49
49
|
readonly name: "EchoClientStream";
|
|
50
|
-
readonly I: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
50
|
+
readonly I: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
51
51
|
body?: string | undefined;
|
|
52
52
|
}>>;
|
|
53
|
-
readonly O: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
53
|
+
readonly O: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
54
54
|
body?: string | undefined;
|
|
55
55
|
}>>;
|
|
56
56
|
readonly kind: MethodKind.ClientStreaming;
|
|
@@ -62,10 +62,10 @@ export declare const EchoerDefinition: {
|
|
|
62
62
|
*/
|
|
63
63
|
readonly EchoBidiStream: {
|
|
64
64
|
readonly name: "EchoBidiStream";
|
|
65
|
-
readonly I: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
65
|
+
readonly I: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
66
66
|
body?: string | undefined;
|
|
67
67
|
}>>;
|
|
68
|
-
readonly O: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
68
|
+
readonly O: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
69
69
|
body?: string | undefined;
|
|
70
70
|
}>>;
|
|
71
71
|
readonly kind: MethodKind.BiDiStreaming;
|
|
@@ -77,17 +77,21 @@ export declare const EchoerDefinition: {
|
|
|
77
77
|
*/
|
|
78
78
|
readonly RpcStream: {
|
|
79
79
|
readonly name: "RpcStream";
|
|
80
|
-
readonly I: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
80
|
+
readonly I: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
81
81
|
body?: {
|
|
82
82
|
value?: undefined;
|
|
83
|
-
case: undefined;
|
|
83
|
+
case: undefined; /**
|
|
84
|
+
* DoNothing does nothing.
|
|
85
|
+
*
|
|
86
|
+
* @generated from rpc echo.Echoer.DoNothing
|
|
87
|
+
*/
|
|
84
88
|
} | {
|
|
85
|
-
value: Message<{
|
|
89
|
+
value: import("@aptre/protobuf-es-lite").Message<{
|
|
86
90
|
componentId?: string | undefined;
|
|
87
91
|
}>;
|
|
88
92
|
case: "init";
|
|
89
93
|
} | {
|
|
90
|
-
value: Message<{
|
|
94
|
+
value: import("@aptre/protobuf-es-lite").Message<{
|
|
91
95
|
error?: string | undefined;
|
|
92
96
|
}>;
|
|
93
97
|
case: "ack";
|
|
@@ -96,17 +100,21 @@ export declare const EchoerDefinition: {
|
|
|
96
100
|
case: "data";
|
|
97
101
|
} | undefined;
|
|
98
102
|
}>>;
|
|
99
|
-
readonly O: import("@aptre/protobuf-es-lite").MessageType<Message<{
|
|
103
|
+
readonly O: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{
|
|
100
104
|
body?: {
|
|
101
105
|
value?: undefined;
|
|
102
|
-
case: undefined;
|
|
106
|
+
case: undefined; /**
|
|
107
|
+
* DoNothing does nothing.
|
|
108
|
+
*
|
|
109
|
+
* @generated from rpc echo.Echoer.DoNothing
|
|
110
|
+
*/
|
|
103
111
|
} | {
|
|
104
|
-
value: Message<{
|
|
112
|
+
value: import("@aptre/protobuf-es-lite").Message<{
|
|
105
113
|
componentId?: string | undefined;
|
|
106
114
|
}>;
|
|
107
115
|
case: "init";
|
|
108
116
|
} | {
|
|
109
|
-
value: Message<{
|
|
117
|
+
value: import("@aptre/protobuf-es-lite").Message<{
|
|
110
118
|
error?: string | undefined;
|
|
111
119
|
}>;
|
|
112
120
|
case: "ack";
|
|
@@ -124,8 +132,8 @@ export declare const EchoerDefinition: {
|
|
|
124
132
|
*/
|
|
125
133
|
readonly DoNothing: {
|
|
126
134
|
readonly name: "DoNothing";
|
|
127
|
-
readonly I: import("@aptre/protobuf-es-lite").MessageType<Message<{}>>;
|
|
128
|
-
readonly O: import("@aptre/protobuf-es-lite").MessageType<Message<{}>>;
|
|
135
|
+
readonly I: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{}>>;
|
|
136
|
+
readonly O: import("@aptre/protobuf-es-lite").MessageType<import("@aptre/protobuf-es-lite").Message<{}>>;
|
|
129
137
|
readonly kind: MethodKind.Unary;
|
|
130
138
|
};
|
|
131
139
|
};
|
|
@@ -141,19 +149,19 @@ export interface Echoer {
|
|
|
141
149
|
*
|
|
142
150
|
* @generated from rpc echo.Echoer.Echo
|
|
143
151
|
*/
|
|
144
|
-
Echo(request:
|
|
152
|
+
Echo(request: EchoMsg, abortSignal?: AbortSignal): Promise<EchoMsg>;
|
|
145
153
|
/**
|
|
146
154
|
* EchoServerStream is an example of a server -> client one-way stream.
|
|
147
155
|
*
|
|
148
156
|
* @generated from rpc echo.Echoer.EchoServerStream
|
|
149
157
|
*/
|
|
150
|
-
EchoServerStream(request:
|
|
158
|
+
EchoServerStream(request: EchoMsg, abortSignal?: AbortSignal): MessageStream<EchoMsg>;
|
|
151
159
|
/**
|
|
152
160
|
* EchoClientStream is an example of client->server one-way stream.
|
|
153
161
|
*
|
|
154
162
|
* @generated from rpc echo.Echoer.EchoClientStream
|
|
155
163
|
*/
|
|
156
|
-
EchoClientStream(request: MessageStream<EchoMsg>, abortSignal?: AbortSignal): Promise<
|
|
164
|
+
EchoClientStream(request: MessageStream<EchoMsg>, abortSignal?: AbortSignal): Promise<EchoMsg>;
|
|
157
165
|
/**
|
|
158
166
|
* EchoBidiStream is an example of a two-way stream.
|
|
159
167
|
*
|
|
@@ -171,7 +179,7 @@ export interface Echoer {
|
|
|
171
179
|
*
|
|
172
180
|
* @generated from rpc echo.Echoer.DoNothing
|
|
173
181
|
*/
|
|
174
|
-
DoNothing(request:
|
|
182
|
+
DoNothing(request: Empty, abortSignal?: AbortSignal): Promise<Empty>;
|
|
175
183
|
}
|
|
176
184
|
export declare const EchoerServiceName: "echo.Echoer";
|
|
177
185
|
export declare class EchoerClient implements Echoer {
|
|
@@ -185,19 +193,19 @@ export declare class EchoerClient implements Echoer {
|
|
|
185
193
|
*
|
|
186
194
|
* @generated from rpc echo.Echoer.Echo
|
|
187
195
|
*/
|
|
188
|
-
Echo(request:
|
|
196
|
+
Echo(request: EchoMsg, abortSignal?: AbortSignal): Promise<EchoMsg>;
|
|
189
197
|
/**
|
|
190
198
|
* EchoServerStream is an example of a server -> client one-way stream.
|
|
191
199
|
*
|
|
192
200
|
* @generated from rpc echo.Echoer.EchoServerStream
|
|
193
201
|
*/
|
|
194
|
-
EchoServerStream(request:
|
|
202
|
+
EchoServerStream(request: EchoMsg, abortSignal?: AbortSignal): MessageStream<EchoMsg>;
|
|
195
203
|
/**
|
|
196
204
|
* EchoClientStream is an example of client->server one-way stream.
|
|
197
205
|
*
|
|
198
206
|
* @generated from rpc echo.Echoer.EchoClientStream
|
|
199
207
|
*/
|
|
200
|
-
EchoClientStream(request: MessageStream<EchoMsg>, abortSignal?: AbortSignal): Promise<
|
|
208
|
+
EchoClientStream(request: MessageStream<EchoMsg>, abortSignal?: AbortSignal): Promise<EchoMsg>;
|
|
201
209
|
/**
|
|
202
210
|
* EchoBidiStream is an example of a two-way stream.
|
|
203
211
|
*
|
|
@@ -215,5 +223,5 @@ export declare class EchoerClient implements Echoer {
|
|
|
215
223
|
*
|
|
216
224
|
* @generated from rpc echo.Echoer.DoNothing
|
|
217
225
|
*/
|
|
218
|
-
DoNothing(request:
|
|
226
|
+
DoNothing(request: Empty, abortSignal?: AbortSignal): Promise<Empty>;
|
|
219
227
|
}
|
package/e2e/mock/mock_srpc.pb.go
CHANGED
package/e2e/mock/mock_srpc.pb.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
5
|
import { MockMsg } from './mock.pb.js'
|
|
6
|
-
import {
|
|
6
|
+
import { MethodKind } from '@aptre/protobuf-es-lite'
|
|
7
7
|
import { ProtoRpc } from 'starpc'
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -39,10 +39,7 @@ export interface Mock {
|
|
|
39
39
|
*
|
|
40
40
|
* @generated from rpc e2e.mock.Mock.MockRequest
|
|
41
41
|
*/
|
|
42
|
-
MockRequest(
|
|
43
|
-
request: Message<MockMsg>,
|
|
44
|
-
abortSignal?: AbortSignal,
|
|
45
|
-
): Promise<Message<MockMsg>>
|
|
42
|
+
MockRequest(request: MockMsg, abortSignal?: AbortSignal): Promise<MockMsg>
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
export const MockServiceName = MockDefinition.typeName
|
|
@@ -61,9 +58,9 @@ export class MockClient implements Mock {
|
|
|
61
58
|
* @generated from rpc e2e.mock.Mock.MockRequest
|
|
62
59
|
*/
|
|
63
60
|
async MockRequest(
|
|
64
|
-
request:
|
|
61
|
+
request: MockMsg,
|
|
65
62
|
abortSignal?: AbortSignal,
|
|
66
|
-
): Promise<
|
|
63
|
+
): Promise<MockMsg> {
|
|
67
64
|
const requestMsg = MockMsg.create(request)
|
|
68
65
|
const result = await this.rpc.request(
|
|
69
66
|
this.service,
|
package/echo/echo_srpc.pb.go
CHANGED
package/echo/echo_srpc.pb.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
5
|
import { EchoMsg } from './echo.pb.js'
|
|
6
|
-
import { Empty,
|
|
6
|
+
import { Empty, MethodKind } from '@aptre/protobuf-es-lite'
|
|
7
7
|
import { RpcStreamPacket } from '../rpcstream/rpcstream.pb.js'
|
|
8
8
|
import {
|
|
9
9
|
buildDecodeMessageTransform,
|
|
@@ -100,10 +100,7 @@ export interface Echoer {
|
|
|
100
100
|
*
|
|
101
101
|
* @generated from rpc echo.Echoer.Echo
|
|
102
102
|
*/
|
|
103
|
-
Echo(
|
|
104
|
-
request: Message<EchoMsg>,
|
|
105
|
-
abortSignal?: AbortSignal,
|
|
106
|
-
): Promise<Message<EchoMsg>>
|
|
103
|
+
Echo(request: EchoMsg, abortSignal?: AbortSignal): Promise<EchoMsg>
|
|
107
104
|
|
|
108
105
|
/**
|
|
109
106
|
* EchoServerStream is an example of a server -> client one-way stream.
|
|
@@ -111,7 +108,7 @@ export interface Echoer {
|
|
|
111
108
|
* @generated from rpc echo.Echoer.EchoServerStream
|
|
112
109
|
*/
|
|
113
110
|
EchoServerStream(
|
|
114
|
-
request:
|
|
111
|
+
request: EchoMsg,
|
|
115
112
|
abortSignal?: AbortSignal,
|
|
116
113
|
): MessageStream<EchoMsg>
|
|
117
114
|
|
|
@@ -123,7 +120,7 @@ export interface Echoer {
|
|
|
123
120
|
EchoClientStream(
|
|
124
121
|
request: MessageStream<EchoMsg>,
|
|
125
122
|
abortSignal?: AbortSignal,
|
|
126
|
-
): Promise<
|
|
123
|
+
): Promise<EchoMsg>
|
|
127
124
|
|
|
128
125
|
/**
|
|
129
126
|
* EchoBidiStream is an example of a two-way stream.
|
|
@@ -150,10 +147,7 @@ export interface Echoer {
|
|
|
150
147
|
*
|
|
151
148
|
* @generated from rpc echo.Echoer.DoNothing
|
|
152
149
|
*/
|
|
153
|
-
DoNothing(
|
|
154
|
-
request: Message<Empty>,
|
|
155
|
-
abortSignal?: AbortSignal,
|
|
156
|
-
): Promise<Message<Empty>>
|
|
150
|
+
DoNothing(request: Empty, abortSignal?: AbortSignal): Promise<Empty>
|
|
157
151
|
}
|
|
158
152
|
|
|
159
153
|
export const EchoerServiceName = EchoerDefinition.typeName
|
|
@@ -176,10 +170,7 @@ export class EchoerClient implements Echoer {
|
|
|
176
170
|
*
|
|
177
171
|
* @generated from rpc echo.Echoer.Echo
|
|
178
172
|
*/
|
|
179
|
-
async Echo(
|
|
180
|
-
request: Message<EchoMsg>,
|
|
181
|
-
abortSignal?: AbortSignal,
|
|
182
|
-
): Promise<Message<EchoMsg>> {
|
|
173
|
+
async Echo(request: EchoMsg, abortSignal?: AbortSignal): Promise<EchoMsg> {
|
|
183
174
|
const requestMsg = EchoMsg.create(request)
|
|
184
175
|
const result = await this.rpc.request(
|
|
185
176
|
this.service,
|
|
@@ -196,7 +187,7 @@ export class EchoerClient implements Echoer {
|
|
|
196
187
|
* @generated from rpc echo.Echoer.EchoServerStream
|
|
197
188
|
*/
|
|
198
189
|
EchoServerStream(
|
|
199
|
-
request:
|
|
190
|
+
request: EchoMsg,
|
|
200
191
|
abortSignal?: AbortSignal,
|
|
201
192
|
): MessageStream<EchoMsg> {
|
|
202
193
|
const requestMsg = EchoMsg.create(request)
|
|
@@ -217,7 +208,7 @@ export class EchoerClient implements Echoer {
|
|
|
217
208
|
async EchoClientStream(
|
|
218
209
|
request: MessageStream<EchoMsg>,
|
|
219
210
|
abortSignal?: AbortSignal,
|
|
220
|
-
): Promise<
|
|
211
|
+
): Promise<EchoMsg> {
|
|
221
212
|
const result = await this.rpc.clientStreamingRequest(
|
|
222
213
|
this.service,
|
|
223
214
|
EchoerDefinition.methods.EchoClientStream.name,
|
|
@@ -268,10 +259,7 @@ export class EchoerClient implements Echoer {
|
|
|
268
259
|
*
|
|
269
260
|
* @generated from rpc echo.Echoer.DoNothing
|
|
270
261
|
*/
|
|
271
|
-
async DoNothing(
|
|
272
|
-
request: Message<Empty>,
|
|
273
|
-
abortSignal?: AbortSignal,
|
|
274
|
-
): Promise<Message<Empty>> {
|
|
262
|
+
async DoNothing(request: Empty, abortSignal?: AbortSignal): Promise<Empty> {
|
|
275
263
|
const requestMsg = Empty.create(request)
|
|
276
264
|
const result = await this.rpc.request(
|
|
277
265
|
this.service,
|
package/go.mod
CHANGED
|
@@ -13,11 +13,11 @@ replace nhooyr.io/websocket => github.com/paralin/nhooyr-websocket v1.8.12-0.202
|
|
|
13
13
|
|
|
14
14
|
require (
|
|
15
15
|
github.com/aperturerobotics/protobuf-go-lite v0.6.5 // latest
|
|
16
|
-
github.com/aperturerobotics/util v1.23.
|
|
16
|
+
github.com/aperturerobotics/util v1.23.4 // latest
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
require (
|
|
20
|
-
github.com/libp2p/go-libp2p v0.
|
|
20
|
+
github.com/libp2p/go-libp2p v0.35.0 // latest
|
|
21
21
|
github.com/libp2p/go-yamux/v4 v4.0.2-0.20240322071716-53ef5820bd48 // master
|
|
22
22
|
github.com/pkg/errors v0.9.1 // latest
|
|
23
23
|
github.com/sirupsen/logrus v1.9.3 // latest
|
package/go.sum
CHANGED
|
@@ -4,8 +4,8 @@ github.com/aperturerobotics/json-iterator-lite v1.0.0 h1:cihbrYWoK/S2RYXhJLpDZd+
|
|
|
4
4
|
github.com/aperturerobotics/json-iterator-lite v1.0.0/go.mod h1:snaApCEDtrHHP6UWSLKiYNOZU9A5NyzccKenx9oZEzg=
|
|
5
5
|
github.com/aperturerobotics/protobuf-go-lite v0.6.5 h1:AuPPcZ7ZaJe9ZYYC4gF7/5/Xbn9Mt9uXyV3+ADWy+Ys=
|
|
6
6
|
github.com/aperturerobotics/protobuf-go-lite v0.6.5/go.mod h1:YTbfnUj3feSULhs8VgepAHFnF3wUc0CPj4jd2axy21I=
|
|
7
|
-
github.com/aperturerobotics/util v1.23.
|
|
8
|
-
github.com/aperturerobotics/util v1.23.
|
|
7
|
+
github.com/aperturerobotics/util v1.23.4 h1:IXkVoN3Cc+5U5Rhd5hC00VGgL1PainhpaTyz5IPkc8I=
|
|
8
|
+
github.com/aperturerobotics/util v1.23.4/go.mod h1:y/BGl05icfllBf7l51IMJ6UOjpsDscAPt3ynhDZrwZ4=
|
|
9
9
|
github.com/cloudflare/circl v1.3.8 h1:j+V8jJt09PoeMFIu2uh5JUyEaIHTXVOHslFoLNAKqwI=
|
|
10
10
|
github.com/cloudflare/circl v1.3.8/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
|
|
11
11
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|