starpc 0.35.1 → 0.35.3

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.
@@ -1,4 +1,4 @@
1
- import type { MessageType } from '@aptre/protobuf-es-lite';
1
+ import type { MessageType } from "@aptre/protobuf-es-lite";
2
2
  export declare const protobufPackage = "echo";
3
3
  /**
4
4
  * EchoMsg is the message body for Echo.
@@ -1,13 +1,14 @@
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
7
  // EchoMsg contains the message type declaration for EchoMsg.
7
8
  export const EchoMsg = createMessageType({
8
- typeName: 'echo.EchoMsg',
9
+ typeName: "echo.EchoMsg",
9
10
  fields: [
10
- { no: 1, name: 'body', kind: 'scalar', T: ScalarType.STRING },
11
+ { no: 1, name: "body", kind: "scalar", T: ScalarType.STRING },
11
12
  ],
12
13
  packedByDefault: true,
13
14
  });
@@ -1,7 +1,7 @@
1
- import { EchoMsg } from './echo.pb.js';
2
- import { Empty, 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, 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
  *
@@ -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 { Empty, 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,7 +63,7 @@ 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,
@@ -74,12 +74,12 @@ export const EchoerDefinition = {
74
74
  * @generated from rpc echo.Echoer.DoNothing
75
75
  */
76
76
  DoNothing: {
77
- name: 'DoNothing',
77
+ name: "DoNothing",
78
78
  I: Empty,
79
79
  O: Empty,
80
80
  kind: MethodKind.Unary,
81
81
  },
82
- },
82
+ }
83
83
  };
84
84
  export const EchoerServiceName = EchoerDefinition.typeName;
85
85
  export class EchoerClient {
@@ -1,4 +1,4 @@
1
- import type { MessageType } from '@aptre/protobuf-es-lite';
1
+ import type { MessageType } from "@aptre/protobuf-es-lite";
2
2
  export declare const protobufPackage = "rpcstream";
3
3
  /**
4
4
  * RpcStreamInit is the first message in a RPC stream.
@@ -48,7 +48,7 @@ export interface RpcStreamPacket {
48
48
  * @generated from field: rpcstream.RpcStreamInit init = 1;
49
49
  */
50
50
  value: RpcStreamInit;
51
- case: 'init';
51
+ case: "init";
52
52
  } | {
53
53
  /**
54
54
  * Ack is sent in response to Init.
@@ -57,7 +57,7 @@ export interface RpcStreamPacket {
57
57
  * @generated from field: rpcstream.RpcAck ack = 2;
58
58
  */
59
59
  value: RpcAck;
60
- case: 'ack';
60
+ case: "ack";
61
61
  } | {
62
62
  /**
63
63
  * Data is the encapsulated data packet.
@@ -65,7 +65,7 @@ export interface RpcStreamPacket {
65
65
  * @generated from field: bytes data = 3;
66
66
  */
67
67
  value: Uint8Array;
68
- case: 'data';
68
+ case: "data";
69
69
  };
70
70
  }
71
71
  export declare const RpcStreamPacket: MessageType<RpcStreamPacket>;
@@ -1,37 +1,34 @@
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
7
  // RpcStreamInit contains the message type declaration for RpcStreamInit.
7
8
  export const RpcStreamInit = createMessageType({
8
- typeName: 'rpcstream.RpcStreamInit',
9
+ typeName: "rpcstream.RpcStreamInit",
9
10
  fields: [
10
- { no: 1, name: 'component_id', kind: 'scalar', T: ScalarType.STRING },
11
+ { no: 1, name: "component_id", kind: "scalar", T: ScalarType.STRING },
11
12
  ],
12
13
  packedByDefault: true,
13
14
  });
15
+ ;
14
16
  // RpcAck contains the message type declaration for RpcAck.
15
17
  export const RpcAck = createMessageType({
16
- typeName: 'rpcstream.RpcAck',
18
+ typeName: "rpcstream.RpcAck",
17
19
  fields: [
18
- { no: 1, name: 'error', kind: 'scalar', T: ScalarType.STRING },
20
+ { no: 1, name: "error", kind: "scalar", T: ScalarType.STRING },
19
21
  ],
20
22
  packedByDefault: true,
21
23
  });
