starpc 0.47.1 → 0.48.0
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/dist/echo/index.d.ts +2 -1
- package/dist/rpcstream/index.d.ts +2 -1
- package/dist/srpc/common-rpc.js +0 -3
- package/dist/srpc/index.d.ts +13 -7
- package/dist/srpc/index.js +3 -3
- package/dist/srpc/server.d.ts +1 -1
- package/echo/index.ts +1 -1
- package/go.mod +2 -2
- package/go.sum +4 -4
- package/integration/integration.go +1 -1
- package/package.json +8 -8
- package/srpc/common-rpc.ts +0 -2
- package/srpc/index.ts +15 -23
- package/srpc/server-http.go +1 -1
- package/srpc/server.ts +1 -1
- package/srpc/websocket.go +1 -1
package/dist/echo/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { EchoMsg } from './echo.pb.js';
|
|
2
|
-
export {
|
|
2
|
+
export { EchoerClient, EchoerDefinition, EchoerServiceName, } from './echo_srpc.pb.js';
|
|
3
|
+
export type { Echoer } from './echo_srpc.pb.js';
|
|
3
4
|
export { EchoerServer } from './server.js';
|
|
4
5
|
export { runClientTest } from './client-test.js';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { RpcStream,
|
|
1
|
+
export { RpcStream, openRpcStream, handleRpcStream, buildRpcStreamOpenStream, } from './rpcstream.js';
|
|
2
|
+
export type { RpcStreamCaller, RpcStreamGetter, RpcStreamHandler, } from './rpcstream.js';
|
|
2
3
|
export { RpcStreamPacket, RpcStreamInit, RpcAck } from './rpcstream.pb.js';
|
package/dist/srpc/common-rpc.js
CHANGED
package/dist/srpc/index.d.ts
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
export { ERR_RPC_ABORT, isAbortError, ERR_STREAM_IDLE, isStreamIdleError, castToError, } from './errors.js';
|
|
2
2
|
export { Client } from './client.js';
|
|
3
3
|
export { Server } from './server.js';
|
|
4
|
-
export { StreamConn
|
|
4
|
+
export { StreamConn } from './conn.js';
|
|
5
|
+
export type { StreamConnParams, StreamHandler } from './conn.js';
|
|
5
6
|
export { WebSocketConn } from './websocket.js';
|
|
6
7
|
export type { PacketHandler, OpenStreamFunc, HandleStreamFunc, PacketStream, streamToPacketStream, } from './stream.js';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
8
|
+
export { StaticHandler, createHandler } from './handler.js';
|
|
9
|
+
export type { Handler, InvokeFn, MethodMap } from './handler.js';
|
|
10
|
+
export { createInvokeFn } from './invoker.js';
|
|
11
|
+
export type { MethodProto } from './invoker.js';
|
|
9
12
|
export { Packet, CallStart, CallData } from './rpcproto.pb.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
13
|
+
export { StaticMux, MultiMux, createMux, createMultiMux } from './mux.js';
|
|
14
|
+
export type { Mux, LookupMethod } from './mux.js';
|
|
15
|
+
export { ChannelStream, newBroadcastChannelStream } from './channel.js';
|
|
16
|
+
export type { ChannelStreamMessage, ChannelPort, ChannelStreamOpts, } from './channel.js';
|
|
12
17
|
export { BroadcastChannelDuplex, BroadcastChannelConn, newBroadcastChannelDuplex, } from './broadcast-channel.js';
|
|
13
18
|
export { MessagePortDuplex, MessagePortConn, newMessagePortDuplex, } from './message-port.js';
|
|
14
|
-
export {
|
|
19
|
+
export { buildDecodeMessageTransform, buildEncodeMessageTransform, } from './message.js';
|
|
20
|
+
export type { MessageStream, DecodeMessageTransform, EncodeMessageTransform, } from './message.js';
|
|
15
21
|
export { parseLengthPrefixTransform, prependLengthPrefixTransform, decodePacketSource, encodePacketSource, uint32LEDecode, uint32LEEncode, decodeUint32Le, encodeUint32Le, lengthPrefixDecode, lengthPrefixEncode, prependPacketLen, } from './packet.js';
|
|
16
22
|
export { combineUint8ArrayListTransform } from './array-list.js';
|
|
17
23
|
export { ValueCtr } from './value-ctr.js';
|
|
@@ -19,4 +25,4 @@ export { OpenStreamCtr } from './open-stream-ctr.js';
|
|
|
19
25
|
export { HandleStreamCtr } from './handle-stream-ctr.js';
|
|
20
26
|
export { writeToPushable, buildPushableSink, messagePushable, } from './pushable.js';
|
|
21
27
|
export { Watchdog } from './watchdog.js';
|
|
22
|
-
export { ProtoRpc } from './proto-rpc.js';
|
|
28
|
+
export type { ProtoRpc } from './proto-rpc.js';
|
package/dist/srpc/index.js
CHANGED
|
@@ -3,11 +3,11 @@ export { Client } from './client.js';
|
|
|
3
3
|
export { Server } from './server.js';
|
|
4
4
|
export { StreamConn } from './conn.js';
|
|
5
5
|
export { WebSocketConn } from './websocket.js';
|
|
6
|
-
export { StaticHandler, createHandler
|
|
6
|
+
export { StaticHandler, createHandler } from './handler.js';
|
|
7
7
|
export { createInvokeFn } from './invoker.js';
|
|
8
8
|
export { Packet, CallStart, CallData } from './rpcproto.pb.js';
|
|
9
|
-
export { StaticMux, MultiMux, createMux, createMultiMux
|
|
10
|
-
export { ChannelStream, newBroadcastChannelStream
|
|
9
|
+
export { StaticMux, MultiMux, createMux, createMultiMux } from './mux.js';
|
|
10
|
+
export { ChannelStream, newBroadcastChannelStream } from './channel.js';
|
|
11
11
|
export { BroadcastChannelDuplex, BroadcastChannelConn, newBroadcastChannelDuplex, } from './broadcast-channel.js';
|
|
12
12
|
export { MessagePortDuplex, MessagePortConn, newMessagePortDuplex, } from './message-port.js';
|
|
13
13
|
export { buildDecodeMessageTransform, buildEncodeMessageTransform, } from './message.js';
|
package/dist/srpc/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LookupMethod } from './mux.js';
|
|
2
2
|
import { ServerRPC } from './server-rpc.js';
|
|
3
|
-
import { StreamHandler } from './conn.js';
|
|
3
|
+
import type { StreamHandler } from './conn.js';
|
|
4
4
|
import { PacketStream } from './stream.js';
|
|
5
5
|
import { RpcStreamHandler } from '../rpcstream/rpcstream.js';
|
|
6
6
|
export declare class Server implements StreamHandler {
|
package/echo/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { EchoMsg } from './echo.pb.js'
|
|
2
2
|
export {
|
|
3
|
-
Echoer,
|
|
4
3
|
EchoerClient,
|
|
5
4
|
EchoerDefinition,
|
|
6
5
|
EchoerServiceName,
|
|
7
6
|
} from './echo_srpc.pb.js'
|
|
7
|
+
export type { Echoer } from './echo_srpc.pb.js'
|
|
8
8
|
export { EchoerServer } from './server.js'
|
|
9
9
|
export { runClientTest } from './client-test.js'
|
package/go.mod
CHANGED
|
@@ -17,10 +17,10 @@ require (
|
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
require (
|
|
20
|
-
github.com/
|
|
20
|
+
github.com/aperturerobotics/go-websocket v1.8.15-0.20260228104546-35e37959349c // master
|
|
21
21
|
github.com/libp2p/go-yamux/v4 v4.0.2 // latest
|
|
22
22
|
github.com/pkg/errors v0.9.1 // latest
|
|
23
|
-
github.com/sirupsen/logrus v1.9.
|
|
23
|
+
github.com/sirupsen/logrus v1.9.5-0.20260226151524-34027eac4204 // latest
|
|
24
24
|
google.golang.org/protobuf v1.36.11 // latest
|
|
25
25
|
)
|
|
26
26
|
|
package/go.sum
CHANGED
|
@@ -8,6 +8,8 @@ github.com/aperturerobotics/go-protoc-gen-prost v0.0.0-20260204215916-dc1f0fed8c
|
|
|
8
8
|
github.com/aperturerobotics/go-protoc-gen-prost v0.0.0-20260204215916-dc1f0fed8cfc/go.mod h1:OBb/beWmr/pDIZAUfi86j/4tBh2v5ctTxKMqSnh9c/4=
|
|
9
9
|
github.com/aperturerobotics/go-protoc-wasi v0.0.0-20260131050911-b5f94b044584 h1:ER8DYYL71cTg39uZ+Gi699tL/hZoscUWDOw4DbizqhI=
|
|
10
10
|
github.com/aperturerobotics/go-protoc-wasi v0.0.0-20260131050911-b5f94b044584/go.mod h1:vEq8i7EKb32+KXGtIEZjjhNns+BdsL2dUMw4uhy3578=
|
|
11
|
+
github.com/aperturerobotics/go-websocket v1.8.15-0.20260228104546-35e37959349c h1:JATtwVM+rTNr0cwQhr9GtDRdi0EsLmfQ0dIT8SlhGMk=
|
|
12
|
+
github.com/aperturerobotics/go-websocket v1.8.15-0.20260228104546-35e37959349c/go.mod h1:9KnSGuqxSXbdB/Oi0I6vvfPLkclfJwMGAQaDDGVgGow=
|
|
11
13
|
github.com/aperturerobotics/json-iterator-lite v1.0.1-0.20251104042408-0c9eb8a3f726 h1:4B1F0DzuqPzb6WqgCjWaqDD7JU9RDsevQG5OP0DFBgs=
|
|
12
14
|
github.com/aperturerobotics/json-iterator-lite v1.0.1-0.20251104042408-0c9eb8a3f726/go.mod h1:SvGGBv3OVxUyqO0ZxA/nvs6z3cg7NIbZ64TnbV2OISo=
|
|
13
15
|
github.com/aperturerobotics/protobuf v0.0.0-20260203024654-8201686529c4 h1:4Dy3BAHh2kgVdHAqtlwcFsgY0kAwUe2m3rfFcaGwGQg=
|
|
@@ -16,8 +18,6 @@ github.com/aperturerobotics/protobuf-go-lite v0.12.2 h1:ujwTKgpIYAVsv8VljB6PPMY5
|
|
|
16
18
|
github.com/aperturerobotics/protobuf-go-lite v0.12.2/go.mod h1:lGH3s5ArCTXKI4wJdlNpaybUtwSjfAG0vdWjxOfMcF8=
|
|
17
19
|
github.com/aperturerobotics/util v1.32.4 h1:+f4rZuGC0AfgvA6bEwxSiW3Px9awyqr/CB2ltHyX4a8=
|
|
18
20
|
github.com/aperturerobotics/util v1.32.4/go.mod h1:qfRZZUDn0sEfc43JRA6rKP8bwFxliqGqJZX+p1jeOnQ=
|
|
19
|
-
github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g=
|
|
20
|
-
github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
|
|
21
21
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
22
22
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
23
23
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
|
@@ -30,8 +30,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
|
|
30
30
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
|
31
31
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
32
32
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
|
33
|
-
github.com/sirupsen/logrus v1.9.
|
|
34
|
-
github.com/sirupsen/logrus v1.9.
|
|
33
|
+
github.com/sirupsen/logrus v1.9.5-0.20260226151524-34027eac4204 h1:YnveTg6h00DNa0rUaIImUk3icr3BIMedAbJparp1bVM=
|
|
34
|
+
github.com/sirupsen/logrus v1.9.5-0.20260226151524-34027eac4204/go.mod h1:FXZFonkDAnFozmO+5hGAFvB0Yg9/j2SIhA/QuIkP180=
|
|
35
35
|
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
|
36
36
|
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
|
37
37
|
github.com/tetratelabs/wazero v1.11.0 h1:+gKemEuKCTevU4d7ZTzlsvgd1uaToIDtlQlmNbwqYhA=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starpc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "Streaming protobuf RPC service protocol over any two-way channel.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -108,22 +108,22 @@
|
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@eslint/js": "^10.0.0",
|
|
111
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
112
|
-
"@typescript-eslint/parser": "^8.
|
|
111
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
112
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
113
113
|
"depcheck": "^1.4.6",
|
|
114
|
-
"esbuild": "^0.27.
|
|
115
|
-
"eslint": "^10.0.
|
|
114
|
+
"esbuild": "^0.27.3",
|
|
115
|
+
"eslint": "^10.0.2",
|
|
116
116
|
"eslint-config-prettier": "^10.0.0",
|
|
117
117
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
118
118
|
"globals": "^17.0.0",
|
|
119
|
-
"happy-dom": "^20.
|
|
119
|
+
"happy-dom": "^20.7.0",
|
|
120
120
|
"husky": "^9.1.7",
|
|
121
121
|
"lint-staged": "^16.2.7",
|
|
122
122
|
"prettier": "^3.8.1",
|
|
123
|
-
"rimraf": "^6.1.
|
|
123
|
+
"rimraf": "^6.1.3",
|
|
124
124
|
"tsx": "^4.20.4",
|
|
125
125
|
"typescript": "^5.8.2",
|
|
126
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
126
|
+
"@typescript/native-preview": "^7.0.0-dev.20260228.1",
|
|
127
127
|
"vitest": "^4.0.18"
|
|
128
128
|
},
|
|
129
129
|
"dependencies": {
|
package/srpc/common-rpc.ts
CHANGED
|
@@ -178,8 +178,6 @@ export class CommonRPC {
|
|
|
178
178
|
// note: this does nothing if _source is already ended.
|
|
179
179
|
if (err && err.message) {
|
|
180
180
|
await this.writeCallData(undefined, true, err.message)
|
|
181
|
-
} else {
|
|
182
|
-
await this.writeCallCancel()
|
|
183
181
|
}
|
|
184
182
|
this._source.end()
|
|
185
183
|
this._rpcDataSource.end(err)
|
package/srpc/index.ts
CHANGED
|
@@ -7,7 +7,8 @@ export {
|
|
|
7
7
|
} from './errors.js'
|
|
8
8
|
export { Client } from './client.js'
|
|
9
9
|
export { Server } from './server.js'
|
|
10
|
-
export { StreamConn
|
|
10
|
+
export { StreamConn } from './conn.js'
|
|
11
|
+
export type { StreamConnParams, StreamHandler } from './conn.js'
|
|
11
12
|
export { WebSocketConn } from './websocket.js'
|
|
12
13
|
export type {
|
|
13
14
|
PacketHandler,
|
|
@@ -16,29 +17,18 @@ export type {
|
|
|
16
17
|
PacketStream,
|
|
17
18
|
streamToPacketStream,
|
|
18
19
|
} from './stream.js'
|
|
19
|
-
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
StaticHandler,
|
|
24
|
-
createHandler,
|
|
25
|
-
} from './handler.js'
|
|
26
|
-
export { MethodProto, createInvokeFn } from './invoker.js'
|
|
20
|
+
export { StaticHandler, createHandler } from './handler.js'
|
|
21
|
+
export type { Handler, InvokeFn, MethodMap } from './handler.js'
|
|
22
|
+
export { createInvokeFn } from './invoker.js'
|
|
23
|
+
export type { MethodProto } from './invoker.js'
|
|
27
24
|
export { Packet, CallStart, CallData } from './rpcproto.pb.js'
|
|
28
|
-
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
LookupMethod,
|
|
33
|
-
createMux,
|
|
34
|
-
createMultiMux,
|
|
35
|
-
} from './mux.js'
|
|
36
|
-
export {
|
|
25
|
+
export { StaticMux, MultiMux, createMux, createMultiMux } from './mux.js'
|
|
26
|
+
export type { Mux, LookupMethod } from './mux.js'
|
|
27
|
+
export { ChannelStream, newBroadcastChannelStream } from './channel.js'
|
|
28
|
+
export type {
|
|
37
29
|
ChannelStreamMessage,
|
|
38
30
|
ChannelPort,
|
|
39
|
-
ChannelStream,
|
|
40
31
|
ChannelStreamOpts,
|
|
41
|
-
newBroadcastChannelStream,
|
|
42
32
|
} from './channel.js'
|
|
43
33
|
export {
|
|
44
34
|
BroadcastChannelDuplex,
|
|
@@ -51,11 +41,13 @@ export {
|
|
|
51
41
|
newMessagePortDuplex,
|
|
52
42
|
} from './message-port.js'
|
|
53
43
|
export {
|
|
44
|
+
buildDecodeMessageTransform,
|
|
45
|
+
buildEncodeMessageTransform,
|
|
46
|
+
} from './message.js'
|
|
47
|
+
export type {
|
|
54
48
|
MessageStream,
|
|
55
49
|
DecodeMessageTransform,
|
|
56
|
-
buildDecodeMessageTransform,
|
|
57
50
|
EncodeMessageTransform,
|
|
58
|
-
buildEncodeMessageTransform,
|
|
59
51
|
} from './message.js'
|
|
60
52
|
export {
|
|
61
53
|
parseLengthPrefixTransform,
|
|
@@ -80,4 +72,4 @@ export {
|
|
|
80
72
|
messagePushable,
|
|
81
73
|
} from './pushable.js'
|
|
82
74
|
export { Watchdog } from './watchdog.js'
|
|
83
|
-
export { ProtoRpc } from './proto-rpc.js'
|
|
75
|
+
export type { ProtoRpc } from './proto-rpc.js'
|
package/srpc/server-http.go
CHANGED
package/srpc/server.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { pipe } from 'it-pipe'
|
|
|
3
3
|
import { LookupMethod } from './mux.js'
|
|
4
4
|
import { ServerRPC } from './server-rpc.js'
|
|
5
5
|
import { decodePacketSource, encodePacketSource } from './packet.js'
|
|
6
|
-
import { StreamHandler } from './conn.js'
|
|
6
|
+
import type { StreamHandler } from './conn.js'
|
|
7
7
|
import { PacketStream } from './stream.js'
|
|
8
8
|
import { RpcStreamHandler } from '../rpcstream/rpcstream.js'
|
|
9
9
|
|