starpc 0.31.12 → 0.31.13
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 +4 -1
- package/dist/cmd/protoc-gen-es-starpc/typescript.js +5 -1
- package/e2e/mock/mock.pb.go +1 -1
- package/echo/echo.pb.go +1 -1
- package/go.mod +2 -2
- package/go.sum +4 -6
- package/package.json +3 -3
- package/srpc/rpcproto.pb.go +14 -2
|
@@ -116,7 +116,10 @@ function generateService(
|
|
|
116
116
|
f.print("export const ", localName(service), "ServiceName = ", localName(service), "Definition.typeName");
|
|
117
117
|
f.print();
|
|
118
118
|
|
|
119
|
-
//
|
|
119
|
+
// Skip the rest if there are no methods.
|
|
120
|
+
if (!service.methods.length) { return; }
|
|
121
|
+
|
|
122
|
+
// Generate the client implementation if there are any methods
|
|
120
123
|
f.print("export class ", localName(service), "Client implements ", localName(service), " {");
|
|
121
124
|
f.print(" private readonly rpc: ", createImportSymbol("ProtoRpc", "starpc"));
|
|
122
125
|
f.print(" private readonly service: string");
|
|
@@ -87,7 +87,11 @@ function generateService(schema, f, service) {
|
|
|
87
87
|
// Generate the service name constant
|
|
88
88
|
f.print("export const ", localName(service), "ServiceName = ", localName(service), "Definition.typeName");
|
|
89
89
|
f.print();
|
|
90
|
-
//
|
|
90
|
+
// Skip the rest if there are no methods.
|
|
91
|
+
if (!service.methods.length) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// Generate the client implementation if there are any methods
|
|
91
95
|
f.print("export class ", localName(service), "Client implements ", localName(service), " {");
|
|
92
96
|
f.print(" private readonly rpc: ", createImportSymbol("ProtoRpc", "starpc"));
|
|
93
97
|
f.print(" private readonly service: string");
|
package/e2e/mock/mock.pb.go
CHANGED
package/echo/echo.pb.go
CHANGED
package/go.mod
CHANGED
|
@@ -3,8 +3,8 @@ module github.com/aperturerobotics/starpc
|
|
|
3
3
|
go 1.22
|
|
4
4
|
|
|
5
5
|
require (
|
|
6
|
-
github.com/aperturerobotics/protobuf-go-lite v0.6.
|
|
7
|
-
github.com/aperturerobotics/util v1.
|
|
6
|
+
github.com/aperturerobotics/protobuf-go-lite v0.6.1 // latest
|
|
7
|
+
github.com/aperturerobotics/util v1.22.1 // latest
|
|
8
8
|
)
|
|
9
9
|
|
|
10
10
|
require (
|
package/go.sum
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
github.com/aperturerobotics/json-iterator-lite v1.0.0 h1:cihbrYWoK/S2RYXhJLpDZd+GUjVvFJN+D3w1VOqqHRI=
|
|
2
2
|
github.com/aperturerobotics/json-iterator-lite v1.0.0/go.mod h1:snaApCEDtrHHP6UWSLKiYNOZU9A5NyzccKenx9oZEzg=
|
|
3
|
-
github.com/aperturerobotics/protobuf-go-lite v0.6.
|
|
4
|
-
github.com/aperturerobotics/protobuf-go-lite v0.6.
|
|
5
|
-
github.com/aperturerobotics/util v1.
|
|
6
|
-
github.com/aperturerobotics/util v1.
|
|
7
|
-
github.com/aperturerobotics/util v1.21.3 h1:Leg1xpgA6u7rGORjfndlInJkkGoJ2bqQxudym5tsIwY=
|
|
8
|
-
github.com/aperturerobotics/util v1.21.3/go.mod h1:pqLfG1F49Z+b9GVavx7RTAyTfkhaj4BZrEvTSuCg8xo=
|
|
3
|
+
github.com/aperturerobotics/protobuf-go-lite v0.6.1 h1:dN4baS2e2qHhdpX57RJKUEukseXrXtqtiUJxGFFUbRs=
|
|
4
|
+
github.com/aperturerobotics/protobuf-go-lite v0.6.1/go.mod h1:6Bp+C+fI1uh0NmIKpxlxyHMkKtCP9Kb3PHkhOzxG4B8=
|
|
5
|
+
github.com/aperturerobotics/util v1.22.1 h1:ubwNwf5vh/f1dhj5v5OLN7sbfj0iC7NsK8NR+/LJH18=
|
|
6
|
+
github.com/aperturerobotics/util v1.22.1/go.mod h1:b9c3xIwtCfd0DwhfOXB1Tk44uCckcYaB+0z8N17bWIY=
|
|
9
7
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
10
8
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
11
9
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starpc",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.13",
|
|
4
4
|
"description": "Streaming protobuf RPC service protocol over any two-way channel.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"release:commit": "git reset && git add package.json && git commit -s -m \"release: v$npm_package_version\" && git tag v$npm_package_version",
|
|
69
69
|
"release:publish": "git push && git push --tags && npm run build && npm publish",
|
|
70
70
|
"release": "npm run release:version && npm run release:commit",
|
|
71
|
-
"prepare": "go mod vendor",
|
|
71
|
+
"prepare": "go mod vendor && rimraf ./hack/bin",
|
|
72
72
|
"precommit": "lint-staged"
|
|
73
73
|
},
|
|
74
74
|
"preferUnplugged": true,
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"@aptre/it-ws": "^1.0.0",
|
|
102
|
-
"@aptre/protobuf-es-lite": "^0.2.
|
|
102
|
+
"@aptre/protobuf-es-lite": "^0.2.15",
|
|
103
103
|
"@chainsafe/libp2p-yamux": "^6.0.2",
|
|
104
104
|
"@libp2p/interface": "^1.3.0",
|
|
105
105
|
"@libp2p/logger": "^4.0.11",
|
package/srpc/rpcproto.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
|
+
// protoc-gen-go-lite version: v0.6.1
|
|
3
3
|
// source: github.com/aperturerobotics/starpc/srpc/rpcproto.proto
|
|
4
4
|
|
|
5
5
|
package srpc
|
|
@@ -191,7 +191,7 @@ func (m *Packet) CloneVT() *Packet {
|
|
|
191
191
|
}
|
|
192
192
|
r := new(Packet)
|
|
193
193
|
if m.Body != nil {
|
|
194
|
-
r.Body = m.Body.(interface{
|
|
194
|
+
r.Body = m.Body.(interface{ CloneOneofVT() isPacket_Body }).CloneOneofVT()
|
|
195
195
|
}
|
|
196
196
|
if len(m.unknownFields) > 0 {
|
|
197
197
|
r.unknownFields = make([]byte, len(m.unknownFields))
|
|
@@ -213,6 +213,10 @@ func (m *Packet_CallStart) CloneVT() *Packet_CallStart {
|
|
|
213
213
|
return r
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
+
func (m *Packet_CallStart) CloneOneofVT() isPacket_Body {
|
|
217
|
+
return m.CloneVT()
|
|
218
|
+
}
|
|
219
|
+
|
|
216
220
|
func (m *Packet_CallData) CloneVT() *Packet_CallData {
|
|
217
221
|
if m == nil {
|
|
218
222
|
return (*Packet_CallData)(nil)
|
|
@@ -222,6 +226,10 @@ func (m *Packet_CallData) CloneVT() *Packet_CallData {
|
|
|
222
226
|
return r
|
|
223
227
|
}
|
|
224
228
|
|
|
229
|
+
func (m *Packet_CallData) CloneOneofVT() isPacket_Body {
|
|
230
|
+
return m.CloneVT()
|
|
231
|
+
}
|
|
232
|
+
|
|
225
233
|
func (m *Packet_CallCancel) CloneVT() *Packet_CallCancel {
|
|
226
234
|
if m == nil {
|
|
227
235
|
return (*Packet_CallCancel)(nil)
|
|
@@ -231,6 +239,10 @@ func (m *Packet_CallCancel) CloneVT() *Packet_CallCancel {
|
|
|
231
239
|
return r
|
|
232
240
|
}
|
|
233
241
|
|
|
242
|
+
func (m *Packet_CallCancel) CloneOneofVT() isPacket_Body {
|
|
243
|
+
return m.CloneVT()
|
|
244
|
+
}
|
|
245
|
+
|
|
234
246
|
func (m *CallStart) CloneVT() *CallStart {
|
|
235
247
|
if m == nil {
|
|
236
248
|
return (*CallStart)(nil)
|