24
+ ;
22
25
  // RpcStreamPacket contains the message type declaration for RpcStreamPacket.
23
26
  export const RpcStreamPacket = createMessageType({
24
- typeName: 'rpcstream.RpcStreamPacket',
27
+ typeName: "rpcstream.RpcStreamPacket",
25
28
  fields: [
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
+ { no: 1, name: "init", kind: "message", T: () => RpcStreamInit, oneof: "body" },
30
+ { no: 2, name: "ack", kind: "message", T: () => RpcAck, oneof: "body" },
31
+ { no: 3, name: "data", kind: "scalar", T: ScalarType.BYTES, oneof: "body" },
35
32
  ],
36
33
  packedByDefault: true,
37
34
  });
@@ -1,4 +1,4 @@
1
- import type { MessageType } from '@aptre/protobuf-es-lite';
1
+ import type { MessageType } from "@aptre/protobuf-es-lite";
2
2
  export declare const protobufPackage = "srpc";
3
3
  /**
4
4
  * CallStart requests starting a new RPC call.
@@ -89,7 +89,7 @@ export interface Packet {
89
89
  * @generated from field: srpc.CallStart call_start = 1;
90
90
  */
91
91
  value: CallStart;
92
- case: 'callStart';
92
+ case: "callStart";
93
93
  } | {
94
94
  /**
95
95
  * CallData is a message in a streaming RPC sequence.
@@ -97,7 +97,7 @@ export interface Packet {
97
97
  * @generated from field: srpc.CallData call_data = 2;
98
98
  */
99
99
  value: CallData;
100
- case: 'callData';
100
+ case: "callData";
101
101
  } | {
102
102
  /**
103
103
  * CallCancel cancels the call.
@@ -105,7 +105,7 @@ export interface Packet {
105
105
  * @generated from field: bool call_cancel = 3;
106
106
  */
107
107
  value: boolean;
108
- case: 'callCancel';
108
+ case: "callCancel";
109
109
  };
110
110
  }
111
111
  export declare const Packet: MessageType<Packet>;
@@ -1,55 +1,40 @@
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
7
  // CallStart contains the message type declaration for CallStart.
7
8
  export const CallStart = createMessageType({
8
- typeName: 'srpc.CallStart',
9
+ typeName: "srpc.CallStart",
9
10
  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 },
11
+ { no: 1, name: "rpc_service", kind: "scalar", T: ScalarType.STRING },
12
+ { no: 2, name: "rpc_method", kind: "scalar", T: ScalarType.STRING },
13
+ { no: 3, name: "data", kind: "scalar", T: ScalarType.BYTES },
14
+ { no: 4, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
14
15
  ],
15
16
  packedByDefault: true,
16
17
  });
18
+ ;
17
19
  // CallData contains the message type declaration for CallData.
18
20
  export const CallData = createMessageType({
19
- typeName: 'srpc.CallData',
21
+ typeName: "srpc.CallData",
20
22
  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 },
23
+ { no: 1, name: "data", kind: "scalar", T: ScalarType.BYTES },
24
+ { no: 2, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
25
+ { no: 3, name: "complete", kind: "scalar", T: ScalarType.BOOL },
26
+ { no: 4, name: "error", kind: "scalar", T: ScalarType.STRING },
25
27
  ],
26
28
  packedByDefault: true,
27
29
  });
30
+ ;
28
31
  // Packet contains the message type declaration for Packet.
29
32
  export const Packet = createMessageType({
30
- typeName: 'srpc.Packet',
33
+ typeName: "srpc.Packet",
31
34
  fields: [
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
+ { no: 1, name: "call_start", kind: "message", T: () => CallStart, oneof: "body" },
36
+ { no: 2, name: "call_data", kind: "message", T: () => CallData, oneof: "body" },
37
+ { no: 3, name: "call_cancel", kind: "scalar", T: ScalarType.BOOL, oneof: "body" },
53
38
  ],
54
39
  packedByDefault: true,
55
40
  });
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.7.0
2
+ // protoc-gen-go-lite version: v0.8.0
3
3
  // source: github.com/aperturerobotics/starpc/echo/echo.proto
4
4
 
5
5
  package echo
