@latticexyz/services 1.4.0 → 1.5.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.
@@ -1,643 +1,670 @@
1
1
  /* eslint-disable */
2
- // @generated by protobuf-ts 2.8.0 with parameter eslint_disable
3
- // @generated from protobuf file "ecs-relay.proto" (package "ecsrelay", syntax proto3)
4
- // tslint:disable
5
- import { ServiceType } from "@protobuf-ts/runtime-rpc";
6
- import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
7
- import type { IBinaryWriter } from "@protobuf-ts/runtime";
8
- import { WireType } from "@protobuf-ts/runtime";
9
- import type { BinaryReadOptions } from "@protobuf-ts/runtime";
10
- import type { IBinaryReader } from "@protobuf-ts/runtime";
11
- import { UnknownFieldHandler } from "@protobuf-ts/runtime";
12
- import type { PartialMessage } from "@protobuf-ts/runtime";
13
- import { reflectionMergePartial } from "@protobuf-ts/runtime";
14
- import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
15
- import { MessageType } from "@protobuf-ts/runtime";
16
- /**
17
- * Identifies a client connecting to Relay Service.
18
- *
19
- * @generated from protobuf message ecsrelay.Identity
20
- */
2
+ import Long from "long";
3
+ import { CallContext, CallOptions } from "nice-grpc-common";
4
+ import _m0 from "protobufjs/minimal";
5
+
6
+ export const protobufPackage = "ecsrelay";
7
+
8
+ /** Identifies a client connecting to Relay Service. */
21
9
  export interface Identity {
22
- /**
23
- * @generated from protobuf field: string name = 1;
24
- */
25
10
  name: string;
26
11
  }
27
- /**
28
- * Signature that a client must provide to prove ownership of identity.
29
- *
30
- * @generated from protobuf message ecsrelay.Signature
31
- */
12
+
13
+ /** Signature that a client must provide to prove ownership of identity. */
32
14
  export interface Signature {
33
- /**
34
- * @generated from protobuf field: string signature = 1;
35
- */
36
15
  signature: string;
37
16
  }
38
- /**
39
- * @generated from protobuf message ecsrelay.Message
40
- */
17
+
41
18
  export interface Message {
42
- /**
43
- * @generated from protobuf field: uint32 version = 1;
44
- */
45
19
  version: number;
46
- /**
47
- * @generated from protobuf field: string id = 2;
48
- */
49
20
  id: string;
50
- /**
51
- * @generated from protobuf field: bytes data = 3;
52
- */
53
21
  data: Uint8Array;
54
- /**
55
- * @generated from protobuf field: int64 timestamp = 4;
56
- */
57
- timestamp: bigint;
58
- /**
59
- * @generated from protobuf field: string signature = 5;
60
- */
22
+ timestamp: number;
61
23
  signature: string;
62
24
  }
63
- /**
64
- * @generated from protobuf message ecsrelay.SubscriptionRequest
65
- */
25
+
66
26
  export interface SubscriptionRequest {
67
- /**
68
- * @generated from protobuf field: ecsrelay.Signature signature = 1;
69
- */
70
- signature?: Signature;
71
- /**
72
- * @generated from protobuf field: ecsrelay.Subscription subscription = 2;
73
- */
74
- subscription?: Subscription;
27
+ signature: Signature | undefined;
28
+ subscription: Subscription | undefined;
75
29
  }
76
- /**
77
- * @generated from protobuf message ecsrelay.Subscription
78
- */
30
+
79
31
  export interface Subscription {
80
- /**
81
- * @generated from protobuf field: string label = 1;
82
- */
83
32
  label: string;
84
33
  }
85
- /**
86
- * @generated from protobuf message ecsrelay.PushRequest
87
- */
34
+
88
35
  export interface PushRequest {
89
- /**
90
- * @generated from protobuf field: string label = 1;
91
- */
92
36
  label: string;
93
- /**
94
- * @generated from protobuf field: ecsrelay.Message message = 2;
95
- */
96
- message?: Message;
37
+ message: Message | undefined;
97
38
  }
98
- /**
99
- * @generated from protobuf message ecsrelay.PushManyRequest
100
- */
39
+
101
40
  export interface PushManyRequest {
102
- /**
103
- * @generated from protobuf field: ecsrelay.Signature signature = 1;
104
- */
105
- signature?: Signature;
106
- /**
107
- * @generated from protobuf field: string label = 2;
108
- */
41
+ signature: Signature | undefined;
109
42
  label: string;
110
- /**
111
- * @generated from protobuf field: repeated ecsrelay.Message messages = 3;
112
- */
113
43
  messages: Message[];
114
44
  }
115
- /**
116
- * @generated from protobuf message ecsrelay.PushResponse
117
- */
45
+
118
46
  export interface PushResponse {}
119
- /**
120
- * @generated from protobuf message ecsrelay.CountIdentitiesRequest
121
- */
47
+
122
48
  export interface CountIdentitiesRequest {}
123
- /**
124
- * @generated from protobuf message ecsrelay.CountIdentitiesResponse
125
- */
49
+
126
50
  export interface CountIdentitiesResponse {
127
- /**
128
- * @generated from protobuf field: uint32 count = 1;
129
- */
130
51
  count: number;
131
52
  }
