starpc 0.16.0 → 0.17.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/e2e/mock/mock.pb.d.ts +21 -6
- package/dist/e2e/mock/mock.pb.js +3 -0
- package/dist/echo/echo.pb.d.ts +185 -32
- package/dist/echo/echo.pb.js +3 -0
- package/dist/rpcstream/rpcstream.pb.d.ts +70 -6
- package/dist/rpcstream/rpcstream.pb.js +16 -7
- package/dist/srpc/index.d.ts +1 -0
- package/dist/srpc/index.js +1 -0
- package/dist/srpc/message.d.ts +2 -3
- package/dist/srpc/packet.d.ts +2 -2
- package/dist/srpc/rpcproto.pb.d.ts +106 -6
- package/dist/srpc/rpcproto.pb.js +16 -7
- package/e2e/mock/mock.pb.ts +4 -0
- package/e2e/mock/mock_srpc.pb.go +1 -9
- package/echo/echo.pb.ts +4 -0
- package/echo/echo_srpc.pb.go +33 -21
- package/echo/server.go +2 -6
- package/go.mod +7 -7
- package/go.sum +14 -14
- package/package.json +19 -19
- package/srpc/client-set.go +2 -1
- package/srpc/index.ts +7 -0
- package/srpc/invoker.go +1 -1
- package/srpc/message.ts +2 -2
- package/srpc/rpcproto.pb.ts +19 -7
|
@@ -12,11 +12,16 @@ export declare const MockMsg: {
|
|
|
12
12
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<MockMsg>;
|
|
13
13
|
fromJSON(object: any): MockMsg;
|
|
14
14
|
toJSON(message: MockMsg): unknown;
|
|
15
|
-
|
|
15
|
+
create<I extends {
|
|
16
16
|
body?: string | undefined;
|
|
17
17
|
} & {
|
|
18
18
|
body?: string | undefined;
|
|
19
|
-
} & { [K in Exclude<keyof I, "body">]: never; }>(
|
|
19
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): MockMsg;
|
|
20
|
+
fromPartial<I_1 extends {
|
|
21
|
+
body?: string | undefined;
|
|
22
|
+
} & {
|
|
23
|
+
body?: string | undefined;
|
|
24
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): MockMsg;
|
|
20
25
|
};
|
|
21
26
|
/** Mock service mocks some RPCs for the e2e tests. */
|
|
22
27
|
export interface Mock {
|
|
@@ -47,11 +52,16 @@ export declare const MockDefinition: {
|
|
|
47
52
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<MockMsg>;
|
|
48
53
|
fromJSON(object: any): MockMsg;
|
|
49
54
|
toJSON(message: MockMsg): unknown;
|
|
50
|
-
|
|
55
|
+
create<I extends {
|
|
51
56
|
body?: string | undefined;
|
|
52
57
|
} & {
|
|
53
58
|
body?: string | undefined;
|
|
54
|
-
} & { [K in Exclude<keyof I, "body">]: never; }>(
|
|
59
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): MockMsg;
|
|
60
|
+
fromPartial<I_1 extends {
|
|
61
|
+
body?: string | undefined;
|
|
62
|
+
} & {
|
|
63
|
+
body?: string | undefined;
|
|
64
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): MockMsg;
|
|
55
65
|
};
|
|
56
66
|
readonly requestStream: false;
|
|
57
67
|
readonly responseType: {
|
|
@@ -61,11 +71,16 @@ export declare const MockDefinition: {
|
|
|
61
71
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<MockMsg>;
|
|
62
72
|
fromJSON(object: any): MockMsg;
|
|
63
73
|
toJSON(message: MockMsg): unknown;
|
|
64
|
-
|
|
74
|
+
create<I extends {
|
|
75
|
+
body?: string | undefined;
|
|
76
|
+
} & {
|
|
77
|
+
body?: string | undefined;
|
|
78
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): MockMsg;
|
|
79
|
+
fromPartial<I_1 extends {
|
|
65
80
|
body?: string | undefined;
|
|
66
81
|
} & {
|
|
67
82
|
body?: string | undefined;
|
|
68
|
-
} & { [
|
|
83
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): MockMsg;
|
|
69
84
|
};
|
|
70
85
|
readonly responseStream: false;
|
|
71
86
|
readonly options: {};
|
package/dist/e2e/mock/mock.pb.js
CHANGED
|
@@ -65,6 +65,9 @@ export const MockMsg = {
|
|
|
65
65
|
message.body !== undefined && (obj.body = message.body);
|
|
66
66
|
return obj;
|
|
67
67
|
},
|
|
68
|
+
create(base) {
|
|
69
|
+
return MockMsg.fromPartial(base ?? {});
|
|
70
|
+
},
|
|
68
71
|
fromPartial(object) {
|
|
69
72
|
const message = createBaseMockMsg();
|
|
70
73
|
message.body = object.body ?? '';
|
package/dist/echo/echo.pb.d.ts
CHANGED
|
@@ -13,11 +13,16 @@ export declare const EchoMsg: {
|
|
|
13
13
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
14
14
|
fromJSON(object: any): EchoMsg;
|
|
15
15
|
toJSON(message: EchoMsg): unknown;
|
|
16
|
-
|
|
16
|
+
create<I extends {
|
|
17
17
|
body?: string | undefined;
|
|
18
18
|
} & {
|
|
19
19
|
body?: string | undefined;
|
|
20
|
-
} & { [K in Exclude<keyof I, "body">]: never; }>(
|
|
20
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
21
|
+
fromPartial<I_1 extends {
|
|
22
|
+
body?: string | undefined;
|
|
23
|
+
} & {
|
|
24
|
+
body?: string | undefined;
|
|
25
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
21
26
|
};
|
|
22
27
|
/** Echoer service returns the given message. */
|
|
23
28
|
export interface Echoer {
|
|
@@ -60,11 +65,16 @@ export declare const EchoerDefinition: {
|
|
|
60
65
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
61
66
|
fromJSON(object: any): EchoMsg;
|
|
62
67
|
toJSON(message: EchoMsg): unknown;
|
|
63
|
-
|
|
68
|
+
create<I extends {
|
|
64
69
|
body?: string | undefined;
|
|
65
70
|
} & {
|
|
66
71
|
body?: string | undefined;
|
|
67
|
-
} & { [K in Exclude<keyof I, "body">]: never; }>(
|
|
72
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
73
|
+
fromPartial<I_1 extends {
|
|
74
|
+
body?: string | undefined;
|
|
75
|
+
} & {
|
|
76
|
+
body?: string | undefined;
|
|
77
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
68
78
|
};
|
|
69
79
|
readonly requestStream: false;
|
|
70
80
|
readonly responseType: {
|
|
@@ -74,11 +84,16 @@ export declare const EchoerDefinition: {
|
|
|
74
84
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
75
85
|
fromJSON(object: any): EchoMsg;
|
|
76
86
|
toJSON(message: EchoMsg): unknown;
|
|
77
|
-
|
|
87
|
+
create<I extends {
|
|
78
88
|
body?: string | undefined;
|
|
79
89
|
} & {
|
|
80
90
|
body?: string | undefined;
|
|
81
|
-
} & { [K in Exclude<keyof I, "body">]: never; }>(
|
|
91
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
92
|
+
fromPartial<I_1 extends {
|
|
93
|
+
body?: string | undefined;
|
|
94
|
+
} & {
|
|
95
|
+
body?: string | undefined;
|
|
96
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
82
97
|
};
|
|
83
98
|
readonly responseStream: false;
|
|
84
99
|
readonly options: {};
|
|
@@ -93,11 +108,16 @@ export declare const EchoerDefinition: {
|
|
|
93
108
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
94
109
|
fromJSON(object: any): EchoMsg;
|
|
95
110
|
toJSON(message: EchoMsg): unknown;
|
|
96
|
-
|
|
111
|
+
create<I extends {
|
|
112
|
+
body?: string | undefined;
|
|
113
|
+
} & {
|
|
114
|
+
body?: string | undefined;
|
|
115
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
116
|
+
fromPartial<I_1 extends {
|
|
97
117
|
body?: string | undefined;
|
|
98
118
|
} & {
|
|
99
119
|
body?: string | undefined;
|
|
100
|
-
} & { [
|
|
120
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
101
121
|
};
|
|
102
122
|
readonly requestStream: false;
|
|
103
123
|
readonly responseType: {
|
|
@@ -107,11 +127,16 @@ export declare const EchoerDefinition: {
|
|
|
107
127
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
108
128
|
fromJSON(object: any): EchoMsg;
|
|
109
129
|
toJSON(message: EchoMsg): unknown;
|
|
110
|
-
|
|
130
|
+
create<I extends {
|
|
111
131
|
body?: string | undefined;
|
|
112
132
|
} & {
|
|
113
133
|
body?: string | undefined;
|
|
114
|
-
} & { [K in Exclude<keyof I, "body">]: never; }>(
|
|
134
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
135
|
+
fromPartial<I_1 extends {
|
|
136
|
+
body?: string | undefined;
|
|
137
|
+
} & {
|
|
138
|
+
body?: string | undefined;
|
|
139
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
115
140
|
};
|
|
116
141
|
readonly responseStream: true;
|
|
117
142
|
readonly options: {};
|
|
@@ -126,11 +151,16 @@ export declare const EchoerDefinition: {
|
|
|
126
151
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
127
152
|
fromJSON(object: any): EchoMsg;
|
|
128
153
|
toJSON(message: EchoMsg): unknown;
|
|
129
|
-
|
|
154
|
+
create<I extends {
|
|
155
|
+
body?: string | undefined;
|
|
156
|
+
} & {
|
|
157
|
+
body?: string | undefined;
|
|
158
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
159
|
+
fromPartial<I_1 extends {
|
|
130
160
|
body?: string | undefined;
|
|
131
161
|
} & {
|
|
132
162
|
body?: string | undefined;
|
|
133
|
-
} & { [
|
|
163
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
134
164
|
};
|
|
135
165
|
readonly requestStream: true;
|
|
136
166
|
readonly responseType: {
|
|
@@ -140,11 +170,16 @@ export declare const EchoerDefinition: {
|
|
|
140
170
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
141
171
|
fromJSON(object: any): EchoMsg;
|
|
142
172
|
toJSON(message: EchoMsg): unknown;
|
|
143
|
-
|
|
173
|
+
create<I extends {
|
|
174
|
+
body?: string | undefined;
|
|
175
|
+
} & {
|
|
176
|
+
body?: string | undefined;
|
|
177
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
178
|
+
fromPartial<I_1 extends {
|
|
144
179
|
body?: string | undefined;
|
|
145
180
|
} & {
|
|
146
181
|
body?: string | undefined;
|
|
147
|
-
} & { [
|
|
182
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
148
183
|
};
|
|
149
184
|
readonly responseStream: false;
|
|
150
185
|
readonly options: {};
|
|
@@ -159,11 +194,16 @@ export declare const EchoerDefinition: {
|
|
|
159
194
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
160
195
|
fromJSON(object: any): EchoMsg;
|
|
161
196
|
toJSON(message: EchoMsg): unknown;
|
|
162
|
-
|
|
197
|
+
create<I extends {
|
|
198
|
+
body?: string | undefined;
|
|
199
|
+
} & {
|
|
200
|
+
body?: string | undefined;
|
|
201
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
202
|
+
fromPartial<I_1 extends {
|
|
163
203
|
body?: string | undefined;
|
|
164
204
|
} & {
|
|
165
205
|
body?: string | undefined;
|
|
166
|
-
} & { [
|
|
206
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
167
207
|
};
|
|
168
208
|
readonly requestStream: true;
|
|
169
209
|
readonly responseType: {
|
|
@@ -173,11 +213,16 @@ export declare const EchoerDefinition: {
|
|
|
173
213
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<EchoMsg>;
|
|
174
214
|
fromJSON(object: any): EchoMsg;
|
|
175
215
|
toJSON(message: EchoMsg): unknown;
|
|
176
|
-
|
|
216
|
+
create<I extends {
|
|
217
|
+
body?: string | undefined;
|
|
218
|
+
} & {
|
|
219
|
+
body?: string | undefined;
|
|
220
|
+
} & { [K in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): EchoMsg;
|
|
221
|
+
fromPartial<I_1 extends {
|
|
177
222
|
body?: string | undefined;
|
|
178
223
|
} & {
|
|
179
224
|
body?: string | undefined;
|
|
180
|
-
} & { [
|
|
225
|
+
} & { [K_1 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): EchoMsg;
|
|
181
226
|
};
|
|
182
227
|
readonly responseStream: true;
|
|
183
228
|
readonly options: {};
|
|
@@ -192,7 +237,7 @@ export declare const EchoerDefinition: {
|
|
|
192
237
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<RpcStreamPacket>;
|
|
193
238
|
fromJSON(object: any): RpcStreamPacket;
|
|
194
239
|
toJSON(message: RpcStreamPacket): unknown;
|
|
195
|
-
|
|
240
|
+
create<I_2 extends {
|
|
196
241
|
body?: ({
|
|
197
242
|
init?: {
|
|
198
243
|
componentId?: string | undefined;
|
|
@@ -222,9 +267,9 @@ export declare const EchoerDefinition: {
|
|
|
222
267
|
componentId?: string | undefined;
|
|
223
268
|
} & {
|
|
224
269
|
componentId?: string | undefined;
|
|
225
|
-
} & { [K in Exclude<keyof
|
|
270
|
+
} & { [K in Exclude<keyof I_2["body"]["init"], "componentId">]: never; }) | undefined;
|
|
226
271
|
$case: "init";
|
|
227
|
-
} & { [K_1 in Exclude<keyof
|
|
272
|
+
} & { [K_1 in Exclude<keyof I_2["body"], "$case" | "init">]: never; }) | ({
|
|
228
273
|
ack?: {
|
|
229
274
|
error?: string | undefined;
|
|
230
275
|
} | undefined;
|
|
@@ -235,17 +280,71 @@ export declare const EchoerDefinition: {
|
|
|
235
280
|
error?: string | undefined;
|
|
236
281
|
} & {
|
|
237
282
|
error?: string | undefined;
|
|
238
|
-
} & { [K_2 in Exclude<keyof
|
|
283
|
+
} & { [K_2 in Exclude<keyof I_2["body"]["ack"], "error">]: never; }) | undefined;
|
|
239
284
|
$case: "ack";
|
|
240
|
-
} & { [K_3 in Exclude<keyof
|
|
285
|
+
} & { [K_3 in Exclude<keyof I_2["body"], "$case" | "ack">]: never; }) | ({
|
|
241
286
|
data?: Uint8Array | undefined;
|
|
242
287
|
} & {
|
|
243
288
|
$case: "data";
|
|
244
289
|
} & {
|
|
245
290
|
data?: Uint8Array | undefined;
|
|
246
291
|
$case: "data";
|
|
247
|
-
} & { [K_4 in Exclude<keyof
|
|
248
|
-
} & { [K_5 in Exclude<keyof
|
|
292
|
+
} & { [K_4 in Exclude<keyof I_2["body"], "$case" | "data">]: never; }) | undefined;
|
|
293
|
+
} & { [K_5 in Exclude<keyof I_2, "body">]: never; }>(base?: I_2 | undefined): RpcStreamPacket;
|
|
294
|
+
fromPartial<I_3 extends {
|
|
295
|
+
body?: ({
|
|
296
|
+
init?: {
|
|
297
|
+
componentId?: string | undefined;
|
|
298
|
+
} | undefined;
|
|
299
|
+
} & {
|
|
300
|
+
$case: "init";
|
|
301
|
+
}) | ({
|
|
302
|
+
ack?: {
|
|
303
|
+
error?: string | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
} & {
|
|
306
|
+
$case: "ack";
|
|
307
|
+
}) | ({
|
|
308
|
+
data?: Uint8Array | undefined;
|
|
309
|
+
} & {
|
|
310
|
+
$case: "data";
|
|
311
|
+
}) | undefined;
|
|
312
|
+
} & {
|
|
313
|
+
body?: ({
|
|
314
|
+
init?: {
|
|
315
|
+
componentId?: string | undefined;
|
|
316
|
+
} | undefined;
|
|
317
|
+
} & {
|
|
318
|
+
$case: "init";
|
|
319
|
+
} & {
|
|
320
|
+
init?: ({
|
|
321
|
+
componentId?: string | undefined;
|
|
322
|
+
} & {
|
|
323
|
+
componentId?: string | undefined;
|
|
324
|
+
} & { [K_6 in Exclude<keyof I_3["body"]["init"], "componentId">]: never; }) | undefined;
|
|
325
|
+
$case: "init";
|
|
326
|
+
} & { [K_7 in Exclude<keyof I_3["body"], "$case" | "init">]: never; }) | ({
|
|
327
|
+
ack?: {
|
|
328
|
+
error?: string | undefined;
|
|
329
|
+
} | undefined;
|
|
330
|
+
} & {
|
|
331
|
+
$case: "ack";
|
|
332
|
+
} & {
|
|
333
|
+
ack?: ({
|
|
334
|
+
error?: string | undefined;
|
|
335
|
+
} & {
|
|
336
|
+
error?: string | undefined;
|
|
337
|
+
} & { [K_8 in Exclude<keyof I_3["body"]["ack"], "error">]: never; }) | undefined;
|
|
338
|
+
$case: "ack";
|
|
339
|
+
} & { [K_9 in Exclude<keyof I_3["body"], "$case" | "ack">]: never; }) | ({
|
|
340
|
+
data?: Uint8Array | undefined;
|
|
341
|
+
} & {
|
|
342
|
+
$case: "data";
|
|
343
|
+
} & {
|
|
344
|
+
data?: Uint8Array | undefined;
|
|
345
|
+
$case: "data";
|
|
346
|
+
} & { [K_10 in Exclude<keyof I_3["body"], "$case" | "data">]: never; }) | undefined;
|
|
347
|
+
} & { [K_11 in Exclude<keyof I_3, "body">]: never; }>(object: I_3): RpcStreamPacket;
|
|
249
348
|
};
|
|
250
349
|
readonly requestStream: true;
|
|
251
350
|
readonly responseType: {
|
|
@@ -255,7 +354,61 @@ export declare const EchoerDefinition: {
|
|
|
255
354
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<RpcStreamPacket>;
|
|
256
355
|
fromJSON(object: any): RpcStreamPacket;
|
|
257
356
|
toJSON(message: RpcStreamPacket): unknown;
|
|
258
|
-
|
|
357
|
+
create<I_2 extends {
|
|
358
|
+
body?: ({
|
|
359
|
+
init?: {
|
|
360
|
+
componentId?: string | undefined;
|
|
361
|
+
} | undefined;
|
|
362
|
+
} & {
|
|
363
|
+
$case: "init";
|
|
364
|
+
}) | ({
|
|
365
|
+
ack?: {
|
|
366
|
+
error?: string | undefined;
|
|
367
|
+
} | undefined;
|
|
368
|
+
} & {
|
|
369
|
+
$case: "ack";
|
|
370
|
+
}) | ({
|
|
371
|
+
data?: Uint8Array | undefined;
|
|
372
|
+
} & {
|
|
373
|
+
$case: "data";
|
|
374
|
+
}) | undefined;
|
|
375
|
+
} & {
|
|
376
|
+
body?: ({
|
|
377
|
+
init?: {
|
|
378
|
+
componentId?: string | undefined;
|
|
379
|
+
} | undefined;
|
|
380
|
+
} & {
|
|
381
|
+
$case: "init";
|
|
382
|
+
} & {
|
|
383
|
+
init?: ({
|
|
384
|
+
componentId?: string | undefined;
|
|
385
|
+
} & {
|
|
386
|
+
componentId?: string | undefined;
|
|
387
|
+
} & { [K in Exclude<keyof I_2["body"]["init"], "componentId">]: never; }) | undefined;
|
|
388
|
+
$case: "init";
|
|
389
|
+
} & { [K_1 in Exclude<keyof I_2["body"], "$case" | "init">]: never; }) | ({
|
|
390
|
+
ack?: {
|
|
391
|
+
error?: string | undefined;
|
|
392
|
+
} | undefined;
|
|
393
|
+
} & {
|
|
394
|
+
$case: "ack";
|
|
395
|
+
} & {
|
|
396
|
+
ack?: ({
|
|
397
|
+
error?: string | undefined;
|
|
398
|
+
} & {
|
|
399
|
+
error?: string | undefined;
|
|
400
|
+
} & { [K_2 in Exclude<keyof I_2["body"]["ack"], "error">]: never; }) | undefined;
|
|
401
|
+
$case: "ack";
|
|
402
|
+
} & { [K_3 in Exclude<keyof I_2["body"], "$case" | "ack">]: never; }) | ({
|
|
403
|
+
data?: Uint8Array | undefined;
|
|
404
|
+
} & {
|
|
405
|
+
$case: "data";
|
|
406
|
+
} & {
|
|
407
|
+
data?: Uint8Array | undefined;
|
|
408
|
+
$case: "data";
|
|
409
|
+
} & { [K_4 in Exclude<keyof I_2["body"], "$case" | "data">]: never; }) | undefined;
|
|
410
|
+
} & { [K_5 in Exclude<keyof I_2, "body">]: never; }>(base?: I_2 | undefined): RpcStreamPacket;
|
|
411
|
+
fromPartial<I_3 extends {
|
|
259
412
|
body?: ({
|
|
260
413
|
init?: {
|
|
261
414
|
componentId?: string | undefined;
|
|
@@ -285,9 +438,9 @@ export declare const EchoerDefinition: {
|
|
|
285
438
|
componentId?: string | undefined;
|
|
286
439
|
} & {
|
|
287
440
|
componentId?: string | undefined;
|
|
288
|
-
} & { [
|
|
441
|
+
} & { [K_6 in Exclude<keyof I_3["body"]["init"], "componentId">]: never; }) | undefined;
|
|
289
442
|
$case: "init";
|
|
290
|
-
} & { [
|
|
443
|
+
} & { [K_7 in Exclude<keyof I_3["body"], "$case" | "init">]: never; }) | ({
|
|
291
444
|
ack?: {
|
|
292
445
|
error?: string | undefined;
|
|
293
446
|
} | undefined;
|
|
@@ -298,17 +451,17 @@ export declare const EchoerDefinition: {
|
|
|
298
451
|
error?: string | undefined;
|
|
299
452
|
} & {
|
|
300
453
|
error?: string | undefined;
|
|
301
|
-
} & { [
|
|
454
|
+
} & { [K_8 in Exclude<keyof I_3["body"]["ack"], "error">]: never; }) | undefined;
|
|
302
455
|
$case: "ack";
|
|
303
|
-
} & { [
|
|
456
|
+
} & { [K_9 in Exclude<keyof I_3["body"], "$case" | "ack">]: never; }) | ({
|
|
304
457
|
data?: Uint8Array | undefined;
|
|
305
458
|
} & {
|
|
306
459
|
$case: "data";
|
|
307
460
|
} & {
|
|
308
461
|
data?: Uint8Array | undefined;
|
|
309
462
|
$case: "data";
|
|
310
|
-
} & { [
|
|
311
|
-
} & { [
|
|
463
|
+
} & { [K_10 in Exclude<keyof I_3["body"], "$case" | "data">]: never; }) | undefined;
|
|
464
|
+
} & { [K_11 in Exclude<keyof I_3, "body">]: never; }>(object: I_3): RpcStreamPacket;
|
|
312
465
|
};
|
|
313
466
|
readonly responseStream: true;
|
|
314
467
|
readonly options: {};
|
package/dist/echo/echo.pb.js
CHANGED
|
@@ -66,6 +66,9 @@ export const EchoMsg = {
|
|
|
66
66
|
message.body !== undefined && (obj.body = message.body);
|
|
67
67
|
return obj;
|
|
68
68
|
},
|
|
69
|
+
create(base) {
|
|
70
|
+
return EchoMsg.fromPartial(base ?? {});
|
|
71
|
+
},
|
|
69
72
|
fromPartial(object) {
|
|
70
73
|
const message = createBaseEchoMsg();
|
|
71
74
|
message.body = object.body ?? '';
|
|
@@ -31,7 +31,7 @@ export declare const RpcStreamPacket: {
|
|
|
31
31
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<RpcStreamPacket>;
|
|
32
32
|
fromJSON(object: any): RpcStreamPacket;
|
|
33
33
|
toJSON(message: RpcStreamPacket): unknown;
|
|
34
|
-
|
|
34
|
+
create<I extends {
|
|
35
35
|
body?: ({
|
|
36
36
|
init?: {
|
|
37
37
|
componentId?: string | undefined;
|
|
@@ -84,7 +84,61 @@ export declare const RpcStreamPacket: {
|
|
|
84
84
|
data?: Uint8Array | undefined;
|
|
85
85
|
$case: "data";
|
|
86
86
|
} & { [K_4 in Exclude<keyof I["body"], "$case" | "data">]: never; }) | undefined;
|
|
87
|
-
} & { [K_5 in Exclude<keyof I, "body">]: never; }>(
|
|
87
|
+
} & { [K_5 in Exclude<keyof I, "body">]: never; }>(base?: I | undefined): RpcStreamPacket;
|
|
88
|
+
fromPartial<I_1 extends {
|
|
89
|
+
body?: ({
|
|
90
|
+
init?: {
|
|
91
|
+
componentId?: string | undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
} & {
|
|
94
|
+
$case: "init";
|
|
95
|
+
}) | ({
|
|
96
|
+
ack?: {
|
|
97
|
+
error?: string | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
} & {
|
|
100
|
+
$case: "ack";
|
|
101
|
+
}) | ({
|
|
102
|
+
data?: Uint8Array | undefined;
|
|
103
|
+
} & {
|
|
104
|
+
$case: "data";
|
|
105
|
+
}) | undefined;
|
|
106
|
+
} & {
|
|
107
|
+
body?: ({
|
|
108
|
+
init?: {
|
|
109
|
+
componentId?: string | undefined;
|
|
110
|
+
} | undefined;
|
|
111
|
+
} & {
|
|
112
|
+
$case: "init";
|
|
113
|
+
} & {
|
|
114
|
+
init?: ({
|
|
115
|
+
componentId?: string | undefined;
|
|
116
|
+
} & {
|
|
117
|
+
componentId?: string | undefined;
|
|
118
|
+
} & { [K_6 in Exclude<keyof I_1["body"]["init"], "componentId">]: never; }) | undefined;
|
|
119
|
+
$case: "init";
|
|
120
|
+
} & { [K_7 in Exclude<keyof I_1["body"], "$case" | "init">]: never; }) | ({
|
|
121
|
+
ack?: {
|
|
122
|
+
error?: string | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
} & {
|
|
125
|
+
$case: "ack";
|
|
126
|
+
} & {
|
|
127
|
+
ack?: ({
|
|
128
|
+
error?: string | undefined;
|
|
129
|
+
} & {
|
|
130
|
+
error?: string | undefined;
|
|
131
|
+
} & { [K_8 in Exclude<keyof I_1["body"]["ack"], "error">]: never; }) | undefined;
|
|
132
|
+
$case: "ack";
|
|
133
|
+
} & { [K_9 in Exclude<keyof I_1["body"], "$case" | "ack">]: never; }) | ({
|
|
134
|
+
data?: Uint8Array | undefined;
|
|
135
|
+
} & {
|
|
136
|
+
$case: "data";
|
|
137
|
+
} & {
|
|
138
|
+
data?: Uint8Array | undefined;
|
|
139
|
+
$case: "data";
|
|
140
|
+
} & { [K_10 in Exclude<keyof I_1["body"], "$case" | "data">]: never; }) | undefined;
|
|
141
|
+
} & { [K_11 in Exclude<keyof I_1, "body">]: never; }>(object: I_1): RpcStreamPacket;
|
|
88
142
|
};
|
|
89
143
|
export declare const RpcStreamInit: {
|
|
90
144
|
encode(message: RpcStreamInit, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -93,11 +147,16 @@ export declare const RpcStreamInit: {
|
|
|
93
147
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<RpcStreamInit>;
|
|
94
148
|
fromJSON(object: any): RpcStreamInit;
|
|
95
149
|
toJSON(message: RpcStreamInit): unknown;
|
|
96
|
-
|
|
150
|
+
create<I extends {
|
|
97
151
|
componentId?: string | undefined;
|
|
98
152
|
} & {
|
|
99
153
|
componentId?: string | undefined;
|
|
100
|
-
} & { [K in Exclude<keyof I, "componentId">]: never; }>(
|
|
154
|
+
} & { [K in Exclude<keyof I, "componentId">]: never; }>(base?: I | undefined): RpcStreamInit;
|
|
155
|
+
fromPartial<I_1 extends {
|
|
156
|
+
componentId?: string | undefined;
|
|
157
|
+
} & {
|
|
158
|
+
componentId?: string | undefined;
|
|
159
|
+
} & { [K_1 in Exclude<keyof I_1, "componentId">]: never; }>(object: I_1): RpcStreamInit;
|
|
101
160
|
};
|
|
102
161
|
export declare const RpcAck: {
|
|
103
162
|
encode(message: RpcAck, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -106,11 +165,16 @@ export declare const RpcAck: {
|
|
|
106
165
|
decodeTransform(source: AsyncIterable<Uint8Array | Uint8Array[]> | Iterable<Uint8Array | Uint8Array[]>): AsyncIterable<RpcAck>;
|
|
107
166
|
fromJSON(object: any): RpcAck;
|
|
108
167
|
toJSON(message: RpcAck): unknown;
|
|
109
|
-
|
|
168
|
+
create<I extends {
|
|
169
|
+
error?: string | undefined;
|
|
170
|
+
} & {
|
|
171
|
+
error?: string | undefined;
|
|
172
|
+
} & { [K in Exclude<keyof I, "error">]: never; }>(base?: I | undefined): RpcAck;
|
|
173
|
+
fromPartial<I_1 extends {
|
|
110
174
|
error?: string | undefined;
|
|
111
175
|
} & {
|
|
112
176
|
error?: string | undefined;
|
|
113
|
-
} & { [
|
|
177
|
+
} & { [K_1 in Exclude<keyof I_1, "error">]: never; }>(object: I_1): RpcAck;
|
|
114
178
|
};
|
|
115
179
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
116
180
|
export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
@@ -103,6 +103,9 @@ export const RpcStreamPacket = {
|
|
|
103
103
|
: undefined);
|
|
104
104
|
return obj;
|
|
105
105
|
},
|
|
106
|
+
create(base) {
|
|
107
|
+
return RpcStreamPacket.fromPartial(base ?? {});
|
|
108
|
+
},
|
|
106
109
|
fromPartial(object) {
|
|
107
110
|
const message = createBaseRpcStreamPacket();
|
|
108
111
|
if (object.body?.$case === 'init' &&
|
|
@@ -191,6 +194,9 @@ export const RpcStreamInit = {
|
|
|
191
194
|
message.componentId !== undefined && (obj.componentId = message.componentId);
|
|
192
195
|
return obj;
|
|
193
196
|
},
|
|
197
|
+
create(base) {
|
|
198
|
+
return RpcStreamInit.fromPartial(base ?? {});
|
|
199
|
+
},
|
|
194
200
|
fromPartial(object) {
|
|
195
201
|
const message = createBaseRpcStreamInit();
|
|
196
202
|
message.componentId = object.componentId ?? '';
|
|
@@ -260,13 +266,16 @@ export const RpcAck = {
|
|
|
260
266
|
message.error !== undefined && (obj.error = message.error);
|
|
261
267
|
return obj;
|
|
262
268
|
},
|
|
269
|
+
create(base) {
|
|
270
|
+
return RpcAck.fromPartial(base ?? {});
|
|
271
|
+
},
|
|
263
272
|
fromPartial(object) {
|
|
264
273
|
const message = createBaseRpcAck();
|
|
265
274
|
message.error = object.error ?? '';
|
|
266
275
|
return message;
|
|
267
276
|
},
|
|
268
277
|
};
|
|
269
|
-
var
|
|
278
|
+
var tsProtoGlobalThis = (() => {
|
|
270
279
|
if (typeof globalThis !== 'undefined') {
|
|
271
280
|
return globalThis;
|
|
272
281
|
}
|
|
@@ -282,11 +291,11 @@ var globalThis = (() => {
|
|
|
282
291
|
throw 'Unable to locate global object';
|
|
283
292
|
})();
|
|
284
293
|
function bytesFromBase64(b64) {
|
|
285
|
-
if (
|
|
286
|
-
return Uint8Array.from(
|
|
294
|
+
if (tsProtoGlobalThis.Buffer) {
|
|
295
|
+
return Uint8Array.from(tsProtoGlobalThis.Buffer.from(b64, 'base64'));
|
|
287
296
|
}
|
|
288
297
|
else {
|
|
289
|
-
const bin =
|
|
298
|
+
const bin = tsProtoGlobalThis.atob(b64);
|
|
290
299
|
const arr = new Uint8Array(bin.length);
|
|
291
300
|
for (let i = 0; i < bin.length; ++i) {
|
|
292
301
|
arr[i] = bin.charCodeAt(i);
|
|
@@ -295,15 +304,15 @@ function bytesFromBase64(b64) {
|
|
|
295
304
|
}
|
|
296
305
|
}
|
|
297
306
|
function base64FromBytes(arr) {
|
|
298
|
-
if (
|
|
299
|
-
return
|
|
307
|
+
if (tsProtoGlobalThis.Buffer) {
|
|
308
|
+
return tsProtoGlobalThis.Buffer.from(arr).toString('base64');
|
|
300
309
|
}
|
|
301
310
|
else {
|
|
302
311
|
const bin = [];
|
|
303
312
|
arr.forEach((byte) => {
|
|
304
313
|
bin.push(String.fromCharCode(byte));
|
|
305
314
|
});
|
|
306
|
-
return
|
|
315
|
+
return tsProtoGlobalThis.btoa(bin.join(''));
|
|
307
316
|
}
|
|
308
317
|
}
|
|
309
318
|
if (_m0.util.Long !== Long) {
|
package/dist/srpc/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { Packet, CallStart, CallData } from './rpcproto.pb.js';
|
|
|
8
8
|
export { Mux, StaticMux, createMux } from './mux.js';
|
|
9
9
|
export { BroadcastChannelDuplex, newBroadcastChannelDuplex, BroadcastChannelConn, } from './broadcast-channel.js';
|
|
10
10
|
export { MessagePortIterable, newMessagePortIterable, MessagePortConn, } from './message-port.js';
|
|
11
|
+
export { MessageDefinition, DecodeMessageTransform, buildDecodeMessageTransform, EncodeMessageTransform, buildEncodeMessageTransform, } from './message.js';
|
|
11
12
|
export { ValueCtr } from './value-ctr.js';
|
|
12
13
|
export { OpenStreamCtr } from './open-stream-ctr.js';
|
|
13
14
|
export { writeToPushable } from './pushable';
|
package/dist/srpc/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { Packet, CallStart, CallData } from './rpcproto.pb.js';
|
|
|
7
7
|
export { StaticMux, createMux } from './mux.js';
|
|
8
8
|
export { BroadcastChannelDuplex, newBroadcastChannelDuplex, BroadcastChannelConn, } from './broadcast-channel.js';
|
|
9
9
|
export { MessagePortIterable, newMessagePortIterable, MessagePortConn, } from './message-port.js';
|
|
10
|
+
export { buildDecodeMessageTransform, buildEncodeMessageTransform, } from './message.js';
|
|
10
11
|
export { ValueCtr } from './value-ctr.js';
|
|
11
12
|
export { OpenStreamCtr } from './open-stream-ctr.js';
|
|
12
13
|
export { writeToPushable } from './pushable';
|
package/dist/srpc/message.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ export interface MessageDefinition<T> {
|
|
|
4
4
|
encode(message: T, writer?: pbjs.Writer): pbjs.Writer;
|
|
5
5
|
decode(input: pbjs.Reader | Uint8Array, length?: number): T;
|
|
6
6
|
}
|
|
7
|
-
type DecodeMessageTransform<T> = (source: Source<Uint8Array | Uint8Array[]>) => AsyncIterable<T>;
|
|
7
|
+
export type DecodeMessageTransform<T> = (source: Source<Uint8Array | Uint8Array[]>) => AsyncIterable<T>;
|
|
8
8
|
export declare function buildDecodeMessageTransform<T>(def: MessageDefinition<T>): DecodeMessageTransform<T>;
|
|
9
|
-
type EncodeMessageTransform<T> = (source: Source<T | T[]>) => AsyncIterable<Uint8Array>;
|
|
9
|
+
export type EncodeMessageTransform<T> = (source: Source<T | T[]>) => AsyncIterable<Uint8Array>;
|
|
10
10
|
export declare function buildEncodeMessageTransform<T>(def: MessageDefinition<T>): EncodeMessageTransform<T>;
|
|
11
|
-
export {};
|