package/echo/echo.pb.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  // @generated from file github.com/aperturerobotics/starpc/echo/echo.proto (package echo, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
- import type { MessageType, PartialFieldInfo } from '@aptre/protobuf-es-lite'
6
- import { createMessageType, ScalarType } from '@aptre/protobuf-es-lite'
5
+ import type { MessageType, PartialFieldInfo } from "@aptre/protobuf-es-lite";
6
+ import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
7
7
 
8
- export const protobufPackage = 'echo'
8
+ export const protobufPackage = "echo";
9
9
 
10
10
  /**
11
11
  * EchoMsg is the message body for Echo.
@@ -16,14 +16,16 @@ export interface EchoMsg {
16
16
  /**
17
17
  * @generated from field: string body = 1;
18
18
  */
19
- body?: string
20
- }
19
+ body?: string;
20
+
21
+ };
21
22
 
22
23
  // EchoMsg contains the message type declaration for EchoMsg.
23
24
  export const EchoMsg: MessageType<EchoMsg> = createMessageType({
24
- typeName: 'echo.EchoMsg',
25
- fields: [
26
- { no: 1, name: 'body', kind: 'scalar', T: ScalarType.STRING },
27
- ] as readonly PartialFieldInfo[],
28
- packedByDefault: true,
29
- })
25
+ typeName: "echo.EchoMsg",
26
+ fields: [
27
+ { no: 1, name: "body", kind: "scalar", T: ScalarType.STRING },
28
+ ] as readonly PartialFieldInfo[],
29
+ packedByDefault: true,
30
+ });
31
+
@@ -2,15 +2,10 @@
2
2
  // @generated from file github.com/aperturerobotics/starpc/echo/echo.proto (package echo, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
- import { EchoMsg } from './echo.pb.js'
6
- import { Empty, MethodKind } from '@aptre/protobuf-es-lite'
7
- import { RpcStreamPacket } from '../rpcstream/rpcstream.pb.js'
8
- import {
9
- buildDecodeMessageTransform,
10
- buildEncodeMessageTransform,
11
- MessageStream,
12
- ProtoRpc,
13
- } from 'starpc'
5
+ import { EchoMsg } from "./echo.pb.js";
6
+ import { Empty, MethodKind } from "@aptre/protobuf-es-lite";
7
+ import { RpcStreamPacket } from "../rpcstream/rpcstream.pb.js";
8
+ import { buildDecodeMessageTransform, buildEncodeMessageTransform, MessageStream, ProtoRpc } from "starpc";
14
9
 
15
10
  /**
16
11
  * Echoer service returns the given message.
@@ -18,7 +13,7 @@ import {
18
13
  * @generated from service echo.Echoer
19
14
  */