132
- // @generated message type with reflection information, may provide speed optimized methods
133
- class Identity$Type extends MessageType<Identity> {
134
- constructor() {
135
- super("ecsrelay.Identity", [{ no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }]);
136
- }
137
- create(value?: PartialMessage<Identity>): Identity {
138
- const message = { name: "" };
139
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
140
- if (value !== undefined) reflectionMergePartial<Identity>(this, message, value);
141
- return message;
142
- }
143
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Identity): Identity {
144
- let message = target ?? this.create(),
145
- end = reader.pos + length;
53
+
54
+ function createBaseIdentity(): Identity {
55
+ return { name: "" };
56
+ }
57
+
58
+ export const Identity = {
59
+ encode(message: Identity, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
60
+ if (message.name !== "") {
61
+ writer.uint32(10).string(message.name);
62
+ }
63
+ return writer;
64
+ },
65
+
66
+ decode(input: _m0.Reader | Uint8Array, length?: number): Identity {
67
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
68
+ let end = length === undefined ? reader.len : reader.pos + length;
69
+ const message = createBaseIdentity();
146
70
  while (reader.pos < end) {
147
- let [fieldNo, wireType] = reader.tag();
148
- switch (fieldNo) {
149
- case /* string name */ 1:
71
+ const tag = reader.uint32();
72
+ switch (tag >>> 3) {
73
+ case 1:
150
74
  message.name = reader.string();
151
75
  break;
152
76
  default:
153
- let u = options.readUnknownField;
154
- if (u === "throw")
155
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
156
- let d = reader.skip(wireType);
157
- if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
77
+ reader.skipType(tag & 7);
78
+ break;
158
79
  }
159
80
  }
160
81
  return message;
161
- }
162
- internalBinaryWrite(message: Identity, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
163
- /* string name = 1; */
164
- if (message.name !== "") writer.tag(1, WireType.LengthDelimited).string(message.name);
165
- let u = options.writeUnknownFields;
166
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
167
- return writer;
168
- }
169
- }
170
- /**
171
- * @generated MessageType for protobuf message ecsrelay.Identity
172
- */
173
- export const Identity = new Identity$Type();
174
- // @generated message type with reflection information, may provide speed optimized methods
175
- class Signature$Type extends MessageType<Signature> {
176
- constructor() {
177
- super("ecsrelay.Signature", [{ no: 1, name: "signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ }]);
178
- }
179
- create(value?: PartialMessage<Signature>): Signature {
180
- const message = { signature: "" };
181
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
182
- if (value !== undefined) reflectionMergePartial<Signature>(this, message, value);
82
+ },
83
+
84
+ fromPartial(object: DeepPartial<Identity>): Identity {
85
+ const message = createBaseIdentity();
86
+ message.name = object.name ?? "";
183
87
  return message;
184
- }
185
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Signature): Signature {
186
- let message = target ?? this.create(),
187
- end = reader.pos + length;
88
+ },
89
+ };
90
+
91
+ function createBaseSignature(): Signature {
92
+ return { signature: "" };
93
+ }
94
+
95
+ export const Signature = {
96
+ encode(message: Signature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
97
+ if (message.signature !== "") {
98
+ writer.uint32(10).string(message.signature);
99
+ }
100
+ return writer;
101
+ },
102
+
103
+ decode(input: _m0.Reader | Uint8Array, length?: number): Signature {
104
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
105
+ let end = length === undefined ? reader.len : reader.pos + length;
106
+ const message = createBaseSignature();
188
107
  while (reader.pos < end) {
189
- let [fieldNo, wireType] = reader.tag();
190
- switch (fieldNo) {
191
- case /* string signature */ 1:
108
+ const tag = reader.uint32();
109
+ switch (tag >>> 3) {
110
+ case 1:
192
111
  message.signature = reader.string();
193
112
  break;
194
113
  default:
195
- let u = options.readUnknownField;
196
- if (u === "throw")
197
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
198
- let d = reader.skip(wireType);
199
- if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
114
+ reader.skipType(tag & 7);
115
+ break;
200
116
  }
201
117
  }
202
118
  return message;
203
- }
204
- internalBinaryWrite(message: Signature, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
205
- /* string signature = 1; */
206
- if (message.signature !== "") writer.tag(1, WireType.LengthDelimited).string(message.signature);
207
- let u = options.writeUnknownFields;
208
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
209
- return writer;
210
- }
211
- }
212
- /**
213
- * @generated MessageType for protobuf message ecsrelay.Signature
214
- */
215
- export const Signature = new Signature$Type();
216
- // @generated message type with reflection information, may provide speed optimized methods
217
- class Message$Type extends MessageType<Message> {
218
- constructor() {
219
- super("ecsrelay.Message", [
220
- { no: 1, name: "version", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
221
- { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
222
- { no: 3, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
223
- { no: 4, name: "timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
224
- { no: 5, name: "signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
225
- ]);
226
- }
227
- create(value?: PartialMessage<Message>): Message {
228
- const message = { version: 0, id: "", data: new Uint8Array(0), timestamp: 0n, signature: "" };
229
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
230
- if (value !== undefined) reflectionMergePartial<Message>(this, message, value);
119
+ },
120
+
121
+ fromPartial(object: DeepPartial<Signature>): Signature {
122
+ const message = createBaseSignature();
123
+ message.signature = object.signature ?? "";
231
124
  return message;
232
- }
233
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Message): Message {
234
- let message = target ?? this.create(),
235
- end = reader.pos + length;
125
+ },
126
+ };
127
+
128
+ function createBaseMessage(): Message {
129
+ return { version: 0, id: "", data: new Uint8Array(), timestamp: 0, signature: "" };
130
+ }
131
+
132
+ export const Message = {
133
+ encode(message: Message, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
134
+ if (message.version !== 0) {
135
+ writer.uint32(8).uint32(message.version);
136
+ }
137
+ if (message.id !== "") {
138
+ writer.uint32(18).string(message.id);
139
+ }
140
+ if (message.data.length !== 0) {
141
+ writer.uint32(26).bytes(message.data);
142
+ }
143
+ if (message.timestamp !== 0) {
144
+ writer.uint32(32).int64(message.timestamp);
145
+ }
146
+ if (message.signature !== "") {
147
+ writer.uint32(42).string(message.signature);
148
+ }
149
+ return writer;
150
+ },
151
+
152
+ decode(input: _m0.Reader | Uint8Array, length?: number): Message {
153
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
154
+ let end = length === undefined ? reader.len : reader.pos + length;
155
+ const message = createBaseMessage();
236
156
  while (reader.pos < end) {
237
- let [fieldNo, wireType] = reader.tag();
238
- switch (fieldNo) {
239
- case /* uint32 version */ 1:
157
+ const tag = reader.uint32();
158
+ switch (tag >>> 3) {
159
+ case 1:
240
160
  message.version = reader.uint32();
241
161
  break;
242
- case /* string id */ 2:
162
+ case 2:
243
163
  message.id = reader.string();
244
164
  break;
245
- case /* bytes data */ 3:
165
+ case 3:
246
166
  message.data = reader.bytes();
247
167
  break;
248
- case /* int64 timestamp */ 4:
249
- message.timestamp = reader.int64().toBigInt();
168
+ case 4:
169
+ message.timestamp = longToNumber(reader.int64() as Long);
250
170
  break;
251
- case /* string signature */ 5:
171
+ case 5:
252
172
  message.signature = reader.string();
253
173
  break;
254
174
  default:
255
- let u = options.readUnknownField;
256
- if (u === "throw")
257
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
258
- let d = reader.skip(wireType);
259
- if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
175
+ reader.skipType(tag & 7);
176
+ break;
260
177
  }
261
178
  }
262
179
  return message;
263
- }
264
- internalBinaryWrite(message: Message, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
265
- /* uint32 version = 1; */
266
- if (message.version !== 0) writer.tag(1, WireType.Varint).uint32(message.version);
267
- /* string id = 2; */
268
- if (message.id !== "") writer.tag(2, WireType.LengthDelimited).string(message.id);
269
- /* bytes data = 3; */
270
- if (message.data.length) writer.tag(3, WireType.LengthDelimited).bytes(message.data);
271
- /* int64 timestamp = 4; */
272
- if (message.timestamp !== 0n) writer.tag(4, WireType.Varint).int64(message.timestamp);
273
- /* string signature = 5; */
274
- if (message.signature !== "") writer.tag(5, WireType.LengthDelimited).string(message.signature);
275
- let u = options.writeUnknownFields;
276
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
277
- return writer;
278
- }
279
- }
280
- /**
281
- * @generated MessageType for protobuf message ecsrelay.Message
282
- */
283
- export const Message = new Message$Type();
284
- // @generated message type with reflection information, may provide speed optimized methods
285
- class SubscriptionRequest$Type extends MessageType<SubscriptionRequest> {
286
- constructor() {
287
- super("ecsrelay.SubscriptionRequest", [
288
- { no: 1, name: "signature", kind: "message", T: () => Signature },
289
- { no: 2, name: "subscription", kind: "message", T: () => Subscription },
290
- ]);
291
- }
292
- create(value?: PartialMessage<SubscriptionRequest>): SubscriptionRequest {
293
- const message = {};
294
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
295
- if (value !== undefined) reflectionMergePartial<SubscriptionRequest>(this, message, value);
180
+ },
181
+
182
+ fromPartial(object: DeepPartial<Message>): Message {
183
+ const message = createBaseMessage();
184
+ message.version = object.version ?? 0;
185
+ message.id = object.id ?? "";
186
+ message.data = object.data ?? new Uint8Array();
187
+ message.timestamp = object.timestamp ?? 0;
188
+ message.signature = object.signature ?? "";
296
189
  return message;
297
- }
298
- internalBinaryRead(
299
- reader: IBinaryReader,
300
- length: number,
301
- options: BinaryReadOptions,
302
- target?: SubscriptionRequest
303
- ): SubscriptionRequest {
304
- let message = target ?? this.create(),
305
- end = reader.pos + length;
190
+ },
191
+ };
192
+
193
+ function createBaseSubscriptionRequest(): SubscriptionRequest {
194
+ return { signature: undefined, subscription: undefined };
195
+ }
196
+
197
+ export const SubscriptionRequest = {
198
+ encode(message: SubscriptionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
199
+ if (message.signature !== undefined) {
200
+ Signature.encode(message.signature, writer.uint32(10).fork()).ldelim();
201
+ }
202
+ if (message.subscription !== undefined) {
203
+ Subscription.encode(message.subscription, writer.uint32(18).fork()).ldelim();
204
+ }
205
+ return writer;
206
+ },
207
+
208
+ decode(input: _m0.Reader | Uint8Array, length?: number): SubscriptionRequest {
209
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
210
+ let end = length === undefined ? reader.len : reader.pos + length;
211
+ const message = createBaseSubscriptionRequest();
306
212
  while (reader.pos < end) {
307
- let [fieldNo, wireType] = reader.tag();
308
- switch (fieldNo) {
309
- case /* ecsrelay.Signature signature */ 1:
310
- message.signature = Signature.internalBinaryRead(reader, reader.uint32(), options, message.signature);
213
+ const tag = reader.uint32();
214
+ switch (tag >>> 3) {
215
+ case 1:
216
+ message.signature = Signature.decode(reader, reader.uint32());
311
217
  break;
312
- case /* ecsrelay.Subscription subscription */ 2:
313
- message.subscription = Subscription.internalBinaryRead(
314
- reader,
315
- reader.uint32(),
316
- options,
317
- message.subscription
318
- );
218
+ case 2:
219
+ message.subscription = Subscription.decode(reader, reader.uint32());
319
220
  break;
320
221
  default:
321
- let u = options.readUnknownField;
322
- if (u === "throw")
323
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
324
- let d = reader.skip(wireType);
325
- if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
222
+ reader.skipType(tag & 7);
223
+ break;
326
224
  }
327
225
  }
328
226
  return message;
329
- }
330
- internalBinaryWrite(message: SubscriptionRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
331
- /* ecsrelay.Signature signature = 1; */
332
- if (message.signature)
333
- Signature.internalBinaryWrite(message.signature, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
334
- /* ecsrelay.Subscription subscription = 2; */
335
- if (message.subscription)
336
- Subscription.internalBinaryWrite(
337
- message.subscription,
338
- writer.tag(2, WireType.LengthDelimited).fork(),
339
- options
340
- ).join();
341
- let u = options.writeUnknownFields;
342
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
343
- return writer;
344
- }
345
- }
346
- /**
347
- * @generated MessageType for protobuf message ecsrelay.SubscriptionRequest
348
- */
349
- export const SubscriptionRequest = new SubscriptionRequest$Type();
350
- // @generated message type with reflection information, may provide speed optimized methods
351
- class Subscription$Type extends MessageType<Subscription> {
352
- constructor() {
353
- super("ecsrelay.Subscription", [{ no: 1, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }]);
354
- }
355
- create(value?: PartialMessage<Subscription>): Subscription {
356
- const message = { label: "" };
357
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
358
- if (value !== undefined) reflectionMergePartial<Subscription>(this, message, value);
227
+ },
228
+
229
+ fromPartial(object: DeepPartial<SubscriptionRequest>): SubscriptionRequest {
230
+ const message = createBaseSubscriptionRequest();
231
+ message.signature =
232
+ object.signature !== undefined && object.signature !== null ? Signature.fromPartial(object.signature) : undefined;
233
+ message.subscription =
234
+ object.subscription !== undefined && object.subscription !== null
235
+ ? Subscription.fromPartial(object.subscription)
236
+ : undefined;
359
237
  return message;
360
- }
361
- internalBinaryRead(
362
- reader: IBinaryReader,
363
- length: number,
364
- options: BinaryReadOptions,
365
- target?: Subscription
366
- ): Subscription {
367
- let message = target ?? this.create(),
368
- end = reader.pos + length;
238
+ },
239
+ };
240
+
241
+ function createBaseSubscription(): Subscription {
242
+ return { label: "" };
243
+ }
244
+
245
+ export const Subscription = {
246
+ encode(message: Subscription, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
247
+ if (message.label !== "") {
248
+ writer.uint32(10).string(message.label);
249
+ }
250
+ return writer;
251
+ },
252
+
253
+ decode(input: _m0.Reader | Uint8Array, length?: number): Subscription {
254
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
255
+ let end = length === undefined ? reader.len : reader.pos + length;
256
+ const message = createBaseSubscription();
369
257
  while (reader.pos < end) {
370
- let [fieldNo, wireType] = reader.tag();
371
- switch (fieldNo) {
372
- case /* string label */ 1:
258
+ const tag = reader.uint32();
259
+ switch (tag >>> 3) {
260
+ case 1:
373
261
  message.label = reader.string();
374
262
  break;
375
263
  default:
376
- let u = options.readUnknownField;
377
- if (u === "throw")
378
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
379
- let d = reader.skip(wireType);
380
- if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
264
+ reader.skipType(tag & 7);
265
+ break;
381
266
  }
382
267
  }
383
268
  return message;
384
- }
385
- internalBinaryWrite(message: Subscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
386
- /* string label = 1; */
387
- if (message.label !== "") writer.tag(1, WireType.LengthDelimited).string(message.label);
388
- let u = options.writeUnknownFields;
389
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
390
- return writer;
391
- }
392
- }
393
- /**
394
- * @generated MessageType for protobuf message ecsrelay.Subscription
395
- */
396
- export const Subscription = new Subscription$Type();
397
- // @generated message type with reflection information, may provide speed optimized methods
398
- class PushRequest$Type extends MessageType<PushRequest> {
399
- constructor() {
400
- super("ecsrelay.PushRequest", [
401
- { no: 1, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
402
- { no: 2, name: "message", kind: "message", T: () => Message },
403
- ]);
404
- }
405
- create(value?: PartialMessage<PushRequest>): PushRequest {
406
- const message = { label: "" };
407
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
408
- if (value !== undefined) reflectionMergePartial<PushRequest>(this, message, value);
269
+ },
270
+
271
+ fromPartial(object: DeepPartial<Subscription>): Subscription {
272
+ const message = createBaseSubscription();
273
+ message.label = object.label ?? "";
409
274
  return message;
410
- }
411
- internalBinaryRead(
412
- reader: IBinaryReader,
413
- length: number,
414
- options: BinaryReadOptions,
415
- target?: PushRequest
416
- ): PushRequest {
417
- let message = target ?? this.create(),
418
- end = reader.pos + length;
275
+ },
276
+ };
277
+
278
+ function createBasePushRequest(): PushRequest {
279
+ return { label: "", message: undefined };
280
+ }
281
+
282
+ export const PushRequest = {
283
+ encode(message: PushRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
284
+ if (message.label !== "") {
285
+ writer.uint32(10).string(message.label);
286
+ }
287
+ if (message.message !== undefined) {
288
+ Message.encode(message.message, writer.uint32(18).fork()).ldelim();
289
+ }
290
+ return writer;
291
+ },
292
+
293
+ decode(input: _m0.Reader | Uint8Array, length?: number): PushRequest {
294
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
295
+ let end = length === undefined ? reader.len : reader.pos + length;
296
+ const message = createBasePushRequest();
419
297
  while (reader.pos < end) {
420
- let [fieldNo, wireType] = reader.tag();
421
- switch (fieldNo) {
422
- case /* string label */ 1:
298
+ const tag = reader.uint32();
299
+ switch (tag >>> 3) {
300
+ case 1:
423
301
  message.label = reader.string();
424
302
  break;
425
- case /* ecsrelay.Message message */ 2:
426
- message.message = Message.internalBinaryRead(reader, reader.uint32(), options, message.message);
303
+ case 2:
304
+ message.message = Message.decode(reader, reader.uint32());
427
305
  break;
428
306
  default:
429
- let u = options.readUnknownField;
430
- if (u === "throw")
431
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
432
- let d = reader.skip(wireType);
433
- if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
307
+ reader.skipType(tag & 7);
308
+ break;
434
309
  }
435
310
  }
436
311
  return message;
437
- }
438
- internalBinaryWrite(message: PushRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
439
- /* string label = 1; */
440
- if (message.label !== "") writer.tag(1, WireType.LengthDelimited).string(message.label);
441
- /* ecsrelay.Message message = 2; */
442
- if (message.message)
443
- Message.internalBinaryWrite(message.message, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
444
- let u = options.writeUnknownFields;
445
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
446
- return writer;
447
- }
448
- }
449
- /**
450
- * @generated MessageType for protobuf message ecsrelay.PushRequest
451
- */
452
- export const PushRequest = new PushRequest$Type();
453
- // @generated message type with reflection information, may provide speed optimized methods
454
- class PushManyRequest$Type extends MessageType<PushManyRequest> {
455
- constructor() {
456
- super("ecsrelay.PushManyRequest", [
457
- { no: 1, name: "signature", kind: "message", T: () => Signature },
458
- { no: 2, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
459
- { no: 3, name: "messages", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Message },
460
- ]);
461
- }
462
- create(value?: PartialMessage<PushManyRequest>): PushManyRequest {
463
- const message = { label: "", messages: [] };
464
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
465
- if (value !== undefined) reflectionMergePartial<PushManyRequest>(this, message, value);
312
+ },
313
+
314
+ fromPartial(object: DeepPartial<PushRequest>): PushRequest {
315
+ const message = createBasePushRequest();
316
+ message.label = object.label ?? "";
317
+ message.message =
318
+ object.message !== undefined && object.message !== null ? Message.fromPartial(object.message) : undefined;
466
319
  return message;
467
- }
468
- internalBinaryRead(
469
- reader: IBinaryReader,
470
- length: number,
471
- options: BinaryReadOptions,
472
- target?: PushManyRequest
473
- ): PushManyRequest {
474
- let message = target ?? this.create(),
475
- end = reader.pos + length;
320
+ },
321
+ };
322
+
323
+ function createBasePushManyRequest(): PushManyRequest {
324
+ return { signature: undefined, label: "", messages: [] };
325
+ }
326
+
327
+ export const PushManyRequest = {
328
+ encode(message: PushManyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
329
+ if (message.signature !== undefined) {
330
+ Signature.encode(message.signature, writer.uint32(10).fork()).ldelim();
331
+ }
332
+ if (message.label !== "") {
333
+ writer.uint32(18).string(message.label);
334
+ }
335
+ for (const v of message.messages) {
336
+ Message.encode(v!, writer.uint32(26).fork()).ldelim();
337
+ }
338
+ return writer;
339
+ },
340
+
341
+ decode(input: _m0.Reader | Uint8Array, length?: number): PushManyRequest {
342
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
343
+ let end = length === undefined ? reader.len : reader.pos + length;
344
+ const message = createBasePushManyRequest();
476
345
  while (reader.pos < end) {
477
- let [fieldNo, wireType] = reader.tag();
478
- switch (fieldNo) {
479
- case /* ecsrelay.Signature signature */ 1:
480
- message.signature = Signature.internalBinaryRead(reader, reader.uint32(), options, message.signature);
346
+ const tag = reader.uint32();
347
+ switch (tag >>> 3) {
348
+ case 1:
349
+ message.signature = Signature.decode(reader, reader.uint32());
481
350
  break;
482
- case /* string label */ 2:
351
+ case 2:
483
352
  message.label = reader.string();
484
353
  break;
485
- case /* repeated ecsrelay.Message messages */ 3:
486
- message.messages.push(Message.internalBinaryRead(reader, reader.uint32(), options));
354
+ case 3:
355
+ message.messages.push(Message.decode(reader, reader.uint32()));
487
356
  break;
488
357
  default:
489
- let u = options.readUnknownField;
490
- if (u === "throw")
491
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
492
- let d = reader.skip(wireType);
493
- if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
358
+ reader.skipType(tag & 7);
359
+ break;
494
360
  }
495
361
  }
496
362
  return message;
497
- }
498
- internalBinaryWrite(message: PushManyRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
499
- /* ecsrelay.Signature signature = 1; */
500
- if (message.signature)
501
- Signature.internalBinaryWrite(message.signature, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
502
- /* string label = 2; */
503
- if (message.label !== "") writer.tag(2, WireType.LengthDelimited).string(message.label);
504
- /* repeated ecsrelay.Message messages = 3; */
505
- for (let i = 0; i < message.messages.length; i++)
506
- Message.internalBinaryWrite(message.messages[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
507
- let u = options.writeUnknownFields;
508
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
509
- return writer;
510
- }
511
- }
512
- /**
513
- * @generated MessageType for protobuf message ecsrelay.PushManyRequest
514
- */
515
- export const PushManyRequest = new PushManyRequest$Type();
516
- // @generated message type with reflection information, may provide speed optimized methods
517
- class PushResponse$Type extends MessageType<PushResponse> {
518
- constructor() {
519
- super("ecsrelay.PushResponse", []);
520
- }
521
- create(value?: PartialMessage<PushResponse>): PushResponse {
522
- const message = {};
523
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
524
- if (value !== undefined) reflectionMergePartial<PushResponse>(this, message, value);
363
+ },
364
+
365
+ fromPartial(object: DeepPartial<PushManyRequest>): PushManyRequest {
366
+ const message = createBasePushManyRequest();
367
+ message.signature =
368
+ object.signature !== undefined && object.signature !== null ? Signature.fromPartial(object.signature) : undefined;
369
+ message.label = object.label ?? "";
370
+ message.messages = object.messages?.map((e) => Message.fromPartial(e)) || [];
525
371
  return message;
526
- }
527
- internalBinaryRead(
528
- reader: IBinaryReader,
529
- length: number,
530
- options: BinaryReadOptions,
531
- target?: PushResponse
532
- ): PushResponse {
533
- return target ?? this.create();
534
- }
535
- internalBinaryWrite(message: PushResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
536
- let u = options.writeUnknownFields;
537
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
538
- return writer;
539
- }
372
+ },
373
+ };
374
+
375
+ function createBasePushResponse(): PushResponse {
376
+ return {};
540
377
  }
541
- /**
542
- * @generated MessageType for protobuf message ecsrelay.PushResponse
543
- */
544
- export const PushResponse = new PushResponse$Type();
545
- // @generated message type with reflection information, may provide speed optimized methods
546
- class CountIdentitiesRequest$Type extends MessageType<CountIdentitiesRequest> {
547
- constructor() {
548
- super("ecsrelay.CountIdentitiesRequest", []);
549
- }
550
- create(value?: PartialMessage<CountIdentitiesRequest>): CountIdentitiesRequest {
551
- const message = {};
552
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
553
- if (value !== undefined) reflectionMergePartial<CountIdentitiesRequest>(this, message, value);
554
- return message;
555
- }
556
- internalBinaryRead(
557
- reader: IBinaryReader,
558
- length: number,
559
- options: BinaryReadOptions,
560
- target?: CountIdentitiesRequest
561
- ): CountIdentitiesRequest {
562
- return target ?? this.create();
563
- }
564
- internalBinaryWrite(
565
- message: CountIdentitiesRequest,
566
- writer: IBinaryWriter,
567
- options: BinaryWriteOptions
568
- ): IBinaryWriter {
569
- let u = options.writeUnknownFields;
570
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
378
+
379
+ export const PushResponse = {
380
+ encode(_: PushResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
571
381
  return writer;
572
- }
382
+ },
383
+
384
+ decode(input: _m0.Reader | Uint8Array, length?: number): PushResponse {
385
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
386
+ let end = length === undefined ? reader.len : reader.pos + length;
387
+ const message = createBasePushResponse();
388
+ while (reader.pos < end) {
389
+ const tag = reader.uint32();
390
+ switch (tag >>> 3) {
391
+ default:
392
+ reader.skipType(tag & 7);
393
+ break;
394
+ }
395
+ }
396
+ return message;
397
+ },
398
+
399
+ fromPartial(_: DeepPartial<PushResponse>): PushResponse {
400
+ const message = createBasePushResponse();
401
+ return message;
402
+ },
403
+ };
404
+
405
+ function createBaseCountIdentitiesRequest(): CountIdentitiesRequest {
406
+ return {};
573
407
  }
574
- /**
575
- * @generated MessageType for protobuf message ecsrelay.CountIdentitiesRequest
576
- */
577
- export const CountIdentitiesRequest = new CountIdentitiesRequest$Type();
578
- // @generated message type with reflection information, may provide speed optimized methods
579
- class CountIdentitiesResponse$Type extends MessageType<CountIdentitiesResponse> {
580
- constructor() {
581
- super("ecsrelay.CountIdentitiesResponse", [{ no: 1, name: "count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }]);
582
- }
583
- create(value?: PartialMessage<CountIdentitiesResponse>): CountIdentitiesResponse {
584
- const message = { count: 0 };
585
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
586
- if (value !== undefined) reflectionMergePartial<CountIdentitiesResponse>(this, message, value);
408
+
409
+ export const CountIdentitiesRequest = {
410
+ encode(_: CountIdentitiesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
411
+ return writer;
412
+ },
413
+
414
+ decode(input: _m0.Reader | Uint8Array, length?: number): CountIdentitiesRequest {
415
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
416
+ let end = length === undefined ? reader.len : reader.pos + length;
417
+ const message = createBaseCountIdentitiesRequest();
418
+ while (reader.pos < end) {
419
+ const tag = reader.uint32();
420
+ switch (tag >>> 3) {
421
+ default:
422
+ reader.skipType(tag & 7);
423
+ break;
424
+ }
425
+ }
587
426
  return message;
588
- }
589
- internalBinaryRead(
590
- reader: IBinaryReader,
591
- length: number,
592
- options: BinaryReadOptions,
593
- target?: CountIdentitiesResponse
594
- ): CountIdentitiesResponse {
595
- let message = target ?? this.create(),
596
- end = reader.pos + length;
427
+ },
428
+
429
+ fromPartial(_: DeepPartial<CountIdentitiesRequest>): CountIdentitiesRequest {
430
+ const message = createBaseCountIdentitiesRequest();
431
+ return message;
432
+ },
433
+ };
434
+
435
+ function createBaseCountIdentitiesResponse(): CountIdentitiesResponse {
436
+ return { count: 0 };
437
+ }
438
+
439
+ export const CountIdentitiesResponse = {
440
+ encode(message: CountIdentitiesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
441
+ if (message.count !== 0) {
442
+ writer.uint32(8).uint32(message.count);
443
+ }
444
+ return writer;
445
+ },
446
+
447
+ decode(input: _m0.Reader | Uint8Array, length?: number): CountIdentitiesResponse {
448
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
449
+ let end = length === undefined ? reader.len : reader.pos + length;
450
+ const message = createBaseCountIdentitiesResponse();
597
451
  while (reader.pos < end) {
598
- let [fieldNo, wireType] = reader.tag();
599
- switch (fieldNo) {
600
- case /* uint32 count */ 1:
452
+ const tag = reader.uint32();
453
+ switch (tag >>> 3) {
454
+ case 1:
601
455
  message.count = reader.uint32();
602
456
  break;
603
457
  default:
604
- let u = options.readUnknownField;
605
- if (u === "throw")
606
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
607
- let d = reader.skip(wireType);
608
- if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
458
+ reader.skipType(tag & 7);
459
+ break;
609
460
  }
610
461
  }
611
462
  return message;
612
- }
613
- internalBinaryWrite(
614
- message: CountIdentitiesResponse,
615
- writer: IBinaryWriter,
616
- options: BinaryWriteOptions
617
- ): IBinaryWriter {
618
- /* uint32 count = 1; */
619
- if (message.count !== 0) writer.tag(1, WireType.Varint).uint32(message.count);
620
- let u = options.writeUnknownFields;
621
- if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
622
- return writer;
623
- }
463
+ },
464
+
465
+ fromPartial(object: DeepPartial<CountIdentitiesResponse>): CountIdentitiesResponse {
466
+ const message = createBaseCountIdentitiesResponse();
467
+ message.count = object.count ?? 0;
468
+ return message;
469
+ },
470
+ };
471
+
472
+ /** The Relay Service definition. */
473
+ export type ECSRelayServiceDefinition = typeof ECSRelayServiceDefinition;
474
+ export const ECSRelayServiceDefinition = {
475
+ name: "ECSRelayService",
476
+ fullName: "ecsrelay.ECSRelayService",
477
+ methods: {
478
+ authenticate: {
479
+ name: "Authenticate",
480
+ requestType: Signature,
481
+ requestStream: false,
482
+ responseType: Identity,
483
+ responseStream: false,
484
+ options: {},
485
+ },
486
+ revoke: {
487
+ name: "Revoke",
488
+ requestType: Signature,
489
+ requestStream: false,
490
+ responseType: Identity,
491
+ responseStream: false,
492
+ options: {},
493
+ },
494
+ ping: {
495
+ name: "Ping",
496
+ requestType: Signature,
497
+ requestStream: false,
498
+ responseType: Identity,
499
+ responseStream: false,
500
+ options: {},
501
+ },
502
+ countAuthenticated: {
503
+ name: "CountAuthenticated",
504
+ requestType: CountIdentitiesRequest,
505
+ requestStream: false,
506
+ responseType: CountIdentitiesResponse,
507
+ responseStream: false,
508
+ options: {},
509
+ },
510
+ countConnected: {
511
+ name: "CountConnected",
512
+ requestType: CountIdentitiesRequest,
513
+ requestStream: false,
514
+ responseType: CountIdentitiesResponse,
515
+ responseStream: false,
516
+ options: {},
517
+ },
518
+ subscribe: {
519
+ name: "Subscribe",
520
+ requestType: SubscriptionRequest,
521
+ requestStream: false,
522
+ responseType: Subscription,
523
+ responseStream: false,
524
+ options: {},
525
+ },
526
+ unsubscribe: {
527
+ name: "Unsubscribe",
528
+ requestType: SubscriptionRequest,
529
+ requestStream: false,
530
+ responseType: Subscription,
531
+ responseStream: false,
532
+ options: {},
533
+ },
534
+ openStream: {
535
+ name: "OpenStream",
536
+ requestType: Signature,
537
+ requestStream: false,
538
+ responseType: Message,
539
+ responseStream: true,
540
+ options: {},
541
+ },
542
+ /** Push a stream of messages to be relayed. */
543
+ pushStream: {
544
+ name: "PushStream",
545
+ requestType: PushRequest,
546
+ requestStream: true,
547
+ responseType: PushResponse,
548
+ responseStream: true,
549
+ options: {},
550
+ },
551
+ /** Push a single message to be relayed. */
552
+ push: {
553
+ name: "Push",
554
+ requestType: PushRequest,
555
+ requestStream: false,
556
+ responseType: PushResponse,
557
+ responseStream: false,
558
+ options: {},
559
+ },
560
+ /** Push a series of messages to be relayed. */
561
+ pushMany: {
562
+ name: "PushMany",
563
+ requestType: PushManyRequest,
564
+ requestStream: false,
565
+ responseType: PushResponse,
566
+ responseStream: false,
567
+ options: {},
568
+ },
569
+ },
570
+ } as const;
571
+
572
+ export interface ECSRelayServiceServiceImplementation<CallContextExt = {}> {
573
+ authenticate(request: Signature, context: CallContext & CallContextExt): Promise<DeepPartial<Identity>>;
574
+ revoke(request: Signature, context: CallContext & CallContextExt): Promise<DeepPartial<Identity>>;
575
+ ping(request: Signature, context: CallContext & CallContextExt): Promise<DeepPartial<Identity>>;
576
+ countAuthenticated(
577
+ request: CountIdentitiesRequest,
578
+ context: CallContext & CallContextExt
579
+ ): Promise<DeepPartial<CountIdentitiesResponse>>;
580
+ countConnected(
581
+ request: CountIdentitiesRequest,
582
+ context: CallContext & CallContextExt
583
+ ): Promise<DeepPartial<CountIdentitiesResponse>>;
584
+ subscribe(request: SubscriptionRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Subscription>>;
585
+ unsubscribe(request: SubscriptionRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Subscription>>;
586
+ openStream(
587
+ request: Signature,
588
+ context: CallContext & CallContextExt
589
+ ): ServerStreamingMethodResult<DeepPartial<Message>>;
590
+ /** Push a stream of messages to be relayed. */
591
+ pushStream(
592
+ request: AsyncIterable<PushRequest>,
593
+ context: CallContext & CallContextExt
594
+ ): ServerStreamingMethodResult<DeepPartial<PushResponse>>;
595
+ /** Push a single message to be relayed. */
596
+ push(request: PushRequest, context: CallContext & CallContextExt): Promise<DeepPartial<PushResponse>>;
597
+ /** Push a series of messages to be relayed. */
598
+ pushMany(request: PushManyRequest, context: CallContext & CallContextExt): Promise<DeepPartial<PushResponse>>;
599
+ }
600
+
601
+ export interface ECSRelayServiceClient<CallOptionsExt = {}> {
602
+ authenticate(request: DeepPartial<Signature>, options?: CallOptions & CallOptionsExt): Promise<Identity>;
603
+ revoke(request: DeepPartial<Signature>, options?: CallOptions & CallOptionsExt): Promise<Identity>;
604
+ ping(request: DeepPartial<Signature>, options?: CallOptions & CallOptionsExt): Promise<Identity>;
605
+ countAuthenticated(
606
+ request: DeepPartial<CountIdentitiesRequest>,
607
+ options?: CallOptions & CallOptionsExt
608
+ ): Promise<CountIdentitiesResponse>;
609
+ countConnected(
610
+ request: DeepPartial<CountIdentitiesRequest>,
611
+ options?: CallOptions & CallOptionsExt
612
+ ): Promise<CountIdentitiesResponse>;
613
+ subscribe(request: DeepPartial<SubscriptionRequest>, options?: CallOptions & CallOptionsExt): Promise<Subscription>;
614
+ unsubscribe(request: DeepPartial<SubscriptionRequest>, options?: CallOptions & CallOptionsExt): Promise<Subscription>;
615
+ openStream(request: DeepPartial<Signature>, options?: CallOptions & CallOptionsExt): AsyncIterable<Message>;
616
+ /** Push a stream of messages to be relayed. */
617
+ pushStream(
618
+ request: AsyncIterable<DeepPartial<PushRequest>>,
619
+ options?: CallOptions & CallOptionsExt
620
+ ): AsyncIterable<PushResponse>;
621
+ /** Push a single message to be relayed. */
622
+ push(request: DeepPartial<PushRequest>, options?: CallOptions & CallOptionsExt): Promise<PushResponse>;
623
+ /** Push a series of messages to be relayed. */
624
+ pushMany(request: DeepPartial<PushManyRequest>, options?: CallOptions & CallOptionsExt): Promise<PushResponse>;
625
+ }
626
+
627
+ declare var self: any | undefined;
628
+ declare var window: any | undefined;
629
+ declare var global: any | undefined;
630
+ var globalThis: any = (() => {
631
+ if (typeof globalThis !== "undefined") {
632
+ return globalThis;
633
+ }
634
+ if (typeof self !== "undefined") {
635
+ return self;
636
+ }
637
+ if (typeof window !== "undefined") {
638
+ return window;
639
+ }
640
+ if (typeof global !== "undefined") {
641
+ return global;
642
+ }
643
+ throw "Unable to locate global object";
644
+ })();
645
+
646
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
647
+
648
+ export type DeepPartial<T> = T extends Builtin
649
+ ? T
650
+ : T extends Array<infer U>
651
+ ? Array<DeepPartial<U>>
652
+ : T extends ReadonlyArray<infer U>
653
+ ? ReadonlyArray<DeepPartial<U>>
654
+ : T extends {}
655
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
656
+ : Partial<T>;
657
+
658
+ function longToNumber(long: Long): number {
659
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
660
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
661
+ }
662
+ return long.toNumber();
663
+ }
664
+
665
+ if (_m0.util.Long !== Long) {
666
+ _m0.util.Long = Long as any;
667
+ _m0.configure();
624
668
  }
625
- /**
626
- * @generated MessageType for protobuf message ecsrelay.CountIdentitiesResponse
627
- */
628
- export const CountIdentitiesResponse = new CountIdentitiesResponse$Type();
629
- /**
630
- * @generated ServiceType for protobuf service ecsrelay.ECSRelayService
631
- */
632
- export const ECSRelayService = new ServiceType("ecsrelay.ECSRelayService", [
633
- { name: "Authenticate", options: {}, I: Signature, O: Identity },
634
- { name: "Revoke", options: {}, I: Signature, O: Identity },
635
- { name: "Ping", options: {}, I: Signature, O: Identity },
636
- { name: "CountAuthenticated", options: {}, I: CountIdentitiesRequest, O: CountIdentitiesResponse },
637
- { name: "CountConnected", options: {}, I: CountIdentitiesRequest, O: CountIdentitiesResponse },
638
- { name: "Subscribe", options: {}, I: SubscriptionRequest, O: Subscription },
639
- { name: "Unsubscribe", options: {}, I: SubscriptionRequest, O: Subscription },
640
- { name: "OpenStream", serverStreaming: true, options: {}, I: Signature, O: Message },
641
- { name: "Push", options: {}, I: PushRequest, O: PushResponse },
642
- { name: "PushMany", options: {}, I: PushManyRequest, O: PushResponse },
643
- ]);
669
+
670
+ export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };