starpc 0.12.0 → 0.12.1
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/echo/server.go +3 -3
- package/package.json +1 -1
- package/patches/ts-proto+1.126.1.patch +0 -25
package/echo/server.go
CHANGED
|
@@ -84,11 +84,11 @@ func (s *EchoServer) EchoBidiStream(strm SRPCEchoer_EchoBidiStreamStream) error
|
|
|
84
84
|
|
|
85
85
|
// RpcStream runs a rpc stream
|
|
86
86
|
func (r *EchoServer) RpcStream(stream SRPCEchoer_RpcStreamStream) error {
|
|
87
|
-
return rpcstream.HandleRpcStream(stream, func(ctx context.Context, componentID string) (srpc.Mux, error) {
|
|
87
|
+
return rpcstream.HandleRpcStream(stream, func(ctx context.Context, componentID string) (srpc.Mux, func(), error) {
|
|
88
88
|
if r.rpcStreamMux == nil {
|
|
89
|
-
return nil, errors.New("not implemented")
|
|
89
|
+
return nil, nil, errors.New("not implemented")
|
|
90
90
|
}
|
|
91
|
-
return r.rpcStreamMux, nil
|
|
91
|
+
return r.rpcStreamMux, nil, nil
|
|
92
92
|
})
|
|
93
93
|
}
|
|
94
94
|
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/ts-proto/build/generate-services.js b/node_modules/ts-proto/build/generate-services.js
|
|
2
|
-
index 8ae7981..5ab6bf6 100644
|
|
3
|
-
--- a/node_modules/ts-proto/build/generate-services.js
|
|
4
|
-
+++ b/node_modules/ts-proto/build/generate-services.js
|
|
5
|
-
@@ -129,7 +129,7 @@ function generateRegularRpcMethod(ctx, fileDesc, serviceDesc, methodDesc) {
|
|
6
|
-
const data = ${encode};
|
|
7
|
-
const ${returnVariable} = this.rpc.${rpcMethod}(
|
|
8
|
-
${maybeCtx}
|
|
9
|
-
- "${(0, utils_1.maybePrefixPackage)(fileDesc, serviceDesc.name)}",
|
|
10
|
-
+ this.service,
|
|
11
|
-
"${methodDesc.name}",
|
|
12
|
-
data
|
|
13
|
-
);
|
|
14
|
-
@@ -148,7 +148,10 @@ function generateServiceClientImpl(ctx, fileDesc, serviceDesc) {
|
|
15
|
-
// Create the constructor(rpc: Rpc)
|
|
16
|
-
const rpcType = options.context ? "Rpc<Context>" : "Rpc";
|
|
17
|
-
chunks.push((0, ts_poet_1.code) `private readonly rpc: ${rpcType};`);
|
|
18
|
-
- chunks.push((0, ts_poet_1.code) `constructor(rpc: ${rpcType}) {`);
|
|
19
|
-
+ chunks.push((0, ts_poet_1.code) `private readonly service: string;`);
|
|
20
|
-
+ chunks.push((0, ts_poet_1.code) `constructor(rpc: ${rpcType}, service?: string) {`);
|
|
21
|
-
+ const serviceID = (0, utils_1.maybePrefixPackage)(fileDesc, serviceDesc.name);
|
|
22
|
-
+ chunks.push((0, ts_poet_1.code) `this.service = service || "${serviceID}";`);
|
|
23
|
-
chunks.push((0, ts_poet_1.code) `this.rpc = rpc;`);
|
|
24
|
-
// Bind each FooService method to the FooServiceImpl class
|
|
25
|
-
for (const methodDesc of serviceDesc.method) {
|