20
15
  export const EchoerDefinition = {
21
- typeName: 'echo.Echoer',
16
+ typeName: "echo.Echoer",
22
17
  methods: {
23
18
  /**
24
19
  * Echo returns the given message.
@@ -26,7 +21,7 @@ export const EchoerDefinition = {
26
21
  * @generated from rpc echo.Echoer.Echo
27
22
  */
28
23
  Echo: {
29
- name: 'Echo',
24
+ name: "Echo",
30
25
  I: EchoMsg,
31
26
  O: EchoMsg,
32
27
  kind: MethodKind.Unary,
@@ -37,7 +32,7 @@ export const EchoerDefinition = {
37
32
  * @generated from rpc echo.Echoer.EchoServerStream
38
33
  */
39
34
  EchoServerStream: {
40
- name: 'EchoServerStream',
35
+ name: "EchoServerStream",
41
36
  I: EchoMsg,
42
37
  O: EchoMsg,
43
38
  kind: MethodKind.ServerStreaming,
@@ -48,7 +43,7 @@ export const EchoerDefinition = {
48
43
  * @generated from rpc echo.Echoer.EchoClientStream
49
44
  */
50
45
  EchoClientStream: {
51
- name: 'EchoClientStream',
46
+ name: "EchoClientStream",
52
47
  I: EchoMsg,
53
48
  O: EchoMsg,
54
49
  kind: MethodKind.ClientStreaming,
@@ -59,7 +54,7 @@ export const EchoerDefinition = {
59
54
  * @generated from rpc echo.Echoer.EchoBidiStream
60
55
  */
61
56
  EchoBidiStream: {
62
- name: 'EchoBidiStream',
57
+ name: "EchoBidiStream",
63
58
  I: EchoMsg,
64
59
  O: EchoMsg,
65
60
  kind: MethodKind.BiDiStreaming,
@@ -70,7 +65,7 @@ export const EchoerDefinition = {
70
65
  * @generated from rpc echo.Echoer.RpcStream
71
66
  */
72
67
  RpcStream: {
73
- name: 'RpcStream',
68
+ name: "RpcStream",
74
69
  I: RpcStreamPacket,
75
70
  O: RpcStreamPacket,
76
71
  kind: MethodKind.BiDiStreaming,
@@ -81,13 +76,13 @@ export const EchoerDefinition = {
81
76
  * @generated from rpc echo.Echoer.DoNothing
82
77
  */
83
78
  DoNothing: {
84
- name: 'DoNothing',
79
+ name: "DoNothing",
85
80
  I: Empty,
86
81
  O: Empty,
87
82
  kind: MethodKind.Unary,
88
83
  },
89
- },
90
- } as const
84
+ }
85
+ } as const;
91
86
 
92
87
  /**
93
88
  * Echoer service returns the given message.
@@ -100,7 +95,10 @@ export interface Echoer {
100
95
  *
101
96
  * @generated from rpc echo.Echoer.Echo
102
97
  */
103
- Echo(request: EchoMsg, abortSignal?: AbortSignal): Promise<EchoMsg>
98
+ Echo(
99
+ request: EchoMsg, abortSignal?: AbortSignal
100
+ ):
101
+ Promise<EchoMsg>
104
102
 
105
103
  /**
106
104
  * EchoServerStream is an example of a server -> client one-way stream.
@@ -108,9 +106,9 @@ export interface Echoer {
108
106
  * @generated from rpc echo.Echoer.EchoServerStream
109
107
  */
110
108
  EchoServerStream(
111
- request: EchoMsg,
112
- abortSignal?: AbortSignal,
113
- ): MessageStream<EchoMsg>
109
+ request: EchoMsg, abortSignal?: AbortSignal
110
+ ):
111
+ MessageStream<EchoMsg>
114
112
 
115
113
  /**
116
114
  * EchoClientStream is an example of client->server one-way stream.
@@ -118,9 +116,9 @@ export interface Echoer {
118
116
  * @generated from rpc echo.Echoer.EchoClientStream
119
117
  */
120
118
  EchoClientStream(
121
- request: MessageStream<EchoMsg>,
122
- abortSignal?: AbortSignal,
123
- ): Promise<EchoMsg>
119
+ request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
120
+ ):
121
+ Promise<EchoMsg>
124
122
 
125
123
  /**
126
124
  * EchoBidiStream is an example of a two-way stream.
@@ -128,9 +126,9 @@ export interface Echoer {
128
126
  * @generated from rpc echo.Echoer.EchoBidiStream
129
127
  */
130
128
  EchoBidiStream(
131
- request: MessageStream<EchoMsg>,
132
- abortSignal?: AbortSignal,
133
- ): MessageStream<EchoMsg>
129
+ request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
130
+ ):
131
+ MessageStream<EchoMsg>
134
132
 
135
133
  /**
136
134
  * RpcStream opens a nested rpc call stream.
@@ -138,16 +136,20 @@ export interface Echoer {
138
136
  * @generated from rpc echo.Echoer.RpcStream
139
137
  */
140
138
  RpcStream(
141
- request: MessageStream<RpcStreamPacket>,
142
- abortSignal?: AbortSignal,
143
- ): MessageStream<RpcStreamPacket>
139
+ request: MessageStream<RpcStreamPacket>, abortSignal?: AbortSignal
140
+ ):
141
+ MessageStream<RpcStreamPacket>
144
142
 
145
143
  /**
146
144
  * DoNothing does nothing.
147
145
  *
148
146
  * @generated from rpc echo.Echoer.DoNothing
149
147
  */
150
- DoNothing(request: Empty, abortSignal?: AbortSignal): Promise<Empty>
148
+ DoNothing(
149
+ request: Empty, abortSignal?: AbortSignal
150
+ ):
151
+ Promise<Empty>
152
+
151
153
  }
152
154
 
153
155
  export const EchoerServiceName = EchoerDefinition.typeName
@@ -170,7 +172,10 @@ export class EchoerClient implements Echoer {
170
172
  *
171
173
  * @generated from rpc echo.Echoer.Echo
172
174
  */
173
- async Echo(request: EchoMsg, abortSignal?: AbortSignal): Promise<EchoMsg> {
175
+ async Echo(
176
+ request: EchoMsg, abortSignal?: AbortSignal
177
+ ):
178
+ Promise<EchoMsg> {
174
179
  const requestMsg = EchoMsg.create(request)
175
180
  const result = await this.rpc.request(
176
181
  this.service,
@@ -187,9 +192,9 @@ export class EchoerClient implements Echoer {
187
192
  * @generated from rpc echo.Echoer.EchoServerStream
188
193
  */
189
194
  EchoServerStream(
190
- request: EchoMsg,
191
- abortSignal?: AbortSignal,
192
- ): MessageStream<EchoMsg> {
195
+ request: EchoMsg, abortSignal?: AbortSignal
196
+ ):
197
+ MessageStream<EchoMsg> {
193
198
  const requestMsg = EchoMsg.create(request)
194
199
  const result = this.rpc.serverStreamingRequest(
195
200
  this.service,
@@ -206,9 +211,9 @@ export class EchoerClient implements Echoer {
206
211
  * @generated from rpc echo.Echoer.EchoClientStream
207
212
  */
208
213
  async EchoClientStream(
209
- request: MessageStream<EchoMsg>,
210
- abortSignal?: AbortSignal,
211
- ): Promise<EchoMsg> {
214
+ request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
215
+ ):
216
+ Promise<EchoMsg> {
212
217
  const result = await this.rpc.clientStreamingRequest(
213
218
  this.service,
214
219
  EchoerDefinition.methods.EchoClientStream.name,
@@ -224,9 +229,9 @@ export class EchoerClient implements Echoer {
224
229
  * @generated from rpc echo.Echoer.EchoBidiStream
225
230
  */
226
231
  EchoBidiStream(
227
- request: MessageStream<EchoMsg>,
228
- abortSignal?: AbortSignal,
229
- ): MessageStream<EchoMsg> {
232
+ request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
233
+ ):
234
+ MessageStream<EchoMsg> {
230
235
  const result = this.rpc.bidirectionalStreamingRequest(
231
236
  this.service,
232
237
  EchoerDefinition.methods.EchoBidiStream.name,
@@ -242,9 +247,9 @@ export class EchoerClient implements Echoer {
242
247
  * @generated from rpc echo.Echoer.RpcStream
243
248
  */
244
249
  RpcStream(
245
- request: MessageStream<RpcStreamPacket>,
246
- abortSignal?: AbortSignal,
247
- ): MessageStream<RpcStreamPacket> {
250
+ request: MessageStream<RpcStreamPacket>, abortSignal?: AbortSignal
251
+ ):
252
+ MessageStream<RpcStreamPacket> {
248
253
  const result = this.rpc.bidirectionalStreamingRequest(
249
254
  this.service,
250
255
  EchoerDefinition.methods.RpcStream.name,
@@ -259,7 +264,10 @@ export class EchoerClient implements Echoer {
259
264
  *
260
265
  * @generated from rpc echo.Echoer.DoNothing
261
266
  */
262
- async DoNothing(request: Empty, abortSignal?: AbortSignal): Promise<Empty> {
267
+ async DoNothing(
268
+ request: Empty, abortSignal?: AbortSignal
269
+ ):
270
+ Promise<Empty> {
263
271
  const requestMsg = Empty.create(request)
264
272
  const result = await this.rpc.request(
265
273
  this.service,
@@ -269,4 +277,5 @@ export class EchoerClient implements Echoer {
269
277
  )
270
278
  return Empty.fromBinary(result)
271
279
  }
280
+
272
281
  }
package/go.mod CHANGED
@@ -2,7 +2,7 @@ module github.com/aperturerobotics/starpc
2
2
 
3
3
  go 1.23
4
4
 
5
- toolchain go1.23.2
5
+ toolchain go1.23.3
6
6
 
7
7
  replace (
8
8
  // This fork uses go-protobuf-lite and adds post-quantum crypto support.
@@ -13,13 +13,13 @@ replace (
13
13
  )
14
14
 
15
15
  require (
16
- github.com/aperturerobotics/protobuf-go-lite v0.7.0 // latest
17
- github.com/aperturerobotics/util v1.26.0 // latest
16
+ github.com/aperturerobotics/protobuf-go-lite v0.8.0 // latest
17
+ github.com/aperturerobotics/util v1.26.2 // latest
18
18
  )
19
19
 
20
20
  require (
21
21
  github.com/coder/websocket v1.8.12 // latest
22
- github.com/libp2p/go-libp2p v0.36.5 // latest
22
+ github.com/libp2p/go-libp2p v0.37.0 // latest
23
23
  github.com/libp2p/go-yamux/v4 v4.0.2-0.20240826150533-e92055b23e0e // master
24
24
  github.com/pkg/errors v0.9.1 // latest
25
25
  github.com/sirupsen/logrus v1.9.3 // latest
package/go.sum CHANGED
@@ -2,10 +2,10 @@ github.com/aperturerobotics/go-libp2p v0.36.3-0.20241002070357-a2e1c3498dd3 h1:c
2
2
  github.com/aperturerobotics/go-libp2p v0.36.3-0.20241002070357-a2e1c3498dd3/go.mod h1:Ii9kaz5Tye5LRRIoQdBUcgtjC7nCrqgvDAdoy2Bdpfc=
3
3
  github.com/aperturerobotics/json-iterator-lite v1.0.0 h1:cihbrYWoK/S2RYXhJLpDZd+GUjVvFJN+D3w1VOqqHRI=
4
4
  github.com/aperturerobotics/json-iterator-lite v1.0.0/go.mod h1:snaApCEDtrHHP6UWSLKiYNOZU9A5NyzccKenx9oZEzg=
5
- github.com/aperturerobotics/protobuf-go-lite v0.7.0 h1:dDoOzD0kxx8fshgqyWrJdhZHfeTLAWvMfH6lU458eZg=
6
- github.com/aperturerobotics/protobuf-go-lite v0.7.0/go.mod h1:MSCkd3x0MtN1WbG5abldAa55AVKHJlOgbZGPDcBauLM=
7
- github.com/aperturerobotics/util v1.26.0 h1:L8gtGwD5kI58cnRBT4yX5U0sOMa0tDIQ+n9jWo8N4ZY=
8
- github.com/aperturerobotics/util v1.26.0/go.mod h1:fARgYzKXU+H4cVsn/NxhWugPtZFvAPqZg2Vng7Lf5aw=
5
+ github.com/aperturerobotics/protobuf-go-lite v0.8.0 h1:SoiTAVArmOrNTX31e6CC5Bem6HuOElg3YYNhp4AAPQc=
6
+ github.com/aperturerobotics/protobuf-go-lite v0.8.0/go.mod h1:y49wVEezRHg78uQ2OzLLZbtTTWuox+ChmaTuh6FLJW8=
7
+ github.com/aperturerobotics/util v1.26.2 h1:PrBgJ3ydAwSD59o7s5zRfL+mbphIC6xo2Inor7/K+ok=
8
+ github.com/aperturerobotics/util v1.26.2/go.mod h1:jp9+cf8cTlX5Jf0F9RlXmKtEw0yXC6gU92V9lXoZ74M=
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/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo=
package/mock/mock.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.7.0
2
+ // protoc-gen-go-lite version: v0.8.0
3
3
  // source: github.com/aperturerobotics/starpc/mock/mock.proto
4
4
 
5
5
  package e2e_mock
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.35.1",
3
+ "version": "0.35.3",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,5 +1,5 @@
1
1
  // Code generated by protoc-gen-go-lite. DO NOT EDIT.
2
- // protoc-gen-go-lite version: v0.7.0
2
+ // protoc-gen-go-lite version: v0.8.0
3
3
  // source: github.com/aperturerobotics/starpc/srpc/rpcproto.proto
4
4
 
5
5
  package srpc
@@ -2,10 +2,10 @@
2
2
  // @generated from file github.com/aperturerobotics/starpc/srpc/rpcproto.proto (package srpc, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
- import type { MessageType, PartialFieldInfo } from '@aptre/protobuf-es-lite'
6
- import { createMessageType, ScalarType } from '@aptre/protobuf-es-lite'
5
+ import type { MessageType, PartialFieldInfo } from "@aptre/protobuf-es-lite";
6
+ import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
7
7
 
8
- export const protobufPackage = 'srpc'
8
+ export const protobufPackage = "srpc";
9
9
 
10
10
  /**
11
11
  * CallStart requests starting a new RPC call.
@@ -19,40 +19,41 @@ export interface CallStart {
19
19
  *
20
20
  * @generated from field: string rpc_service = 1;
21
21
  */
22
- rpcService?: string
22
+ rpcService?: string;
23
23
  /**
24
24
  * RpcMethod is the RPC method to call.
25
25
  * Must be set.
26
26
  *
27
27
  * @generated from field: string rpc_method = 2;
28
28
  */
29
- rpcMethod?: string
29
+ rpcMethod?: string;
30
30
  /**
31
31
  * Data contains the request or the first message in the stream.
32
32
  * Optional if streaming.
33
33
  *
34
34
  * @generated from field: bytes data = 3;
35
35
  */
36
- data?: Uint8Array
36
+ data?: Uint8Array;
37
37
  /**
38
38
  * DataIsZero indicates Data is set with an empty message.
39
39
  *
40
40
  * @generated from field: bool data_is_zero = 4;
41
41
  */
42
- dataIsZero?: boolean
43
- }
42
+ dataIsZero?: boolean;
43
+
44
+ };
44
45
 
45
46
  // CallStart contains the message type declaration for CallStart.
46
47
  export const CallStart: MessageType<CallStart> = createMessageType({
47
- typeName: 'srpc.CallStart',
48
- fields: [
49
- { no: 1, name: 'rpc_service', kind: 'scalar', T: ScalarType.STRING },
50
- { no: 2, name: 'rpc_method', kind: 'scalar', T: ScalarType.STRING },
51
- { no: 3, name: 'data', kind: 'scalar', T: ScalarType.BYTES },
52
- { no: 4, name: 'data_is_zero', kind: 'scalar', T: ScalarType.BOOL },
53
- ] as readonly PartialFieldInfo[],
54
- packedByDefault: true,
55
- })
48
+ typeName: "srpc.CallStart",
49
+ fields: [
50
+ { no: 1, name: "rpc_service", kind: "scalar", T: ScalarType.STRING },
51
+ { no: 2, name: "rpc_method", kind: "scalar", T: ScalarType.STRING },
52
+ { no: 3, name: "data", kind: "scalar", T: ScalarType.BYTES },
53
+ { no: 4, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
54
+ ] as readonly PartialFieldInfo[],
55
+ packedByDefault: true,
56
+ });
56
57
 
57
58
  /**
58
59
  * CallData contains a message in a streaming RPC sequence.
@@ -65,39 +66,40 @@ export interface CallData {
65
66
  *
66
67
  * @generated from field: bytes data = 1;
67
68
  */
68
- data?: Uint8Array
69
+ data?: Uint8Array;
69
70
  /**
70
71
  * DataIsZero indicates Data is set with an empty message.
71
72
  *
72
73
  * @generated from field: bool data_is_zero = 2;
73
74
  */
74
- dataIsZero?: boolean
75
+ dataIsZero?: boolean;
75
76
  /**
76
77
  * Complete indicates the RPC call is completed.
77
78
  *
78
79
  * @generated from field: bool complete = 3;
79
80
  */
80
- complete?: boolean
81
+ complete?: boolean;
81
82
  /**
82
83
  * Error contains any error that caused the RPC to fail.
83
84
  * If set, implies complete=true.
84
85
  *
85
86
  * @generated from field: string error = 4;
86
87
  */
87
- error?: string
88
- }
88
+ error?: string;
89
+
90
+ };
89
91
 
90
92
  // CallData contains the message type declaration for CallData.
91
93
  export const CallData: MessageType<CallData> = createMessageType({
92
- typeName: 'srpc.CallData',
93
- fields: [
94
- { no: 1, name: 'data', kind: 'scalar', T: ScalarType.BYTES },
95
- { no: 2, name: 'data_is_zero', kind: 'scalar', T: ScalarType.BOOL },
96
- { no: 3, name: 'complete', kind: 'scalar', T: ScalarType.BOOL },
97
- { no: 4, name: 'error', kind: 'scalar', T: ScalarType.STRING },
98
- ] as readonly PartialFieldInfo[],
99
- packedByDefault: true,
100
- })
94
+ typeName: "srpc.CallData",
95
+ fields: [
96
+ { no: 1, name: "data", kind: "scalar", T: ScalarType.BYTES },
97
+ { no: 2, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
98
+ { no: 3, name: "complete", kind: "scalar", T: ScalarType.BOOL },
99
+ { no: 4, name: "error", kind: "scalar", T: ScalarType.STRING },
100
+ ] as readonly PartialFieldInfo[],
101
+ packedByDefault: true,
102
+ });
101
103
 
102
104
  /**
103
105
  * Packet is a message sent over a srpc packet connection.
@@ -105,70 +107,51 @@ export const CallData: MessageType<CallData> = createMessageType({
105
107
  * @generated from message srpc.Packet
106
108
  */
107
109
  export interface Packet {
110
+
108
111
  /**
109
112
  * Body is the packet body.
110
113
  *
111
114
  * @generated from oneof srpc.Packet.body
112
115
  */
113
- body?:
114
- | {
115
- value?: undefined
116
- case: undefined
117
- }
118
- | {
119
- /**
120
- * CallStart initiates a new call.
121
- *
122
- * @generated from field: srpc.CallStart call_start = 1;
123
- */
124
- value: CallStart
125
- case: 'callStart'
126
- }
127
- | {
128
- /**
129
- * CallData is a message in a streaming RPC sequence.
130
- *
131
- * @generated from field: srpc.CallData call_data = 2;
132
- */
133
- value: CallData
134
- case: 'callData'
135
- }
136
- | {
137
- /**
138
- * CallCancel cancels the call.
139
- *
140
- * @generated from field: bool call_cancel = 3;
141
- */
142
- value: boolean
143
- case: 'callCancel'
144
- }
145
- }
116
+ body?: {
117
+ value?: undefined,
118
+ case: undefined
119
+ } | {
120
+ /**
121
+ * CallStart initiates a new call.
122
+ *
123
+ * @generated from field: srpc.CallStart call_start = 1;
124
+ */
125
+ value: CallStart;
126
+ case: "callStart";
127
+ } | {
128
+ /**
129
+ * CallData is a message in a streaming RPC sequence.
130
+ *
131
+ * @generated from field: srpc.CallData call_data = 2;
132
+ */
133
+ value: CallData;
134
+ case: "callData";
135
+ } | {
136
+ /**
137
+ * CallCancel cancels the call.
138
+ *
139
+ * @generated from field: bool call_cancel = 3;
140
+ */
141
+ value: boolean;
142
+ case: "callCancel";
143
+ };
144
+
145
+ };
146
146
 
147
147
  // Packet contains the message type declaration for Packet.
148
148
  export const Packet: MessageType<Packet> = createMessageType({
149
- typeName: 'srpc.Packet',
150
- fields: [
151
- {
152
- no: 1,
153
- name: 'call_start',
154
- kind: 'message',
155
- T: () => CallStart,
156
- oneof: 'body',
157
- },
158
- {
159
- no: 2,
160
- name: 'call_data',
161
- kind: 'message',
162
- T: () => CallData,
163
- oneof: 'body',
164
- },
165
- {
166
- no: 3,
167
- name: 'call_cancel',
168
- kind: 'scalar',
169
- T: ScalarType.BOOL,
170
- oneof: 'body',
171
- },
172
- ] as readonly PartialFieldInfo[],
173
- packedByDefault: true,
174
- })
149
+ typeName: "srpc.Packet",
150
+ fields: [
151
+ { no: 1, name: "call_start", kind: "message", T: () => CallStart, oneof: "body" },
152
+ { no: 2, name: "call_data", kind: "message", T: () => CallData, oneof: "body" },
153
+ { no: 3, name: "call_cancel", kind: "scalar", T: ScalarType.BOOL, oneof: "body" },
154
+ ] as readonly PartialFieldInfo[],
155
+ packedByDefault: true,
156
+ });
157
+