@latticexyz/services 2.0.0-snapshot-test-32d38619 → 2.0.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/README.md +1 -241
- package/dist/faucet.d.ts +369 -0
- package/dist/faucet.js.map +1 -1
- package/package.json +5 -25
- package/protobuf/ts/faucet/faucet.ts +19 -19
- package/protobuf/ts/index.ts +0 -3
- package/ts/faucet/createFaucetService.ts +1 -1
- package/README.v1.md +0 -119
- package/bin/faucet +0 -0
- package/bin/mode +0 -0
- package/dist/ecs-relay.js +0 -683
- package/dist/ecs-relay.js.map +0 -1
- package/dist/ecs-snapshot.js +0 -810
- package/dist/ecs-snapshot.js.map +0 -1
- package/dist/ecs-stream.js +0 -391
- package/dist/ecs-stream.js.map +0 -1
- package/dist/mode.js +0 -1481
- package/dist/mode.js.map +0 -1
- package/protobuf/go/ecs-relay/ecs-relay.pb.go +0 -971
- package/protobuf/go/ecs-relay/ecs-relay_grpc.pb.go +0 -545
- package/protobuf/go/ecs-snapshot/ecs-snapshot.pb.go +0 -1124
- package/protobuf/go/ecs-snapshot/ecs-snapshot_grpc.pb.go +0 -502
- package/protobuf/go/ecs-stream/ecs-stream.pb.go +0 -525
- package/protobuf/go/ecs-stream/ecs-stream_grpc.pb.go +0 -138
- package/protobuf/go/faucet/faucet.pb.go +0 -1133
- package/protobuf/go/faucet/faucet_grpc.pb.go +0 -370
- package/protobuf/go/mode/mode.pb.go +0 -1772
- package/protobuf/go/mode/mode_grpc.pb.go +0 -283
- package/protobuf/ts/ecs-relay/ecs-relay.ts +0 -889
- package/protobuf/ts/ecs-snapshot/ecs-snapshot.ts +0 -1078
- package/protobuf/ts/ecs-stream/ecs-stream.ts +0 -508
- package/protobuf/ts/mode/google/protobuf/any.ts +0 -191
- package/protobuf/ts/mode/mode.ts +0 -1875
@@ -1,508 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
import Long from "long";
|
3
|
-
import type { CallContext, CallOptions } from "nice-grpc-common";
|
4
|
-
import _m0 from "protobufjs/minimal.js";
|
5
|
-
|
6
|
-
export const protobufPackage = "ecsstream";
|
7
|
-
|
8
|
-
export interface TxMetadata {
|
9
|
-
to: string;
|
10
|
-
data: Uint8Array;
|
11
|
-
value: number;
|
12
|
-
}
|
13
|
-
|
14
|
-
export interface ECSEvent {
|
15
|
-
eventType: string;
|
16
|
-
componentId: string;
|
17
|
-
entityId: string;
|
18
|
-
value: Uint8Array;
|
19
|
-
txHash: string;
|
20
|
-
txMetadata: TxMetadata | undefined;
|
21
|
-
}
|
22
|
-
|
23
|
-
/**
|
24
|
-
* Request to subscribe to an ECSStream. The required parameter is 'worldAddress', while others
|
25
|
-
* are opt-in based on which data the client is interested in receiving.
|
26
|
-
*/
|
27
|
-
export interface ECSStreamBlockBundleRequest {
|
28
|
-
worldAddress: string;
|
29
|
-
blockNumber: boolean;
|
30
|
-
blockHash: boolean;
|
31
|
-
blockTimestamp: boolean;
|
32
|
-
transactionsConfirmed: boolean;
|
33
|
-
ecsEvents: boolean;
|
34
|
-
ecsEventsIncludeTxMetadata: boolean;
|
35
|
-
}
|
36
|
-
|
37
|
-
/**
|
38
|
-
* ECSStream response. The fields are populated based on the request which must have been sent when
|
39
|
-
* starting the subscription.
|
40
|
-
*/
|
41
|
-
export interface ECSStreamBlockBundleReply {
|
42
|
-
blockNumber: number;
|
43
|
-
blockHash: string;
|
44
|
-
blockTimestamp: number;
|
45
|
-
transactionsConfirmed: string[];
|
46
|
-
ecsEvents: ECSEvent[];
|
47
|
-
}
|
48
|
-
|
49
|
-
function createBaseTxMetadata(): TxMetadata {
|
50
|
-
return { to: "", data: new Uint8Array(), value: 0 };
|
51
|
-
}
|
52
|
-
|
53
|
-
export const TxMetadata = {
|
54
|
-
encode(message: TxMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
55
|
-
if (message.to !== "") {
|
56
|
-
writer.uint32(18).string(message.to);
|
57
|
-
}
|
58
|
-
if (message.data.length !== 0) {
|
59
|
-
writer.uint32(26).bytes(message.data);
|
60
|
-
}
|
61
|
-
if (message.value !== 0) {
|
62
|
-
writer.uint32(32).uint64(message.value);
|
63
|
-
}
|
64
|
-
return writer;
|
65
|
-
},
|
66
|
-
|
67
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): TxMetadata {
|
68
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
69
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
70
|
-
const message = createBaseTxMetadata();
|
71
|
-
while (reader.pos < end) {
|
72
|
-
const tag = reader.uint32();
|
73
|
-
switch (tag >>> 3) {
|
74
|
-
case 2:
|
75
|
-
if (tag != 18) {
|
76
|
-
break;
|
77
|
-
}
|
78
|
-
|
79
|
-
message.to = reader.string();
|
80
|
-
continue;
|
81
|
-
case 3:
|
82
|
-
if (tag != 26) {
|
83
|
-
break;
|
84
|
-
}
|
85
|
-
|
86
|
-
message.data = reader.bytes();
|
87
|
-
continue;
|
88
|
-
case 4:
|
89
|
-
if (tag != 32) {
|
90
|
-
break;
|
91
|
-
}
|
92
|
-
|
93
|
-
message.value = longToNumber(reader.uint64() as Long);
|
94
|
-
continue;
|
95
|
-
}
|
96
|
-
if ((tag & 7) == 4 || tag == 0) {
|
97
|
-
break;
|
98
|
-
}
|
99
|
-
reader.skipType(tag & 7);
|
100
|
-
}
|
101
|
-
return message;
|
102
|
-
},
|
103
|
-
|
104
|
-
create(base?: DeepPartial<TxMetadata>): TxMetadata {
|
105
|
-
return TxMetadata.fromPartial(base ?? {});
|
106
|
-
},
|
107
|
-
|
108
|
-
fromPartial(object: DeepPartial<TxMetadata>): TxMetadata {
|
109
|
-
const message = createBaseTxMetadata();
|
110
|
-
message.to = object.to ?? "";
|
111
|
-
message.data = object.data ?? new Uint8Array();
|
112
|
-
message.value = object.value ?? 0;
|
113
|
-
return message;
|
114
|
-
},
|
115
|
-
};
|
116
|
-
|
117
|
-
function createBaseECSEvent(): ECSEvent {
|
118
|
-
return { eventType: "", componentId: "", entityId: "", value: new Uint8Array(), txHash: "", txMetadata: undefined };
|
119
|
-
}
|
120
|
-
|
121
|
-
export const ECSEvent = {
|
122
|
-
encode(message: ECSEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
123
|
-
if (message.eventType !== "") {
|
124
|
-
writer.uint32(10).string(message.eventType);
|
125
|
-
}
|
126
|
-
if (message.componentId !== "") {
|
127
|
-
writer.uint32(18).string(message.componentId);
|
128
|
-
}
|
129
|
-
if (message.entityId !== "") {
|
130
|
-
writer.uint32(26).string(message.entityId);
|
131
|
-
}
|
132
|
-
if (message.value.length !== 0) {
|
133
|
-
writer.uint32(34).bytes(message.value);
|
134
|
-
}
|
135
|
-
if (message.txHash !== "") {
|
136
|
-
writer.uint32(42).string(message.txHash);
|
137
|
-
}
|
138
|
-
if (message.txMetadata !== undefined) {
|
139
|
-
TxMetadata.encode(message.txMetadata, writer.uint32(50).fork()).ldelim();
|
140
|
-
}
|
141
|
-
return writer;
|
142
|
-
},
|
143
|
-
|
144
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): ECSEvent {
|
145
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
146
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
147
|
-
const message = createBaseECSEvent();
|
148
|
-
while (reader.pos < end) {
|
149
|
-
const tag = reader.uint32();
|
150
|
-
switch (tag >>> 3) {
|
151
|
-
case 1:
|
152
|
-
if (tag != 10) {
|
153
|
-
break;
|
154
|
-
}
|
155
|
-
|
156
|
-
message.eventType = reader.string();
|
157
|
-
continue;
|
158
|
-
case 2:
|
159
|
-
if (tag != 18) {
|
160
|
-
break;
|
161
|
-
}
|
162
|
-
|
163
|
-
message.componentId = reader.string();
|
164
|
-
continue;
|
165
|
-
case 3:
|
166
|
-
if (tag != 26) {
|
167
|
-
break;
|
168
|
-
}
|
169
|
-
|
170
|
-
message.entityId = reader.string();
|
171
|
-
continue;
|
172
|
-
case 4:
|
173
|
-
if (tag != 34) {
|
174
|
-
break;
|
175
|
-
}
|
176
|
-
|
177
|
-
message.value = reader.bytes();
|
178
|
-
continue;
|
179
|
-
case 5:
|
180
|
-
if (tag != 42) {
|
181
|
-
break;
|
182
|
-
}
|
183
|
-
|
184
|
-
message.txHash = reader.string();
|
185
|
-
continue;
|
186
|
-
case 6:
|
187
|
-
if (tag != 50) {
|
188
|
-
break;
|
189
|
-
}
|
190
|
-
|
191
|
-
message.txMetadata = TxMetadata.decode(reader, reader.uint32());
|
192
|
-
continue;
|
193
|
-
}
|
194
|
-
if ((tag & 7) == 4 || tag == 0) {
|
195
|
-
break;
|
196
|
-
}
|
197
|
-
reader.skipType(tag & 7);
|
198
|
-
}
|
199
|
-
return message;
|
200
|
-
},
|
201
|
-
|
202
|
-
create(base?: DeepPartial<ECSEvent>): ECSEvent {
|
203
|
-
return ECSEvent.fromPartial(base ?? {});
|
204
|
-
},
|
205
|
-
|
206
|
-
fromPartial(object: DeepPartial<ECSEvent>): ECSEvent {
|
207
|
-
const message = createBaseECSEvent();
|
208
|
-
message.eventType = object.eventType ?? "";
|
209
|
-
message.componentId = object.componentId ?? "";
|
210
|
-
message.entityId = object.entityId ?? "";
|
211
|
-
message.value = object.value ?? new Uint8Array();
|
212
|
-
message.txHash = object.txHash ?? "";
|
213
|
-
message.txMetadata =
|
214
|
-
object.txMetadata !== undefined && object.txMetadata !== null
|
215
|
-
? TxMetadata.fromPartial(object.txMetadata)
|
216
|
-
: undefined;
|
217
|
-
return message;
|
218
|
-
},
|
219
|
-
};
|
220
|
-
|
221
|
-
function createBaseECSStreamBlockBundleRequest(): ECSStreamBlockBundleRequest {
|
222
|
-
return {
|
223
|
-
worldAddress: "",
|
224
|
-
blockNumber: false,
|
225
|
-
blockHash: false,
|
226
|
-
blockTimestamp: false,
|
227
|
-
transactionsConfirmed: false,
|
228
|
-
ecsEvents: false,
|
229
|
-
ecsEventsIncludeTxMetadata: false,
|
230
|
-
};
|
231
|
-
}
|
232
|
-
|
233
|
-
export const ECSStreamBlockBundleRequest = {
|
234
|
-
encode(message: ECSStreamBlockBundleRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
235
|
-
if (message.worldAddress !== "") {
|
236
|
-
writer.uint32(10).string(message.worldAddress);
|
237
|
-
}
|
238
|
-
if (message.blockNumber === true) {
|
239
|
-
writer.uint32(16).bool(message.blockNumber);
|
240
|
-
}
|
241
|
-
if (message.blockHash === true) {
|
242
|
-
writer.uint32(24).bool(message.blockHash);
|
243
|
-
}
|
244
|
-
if (message.blockTimestamp === true) {
|
245
|
-
writer.uint32(32).bool(message.blockTimestamp);
|
246
|
-
}
|
247
|
-
if (message.transactionsConfirmed === true) {
|
248
|
-
writer.uint32(40).bool(message.transactionsConfirmed);
|
249
|
-
}
|
250
|
-
if (message.ecsEvents === true) {
|
251
|
-
writer.uint32(48).bool(message.ecsEvents);
|
252
|
-
}
|
253
|
-
if (message.ecsEventsIncludeTxMetadata === true) {
|
254
|
-
writer.uint32(56).bool(message.ecsEventsIncludeTxMetadata);
|
255
|
-
}
|
256
|
-
return writer;
|
257
|
-
},
|
258
|
-
|
259
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): ECSStreamBlockBundleRequest {
|
260
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
261
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
262
|
-
const message = createBaseECSStreamBlockBundleRequest();
|
263
|
-
while (reader.pos < end) {
|
264
|
-
const tag = reader.uint32();
|
265
|
-
switch (tag >>> 3) {
|
266
|
-
case 1:
|
267
|
-
if (tag != 10) {
|
268
|
-
break;
|
269
|
-
}
|
270
|
-
|
271
|
-
message.worldAddress = reader.string();
|
272
|
-
continue;
|
273
|
-
case 2:
|
274
|
-
if (tag != 16) {
|
275
|
-
break;
|
276
|
-
}
|
277
|
-
|
278
|
-
message.blockNumber = reader.bool();
|
279
|
-
continue;
|
280
|
-
case 3:
|
281
|
-
if (tag != 24) {
|
282
|
-
break;
|
283
|
-
}
|
284
|
-
|
285
|
-
message.blockHash = reader.bool();
|
286
|
-
continue;
|
287
|
-
case 4:
|
288
|
-
if (tag != 32) {
|
289
|
-
break;
|
290
|
-
}
|
291
|
-
|
292
|
-
message.blockTimestamp = reader.bool();
|
293
|
-
continue;
|
294
|
-
case 5:
|
295
|
-
if (tag != 40) {
|
296
|
-
break;
|
297
|
-
}
|
298
|
-
|
299
|
-
message.transactionsConfirmed = reader.bool();
|
300
|
-
continue;
|
301
|
-
case 6:
|
302
|
-
if (tag != 48) {
|
303
|
-
break;
|
304
|
-
}
|
305
|
-
|
306
|
-
message.ecsEvents = reader.bool();
|
307
|
-
continue;
|
308
|
-
case 7:
|
309
|
-
if (tag != 56) {
|
310
|
-
break;
|
311
|
-
}
|
312
|
-
|
313
|
-
message.ecsEventsIncludeTxMetadata = reader.bool();
|
314
|
-
continue;
|
315
|
-
}
|
316
|
-
if ((tag & 7) == 4 || tag == 0) {
|
317
|
-
break;
|
318
|
-
}
|
319
|
-
reader.skipType(tag & 7);
|
320
|
-
}
|
321
|
-
return message;
|
322
|
-
},
|
323
|
-
|
324
|
-
create(base?: DeepPartial<ECSStreamBlockBundleRequest>): ECSStreamBlockBundleRequest {
|
325
|
-
return ECSStreamBlockBundleRequest.fromPartial(base ?? {});
|
326
|
-
},
|
327
|
-
|
328
|
-
fromPartial(object: DeepPartial<ECSStreamBlockBundleRequest>): ECSStreamBlockBundleRequest {
|
329
|
-
const message = createBaseECSStreamBlockBundleRequest();
|
330
|
-
message.worldAddress = object.worldAddress ?? "";
|
331
|
-
message.blockNumber = object.blockNumber ?? false;
|
332
|
-
message.blockHash = object.blockHash ?? false;
|
333
|
-
message.blockTimestamp = object.blockTimestamp ?? false;
|
334
|
-
message.transactionsConfirmed = object.transactionsConfirmed ?? false;
|
335
|
-
message.ecsEvents = object.ecsEvents ?? false;
|
336
|
-
message.ecsEventsIncludeTxMetadata = object.ecsEventsIncludeTxMetadata ?? false;
|
337
|
-
return message;
|
338
|
-
},
|
339
|
-
};
|
340
|
-
|
341
|
-
function createBaseECSStreamBlockBundleReply(): ECSStreamBlockBundleReply {
|
342
|
-
return { blockNumber: 0, blockHash: "", blockTimestamp: 0, transactionsConfirmed: [], ecsEvents: [] };
|
343
|
-
}
|
344
|
-
|
345
|
-
export const ECSStreamBlockBundleReply = {
|
346
|
-
encode(message: ECSStreamBlockBundleReply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
347
|
-
if (message.blockNumber !== 0) {
|
348
|
-
writer.uint32(8).uint32(message.blockNumber);
|
349
|
-
}
|
350
|
-
if (message.blockHash !== "") {
|
351
|
-
writer.uint32(18).string(message.blockHash);
|
352
|
-
}
|
353
|
-
if (message.blockTimestamp !== 0) {
|
354
|
-
writer.uint32(24).uint32(message.blockTimestamp);
|
355
|
-
}
|
356
|
-
for (const v of message.transactionsConfirmed) {
|
357
|
-
writer.uint32(34).string(v!);
|
358
|
-
}
|
359
|
-
for (const v of message.ecsEvents) {
|
360
|
-
ECSEvent.encode(v!, writer.uint32(42).fork()).ldelim();
|
361
|
-
}
|
362
|
-
return writer;
|
363
|
-
},
|
364
|
-
|
365
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): ECSStreamBlockBundleReply {
|
366
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
367
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
368
|
-
const message = createBaseECSStreamBlockBundleReply();
|
369
|
-
while (reader.pos < end) {
|
370
|
-
const tag = reader.uint32();
|
371
|
-
switch (tag >>> 3) {
|
372
|
-
case 1:
|
373
|
-
if (tag != 8) {
|
374
|
-
break;
|
375
|
-
}
|
376
|
-
|
377
|
-
message.blockNumber = reader.uint32();
|
378
|
-
continue;
|
379
|
-
case 2:
|
380
|
-
if (tag != 18) {
|
381
|
-
break;
|
382
|
-
}
|
383
|
-
|
384
|
-
message.blockHash = reader.string();
|
385
|
-
continue;
|
386
|
-
case 3:
|
387
|
-
if (tag != 24) {
|
388
|
-
break;
|
389
|
-
}
|
390
|
-
|
391
|
-
message.blockTimestamp = reader.uint32();
|
392
|
-
continue;
|
393
|
-
case 4:
|
394
|
-
if (tag != 34) {
|
395
|
-
break;
|
396
|
-
}
|
397
|
-
|
398
|
-
message.transactionsConfirmed.push(reader.string());
|
399
|
-
continue;
|
400
|
-
case 5:
|
401
|
-
if (tag != 42) {
|
402
|
-
break;
|
403
|
-
}
|
404
|
-
|
405
|
-
message.ecsEvents.push(ECSEvent.decode(reader, reader.uint32()));
|
406
|
-
continue;
|
407
|
-
}
|
408
|
-
if ((tag & 7) == 4 || tag == 0) {
|
409
|
-
break;
|
410
|
-
}
|
411
|
-
reader.skipType(tag & 7);
|
412
|
-
}
|
413
|
-
return message;
|
414
|
-
},
|
415
|
-
|
416
|
-
create(base?: DeepPartial<ECSStreamBlockBundleReply>): ECSStreamBlockBundleReply {
|
417
|
-
return ECSStreamBlockBundleReply.fromPartial(base ?? {});
|
418
|
-
},
|
419
|
-
|
420
|
-
fromPartial(object: DeepPartial<ECSStreamBlockBundleReply>): ECSStreamBlockBundleReply {
|
421
|
-
const message = createBaseECSStreamBlockBundleReply();
|
422
|
-
message.blockNumber = object.blockNumber ?? 0;
|
423
|
-
message.blockHash = object.blockHash ?? "";
|
424
|
-
message.blockTimestamp = object.blockTimestamp ?? 0;
|
425
|
-
message.transactionsConfirmed = object.transactionsConfirmed?.map((e) => e) || [];
|
426
|
-
message.ecsEvents = object.ecsEvents?.map((e) => ECSEvent.fromPartial(e)) || [];
|
427
|
-
return message;
|
428
|
-
},
|
429
|
-
};
|
430
|
-
|
431
|
-
/** The Stream Service definition. */
|
432
|
-
export type ECSStreamServiceDefinition = typeof ECSStreamServiceDefinition;
|
433
|
-
export const ECSStreamServiceDefinition = {
|
434
|
-
name: "ECSStreamService",
|
435
|
-
fullName: "ecsstream.ECSStreamService",
|
436
|
-
methods: {
|
437
|
-
/** Opens a cursor to receive the latest ECS events and additional data specified via request. */
|
438
|
-
subscribeToStreamLatest: {
|
439
|
-
name: "SubscribeToStreamLatest",
|
440
|
-
requestType: ECSStreamBlockBundleRequest,
|
441
|
-
requestStream: false,
|
442
|
-
responseType: ECSStreamBlockBundleReply,
|
443
|
-
responseStream: true,
|
444
|
-
options: {},
|
445
|
-
},
|
446
|
-
},
|
447
|
-
} as const;
|
448
|
-
|
449
|
-
export interface ECSStreamServiceImplementation<CallContextExt = {}> {
|
450
|
-
/** Opens a cursor to receive the latest ECS events and additional data specified via request. */
|
451
|
-
subscribeToStreamLatest(
|
452
|
-
request: ECSStreamBlockBundleRequest,
|
453
|
-
context: CallContext & CallContextExt
|
454
|
-
): ServerStreamingMethodResult<DeepPartial<ECSStreamBlockBundleReply>>;
|
455
|
-
}
|
456
|
-
|
457
|
-
export interface ECSStreamServiceClient<CallOptionsExt = {}> {
|
458
|
-
/** Opens a cursor to receive the latest ECS events and additional data specified via request. */
|
459
|
-
subscribeToStreamLatest(
|
460
|
-
request: DeepPartial<ECSStreamBlockBundleRequest>,
|
461
|
-
options?: CallOptions & CallOptionsExt
|
462
|
-
): AsyncIterable<ECSStreamBlockBundleReply>;
|
463
|
-
}
|
464
|
-
|
465
|
-
declare var self: any | undefined;
|
466
|
-
declare var window: any | undefined;
|
467
|
-
declare var global: any | undefined;
|
468
|
-
var tsProtoGlobalThis: any = (() => {
|
469
|
-
if (typeof globalThis !== "undefined") {
|
470
|
-
return globalThis;
|
471
|
-
}
|
472
|
-
if (typeof self !== "undefined") {
|
473
|
-
return self;
|
474
|
-
}
|
475
|
-
if (typeof window !== "undefined") {
|
476
|
-
return window;
|
477
|
-
}
|
478
|
-
if (typeof global !== "undefined") {
|
479
|
-
return global;
|
480
|
-
}
|
481
|
-
throw "Unable to locate global object";
|
482
|
-
})();
|
483
|
-
|
484
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
485
|
-
|
486
|
-
export type DeepPartial<T> = T extends Builtin
|
487
|
-
? T
|
488
|
-
: T extends Array<infer U>
|
489
|
-
? Array<DeepPartial<U>>
|
490
|
-
: T extends ReadonlyArray<infer U>
|
491
|
-
? ReadonlyArray<DeepPartial<U>>
|
492
|
-
: T extends {}
|
493
|
-
? { [K in keyof T]?: DeepPartial<T[K]> }
|
494
|
-
: Partial<T>;
|
495
|
-
|
496
|
-
function longToNumber(long: Long): number {
|
497
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
498
|
-
throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
499
|
-
}
|
500
|
-
return long.toNumber();
|
501
|
-
}
|
502
|
-
|
503
|
-
if (_m0.util.Long !== Long) {
|
504
|
-
_m0.util.Long = Long as any;
|
505
|
-
_m0.configure();
|
506
|
-
}
|
507
|
-
|
508
|
-
export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };
|
@@ -1,191 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
import _m0 from "protobufjs/minimal";
|
3
|
-
|
4
|
-
export const protobufPackage = "google.protobuf";
|
5
|
-
|
6
|
-
/**
|
7
|
-
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
8
|
-
* URL that describes the type of the serialized message.
|
9
|
-
*
|
10
|
-
* Protobuf library provides support to pack/unpack Any values in the form
|
11
|
-
* of utility functions or additional generated methods of the Any type.
|
12
|
-
*
|
13
|
-
* Example 1: Pack and unpack a message in C++.
|
14
|
-
*
|
15
|
-
* Foo foo = ...;
|
16
|
-
* Any any;
|
17
|
-
* any.PackFrom(foo);
|
18
|
-
* ...
|
19
|
-
* if (any.UnpackTo(&foo)) {
|
20
|
-
* ...
|
21
|
-
* }
|
22
|
-
*
|
23
|
-
* Example 2: Pack and unpack a message in Java.
|
24
|
-
*
|
25
|
-
* Foo foo = ...;
|
26
|
-
* Any any = Any.pack(foo);
|
27
|
-
* ...
|
28
|
-
* if (any.is(Foo.class)) {
|
29
|
-
* foo = any.unpack(Foo.class);
|
30
|
-
* }
|
31
|
-
*
|
32
|
-
* Example 3: Pack and unpack a message in Python.
|
33
|
-
*
|
34
|
-
* foo = Foo(...)
|
35
|
-
* any = Any()
|
36
|
-
* any.Pack(foo)
|
37
|
-
* ...
|
38
|
-
* if any.Is(Foo.DESCRIPTOR):
|
39
|
-
* any.Unpack(foo)
|
40
|
-
* ...
|
41
|
-
*
|
42
|
-
* Example 4: Pack and unpack a message in Go
|
43
|
-
*
|
44
|
-
* foo := &pb.Foo{...}
|
45
|
-
* any, err := anypb.New(foo)
|
46
|
-
* if err != nil {
|
47
|
-
* ...
|
48
|
-
* }
|
49
|
-
* ...
|
50
|
-
* foo := &pb.Foo{}
|
51
|
-
* if err := any.UnmarshalTo(foo); err != nil {
|
52
|
-
* ...
|
53
|
-
* }
|
54
|
-
*
|
55
|
-
* The pack methods provided by protobuf library will by default use
|
56
|
-
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
57
|
-
* methods only use the fully qualified type name after the last '/'
|
58
|
-
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
59
|
-
* name "y.z".
|
60
|
-
*
|
61
|
-
* JSON
|
62
|
-
*
|
63
|
-
* The JSON representation of an `Any` value uses the regular
|
64
|
-
* representation of the deserialized, embedded message, with an
|
65
|
-
* additional field `@type` which contains the type URL. Example:
|
66
|
-
*
|
67
|
-
* package google.profile;
|
68
|
-
* message Person {
|
69
|
-
* string first_name = 1;
|
70
|
-
* string last_name = 2;
|
71
|
-
* }
|
72
|
-
*
|
73
|
-
* {
|
74
|
-
* "@type": "type.googleapis.com/google.profile.Person",
|
75
|
-
* "firstName": <string>,
|
76
|
-
* "lastName": <string>
|
77
|
-
* }
|
78
|
-
*
|
79
|
-
* If the embedded message type is well-known and has a custom JSON
|
80
|
-
* representation, that representation will be embedded adding a field
|
81
|
-
* `value` which holds the custom JSON in addition to the `@type`
|
82
|
-
* field. Example (for message [google.protobuf.Duration][]):
|
83
|
-
*
|
84
|
-
* {
|
85
|
-
* "@type": "type.googleapis.com/google.protobuf.Duration",
|
86
|
-
* "value": "1.212s"
|
87
|
-
* }
|
88
|
-
*/
|
89
|
-
export interface Any {
|
90
|
-
/**
|
91
|
-
* A URL/resource name that uniquely identifies the type of the serialized
|
92
|
-
* protocol buffer message. This string must contain at least
|
93
|
-
* one "/" character. The last segment of the URL's path must represent
|
94
|
-
* the fully qualified name of the type (as in
|
95
|
-
* `path/google.protobuf.Duration`). The name should be in a canonical form
|
96
|
-
* (e.g., leading "." is not accepted).
|
97
|
-
*
|
98
|
-
* In practice, teams usually precompile into the binary all types that they
|
99
|
-
* expect it to use in the context of Any. However, for URLs which use the
|
100
|
-
* scheme `http`, `https`, or no scheme, one can optionally set up a type
|
101
|
-
* server that maps type URLs to message definitions as follows:
|
102
|
-
*
|
103
|
-
* * If no scheme is provided, `https` is assumed.
|
104
|
-
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
105
|
-
* value in binary format, or produce an error.
|
106
|
-
* * Applications are allowed to cache lookup results based on the
|
107
|
-
* URL, or have them precompiled into a binary to avoid any
|
108
|
-
* lookup. Therefore, binary compatibility needs to be preserved
|
109
|
-
* on changes to types. (Use versioned type names to manage
|
110
|
-
* breaking changes.)
|
111
|
-
*
|
112
|
-
* Note: this functionality is not currently available in the official
|
113
|
-
* protobuf release, and it is not used for type URLs beginning with
|
114
|
-
* type.googleapis.com.
|
115
|
-
*
|
116
|
-
* Schemes other than `http`, `https` (or the empty scheme) might be
|
117
|
-
* used with implementation specific semantics.
|
118
|
-
*/
|
119
|
-
typeUrl: string;
|
120
|
-
/** Must be a valid serialized protocol buffer of the above specified type. */
|
121
|
-
value: Uint8Array;
|
122
|
-
}
|
123
|
-
|
124
|
-
function createBaseAny(): Any {
|
125
|
-
return { typeUrl: "", value: new Uint8Array() };
|
126
|
-
}
|
127
|
-
|
128
|
-
export const Any = {
|
129
|
-
encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
130
|
-
if (message.typeUrl !== "") {
|
131
|
-
writer.uint32(10).string(message.typeUrl);
|
132
|
-
}
|
133
|
-
if (message.value.length !== 0) {
|
134
|
-
writer.uint32(18).bytes(message.value);
|
135
|
-
}
|
136
|
-
return writer;
|
137
|
-
},
|
138
|
-
|
139
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Any {
|
140
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
141
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
142
|
-
const message = createBaseAny();
|
143
|
-
while (reader.pos < end) {
|
144
|
-
const tag = reader.uint32();
|
145
|
-
switch (tag >>> 3) {
|
146
|
-
case 1:
|
147
|
-
if (tag != 10) {
|
148
|
-
break;
|
149
|
-
}
|
150
|
-
|
151
|
-
message.typeUrl = reader.string();
|
152
|
-
continue;
|
153
|
-
case 2:
|
154
|
-
if (tag != 18) {
|
155
|
-
break;
|
156
|
-
}
|
157
|
-
|
158
|
-
message.value = reader.bytes();
|
159
|
-
continue;
|
160
|
-
}
|
161
|
-
if ((tag & 7) == 4 || tag == 0) {
|
162
|
-
break;
|
163
|
-
}
|
164
|
-
reader.skipType(tag & 7);
|
165
|
-
}
|
166
|
-
return message;
|
167
|
-
},
|
168
|
-
|
169
|
-
create(base?: DeepPartial<Any>): Any {
|
170
|
-
return Any.fromPartial(base ?? {});
|
171
|
-
},
|
172
|
-
|
173
|
-
fromPartial(object: DeepPartial<Any>): Any {
|
174
|
-
const message = createBaseAny();
|
175
|
-
message.typeUrl = object.typeUrl ?? "";
|
176
|
-
message.value = object.value ?? new Uint8Array();
|
177
|
-
return message;
|
178
|
-
},
|
179
|
-
};
|
180
|
-
|
181
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
182
|
-
|
183
|
-
export type DeepPartial<T> = T extends Builtin
|
184
|
-
? T
|
185
|
-
: T extends Array<infer U>
|
186
|
-
? Array<DeepPartial<U>>
|
187
|
-
: T extends ReadonlyArray<infer U>
|
188
|
-
? ReadonlyArray<DeepPartial<U>>
|
189
|
-
: T extends {}
|
190
|
-
? { [K in keyof T]?: DeepPartial<T[K]> }
|
191
|
-
: Partial<T>;
|