@cratis/chronicle.contracts 19.145.0 → 19.146.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.
Files changed (35) hide show
  1. package/dist/cjs/generated/descriptorSet.js +1 -1
  2. package/dist/cjs/generated/descriptorSet.js.map +1 -1
  3. package/dist/cjs/generated/federation.d.ts +261 -0
  4. package/dist/cjs/generated/federation.d.ts.map +1 -0
  5. package/dist/cjs/generated/federation.js +2457 -0
  6. package/dist/cjs/generated/federation.js.map +1 -0
  7. package/dist/cjs/generated/index.d.ts +2 -0
  8. package/dist/cjs/generated/index.d.ts.map +1 -1
  9. package/dist/cjs/index.js +15 -0
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/esm/generated/descriptorSet.js +1 -1
  12. package/dist/esm/generated/descriptorSet.js.map +1 -1
  13. package/dist/esm/generated/federation.d.ts +261 -0
  14. package/dist/esm/generated/federation.d.ts.map +1 -0
  15. package/dist/esm/generated/federation.js +2437 -0
  16. package/dist/esm/generated/federation.js.map +1 -0
  17. package/dist/esm/generated/index.d.ts +2 -0
  18. package/dist/esm/generated/index.d.ts.map +1 -1
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/generated/descriptorSet.js +1 -1
  22. package/dist/generated/descriptorSet.js.map +1 -1
  23. package/dist/generated/federation.d.ts +261 -0
  24. package/dist/generated/federation.d.ts.map +1 -0
  25. package/dist/generated/federation.js +2436 -0
  26. package/dist/generated/federation.js.map +1 -0
  27. package/dist/generated/index.d.ts +2 -0
  28. package/dist/generated/index.d.ts.map +1 -1
  29. package/dist/generated/index.js +1 -0
  30. package/dist/generated/index.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/generated/descriptorSet.ts +1 -1
  33. package/generated/federation.ts +2877 -0
  34. package/generated/index.ts +3 -0
  35. package/package.json +1 -1
@@ -0,0 +1,2877 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.18.4
4
+ // protoc v5.28.3
5
+ // source: federation.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import type { CallContext, CallOptions } from "nice-grpc-common";
10
+ import { Empty } from "./google/protobuf/empty";
11
+ import { Guid } from "./protobuf-net/bcl";
12
+
13
+ export const protobufPackage = "Cratis.Chronicle.Contracts.Federation";
14
+
15
+ export const protobufFileName = "federation.proto";
16
+
17
+ export enum ValidationResultSeverity {
18
+ Unknown = 0,
19
+ Information = 1,
20
+ Warning = 2,
21
+ Error = 3,
22
+ UNRECOGNIZED = -1,
23
+ }
24
+
25
+ export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity {
26
+ switch (object) {
27
+ case 0:
28
+ case "Unknown":
29
+ return ValidationResultSeverity.Unknown;
30
+ case 1:
31
+ case "Information":
32
+ return ValidationResultSeverity.Information;
33
+ case 2:
34
+ case "Warning":
35
+ return ValidationResultSeverity.Warning;
36
+ case 3:
37
+ case "Error":
38
+ return ValidationResultSeverity.Error;
39
+ case -1:
40
+ case "UNRECOGNIZED":
41
+ default:
42
+ return ValidationResultSeverity.UNRECOGNIZED;
43
+ }
44
+ }
45
+
46
+ export function validationResultSeverityToJSON(object: ValidationResultSeverity): string {
47
+ switch (object) {
48
+ case ValidationResultSeverity.Unknown:
49
+ return "Unknown";
50
+ case ValidationResultSeverity.Information:
51
+ return "Information";
52
+ case ValidationResultSeverity.Warning:
53
+ return "Warning";
54
+ case ValidationResultSeverity.Error:
55
+ return "Error";
56
+ case ValidationResultSeverity.UNRECOGNIZED:
57
+ default:
58
+ return "UNRECOGNIZED";
59
+ }
60
+ }
61
+
62
+ export interface BindFederationPeerRequest {
63
+ Id: string;
64
+ LogicalSource: string;
65
+ Endpoint: string;
66
+ ServerPin: string;
67
+ ClientCertificate: string;
68
+ RemoteEventStore: string;
69
+ RemoteNamespace: string;
70
+ TargetEventStore: string;
71
+ TargetNamespace: string;
72
+ }
73
+
74
+ export interface CommandResult {
75
+ /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */
76
+ CorrelationId: Guid | undefined;
77
+ IsAuthorized: boolean;
78
+ ValidationResults: ValidationResult[];
79
+ ExceptionMessages: string[];
80
+ ExceptionStackTrace: string;
81
+ AuthorizationFailureReason: string;
82
+ }
83
+
84
+ export interface FederatedEvent {
85
+ SequenceNumber: bigint;
86
+ EventType: string;
87
+ Generation: number;
88
+ EventSourceType: string;
89
+ EventSourceId: string;
90
+ EventStreamType: string;
91
+ EventStreamId: string;
92
+ Occurred: SerializableDateTimeOffset | undefined;
93
+ CorrelationId: string;
94
+ Subject: string;
95
+ Content: string;
96
+ Tags: string[];
97
+ }
98
+
99
+ export interface FederatedEventBatchResponse {
100
+ Status: string;
101
+ OriginEventStore: string;
102
+ Events: FederatedEvent[];
103
+ NextSequenceNumber: bigint;
104
+ TailSequenceNumber: bigint;
105
+ }
106
+
107
+ export interface FederationBindingResponse {
108
+ Id: string;
109
+ LogicalSource: string;
110
+ Endpoint: string;
111
+ ServerPin: string;
112
+ ClientCertificate: string;
113
+ RemoteEventStore: string;
114
+ RemoteNamespace: string;
115
+ TargetEventStore: string;
116
+ TargetNamespace: string;
117
+ Origin: string;
118
+ State: string;
119
+ LastSourceSequenceNumber: bigint;
120
+ RemoteTailSequenceNumber: bigint;
121
+ Lag: bigint;
122
+ LastDelivery: SerializableDateTimeOffset | undefined;
123
+ LastError: string;
124
+ }
125
+
126
+ export interface FederationGrantInformationResponse {
127
+ Id: string;
128
+ ClientPin: string;
129
+ EventStore: string;
130
+ Namespaces: string[];
131
+ AllPublic: boolean;
132
+ EventTypes: string[];
133
+ Revoked: boolean;
134
+ Origin: string;
135
+ LastPull: SerializableDateTimeOffset | undefined;
136
+ EventsDelivered: bigint;
137
+ BytesDelivered: bigint;
138
+ Throttled: bigint;
139
+ }
140
+
141
+ export interface PullRequest {
142
+ EventStore: string;
143
+ Namespace: string;
144
+ FromSequenceNumber: bigint;
145
+ Limit: number;
146
+ EventTypes: string[];
147
+ }
148
+
149
+ export interface QueryResultFederatedEventBatchResponse {
150
+ /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */
151
+ CorrelationId: Guid | undefined;
152
+ IsAuthorized: boolean;
153
+ ValidationResults: ValidationResult[];
154
+ ExceptionMessages: string[];
155
+ ExceptionStackTrace: string;
156
+ Data: FederatedEventBatchResponse | undefined;
157
+ }
158
+
159
+ export interface QueryResultIEnumerableFederationBindingResponse {
160
+ /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */
161
+ CorrelationId: Guid | undefined;
162
+ IsAuthorized: boolean;
163
+ ValidationResults: ValidationResult[];
164
+ ExceptionMessages: string[];
165
+ ExceptionStackTrace: string;
166
+ Data: FederationBindingResponse[];
167
+ }
168
+
169
+ export interface QueryResultIEnumerableFederationGrantInformationResponse {
170
+ /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */
171
+ CorrelationId: Guid | undefined;
172
+ IsAuthorized: boolean;
173
+ ValidationResults: ValidationResult[];
174
+ ExceptionMessages: string[];
175
+ ExceptionStackTrace: string;
176
+ Data: FederationGrantInformationResponse[];
177
+ }
178
+
179
+ export interface RevokeFederationLinkRequest {
180
+ Id: string;
181
+ }
182
+
183
+ /** Represents a DateTimeOffset value as an ISO 8601 string (e.g., "2024-01-15T12:30:00.0000000+02:00"). */
184
+ export interface SerializableDateTimeOffset {
185
+ Value: string;
186
+ }
187
+
188
+ export interface SetFederationGrantRequest {
189
+ Id: string;
190
+ ClientPin: string;
191
+ EventStore: string;
192
+ Namespaces: string[];
193
+ AllPublic: boolean;
194
+ EventTypes: string[];
195
+ }
196
+
197
+ export interface UnbindFederationPeerRequest {
198
+ Id: string;
199
+ }
200
+
201
+ export interface ValidationResult {
202
+ /** default value could not be applied: Error */
203
+ Severity: ValidationResultSeverity;
204
+ Message: string;
205
+ Members: string[];
206
+ }
207
+
208
+ function createBaseBindFederationPeerRequest(): BindFederationPeerRequest {
209
+ return {
210
+ Id: "",
211
+ LogicalSource: "",
212
+ Endpoint: "",
213
+ ServerPin: "",
214
+ ClientCertificate: "",
215
+ RemoteEventStore: "",
216
+ RemoteNamespace: "",
217
+ TargetEventStore: "",
218
+ TargetNamespace: "",
219
+ };
220
+ }
221
+
222
+ export const BindFederationPeerRequest: MessageFns<BindFederationPeerRequest> = {
223
+ encode(message: BindFederationPeerRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
224
+ if (message.Id !== "") {
225
+ writer.uint32(10).string(message.Id);
226
+ }
227
+ if (message.LogicalSource !== "") {
228
+ writer.uint32(18).string(message.LogicalSource);
229
+ }
230
+ if (message.Endpoint !== "") {
231
+ writer.uint32(26).string(message.Endpoint);
232
+ }
233
+ if (message.ServerPin !== "") {
234
+ writer.uint32(34).string(message.ServerPin);
235
+ }
236
+ if (message.ClientCertificate !== "") {
237
+ writer.uint32(42).string(message.ClientCertificate);
238
+ }
239
+ if (message.RemoteEventStore !== "") {
240
+ writer.uint32(50).string(message.RemoteEventStore);
241
+ }
242
+ if (message.RemoteNamespace !== "") {
243
+ writer.uint32(58).string(message.RemoteNamespace);
244
+ }
245
+ if (message.TargetEventStore !== "") {
246
+ writer.uint32(66).string(message.TargetEventStore);
247
+ }
248
+ if (message.TargetNamespace !== "") {
249
+ writer.uint32(74).string(message.TargetNamespace);
250
+ }
251
+ return writer;
252
+ },
253
+
254
+ decode(input: BinaryReader | Uint8Array, length?: number): BindFederationPeerRequest {
255
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
256
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
257
+ if (previousRecursionDepth >= 100) {
258
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
259
+ }
260
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
261
+ try {
262
+ const end = length === undefined ? reader.len : reader.pos + length;
263
+ const message = createBaseBindFederationPeerRequest();
264
+ while (reader.pos < end) {
265
+ const tag = reader.uint32();
266
+ switch (tag >>> 3) {
267
+ case 1: {
268
+ if (tag !== 10) {
269
+ break;
270
+ }
271
+
272
+ message.Id = reader.string();
273
+ continue;
274
+ }
275
+ case 2: {
276
+ if (tag !== 18) {
277
+ break;
278
+ }
279
+
280
+ message.LogicalSource = reader.string();
281
+ continue;
282
+ }
283
+ case 3: {
284
+ if (tag !== 26) {
285
+ break;
286
+ }
287
+
288
+ message.Endpoint = reader.string();
289
+ continue;
290
+ }
291
+ case 4: {
292
+ if (tag !== 34) {
293
+ break;
294
+ }
295
+
296
+ message.ServerPin = reader.string();
297
+ continue;
298
+ }
299
+ case 5: {
300
+ if (tag !== 42) {
301
+ break;
302
+ }
303
+
304
+ message.ClientCertificate = reader.string();
305
+ continue;
306
+ }
307
+ case 6: {
308
+ if (tag !== 50) {
309
+ break;
310
+ }
311
+
312
+ message.RemoteEventStore = reader.string();
313
+ continue;
314
+ }
315
+ case 7: {
316
+ if (tag !== 58) {
317
+ break;
318
+ }
319
+
320
+ message.RemoteNamespace = reader.string();
321
+ continue;
322
+ }
323
+ case 8: {
324
+ if (tag !== 66) {
325
+ break;
326
+ }
327
+
328
+ message.TargetEventStore = reader.string();
329
+ continue;
330
+ }
331
+ case 9: {
332
+ if (tag !== 74) {
333
+ break;
334
+ }
335
+
336
+ message.TargetNamespace = reader.string();
337
+ continue;
338
+ }
339
+ }
340
+ if ((tag & 7) === 4 || tag === 0) {
341
+ break;
342
+ }
343
+ reader.skip(tag & 7);
344
+ }
345
+ return message;
346
+ } finally {
347
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
348
+ }
349
+ },
350
+
351
+ fromJSON(object: any): BindFederationPeerRequest {
352
+ return {
353
+ Id: isSet(object.Id) ? globalThis.String(object.Id) : "",
354
+ LogicalSource: isSet(object.LogicalSource) ? globalThis.String(object.LogicalSource) : "",
355
+ Endpoint: isSet(object.Endpoint) ? globalThis.String(object.Endpoint) : "",
356
+ ServerPin: isSet(object.ServerPin) ? globalThis.String(object.ServerPin) : "",
357
+ ClientCertificate: isSet(object.ClientCertificate) ? globalThis.String(object.ClientCertificate) : "",
358
+ RemoteEventStore: isSet(object.RemoteEventStore) ? globalThis.String(object.RemoteEventStore) : "",
359
+ RemoteNamespace: isSet(object.RemoteNamespace) ? globalThis.String(object.RemoteNamespace) : "",
360
+ TargetEventStore: isSet(object.TargetEventStore) ? globalThis.String(object.TargetEventStore) : "",
361
+ TargetNamespace: isSet(object.TargetNamespace) ? globalThis.String(object.TargetNamespace) : "",
362
+ };
363
+ },
364
+
365
+ toJSON(message: BindFederationPeerRequest): unknown {
366
+ const obj: any = {};
367
+ if (message.Id !== "") {
368
+ obj.Id = message.Id;
369
+ }
370
+ if (message.LogicalSource !== "") {
371
+ obj.LogicalSource = message.LogicalSource;
372
+ }
373
+ if (message.Endpoint !== "") {
374
+ obj.Endpoint = message.Endpoint;
375
+ }
376
+ if (message.ServerPin !== "") {
377
+ obj.ServerPin = message.ServerPin;
378
+ }
379
+ if (message.ClientCertificate !== "") {
380
+ obj.ClientCertificate = message.ClientCertificate;
381
+ }
382
+ if (message.RemoteEventStore !== "") {
383
+ obj.RemoteEventStore = message.RemoteEventStore;
384
+ }
385
+ if (message.RemoteNamespace !== "") {
386
+ obj.RemoteNamespace = message.RemoteNamespace;
387
+ }
388
+ if (message.TargetEventStore !== "") {
389
+ obj.TargetEventStore = message.TargetEventStore;
390
+ }
391
+ if (message.TargetNamespace !== "") {
392
+ obj.TargetNamespace = message.TargetNamespace;
393
+ }
394
+ return obj;
395
+ },
396
+
397
+ create(base?: DeepPartial<BindFederationPeerRequest>): BindFederationPeerRequest {
398
+ return BindFederationPeerRequest.fromPartial(base ?? {});
399
+ },
400
+ fromPartial(object: DeepPartial<BindFederationPeerRequest>): BindFederationPeerRequest {
401
+ const message = createBaseBindFederationPeerRequest();
402
+ message.Id = object.Id ?? "";
403
+ message.LogicalSource = object.LogicalSource ?? "";
404
+ message.Endpoint = object.Endpoint ?? "";
405
+ message.ServerPin = object.ServerPin ?? "";
406
+ message.ClientCertificate = object.ClientCertificate ?? "";
407
+ message.RemoteEventStore = object.RemoteEventStore ?? "";
408
+ message.RemoteNamespace = object.RemoteNamespace ?? "";
409
+ message.TargetEventStore = object.TargetEventStore ?? "";
410
+ message.TargetNamespace = object.TargetNamespace ?? "";
411
+ return message;
412
+ },
413
+ };
414
+
415
+ function createBaseCommandResult(): CommandResult {
416
+ return {
417
+ CorrelationId: undefined,
418
+ IsAuthorized: false,
419
+ ValidationResults: [],
420
+ ExceptionMessages: [],
421
+ ExceptionStackTrace: "",
422
+ AuthorizationFailureReason: "",
423
+ };
424
+ }
425
+
426
+ export const CommandResult: MessageFns<CommandResult> = {
427
+ encode(message: CommandResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
428
+ if (message.CorrelationId !== undefined) {
429
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
430
+ }
431
+ if (message.IsAuthorized !== false) {
432
+ writer.uint32(16).bool(message.IsAuthorized);
433
+ }
434
+ for (const v of message.ValidationResults) {
435
+ ValidationResult.encode(v!, writer.uint32(26).fork()).join();
436
+ }
437
+ for (const v of message.ExceptionMessages) {
438
+ writer.uint32(34).string(v!);
439
+ }
440
+ if (message.ExceptionStackTrace !== "") {
441
+ writer.uint32(42).string(message.ExceptionStackTrace);
442
+ }
443
+ if (message.AuthorizationFailureReason !== "") {
444
+ writer.uint32(50).string(message.AuthorizationFailureReason);
445
+ }
446
+ return writer;
447
+ },
448
+
449
+ decode(input: BinaryReader | Uint8Array, length?: number): CommandResult {
450
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
451
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
452
+ if (previousRecursionDepth >= 100) {
453
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
454
+ }
455
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
456
+ try {
457
+ const end = length === undefined ? reader.len : reader.pos + length;
458
+ const message = createBaseCommandResult();
459
+ while (reader.pos < end) {
460
+ const tag = reader.uint32();
461
+ switch (tag >>> 3) {
462
+ case 1: {
463
+ if (tag !== 10) {
464
+ break;
465
+ }
466
+
467
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
468
+ continue;
469
+ }
470
+ case 2: {
471
+ if (tag !== 16) {
472
+ break;
473
+ }
474
+
475
+ message.IsAuthorized = reader.bool();
476
+ continue;
477
+ }
478
+ case 3: {
479
+ if (tag !== 26) {
480
+ break;
481
+ }
482
+
483
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
484
+ continue;
485
+ }
486
+ case 4: {
487
+ if (tag !== 34) {
488
+ break;
489
+ }
490
+
491
+ message.ExceptionMessages.push(reader.string());
492
+ continue;
493
+ }
494
+ case 5: {
495
+ if (tag !== 42) {
496
+ break;
497
+ }
498
+
499
+ message.ExceptionStackTrace = reader.string();
500
+ continue;
501
+ }
502
+ case 6: {
503
+ if (tag !== 50) {
504
+ break;
505
+ }
506
+
507
+ message.AuthorizationFailureReason = reader.string();
508
+ continue;
509
+ }
510
+ }
511
+ if ((tag & 7) === 4 || tag === 0) {
512
+ break;
513
+ }
514
+ reader.skip(tag & 7);
515
+ }
516
+ return message;
517
+ } finally {
518
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
519
+ }
520
+ },
521
+
522
+ fromJSON(object: any): CommandResult {
523
+ return {
524
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
525
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
526
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
527
+ ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e))
528
+ : [],
529
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
530
+ ? object.ExceptionMessages.map((e: any) => globalThis.String(e))
531
+ : [],
532
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
533
+ AuthorizationFailureReason: isSet(object.AuthorizationFailureReason)
534
+ ? globalThis.String(object.AuthorizationFailureReason)
535
+ : "",
536
+ };
537
+ },
538
+
539
+ toJSON(message: CommandResult): unknown {
540
+ const obj: any = {};
541
+ if (message.CorrelationId !== undefined) {
542
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
543
+ }
544
+ if (message.IsAuthorized !== false) {
545
+ obj.IsAuthorized = message.IsAuthorized;
546
+ }
547
+ if (message.ValidationResults?.length) {
548
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
549
+ }
550
+ if (message.ExceptionMessages?.length) {
551
+ obj.ExceptionMessages = message.ExceptionMessages;
552
+ }
553
+ if (message.ExceptionStackTrace !== "") {
554
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
555
+ }
556
+ if (message.AuthorizationFailureReason !== "") {
557
+ obj.AuthorizationFailureReason = message.AuthorizationFailureReason;
558
+ }
559
+ return obj;
560
+ },
561
+
562
+ create(base?: DeepPartial<CommandResult>): CommandResult {
563
+ return CommandResult.fromPartial(base ?? {});
564
+ },
565
+ fromPartial(object: DeepPartial<CommandResult>): CommandResult {
566
+ const message = createBaseCommandResult();
567
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
568
+ ? Guid.fromPartial(object.CorrelationId)
569
+ : undefined;
570
+ message.IsAuthorized = object.IsAuthorized ?? false;
571
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
572
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
573
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
574
+ message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? "";
575
+ return message;
576
+ },
577
+ };
578
+
579
+ function createBaseFederatedEvent(): FederatedEvent {
580
+ return {
581
+ SequenceNumber: 0n,
582
+ EventType: "",
583
+ Generation: 0,
584
+ EventSourceType: "",
585
+ EventSourceId: "",
586
+ EventStreamType: "",
587
+ EventStreamId: "",
588
+ Occurred: undefined,
589
+ CorrelationId: "",
590
+ Subject: "",
591
+ Content: "",
592
+ Tags: [],
593
+ };
594
+ }
595
+
596
+ export const FederatedEvent: MessageFns<FederatedEvent> = {
597
+ encode(message: FederatedEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
598
+ if (message.SequenceNumber !== 0n) {
599
+ if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) {
600
+ throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large");
601
+ }
602
+ writer.uint32(8).uint64(message.SequenceNumber);
603
+ }
604
+ if (message.EventType !== "") {
605
+ writer.uint32(18).string(message.EventType);
606
+ }
607
+ if (message.Generation !== 0) {
608
+ writer.uint32(24).uint32(message.Generation);
609
+ }
610
+ if (message.EventSourceType !== "") {
611
+ writer.uint32(34).string(message.EventSourceType);
612
+ }
613
+ if (message.EventSourceId !== "") {
614
+ writer.uint32(42).string(message.EventSourceId);
615
+ }
616
+ if (message.EventStreamType !== "") {
617
+ writer.uint32(50).string(message.EventStreamType);
618
+ }
619
+ if (message.EventStreamId !== "") {
620
+ writer.uint32(58).string(message.EventStreamId);
621
+ }
622
+ if (message.Occurred !== undefined) {
623
+ SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(66).fork()).join();
624
+ }
625
+ if (message.CorrelationId !== "") {
626
+ writer.uint32(74).string(message.CorrelationId);
627
+ }
628
+ if (message.Subject !== "") {
629
+ writer.uint32(82).string(message.Subject);
630
+ }
631
+ if (message.Content !== "") {
632
+ writer.uint32(90).string(message.Content);
633
+ }
634
+ for (const v of message.Tags) {
635
+ writer.uint32(98).string(v!);
636
+ }
637
+ return writer;
638
+ },
639
+
640
+ decode(input: BinaryReader | Uint8Array, length?: number): FederatedEvent {
641
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
642
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
643
+ if (previousRecursionDepth >= 100) {
644
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
645
+ }
646
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
647
+ try {
648
+ const end = length === undefined ? reader.len : reader.pos + length;
649
+ const message = createBaseFederatedEvent();
650
+ while (reader.pos < end) {
651
+ const tag = reader.uint32();
652
+ switch (tag >>> 3) {
653
+ case 1: {
654
+ if (tag !== 8) {
655
+ break;
656
+ }
657
+
658
+ message.SequenceNumber = reader.uint64() as bigint;
659
+ continue;
660
+ }
661
+ case 2: {
662
+ if (tag !== 18) {
663
+ break;
664
+ }
665
+
666
+ message.EventType = reader.string();
667
+ continue;
668
+ }
669
+ case 3: {
670
+ if (tag !== 24) {
671
+ break;
672
+ }
673
+
674
+ message.Generation = reader.uint32();
675
+ continue;
676
+ }
677
+ case 4: {
678
+ if (tag !== 34) {
679
+ break;
680
+ }
681
+
682
+ message.EventSourceType = reader.string();
683
+ continue;
684
+ }
685
+ case 5: {
686
+ if (tag !== 42) {
687
+ break;
688
+ }
689
+
690
+ message.EventSourceId = reader.string();
691
+ continue;
692
+ }
693
+ case 6: {
694
+ if (tag !== 50) {
695
+ break;
696
+ }
697
+
698
+ message.EventStreamType = reader.string();
699
+ continue;
700
+ }
701
+ case 7: {
702
+ if (tag !== 58) {
703
+ break;
704
+ }
705
+
706
+ message.EventStreamId = reader.string();
707
+ continue;
708
+ }
709
+ case 8: {
710
+ if (tag !== 66) {
711
+ break;
712
+ }
713
+
714
+ message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32());
715
+ continue;
716
+ }
717
+ case 9: {
718
+ if (tag !== 74) {
719
+ break;
720
+ }
721
+
722
+ message.CorrelationId = reader.string();
723
+ continue;
724
+ }
725
+ case 10: {
726
+ if (tag !== 82) {
727
+ break;
728
+ }
729
+
730
+ message.Subject = reader.string();
731
+ continue;
732
+ }
733
+ case 11: {
734
+ if (tag !== 90) {
735
+ break;
736
+ }
737
+
738
+ message.Content = reader.string();
739
+ continue;
740
+ }
741
+ case 12: {
742
+ if (tag !== 98) {
743
+ break;
744
+ }
745
+
746
+ message.Tags.push(reader.string());
747
+ continue;
748
+ }
749
+ }
750
+ if ((tag & 7) === 4 || tag === 0) {
751
+ break;
752
+ }
753
+ reader.skip(tag & 7);
754
+ }
755
+ return message;
756
+ } finally {
757
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
758
+ }
759
+ },
760
+
761
+ fromJSON(object: any): FederatedEvent {
762
+ return {
763
+ SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n,
764
+ EventType: isSet(object.EventType) ? globalThis.String(object.EventType) : "",
765
+ Generation: isSet(object.Generation) ? globalThis.Number(object.Generation) : 0,
766
+ EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "",
767
+ EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "",
768
+ EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "",
769
+ EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "",
770
+ Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined,
771
+ CorrelationId: isSet(object.CorrelationId) ? globalThis.String(object.CorrelationId) : "",
772
+ Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "",
773
+ Content: isSet(object.Content) ? globalThis.String(object.Content) : "",
774
+ Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [],
775
+ };
776
+ },
777
+
778
+ toJSON(message: FederatedEvent): unknown {
779
+ const obj: any = {};
780
+ if (message.SequenceNumber !== 0n) {
781
+ obj.SequenceNumber = message.SequenceNumber.toString();
782
+ }
783
+ if (message.EventType !== "") {
784
+ obj.EventType = message.EventType;
785
+ }
786
+ if (message.Generation !== 0) {
787
+ obj.Generation = Math.round(message.Generation);
788
+ }
789
+ if (message.EventSourceType !== "") {
790
+ obj.EventSourceType = message.EventSourceType;
791
+ }
792
+ if (message.EventSourceId !== "") {
793
+ obj.EventSourceId = message.EventSourceId;
794
+ }
795
+ if (message.EventStreamType !== "") {
796
+ obj.EventStreamType = message.EventStreamType;
797
+ }
798
+ if (message.EventStreamId !== "") {
799
+ obj.EventStreamId = message.EventStreamId;
800
+ }
801
+ if (message.Occurred !== undefined) {
802
+ obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred);
803
+ }
804
+ if (message.CorrelationId !== "") {
805
+ obj.CorrelationId = message.CorrelationId;
806
+ }
807
+ if (message.Subject !== "") {
808
+ obj.Subject = message.Subject;
809
+ }
810
+ if (message.Content !== "") {
811
+ obj.Content = message.Content;
812
+ }
813
+ if (message.Tags?.length) {
814
+ obj.Tags = message.Tags;
815
+ }
816
+ return obj;
817
+ },
818
+
819
+ create(base?: DeepPartial<FederatedEvent>): FederatedEvent {
820
+ return FederatedEvent.fromPartial(base ?? {});
821
+ },
822
+ fromPartial(object: DeepPartial<FederatedEvent>): FederatedEvent {
823
+ const message = createBaseFederatedEvent();
824
+ message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null)
825
+ ? BigInt(object.SequenceNumber)
826
+ : 0n;
827
+ message.EventType = object.EventType ?? "";
828
+ message.Generation = object.Generation ?? 0;
829
+ message.EventSourceType = object.EventSourceType ?? "";
830
+ message.EventSourceId = object.EventSourceId ?? "";
831
+ message.EventStreamType = object.EventStreamType ?? "";
832
+ message.EventStreamId = object.EventStreamId ?? "";
833
+ message.Occurred = (object.Occurred !== undefined && object.Occurred !== null)
834
+ ? SerializableDateTimeOffset.fromPartial(object.Occurred)
835
+ : undefined;
836
+ message.CorrelationId = object.CorrelationId ?? "";
837
+ message.Subject = object.Subject ?? "";
838
+ message.Content = object.Content ?? "";
839
+ message.Tags = object.Tags?.map((e) => e) || [];
840
+ return message;
841
+ },
842
+ };
843
+
844
+ function createBaseFederatedEventBatchResponse(): FederatedEventBatchResponse {
845
+ return { Status: "", OriginEventStore: "", Events: [], NextSequenceNumber: 0n, TailSequenceNumber: 0n };
846
+ }
847
+
848
+ export const FederatedEventBatchResponse: MessageFns<FederatedEventBatchResponse> = {
849
+ encode(message: FederatedEventBatchResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
850
+ if (message.Status !== "") {
851
+ writer.uint32(10).string(message.Status);
852
+ }
853
+ if (message.OriginEventStore !== "") {
854
+ writer.uint32(18).string(message.OriginEventStore);
855
+ }
856
+ for (const v of message.Events) {
857
+ FederatedEvent.encode(v!, writer.uint32(26).fork()).join();
858
+ }
859
+ if (message.NextSequenceNumber !== 0n) {
860
+ if (BigInt.asUintN(64, message.NextSequenceNumber) !== message.NextSequenceNumber) {
861
+ throw new globalThis.Error("value provided for field message.NextSequenceNumber of type uint64 too large");
862
+ }
863
+ writer.uint32(32).uint64(message.NextSequenceNumber);
864
+ }
865
+ if (message.TailSequenceNumber !== 0n) {
866
+ if (BigInt.asUintN(64, message.TailSequenceNumber) !== message.TailSequenceNumber) {
867
+ throw new globalThis.Error("value provided for field message.TailSequenceNumber of type uint64 too large");
868
+ }
869
+ writer.uint32(40).uint64(message.TailSequenceNumber);
870
+ }
871
+ return writer;
872
+ },
873
+
874
+ decode(input: BinaryReader | Uint8Array, length?: number): FederatedEventBatchResponse {
875
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
876
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
877
+ if (previousRecursionDepth >= 100) {
878
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
879
+ }
880
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
881
+ try {
882
+ const end = length === undefined ? reader.len : reader.pos + length;
883
+ const message = createBaseFederatedEventBatchResponse();
884
+ while (reader.pos < end) {
885
+ const tag = reader.uint32();
886
+ switch (tag >>> 3) {
887
+ case 1: {
888
+ if (tag !== 10) {
889
+ break;
890
+ }
891
+
892
+ message.Status = reader.string();
893
+ continue;
894
+ }
895
+ case 2: {
896
+ if (tag !== 18) {
897
+ break;
898
+ }
899
+
900
+ message.OriginEventStore = reader.string();
901
+ continue;
902
+ }
903
+ case 3: {
904
+ if (tag !== 26) {
905
+ break;
906
+ }
907
+
908
+ message.Events.push(FederatedEvent.decode(reader, reader.uint32()));
909
+ continue;
910
+ }
911
+ case 4: {
912
+ if (tag !== 32) {
913
+ break;
914
+ }
915
+
916
+ message.NextSequenceNumber = reader.uint64() as bigint;
917
+ continue;
918
+ }
919
+ case 5: {
920
+ if (tag !== 40) {
921
+ break;
922
+ }
923
+
924
+ message.TailSequenceNumber = reader.uint64() as bigint;
925
+ continue;
926
+ }
927
+ }
928
+ if ((tag & 7) === 4 || tag === 0) {
929
+ break;
930
+ }
931
+ reader.skip(tag & 7);
932
+ }
933
+ return message;
934
+ } finally {
935
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
936
+ }
937
+ },
938
+
939
+ fromJSON(object: any): FederatedEventBatchResponse {
940
+ return {
941
+ Status: isSet(object.Status) ? globalThis.String(object.Status) : "",
942
+ OriginEventStore: isSet(object.OriginEventStore) ? globalThis.String(object.OriginEventStore) : "",
943
+ Events: globalThis.Array.isArray(object?.Events) ? object.Events.map((e: any) => FederatedEvent.fromJSON(e)) : [],
944
+ NextSequenceNumber: isSet(object.NextSequenceNumber) ? BigInt(object.NextSequenceNumber) : 0n,
945
+ TailSequenceNumber: isSet(object.TailSequenceNumber) ? BigInt(object.TailSequenceNumber) : 0n,
946
+ };
947
+ },
948
+
949
+ toJSON(message: FederatedEventBatchResponse): unknown {
950
+ const obj: any = {};
951
+ if (message.Status !== "") {
952
+ obj.Status = message.Status;
953
+ }
954
+ if (message.OriginEventStore !== "") {
955
+ obj.OriginEventStore = message.OriginEventStore;
956
+ }
957
+ if (message.Events?.length) {
958
+ obj.Events = message.Events.map((e) => FederatedEvent.toJSON(e));
959
+ }
960
+ if (message.NextSequenceNumber !== 0n) {
961
+ obj.NextSequenceNumber = message.NextSequenceNumber.toString();
962
+ }
963
+ if (message.TailSequenceNumber !== 0n) {
964
+ obj.TailSequenceNumber = message.TailSequenceNumber.toString();
965
+ }
966
+ return obj;
967
+ },
968
+
969
+ create(base?: DeepPartial<FederatedEventBatchResponse>): FederatedEventBatchResponse {
970
+ return FederatedEventBatchResponse.fromPartial(base ?? {});
971
+ },
972
+ fromPartial(object: DeepPartial<FederatedEventBatchResponse>): FederatedEventBatchResponse {
973
+ const message = createBaseFederatedEventBatchResponse();
974
+ message.Status = object.Status ?? "";
975
+ message.OriginEventStore = object.OriginEventStore ?? "";
976
+ message.Events = object.Events?.map((e) => FederatedEvent.fromPartial(e)) || [];
977
+ message.NextSequenceNumber = (object.NextSequenceNumber !== undefined && object.NextSequenceNumber !== null)
978
+ ? BigInt(object.NextSequenceNumber)
979
+ : 0n;
980
+ message.TailSequenceNumber = (object.TailSequenceNumber !== undefined && object.TailSequenceNumber !== null)
981
+ ? BigInt(object.TailSequenceNumber)
982
+ : 0n;
983
+ return message;
984
+ },
985
+ };
986
+
987
+ function createBaseFederationBindingResponse(): FederationBindingResponse {
988
+ return {
989
+ Id: "",
990
+ LogicalSource: "",
991
+ Endpoint: "",
992
+ ServerPin: "",
993
+ ClientCertificate: "",
994
+ RemoteEventStore: "",
995
+ RemoteNamespace: "",
996
+ TargetEventStore: "",
997
+ TargetNamespace: "",
998
+ Origin: "",
999
+ State: "",
1000
+ LastSourceSequenceNumber: 0n,
1001
+ RemoteTailSequenceNumber: 0n,
1002
+ Lag: 0n,
1003
+ LastDelivery: undefined,
1004
+ LastError: "",
1005
+ };
1006
+ }
1007
+
1008
+ export const FederationBindingResponse: MessageFns<FederationBindingResponse> = {
1009
+ encode(message: FederationBindingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1010
+ if (message.Id !== "") {
1011
+ writer.uint32(10).string(message.Id);
1012
+ }
1013
+ if (message.LogicalSource !== "") {
1014
+ writer.uint32(18).string(message.LogicalSource);
1015
+ }
1016
+ if (message.Endpoint !== "") {
1017
+ writer.uint32(26).string(message.Endpoint);
1018
+ }
1019
+ if (message.ServerPin !== "") {
1020
+ writer.uint32(34).string(message.ServerPin);
1021
+ }
1022
+ if (message.ClientCertificate !== "") {
1023
+ writer.uint32(42).string(message.ClientCertificate);
1024
+ }
1025
+ if (message.RemoteEventStore !== "") {
1026
+ writer.uint32(50).string(message.RemoteEventStore);
1027
+ }
1028
+ if (message.RemoteNamespace !== "") {
1029
+ writer.uint32(58).string(message.RemoteNamespace);
1030
+ }
1031
+ if (message.TargetEventStore !== "") {
1032
+ writer.uint32(66).string(message.TargetEventStore);
1033
+ }
1034
+ if (message.TargetNamespace !== "") {
1035
+ writer.uint32(74).string(message.TargetNamespace);
1036
+ }
1037
+ if (message.Origin !== "") {
1038
+ writer.uint32(82).string(message.Origin);
1039
+ }
1040
+ if (message.State !== "") {
1041
+ writer.uint32(90).string(message.State);
1042
+ }
1043
+ if (message.LastSourceSequenceNumber !== 0n) {
1044
+ if (BigInt.asUintN(64, message.LastSourceSequenceNumber) !== message.LastSourceSequenceNumber) {
1045
+ throw new globalThis.Error(
1046
+ "value provided for field message.LastSourceSequenceNumber of type uint64 too large",
1047
+ );
1048
+ }
1049
+ writer.uint32(96).uint64(message.LastSourceSequenceNumber);
1050
+ }
1051
+ if (message.RemoteTailSequenceNumber !== 0n) {
1052
+ if (BigInt.asUintN(64, message.RemoteTailSequenceNumber) !== message.RemoteTailSequenceNumber) {
1053
+ throw new globalThis.Error(
1054
+ "value provided for field message.RemoteTailSequenceNumber of type uint64 too large",
1055
+ );
1056
+ }
1057
+ writer.uint32(104).uint64(message.RemoteTailSequenceNumber);
1058
+ }
1059
+ if (message.Lag !== 0n) {
1060
+ if (BigInt.asUintN(64, message.Lag) !== message.Lag) {
1061
+ throw new globalThis.Error("value provided for field message.Lag of type uint64 too large");
1062
+ }
1063
+ writer.uint32(112).uint64(message.Lag);
1064
+ }
1065
+ if (message.LastDelivery !== undefined) {
1066
+ SerializableDateTimeOffset.encode(message.LastDelivery, writer.uint32(122).fork()).join();
1067
+ }
1068
+ if (message.LastError !== "") {
1069
+ writer.uint32(130).string(message.LastError);
1070
+ }
1071
+ return writer;
1072
+ },
1073
+
1074
+ decode(input: BinaryReader | Uint8Array, length?: number): FederationBindingResponse {
1075
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1076
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1077
+ if (previousRecursionDepth >= 100) {
1078
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1079
+ }
1080
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1081
+ try {
1082
+ const end = length === undefined ? reader.len : reader.pos + length;
1083
+ const message = createBaseFederationBindingResponse();
1084
+ while (reader.pos < end) {
1085
+ const tag = reader.uint32();
1086
+ switch (tag >>> 3) {
1087
+ case 1: {
1088
+ if (tag !== 10) {
1089
+ break;
1090
+ }
1091
+
1092
+ message.Id = reader.string();
1093
+ continue;
1094
+ }
1095
+ case 2: {
1096
+ if (tag !== 18) {
1097
+ break;
1098
+ }
1099
+
1100
+ message.LogicalSource = reader.string();
1101
+ continue;
1102
+ }
1103
+ case 3: {
1104
+ if (tag !== 26) {
1105
+ break;
1106
+ }
1107
+
1108
+ message.Endpoint = reader.string();
1109
+ continue;
1110
+ }
1111
+ case 4: {
1112
+ if (tag !== 34) {
1113
+ break;
1114
+ }
1115
+
1116
+ message.ServerPin = reader.string();
1117
+ continue;
1118
+ }
1119
+ case 5: {
1120
+ if (tag !== 42) {
1121
+ break;
1122
+ }
1123
+
1124
+ message.ClientCertificate = reader.string();
1125
+ continue;
1126
+ }
1127
+ case 6: {
1128
+ if (tag !== 50) {
1129
+ break;
1130
+ }
1131
+
1132
+ message.RemoteEventStore = reader.string();
1133
+ continue;
1134
+ }
1135
+ case 7: {
1136
+ if (tag !== 58) {
1137
+ break;
1138
+ }
1139
+
1140
+ message.RemoteNamespace = reader.string();
1141
+ continue;
1142
+ }
1143
+ case 8: {
1144
+ if (tag !== 66) {
1145
+ break;
1146
+ }
1147
+
1148
+ message.TargetEventStore = reader.string();
1149
+ continue;
1150
+ }
1151
+ case 9: {
1152
+ if (tag !== 74) {
1153
+ break;
1154
+ }
1155
+
1156
+ message.TargetNamespace = reader.string();
1157
+ continue;
1158
+ }
1159
+ case 10: {
1160
+ if (tag !== 82) {
1161
+ break;
1162
+ }
1163
+
1164
+ message.Origin = reader.string();
1165
+ continue;
1166
+ }
1167
+ case 11: {
1168
+ if (tag !== 90) {
1169
+ break;
1170
+ }
1171
+
1172
+ message.State = reader.string();
1173
+ continue;
1174
+ }
1175
+ case 12: {
1176
+ if (tag !== 96) {
1177
+ break;
1178
+ }
1179
+
1180
+ message.LastSourceSequenceNumber = reader.uint64() as bigint;
1181
+ continue;
1182
+ }
1183
+ case 13: {
1184
+ if (tag !== 104) {
1185
+ break;
1186
+ }
1187
+
1188
+ message.RemoteTailSequenceNumber = reader.uint64() as bigint;
1189
+ continue;
1190
+ }
1191
+ case 14: {
1192
+ if (tag !== 112) {
1193
+ break;
1194
+ }
1195
+
1196
+ message.Lag = reader.uint64() as bigint;
1197
+ continue;
1198
+ }
1199
+ case 15: {
1200
+ if (tag !== 122) {
1201
+ break;
1202
+ }
1203
+
1204
+ message.LastDelivery = SerializableDateTimeOffset.decode(reader, reader.uint32());
1205
+ continue;
1206
+ }
1207
+ case 16: {
1208
+ if (tag !== 130) {
1209
+ break;
1210
+ }
1211
+
1212
+ message.LastError = reader.string();
1213
+ continue;
1214
+ }
1215
+ }
1216
+ if ((tag & 7) === 4 || tag === 0) {
1217
+ break;
1218
+ }
1219
+ reader.skip(tag & 7);
1220
+ }
1221
+ return message;
1222
+ } finally {
1223
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1224
+ }
1225
+ },
1226
+
1227
+ fromJSON(object: any): FederationBindingResponse {
1228
+ return {
1229
+ Id: isSet(object.Id) ? globalThis.String(object.Id) : "",
1230
+ LogicalSource: isSet(object.LogicalSource) ? globalThis.String(object.LogicalSource) : "",
1231
+ Endpoint: isSet(object.Endpoint) ? globalThis.String(object.Endpoint) : "",
1232
+ ServerPin: isSet(object.ServerPin) ? globalThis.String(object.ServerPin) : "",
1233
+ ClientCertificate: isSet(object.ClientCertificate) ? globalThis.String(object.ClientCertificate) : "",
1234
+ RemoteEventStore: isSet(object.RemoteEventStore) ? globalThis.String(object.RemoteEventStore) : "",
1235
+ RemoteNamespace: isSet(object.RemoteNamespace) ? globalThis.String(object.RemoteNamespace) : "",
1236
+ TargetEventStore: isSet(object.TargetEventStore) ? globalThis.String(object.TargetEventStore) : "",
1237
+ TargetNamespace: isSet(object.TargetNamespace) ? globalThis.String(object.TargetNamespace) : "",
1238
+ Origin: isSet(object.Origin) ? globalThis.String(object.Origin) : "",
1239
+ State: isSet(object.State) ? globalThis.String(object.State) : "",
1240
+ LastSourceSequenceNumber: isSet(object.LastSourceSequenceNumber) ? BigInt(object.LastSourceSequenceNumber) : 0n,
1241
+ RemoteTailSequenceNumber: isSet(object.RemoteTailSequenceNumber) ? BigInt(object.RemoteTailSequenceNumber) : 0n,
1242
+ Lag: isSet(object.Lag) ? BigInt(object.Lag) : 0n,
1243
+ LastDelivery: isSet(object.LastDelivery) ? SerializableDateTimeOffset.fromJSON(object.LastDelivery) : undefined,
1244
+ LastError: isSet(object.LastError) ? globalThis.String(object.LastError) : "",
1245
+ };
1246
+ },
1247
+
1248
+ toJSON(message: FederationBindingResponse): unknown {
1249
+ const obj: any = {};
1250
+ if (message.Id !== "") {
1251
+ obj.Id = message.Id;
1252
+ }
1253
+ if (message.LogicalSource !== "") {
1254
+ obj.LogicalSource = message.LogicalSource;
1255
+ }
1256
+ if (message.Endpoint !== "") {
1257
+ obj.Endpoint = message.Endpoint;
1258
+ }
1259
+ if (message.ServerPin !== "") {
1260
+ obj.ServerPin = message.ServerPin;
1261
+ }
1262
+ if (message.ClientCertificate !== "") {
1263
+ obj.ClientCertificate = message.ClientCertificate;
1264
+ }
1265
+ if (message.RemoteEventStore !== "") {
1266
+ obj.RemoteEventStore = message.RemoteEventStore;
1267
+ }
1268
+ if (message.RemoteNamespace !== "") {
1269
+ obj.RemoteNamespace = message.RemoteNamespace;
1270
+ }
1271
+ if (message.TargetEventStore !== "") {
1272
+ obj.TargetEventStore = message.TargetEventStore;
1273
+ }
1274
+ if (message.TargetNamespace !== "") {
1275
+ obj.TargetNamespace = message.TargetNamespace;
1276
+ }
1277
+ if (message.Origin !== "") {
1278
+ obj.Origin = message.Origin;
1279
+ }
1280
+ if (message.State !== "") {
1281
+ obj.State = message.State;
1282
+ }
1283
+ if (message.LastSourceSequenceNumber !== 0n) {
1284
+ obj.LastSourceSequenceNumber = message.LastSourceSequenceNumber.toString();
1285
+ }
1286
+ if (message.RemoteTailSequenceNumber !== 0n) {
1287
+ obj.RemoteTailSequenceNumber = message.RemoteTailSequenceNumber.toString();
1288
+ }
1289
+ if (message.Lag !== 0n) {
1290
+ obj.Lag = message.Lag.toString();
1291
+ }
1292
+ if (message.LastDelivery !== undefined) {
1293
+ obj.LastDelivery = SerializableDateTimeOffset.toJSON(message.LastDelivery);
1294
+ }
1295
+ if (message.LastError !== "") {
1296
+ obj.LastError = message.LastError;
1297
+ }
1298
+ return obj;
1299
+ },
1300
+
1301
+ create(base?: DeepPartial<FederationBindingResponse>): FederationBindingResponse {
1302
+ return FederationBindingResponse.fromPartial(base ?? {});
1303
+ },
1304
+ fromPartial(object: DeepPartial<FederationBindingResponse>): FederationBindingResponse {
1305
+ const message = createBaseFederationBindingResponse();
1306
+ message.Id = object.Id ?? "";
1307
+ message.LogicalSource = object.LogicalSource ?? "";
1308
+ message.Endpoint = object.Endpoint ?? "";
1309
+ message.ServerPin = object.ServerPin ?? "";
1310
+ message.ClientCertificate = object.ClientCertificate ?? "";
1311
+ message.RemoteEventStore = object.RemoteEventStore ?? "";
1312
+ message.RemoteNamespace = object.RemoteNamespace ?? "";
1313
+ message.TargetEventStore = object.TargetEventStore ?? "";
1314
+ message.TargetNamespace = object.TargetNamespace ?? "";
1315
+ message.Origin = object.Origin ?? "";
1316
+ message.State = object.State ?? "";
1317
+ message.LastSourceSequenceNumber =
1318
+ (object.LastSourceSequenceNumber !== undefined && object.LastSourceSequenceNumber !== null)
1319
+ ? BigInt(object.LastSourceSequenceNumber)
1320
+ : 0n;
1321
+ message.RemoteTailSequenceNumber =
1322
+ (object.RemoteTailSequenceNumber !== undefined && object.RemoteTailSequenceNumber !== null)
1323
+ ? BigInt(object.RemoteTailSequenceNumber)
1324
+ : 0n;
1325
+ message.Lag = (object.Lag !== undefined && object.Lag !== null) ? BigInt(object.Lag) : 0n;
1326
+ message.LastDelivery = (object.LastDelivery !== undefined && object.LastDelivery !== null)
1327
+ ? SerializableDateTimeOffset.fromPartial(object.LastDelivery)
1328
+ : undefined;
1329
+ message.LastError = object.LastError ?? "";
1330
+ return message;
1331
+ },
1332
+ };
1333
+
1334
+ function createBaseFederationGrantInformationResponse(): FederationGrantInformationResponse {
1335
+ return {
1336
+ Id: "",
1337
+ ClientPin: "",
1338
+ EventStore: "",
1339
+ Namespaces: [],
1340
+ AllPublic: false,
1341
+ EventTypes: [],
1342
+ Revoked: false,
1343
+ Origin: "",
1344
+ LastPull: undefined,
1345
+ EventsDelivered: 0n,
1346
+ BytesDelivered: 0n,
1347
+ Throttled: 0n,
1348
+ };
1349
+ }
1350
+
1351
+ export const FederationGrantInformationResponse: MessageFns<FederationGrantInformationResponse> = {
1352
+ encode(message: FederationGrantInformationResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1353
+ if (message.Id !== "") {
1354
+ writer.uint32(10).string(message.Id);
1355
+ }
1356
+ if (message.ClientPin !== "") {
1357
+ writer.uint32(18).string(message.ClientPin);
1358
+ }
1359
+ if (message.EventStore !== "") {
1360
+ writer.uint32(26).string(message.EventStore);
1361
+ }
1362
+ for (const v of message.Namespaces) {
1363
+ writer.uint32(34).string(v!);
1364
+ }
1365
+ if (message.AllPublic !== false) {
1366
+ writer.uint32(40).bool(message.AllPublic);
1367
+ }
1368
+ for (const v of message.EventTypes) {
1369
+ writer.uint32(50).string(v!);
1370
+ }
1371
+ if (message.Revoked !== false) {
1372
+ writer.uint32(56).bool(message.Revoked);
1373
+ }
1374
+ if (message.Origin !== "") {
1375
+ writer.uint32(66).string(message.Origin);
1376
+ }
1377
+ if (message.LastPull !== undefined) {
1378
+ SerializableDateTimeOffset.encode(message.LastPull, writer.uint32(74).fork()).join();
1379
+ }
1380
+ if (message.EventsDelivered !== 0n) {
1381
+ if (BigInt.asUintN(64, message.EventsDelivered) !== message.EventsDelivered) {
1382
+ throw new globalThis.Error("value provided for field message.EventsDelivered of type uint64 too large");
1383
+ }
1384
+ writer.uint32(80).uint64(message.EventsDelivered);
1385
+ }
1386
+ if (message.BytesDelivered !== 0n) {
1387
+ if (BigInt.asUintN(64, message.BytesDelivered) !== message.BytesDelivered) {
1388
+ throw new globalThis.Error("value provided for field message.BytesDelivered of type uint64 too large");
1389
+ }
1390
+ writer.uint32(88).uint64(message.BytesDelivered);
1391
+ }
1392
+ if (message.Throttled !== 0n) {
1393
+ if (BigInt.asUintN(64, message.Throttled) !== message.Throttled) {
1394
+ throw new globalThis.Error("value provided for field message.Throttled of type uint64 too large");
1395
+ }
1396
+ writer.uint32(96).uint64(message.Throttled);
1397
+ }
1398
+ return writer;
1399
+ },
1400
+
1401
+ decode(input: BinaryReader | Uint8Array, length?: number): FederationGrantInformationResponse {
1402
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1403
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1404
+ if (previousRecursionDepth >= 100) {
1405
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1406
+ }
1407
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1408
+ try {
1409
+ const end = length === undefined ? reader.len : reader.pos + length;
1410
+ const message = createBaseFederationGrantInformationResponse();
1411
+ while (reader.pos < end) {
1412
+ const tag = reader.uint32();
1413
+ switch (tag >>> 3) {
1414
+ case 1: {
1415
+ if (tag !== 10) {
1416
+ break;
1417
+ }
1418
+
1419
+ message.Id = reader.string();
1420
+ continue;
1421
+ }
1422
+ case 2: {
1423
+ if (tag !== 18) {
1424
+ break;
1425
+ }
1426
+
1427
+ message.ClientPin = reader.string();
1428
+ continue;
1429
+ }
1430
+ case 3: {
1431
+ if (tag !== 26) {
1432
+ break;
1433
+ }
1434
+
1435
+ message.EventStore = reader.string();
1436
+ continue;
1437
+ }
1438
+ case 4: {
1439
+ if (tag !== 34) {
1440
+ break;
1441
+ }
1442
+
1443
+ message.Namespaces.push(reader.string());
1444
+ continue;
1445
+ }
1446
+ case 5: {
1447
+ if (tag !== 40) {
1448
+ break;
1449
+ }
1450
+
1451
+ message.AllPublic = reader.bool();
1452
+ continue;
1453
+ }
1454
+ case 6: {
1455
+ if (tag !== 50) {
1456
+ break;
1457
+ }
1458
+
1459
+ message.EventTypes.push(reader.string());
1460
+ continue;
1461
+ }
1462
+ case 7: {
1463
+ if (tag !== 56) {
1464
+ break;
1465
+ }
1466
+
1467
+ message.Revoked = reader.bool();
1468
+ continue;
1469
+ }
1470
+ case 8: {
1471
+ if (tag !== 66) {
1472
+ break;
1473
+ }
1474
+
1475
+ message.Origin = reader.string();
1476
+ continue;
1477
+ }
1478
+ case 9: {
1479
+ if (tag !== 74) {
1480
+ break;
1481
+ }
1482
+
1483
+ message.LastPull = SerializableDateTimeOffset.decode(reader, reader.uint32());
1484
+ continue;
1485
+ }
1486
+ case 10: {
1487
+ if (tag !== 80) {
1488
+ break;
1489
+ }
1490
+
1491
+ message.EventsDelivered = reader.uint64() as bigint;
1492
+ continue;
1493
+ }
1494
+ case 11: {
1495
+ if (tag !== 88) {
1496
+ break;
1497
+ }
1498
+
1499
+ message.BytesDelivered = reader.uint64() as bigint;
1500
+ continue;
1501
+ }
1502
+ case 12: {
1503
+ if (tag !== 96) {
1504
+ break;
1505
+ }
1506
+
1507
+ message.Throttled = reader.uint64() as bigint;
1508
+ continue;
1509
+ }
1510
+ }
1511
+ if ((tag & 7) === 4 || tag === 0) {
1512
+ break;
1513
+ }
1514
+ reader.skip(tag & 7);
1515
+ }
1516
+ return message;
1517
+ } finally {
1518
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1519
+ }
1520
+ },
1521
+
1522
+ fromJSON(object: any): FederationGrantInformationResponse {
1523
+ return {
1524
+ Id: isSet(object.Id) ? globalThis.String(object.Id) : "",
1525
+ ClientPin: isSet(object.ClientPin) ? globalThis.String(object.ClientPin) : "",
1526
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1527
+ Namespaces: globalThis.Array.isArray(object?.Namespaces)
1528
+ ? object.Namespaces.map((e: any) => globalThis.String(e))
1529
+ : [],
1530
+ AllPublic: isSet(object.AllPublic) ? globalThis.Boolean(object.AllPublic) : false,
1531
+ EventTypes: globalThis.Array.isArray(object?.EventTypes)
1532
+ ? object.EventTypes.map((e: any) => globalThis.String(e))
1533
+ : [],
1534
+ Revoked: isSet(object.Revoked) ? globalThis.Boolean(object.Revoked) : false,
1535
+ Origin: isSet(object.Origin) ? globalThis.String(object.Origin) : "",
1536
+ LastPull: isSet(object.LastPull) ? SerializableDateTimeOffset.fromJSON(object.LastPull) : undefined,
1537
+ EventsDelivered: isSet(object.EventsDelivered) ? BigInt(object.EventsDelivered) : 0n,
1538
+ BytesDelivered: isSet(object.BytesDelivered) ? BigInt(object.BytesDelivered) : 0n,
1539
+ Throttled: isSet(object.Throttled) ? BigInt(object.Throttled) : 0n,
1540
+ };
1541
+ },
1542
+
1543
+ toJSON(message: FederationGrantInformationResponse): unknown {
1544
+ const obj: any = {};
1545
+ if (message.Id !== "") {
1546
+ obj.Id = message.Id;
1547
+ }
1548
+ if (message.ClientPin !== "") {
1549
+ obj.ClientPin = message.ClientPin;
1550
+ }
1551
+ if (message.EventStore !== "") {
1552
+ obj.EventStore = message.EventStore;
1553
+ }
1554
+ if (message.Namespaces?.length) {
1555
+ obj.Namespaces = message.Namespaces;
1556
+ }
1557
+ if (message.AllPublic !== false) {
1558
+ obj.AllPublic = message.AllPublic;
1559
+ }
1560
+ if (message.EventTypes?.length) {
1561
+ obj.EventTypes = message.EventTypes;
1562
+ }
1563
+ if (message.Revoked !== false) {
1564
+ obj.Revoked = message.Revoked;
1565
+ }
1566
+ if (message.Origin !== "") {
1567
+ obj.Origin = message.Origin;
1568
+ }
1569
+ if (message.LastPull !== undefined) {
1570
+ obj.LastPull = SerializableDateTimeOffset.toJSON(message.LastPull);
1571
+ }
1572
+ if (message.EventsDelivered !== 0n) {
1573
+ obj.EventsDelivered = message.EventsDelivered.toString();
1574
+ }
1575
+ if (message.BytesDelivered !== 0n) {
1576
+ obj.BytesDelivered = message.BytesDelivered.toString();
1577
+ }
1578
+ if (message.Throttled !== 0n) {
1579
+ obj.Throttled = message.Throttled.toString();
1580
+ }
1581
+ return obj;
1582
+ },
1583
+
1584
+ create(base?: DeepPartial<FederationGrantInformationResponse>): FederationGrantInformationResponse {
1585
+ return FederationGrantInformationResponse.fromPartial(base ?? {});
1586
+ },
1587
+ fromPartial(object: DeepPartial<FederationGrantInformationResponse>): FederationGrantInformationResponse {
1588
+ const message = createBaseFederationGrantInformationResponse();
1589
+ message.Id = object.Id ?? "";
1590
+ message.ClientPin = object.ClientPin ?? "";
1591
+ message.EventStore = object.EventStore ?? "";
1592
+ message.Namespaces = object.Namespaces?.map((e) => e) || [];
1593
+ message.AllPublic = object.AllPublic ?? false;
1594
+ message.EventTypes = object.EventTypes?.map((e) => e) || [];
1595
+ message.Revoked = object.Revoked ?? false;
1596
+ message.Origin = object.Origin ?? "";
1597
+ message.LastPull = (object.LastPull !== undefined && object.LastPull !== null)
1598
+ ? SerializableDateTimeOffset.fromPartial(object.LastPull)
1599
+ : undefined;
1600
+ message.EventsDelivered = (object.EventsDelivered !== undefined && object.EventsDelivered !== null)
1601
+ ? BigInt(object.EventsDelivered)
1602
+ : 0n;
1603
+ message.BytesDelivered = (object.BytesDelivered !== undefined && object.BytesDelivered !== null)
1604
+ ? BigInt(object.BytesDelivered)
1605
+ : 0n;
1606
+ message.Throttled = (object.Throttled !== undefined && object.Throttled !== null) ? BigInt(object.Throttled) : 0n;
1607
+ return message;
1608
+ },
1609
+ };
1610
+
1611
+ function createBasePullRequest(): PullRequest {
1612
+ return { EventStore: "", Namespace: "", FromSequenceNumber: 0n, Limit: 0, EventTypes: [] };
1613
+ }
1614
+
1615
+ export const PullRequest: MessageFns<PullRequest> = {
1616
+ encode(message: PullRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1617
+ if (message.EventStore !== "") {
1618
+ writer.uint32(10).string(message.EventStore);
1619
+ }
1620
+ if (message.Namespace !== "") {
1621
+ writer.uint32(18).string(message.Namespace);
1622
+ }
1623
+ if (message.FromSequenceNumber !== 0n) {
1624
+ if (BigInt.asUintN(64, message.FromSequenceNumber) !== message.FromSequenceNumber) {
1625
+ throw new globalThis.Error("value provided for field message.FromSequenceNumber of type uint64 too large");
1626
+ }
1627
+ writer.uint32(24).uint64(message.FromSequenceNumber);
1628
+ }
1629
+ if (message.Limit !== 0) {
1630
+ writer.uint32(32).int32(message.Limit);
1631
+ }
1632
+ for (const v of message.EventTypes) {
1633
+ writer.uint32(42).string(v!);
1634
+ }
1635
+ return writer;
1636
+ },
1637
+
1638
+ decode(input: BinaryReader | Uint8Array, length?: number): PullRequest {
1639
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1640
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1641
+ if (previousRecursionDepth >= 100) {
1642
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1643
+ }
1644
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1645
+ try {
1646
+ const end = length === undefined ? reader.len : reader.pos + length;
1647
+ const message = createBasePullRequest();
1648
+ while (reader.pos < end) {
1649
+ const tag = reader.uint32();
1650
+ switch (tag >>> 3) {
1651
+ case 1: {
1652
+ if (tag !== 10) {
1653
+ break;
1654
+ }
1655
+
1656
+ message.EventStore = reader.string();
1657
+ continue;
1658
+ }
1659
+ case 2: {
1660
+ if (tag !== 18) {
1661
+ break;
1662
+ }
1663
+
1664
+ message.Namespace = reader.string();
1665
+ continue;
1666
+ }
1667
+ case 3: {
1668
+ if (tag !== 24) {
1669
+ break;
1670
+ }
1671
+
1672
+ message.FromSequenceNumber = reader.uint64() as bigint;
1673
+ continue;
1674
+ }
1675
+ case 4: {
1676
+ if (tag !== 32) {
1677
+ break;
1678
+ }
1679
+
1680
+ message.Limit = reader.int32();
1681
+ continue;
1682
+ }
1683
+ case 5: {
1684
+ if (tag !== 42) {
1685
+ break;
1686
+ }
1687
+
1688
+ message.EventTypes.push(reader.string());
1689
+ continue;
1690
+ }
1691
+ }
1692
+ if ((tag & 7) === 4 || tag === 0) {
1693
+ break;
1694
+ }
1695
+ reader.skip(tag & 7);
1696
+ }
1697
+ return message;
1698
+ } finally {
1699
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1700
+ }
1701
+ },
1702
+
1703
+ fromJSON(object: any): PullRequest {
1704
+ return {
1705
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1706
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1707
+ FromSequenceNumber: isSet(object.FromSequenceNumber) ? BigInt(object.FromSequenceNumber) : 0n,
1708
+ Limit: isSet(object.Limit) ? globalThis.Number(object.Limit) : 0,
1709
+ EventTypes: globalThis.Array.isArray(object?.EventTypes)
1710
+ ? object.EventTypes.map((e: any) => globalThis.String(e))
1711
+ : [],
1712
+ };
1713
+ },
1714
+
1715
+ toJSON(message: PullRequest): unknown {
1716
+ const obj: any = {};
1717
+ if (message.EventStore !== "") {
1718
+ obj.EventStore = message.EventStore;
1719
+ }
1720
+ if (message.Namespace !== "") {
1721
+ obj.Namespace = message.Namespace;
1722
+ }
1723
+ if (message.FromSequenceNumber !== 0n) {
1724
+ obj.FromSequenceNumber = message.FromSequenceNumber.toString();
1725
+ }
1726
+ if (message.Limit !== 0) {
1727
+ obj.Limit = Math.round(message.Limit);
1728
+ }
1729
+ if (message.EventTypes?.length) {
1730
+ obj.EventTypes = message.EventTypes;
1731
+ }
1732
+ return obj;
1733
+ },
1734
+
1735
+ create(base?: DeepPartial<PullRequest>): PullRequest {
1736
+ return PullRequest.fromPartial(base ?? {});
1737
+ },
1738
+ fromPartial(object: DeepPartial<PullRequest>): PullRequest {
1739
+ const message = createBasePullRequest();
1740
+ message.EventStore = object.EventStore ?? "";
1741
+ message.Namespace = object.Namespace ?? "";
1742
+ message.FromSequenceNumber = (object.FromSequenceNumber !== undefined && object.FromSequenceNumber !== null)
1743
+ ? BigInt(object.FromSequenceNumber)
1744
+ : 0n;
1745
+ message.Limit = object.Limit ?? 0;
1746
+ message.EventTypes = object.EventTypes?.map((e) => e) || [];
1747
+ return message;
1748
+ },
1749
+ };
1750
+
1751
+ function createBaseQueryResultFederatedEventBatchResponse(): QueryResultFederatedEventBatchResponse {
1752
+ return {
1753
+ CorrelationId: undefined,
1754
+ IsAuthorized: false,
1755
+ ValidationResults: [],
1756
+ ExceptionMessages: [],
1757
+ ExceptionStackTrace: "",
1758
+ Data: undefined,
1759
+ };
1760
+ }
1761
+
1762
+ export const QueryResultFederatedEventBatchResponse: MessageFns<QueryResultFederatedEventBatchResponse> = {
1763
+ encode(message: QueryResultFederatedEventBatchResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1764
+ if (message.CorrelationId !== undefined) {
1765
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1766
+ }
1767
+ if (message.IsAuthorized !== false) {
1768
+ writer.uint32(16).bool(message.IsAuthorized);
1769
+ }
1770
+ for (const v of message.ValidationResults) {
1771
+ ValidationResult.encode(v!, writer.uint32(26).fork()).join();
1772
+ }
1773
+ for (const v of message.ExceptionMessages) {
1774
+ writer.uint32(34).string(v!);
1775
+ }
1776
+ if (message.ExceptionStackTrace !== "") {
1777
+ writer.uint32(42).string(message.ExceptionStackTrace);
1778
+ }
1779
+ if (message.Data !== undefined) {
1780
+ FederatedEventBatchResponse.encode(message.Data, writer.uint32(50).fork()).join();
1781
+ }
1782
+ return writer;
1783
+ },
1784
+
1785
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryResultFederatedEventBatchResponse {
1786
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1787
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1788
+ if (previousRecursionDepth >= 100) {
1789
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1790
+ }
1791
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1792
+ try {
1793
+ const end = length === undefined ? reader.len : reader.pos + length;
1794
+ const message = createBaseQueryResultFederatedEventBatchResponse();
1795
+ while (reader.pos < end) {
1796
+ const tag = reader.uint32();
1797
+ switch (tag >>> 3) {
1798
+ case 1: {
1799
+ if (tag !== 10) {
1800
+ break;
1801
+ }
1802
+
1803
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
1804
+ continue;
1805
+ }
1806
+ case 2: {
1807
+ if (tag !== 16) {
1808
+ break;
1809
+ }
1810
+
1811
+ message.IsAuthorized = reader.bool();
1812
+ continue;
1813
+ }
1814
+ case 3: {
1815
+ if (tag !== 26) {
1816
+ break;
1817
+ }
1818
+
1819
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
1820
+ continue;
1821
+ }
1822
+ case 4: {
1823
+ if (tag !== 34) {
1824
+ break;
1825
+ }
1826
+
1827
+ message.ExceptionMessages.push(reader.string());
1828
+ continue;
1829
+ }
1830
+ case 5: {
1831
+ if (tag !== 42) {
1832
+ break;
1833
+ }
1834
+
1835
+ message.ExceptionStackTrace = reader.string();
1836
+ continue;
1837
+ }
1838
+ case 6: {
1839
+ if (tag !== 50) {
1840
+ break;
1841
+ }
1842
+
1843
+ message.Data = FederatedEventBatchResponse.decode(reader, reader.uint32());
1844
+ continue;
1845
+ }
1846
+ }
1847
+ if ((tag & 7) === 4 || tag === 0) {
1848
+ break;
1849
+ }
1850
+ reader.skip(tag & 7);
1851
+ }
1852
+ return message;
1853
+ } finally {
1854
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1855
+ }
1856
+ },
1857
+
1858
+ fromJSON(object: any): QueryResultFederatedEventBatchResponse {
1859
+ return {
1860
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
1861
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
1862
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
1863
+ ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e))
1864
+ : [],
1865
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
1866
+ ? object.ExceptionMessages.map((e: any) => globalThis.String(e))
1867
+ : [],
1868
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
1869
+ Data: isSet(object.Data) ? FederatedEventBatchResponse.fromJSON(object.Data) : undefined,
1870
+ };
1871
+ },
1872
+
1873
+ toJSON(message: QueryResultFederatedEventBatchResponse): unknown {
1874
+ const obj: any = {};
1875
+ if (message.CorrelationId !== undefined) {
1876
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
1877
+ }
1878
+ if (message.IsAuthorized !== false) {
1879
+ obj.IsAuthorized = message.IsAuthorized;
1880
+ }
1881
+ if (message.ValidationResults?.length) {
1882
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
1883
+ }
1884
+ if (message.ExceptionMessages?.length) {
1885
+ obj.ExceptionMessages = message.ExceptionMessages;
1886
+ }
1887
+ if (message.ExceptionStackTrace !== "") {
1888
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
1889
+ }
1890
+ if (message.Data !== undefined) {
1891
+ obj.Data = FederatedEventBatchResponse.toJSON(message.Data);
1892
+ }
1893
+ return obj;
1894
+ },
1895
+
1896
+ create(base?: DeepPartial<QueryResultFederatedEventBatchResponse>): QueryResultFederatedEventBatchResponse {
1897
+ return QueryResultFederatedEventBatchResponse.fromPartial(base ?? {});
1898
+ },
1899
+ fromPartial(object: DeepPartial<QueryResultFederatedEventBatchResponse>): QueryResultFederatedEventBatchResponse {
1900
+ const message = createBaseQueryResultFederatedEventBatchResponse();
1901
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1902
+ ? Guid.fromPartial(object.CorrelationId)
1903
+ : undefined;
1904
+ message.IsAuthorized = object.IsAuthorized ?? false;
1905
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
1906
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
1907
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
1908
+ message.Data = (object.Data !== undefined && object.Data !== null)
1909
+ ? FederatedEventBatchResponse.fromPartial(object.Data)
1910
+ : undefined;
1911
+ return message;
1912
+ },
1913
+ };
1914
+
1915
+ function createBaseQueryResultIEnumerableFederationBindingResponse(): QueryResultIEnumerableFederationBindingResponse {
1916
+ return {
1917
+ CorrelationId: undefined,
1918
+ IsAuthorized: false,
1919
+ ValidationResults: [],
1920
+ ExceptionMessages: [],
1921
+ ExceptionStackTrace: "",
1922
+ Data: [],
1923
+ };
1924
+ }
1925
+
1926
+ export const QueryResultIEnumerableFederationBindingResponse: MessageFns<
1927
+ QueryResultIEnumerableFederationBindingResponse
1928
+ > = {
1929
+ encode(
1930
+ message: QueryResultIEnumerableFederationBindingResponse,
1931
+ writer: BinaryWriter = new BinaryWriter(),
1932
+ ): BinaryWriter {
1933
+ if (message.CorrelationId !== undefined) {
1934
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1935
+ }
1936
+ if (message.IsAuthorized !== false) {
1937
+ writer.uint32(16).bool(message.IsAuthorized);
1938
+ }
1939
+ for (const v of message.ValidationResults) {
1940
+ ValidationResult.encode(v!, writer.uint32(26).fork()).join();
1941
+ }
1942
+ for (const v of message.ExceptionMessages) {
1943
+ writer.uint32(34).string(v!);
1944
+ }
1945
+ if (message.ExceptionStackTrace !== "") {
1946
+ writer.uint32(42).string(message.ExceptionStackTrace);
1947
+ }
1948
+ for (const v of message.Data) {
1949
+ FederationBindingResponse.encode(v!, writer.uint32(50).fork()).join();
1950
+ }
1951
+ return writer;
1952
+ },
1953
+
1954
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableFederationBindingResponse {
1955
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1956
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1957
+ if (previousRecursionDepth >= 100) {
1958
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1959
+ }
1960
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1961
+ try {
1962
+ const end = length === undefined ? reader.len : reader.pos + length;
1963
+ const message = createBaseQueryResultIEnumerableFederationBindingResponse();
1964
+ while (reader.pos < end) {
1965
+ const tag = reader.uint32();
1966
+ switch (tag >>> 3) {
1967
+ case 1: {
1968
+ if (tag !== 10) {
1969
+ break;
1970
+ }
1971
+
1972
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
1973
+ continue;
1974
+ }
1975
+ case 2: {
1976
+ if (tag !== 16) {
1977
+ break;
1978
+ }
1979
+
1980
+ message.IsAuthorized = reader.bool();
1981
+ continue;
1982
+ }
1983
+ case 3: {
1984
+ if (tag !== 26) {
1985
+ break;
1986
+ }
1987
+
1988
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
1989
+ continue;
1990
+ }
1991
+ case 4: {
1992
+ if (tag !== 34) {
1993
+ break;
1994
+ }
1995
+
1996
+ message.ExceptionMessages.push(reader.string());
1997
+ continue;
1998
+ }
1999
+ case 5: {
2000
+ if (tag !== 42) {
2001
+ break;
2002
+ }
2003
+
2004
+ message.ExceptionStackTrace = reader.string();
2005
+ continue;
2006
+ }
2007
+ case 6: {
2008
+ if (tag !== 50) {
2009
+ break;
2010
+ }
2011
+
2012
+ message.Data.push(FederationBindingResponse.decode(reader, reader.uint32()));
2013
+ continue;
2014
+ }
2015
+ }
2016
+ if ((tag & 7) === 4 || tag === 0) {
2017
+ break;
2018
+ }
2019
+ reader.skip(tag & 7);
2020
+ }
2021
+ return message;
2022
+ } finally {
2023
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2024
+ }
2025
+ },
2026
+
2027
+ fromJSON(object: any): QueryResultIEnumerableFederationBindingResponse {
2028
+ return {
2029
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
2030
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
2031
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
2032
+ ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e))
2033
+ : [],
2034
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
2035
+ ? object.ExceptionMessages.map((e: any) => globalThis.String(e))
2036
+ : [],
2037
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
2038
+ Data: globalThis.Array.isArray(object?.Data)
2039
+ ? object.Data.map((e: any) => FederationBindingResponse.fromJSON(e))
2040
+ : [],
2041
+ };
2042
+ },
2043
+
2044
+ toJSON(message: QueryResultIEnumerableFederationBindingResponse): unknown {
2045
+ const obj: any = {};
2046
+ if (message.CorrelationId !== undefined) {
2047
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
2048
+ }
2049
+ if (message.IsAuthorized !== false) {
2050
+ obj.IsAuthorized = message.IsAuthorized;
2051
+ }
2052
+ if (message.ValidationResults?.length) {
2053
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
2054
+ }
2055
+ if (message.ExceptionMessages?.length) {
2056
+ obj.ExceptionMessages = message.ExceptionMessages;
2057
+ }
2058
+ if (message.ExceptionStackTrace !== "") {
2059
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
2060
+ }
2061
+ if (message.Data?.length) {
2062
+ obj.Data = message.Data.map((e) => FederationBindingResponse.toJSON(e));
2063
+ }
2064
+ return obj;
2065
+ },
2066
+
2067
+ create(
2068
+ base?: DeepPartial<QueryResultIEnumerableFederationBindingResponse>,
2069
+ ): QueryResultIEnumerableFederationBindingResponse {
2070
+ return QueryResultIEnumerableFederationBindingResponse.fromPartial(base ?? {});
2071
+ },
2072
+ fromPartial(
2073
+ object: DeepPartial<QueryResultIEnumerableFederationBindingResponse>,
2074
+ ): QueryResultIEnumerableFederationBindingResponse {
2075
+ const message = createBaseQueryResultIEnumerableFederationBindingResponse();
2076
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
2077
+ ? Guid.fromPartial(object.CorrelationId)
2078
+ : undefined;
2079
+ message.IsAuthorized = object.IsAuthorized ?? false;
2080
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
2081
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
2082
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
2083
+ message.Data = object.Data?.map((e) => FederationBindingResponse.fromPartial(e)) || [];
2084
+ return message;
2085
+ },
2086
+ };
2087
+
2088
+ function createBaseQueryResultIEnumerableFederationGrantInformationResponse(): QueryResultIEnumerableFederationGrantInformationResponse {
2089
+ return {
2090
+ CorrelationId: undefined,
2091
+ IsAuthorized: false,
2092
+ ValidationResults: [],
2093
+ ExceptionMessages: [],
2094
+ ExceptionStackTrace: "",
2095
+ Data: [],
2096
+ };
2097
+ }
2098
+
2099
+ export const QueryResultIEnumerableFederationGrantInformationResponse: MessageFns<
2100
+ QueryResultIEnumerableFederationGrantInformationResponse
2101
+ > = {
2102
+ encode(
2103
+ message: QueryResultIEnumerableFederationGrantInformationResponse,
2104
+ writer: BinaryWriter = new BinaryWriter(),
2105
+ ): BinaryWriter {
2106
+ if (message.CorrelationId !== undefined) {
2107
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
2108
+ }
2109
+ if (message.IsAuthorized !== false) {
2110
+ writer.uint32(16).bool(message.IsAuthorized);
2111
+ }
2112
+ for (const v of message.ValidationResults) {
2113
+ ValidationResult.encode(v!, writer.uint32(26).fork()).join();
2114
+ }
2115
+ for (const v of message.ExceptionMessages) {
2116
+ writer.uint32(34).string(v!);
2117
+ }
2118
+ if (message.ExceptionStackTrace !== "") {
2119
+ writer.uint32(42).string(message.ExceptionStackTrace);
2120
+ }
2121
+ for (const v of message.Data) {
2122
+ FederationGrantInformationResponse.encode(v!, writer.uint32(50).fork()).join();
2123
+ }
2124
+ return writer;
2125
+ },
2126
+
2127
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableFederationGrantInformationResponse {
2128
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2129
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2130
+ if (previousRecursionDepth >= 100) {
2131
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2132
+ }
2133
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2134
+ try {
2135
+ const end = length === undefined ? reader.len : reader.pos + length;
2136
+ const message = createBaseQueryResultIEnumerableFederationGrantInformationResponse();
2137
+ while (reader.pos < end) {
2138
+ const tag = reader.uint32();
2139
+ switch (tag >>> 3) {
2140
+ case 1: {
2141
+ if (tag !== 10) {
2142
+ break;
2143
+ }
2144
+
2145
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
2146
+ continue;
2147
+ }
2148
+ case 2: {
2149
+ if (tag !== 16) {
2150
+ break;
2151
+ }
2152
+
2153
+ message.IsAuthorized = reader.bool();
2154
+ continue;
2155
+ }
2156
+ case 3: {
2157
+ if (tag !== 26) {
2158
+ break;
2159
+ }
2160
+
2161
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
2162
+ continue;
2163
+ }
2164
+ case 4: {
2165
+ if (tag !== 34) {
2166
+ break;
2167
+ }
2168
+
2169
+ message.ExceptionMessages.push(reader.string());
2170
+ continue;
2171
+ }
2172
+ case 5: {
2173
+ if (tag !== 42) {
2174
+ break;
2175
+ }
2176
+
2177
+ message.ExceptionStackTrace = reader.string();
2178
+ continue;
2179
+ }
2180
+ case 6: {
2181
+ if (tag !== 50) {
2182
+ break;
2183
+ }
2184
+
2185
+ message.Data.push(FederationGrantInformationResponse.decode(reader, reader.uint32()));
2186
+ continue;
2187
+ }
2188
+ }
2189
+ if ((tag & 7) === 4 || tag === 0) {
2190
+ break;
2191
+ }
2192
+ reader.skip(tag & 7);
2193
+ }
2194
+ return message;
2195
+ } finally {
2196
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2197
+ }
2198
+ },
2199
+
2200
+ fromJSON(object: any): QueryResultIEnumerableFederationGrantInformationResponse {
2201
+ return {
2202
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
2203
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
2204
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
2205
+ ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e))
2206
+ : [],
2207
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
2208
+ ? object.ExceptionMessages.map((e: any) => globalThis.String(e))
2209
+ : [],
2210
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
2211
+ Data: globalThis.Array.isArray(object?.Data)
2212
+ ? object.Data.map((e: any) => FederationGrantInformationResponse.fromJSON(e))
2213
+ : [],
2214
+ };
2215
+ },
2216
+
2217
+ toJSON(message: QueryResultIEnumerableFederationGrantInformationResponse): unknown {
2218
+ const obj: any = {};
2219
+ if (message.CorrelationId !== undefined) {
2220
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
2221
+ }
2222
+ if (message.IsAuthorized !== false) {
2223
+ obj.IsAuthorized = message.IsAuthorized;
2224
+ }
2225
+ if (message.ValidationResults?.length) {
2226
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
2227
+ }
2228
+ if (message.ExceptionMessages?.length) {
2229
+ obj.ExceptionMessages = message.ExceptionMessages;
2230
+ }
2231
+ if (message.ExceptionStackTrace !== "") {
2232
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
2233
+ }
2234
+ if (message.Data?.length) {
2235
+ obj.Data = message.Data.map((e) => FederationGrantInformationResponse.toJSON(e));
2236
+ }
2237
+ return obj;
2238
+ },
2239
+
2240
+ create(
2241
+ base?: DeepPartial<QueryResultIEnumerableFederationGrantInformationResponse>,
2242
+ ): QueryResultIEnumerableFederationGrantInformationResponse {
2243
+ return QueryResultIEnumerableFederationGrantInformationResponse.fromPartial(base ?? {});
2244
+ },
2245
+ fromPartial(
2246
+ object: DeepPartial<QueryResultIEnumerableFederationGrantInformationResponse>,
2247
+ ): QueryResultIEnumerableFederationGrantInformationResponse {
2248
+ const message = createBaseQueryResultIEnumerableFederationGrantInformationResponse();
2249
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
2250
+ ? Guid.fromPartial(object.CorrelationId)
2251
+ : undefined;
2252
+ message.IsAuthorized = object.IsAuthorized ?? false;
2253
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
2254
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
2255
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
2256
+ message.Data = object.Data?.map((e) => FederationGrantInformationResponse.fromPartial(e)) || [];
2257
+ return message;
2258
+ },
2259
+ };
2260
+
2261
+ function createBaseRevokeFederationLinkRequest(): RevokeFederationLinkRequest {
2262
+ return { Id: "" };
2263
+ }
2264
+
2265
+ export const RevokeFederationLinkRequest: MessageFns<RevokeFederationLinkRequest> = {
2266
+ encode(message: RevokeFederationLinkRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2267
+ if (message.Id !== "") {
2268
+ writer.uint32(10).string(message.Id);
2269
+ }
2270
+ return writer;
2271
+ },
2272
+
2273
+ decode(input: BinaryReader | Uint8Array, length?: number): RevokeFederationLinkRequest {
2274
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2275
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2276
+ if (previousRecursionDepth >= 100) {
2277
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2278
+ }
2279
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2280
+ try {
2281
+ const end = length === undefined ? reader.len : reader.pos + length;
2282
+ const message = createBaseRevokeFederationLinkRequest();
2283
+ while (reader.pos < end) {
2284
+ const tag = reader.uint32();
2285
+ switch (tag >>> 3) {
2286
+ case 1: {
2287
+ if (tag !== 10) {
2288
+ break;
2289
+ }
2290
+
2291
+ message.Id = reader.string();
2292
+ continue;
2293
+ }
2294
+ }
2295
+ if ((tag & 7) === 4 || tag === 0) {
2296
+ break;
2297
+ }
2298
+ reader.skip(tag & 7);
2299
+ }
2300
+ return message;
2301
+ } finally {
2302
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2303
+ }
2304
+ },
2305
+
2306
+ fromJSON(object: any): RevokeFederationLinkRequest {
2307
+ return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "" };
2308
+ },
2309
+
2310
+ toJSON(message: RevokeFederationLinkRequest): unknown {
2311
+ const obj: any = {};
2312
+ if (message.Id !== "") {
2313
+ obj.Id = message.Id;
2314
+ }
2315
+ return obj;
2316
+ },
2317
+
2318
+ create(base?: DeepPartial<RevokeFederationLinkRequest>): RevokeFederationLinkRequest {
2319
+ return RevokeFederationLinkRequest.fromPartial(base ?? {});
2320
+ },
2321
+ fromPartial(object: DeepPartial<RevokeFederationLinkRequest>): RevokeFederationLinkRequest {
2322
+ const message = createBaseRevokeFederationLinkRequest();
2323
+ message.Id = object.Id ?? "";
2324
+ return message;
2325
+ },
2326
+ };
2327
+
2328
+ function createBaseSerializableDateTimeOffset(): SerializableDateTimeOffset {
2329
+ return { Value: "" };
2330
+ }
2331
+
2332
+ export const SerializableDateTimeOffset: MessageFns<SerializableDateTimeOffset> = {
2333
+ encode(message: SerializableDateTimeOffset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2334
+ if (message.Value !== "") {
2335
+ writer.uint32(10).string(message.Value);
2336
+ }
2337
+ return writer;
2338
+ },
2339
+
2340
+ decode(input: BinaryReader | Uint8Array, length?: number): SerializableDateTimeOffset {
2341
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2342
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2343
+ if (previousRecursionDepth >= 100) {
2344
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2345
+ }
2346
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2347
+ try {
2348
+ const end = length === undefined ? reader.len : reader.pos + length;
2349
+ const message = createBaseSerializableDateTimeOffset();
2350
+ while (reader.pos < end) {
2351
+ const tag = reader.uint32();
2352
+ switch (tag >>> 3) {
2353
+ case 1: {
2354
+ if (tag !== 10) {
2355
+ break;
2356
+ }
2357
+
2358
+ message.Value = reader.string();
2359
+ continue;
2360
+ }
2361
+ }
2362
+ if ((tag & 7) === 4 || tag === 0) {
2363
+ break;
2364
+ }
2365
+ reader.skip(tag & 7);
2366
+ }
2367
+ return message;
2368
+ } finally {
2369
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2370
+ }
2371
+ },
2372
+
2373
+ fromJSON(object: any): SerializableDateTimeOffset {
2374
+ return { Value: isSet(object.Value) ? globalThis.String(object.Value) : "" };
2375
+ },
2376
+
2377
+ toJSON(message: SerializableDateTimeOffset): unknown {
2378
+ const obj: any = {};
2379
+ if (message.Value !== "") {
2380
+ obj.Value = message.Value;
2381
+ }
2382
+ return obj;
2383
+ },
2384
+
2385
+ create(base?: DeepPartial<SerializableDateTimeOffset>): SerializableDateTimeOffset {
2386
+ return SerializableDateTimeOffset.fromPartial(base ?? {});
2387
+ },
2388
+ fromPartial(object: DeepPartial<SerializableDateTimeOffset>): SerializableDateTimeOffset {
2389
+ const message = createBaseSerializableDateTimeOffset();
2390
+ message.Value = object.Value ?? "";
2391
+ return message;
2392
+ },
2393
+ };
2394
+
2395
+ function createBaseSetFederationGrantRequest(): SetFederationGrantRequest {
2396
+ return { Id: "", ClientPin: "", EventStore: "", Namespaces: [], AllPublic: false, EventTypes: [] };
2397
+ }
2398
+
2399
+ export const SetFederationGrantRequest: MessageFns<SetFederationGrantRequest> = {
2400
+ encode(message: SetFederationGrantRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2401
+ if (message.Id !== "") {
2402
+ writer.uint32(10).string(message.Id);
2403
+ }
2404
+ if (message.ClientPin !== "") {
2405
+ writer.uint32(18).string(message.ClientPin);
2406
+ }
2407
+ if (message.EventStore !== "") {
2408
+ writer.uint32(26).string(message.EventStore);
2409
+ }
2410
+ for (const v of message.Namespaces) {
2411
+ writer.uint32(34).string(v!);
2412
+ }
2413
+ if (message.AllPublic !== false) {
2414
+ writer.uint32(40).bool(message.AllPublic);
2415
+ }
2416
+ for (const v of message.EventTypes) {
2417
+ writer.uint32(50).string(v!);
2418
+ }
2419
+ return writer;
2420
+ },
2421
+
2422
+ decode(input: BinaryReader | Uint8Array, length?: number): SetFederationGrantRequest {
2423
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2424
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2425
+ if (previousRecursionDepth >= 100) {
2426
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2427
+ }
2428
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2429
+ try {
2430
+ const end = length === undefined ? reader.len : reader.pos + length;
2431
+ const message = createBaseSetFederationGrantRequest();
2432
+ while (reader.pos < end) {
2433
+ const tag = reader.uint32();
2434
+ switch (tag >>> 3) {
2435
+ case 1: {
2436
+ if (tag !== 10) {
2437
+ break;
2438
+ }
2439
+
2440
+ message.Id = reader.string();
2441
+ continue;
2442
+ }
2443
+ case 2: {
2444
+ if (tag !== 18) {
2445
+ break;
2446
+ }
2447
+
2448
+ message.ClientPin = reader.string();
2449
+ continue;
2450
+ }
2451
+ case 3: {
2452
+ if (tag !== 26) {
2453
+ break;
2454
+ }
2455
+
2456
+ message.EventStore = reader.string();
2457
+ continue;
2458
+ }
2459
+ case 4: {
2460
+ if (tag !== 34) {
2461
+ break;
2462
+ }
2463
+
2464
+ message.Namespaces.push(reader.string());
2465
+ continue;
2466
+ }
2467
+ case 5: {
2468
+ if (tag !== 40) {
2469
+ break;
2470
+ }
2471
+
2472
+ message.AllPublic = reader.bool();
2473
+ continue;
2474
+ }
2475
+ case 6: {
2476
+ if (tag !== 50) {
2477
+ break;
2478
+ }
2479
+
2480
+ message.EventTypes.push(reader.string());
2481
+ continue;
2482
+ }
2483
+ }
2484
+ if ((tag & 7) === 4 || tag === 0) {
2485
+ break;
2486
+ }
2487
+ reader.skip(tag & 7);
2488
+ }
2489
+ return message;
2490
+ } finally {
2491
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2492
+ }
2493
+ },
2494
+
2495
+ fromJSON(object: any): SetFederationGrantRequest {
2496
+ return {
2497
+ Id: isSet(object.Id) ? globalThis.String(object.Id) : "",
2498
+ ClientPin: isSet(object.ClientPin) ? globalThis.String(object.ClientPin) : "",
2499
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
2500
+ Namespaces: globalThis.Array.isArray(object?.Namespaces)
2501
+ ? object.Namespaces.map((e: any) => globalThis.String(e))
2502
+ : [],
2503
+ AllPublic: isSet(object.AllPublic) ? globalThis.Boolean(object.AllPublic) : false,
2504
+ EventTypes: globalThis.Array.isArray(object?.EventTypes)
2505
+ ? object.EventTypes.map((e: any) => globalThis.String(e))
2506
+ : [],
2507
+ };
2508
+ },
2509
+
2510
+ toJSON(message: SetFederationGrantRequest): unknown {
2511
+ const obj: any = {};
2512
+ if (message.Id !== "") {
2513
+ obj.Id = message.Id;
2514
+ }
2515
+ if (message.ClientPin !== "") {
2516
+ obj.ClientPin = message.ClientPin;
2517
+ }
2518
+ if (message.EventStore !== "") {
2519
+ obj.EventStore = message.EventStore;
2520
+ }
2521
+ if (message.Namespaces?.length) {
2522
+ obj.Namespaces = message.Namespaces;
2523
+ }
2524
+ if (message.AllPublic !== false) {
2525
+ obj.AllPublic = message.AllPublic;
2526
+ }
2527
+ if (message.EventTypes?.length) {
2528
+ obj.EventTypes = message.EventTypes;
2529
+ }
2530
+ return obj;
2531
+ },
2532
+
2533
+ create(base?: DeepPartial<SetFederationGrantRequest>): SetFederationGrantRequest {
2534
+ return SetFederationGrantRequest.fromPartial(base ?? {});
2535
+ },
2536
+ fromPartial(object: DeepPartial<SetFederationGrantRequest>): SetFederationGrantRequest {
2537
+ const message = createBaseSetFederationGrantRequest();
2538
+ message.Id = object.Id ?? "";
2539
+ message.ClientPin = object.ClientPin ?? "";
2540
+ message.EventStore = object.EventStore ?? "";
2541
+ message.Namespaces = object.Namespaces?.map((e) => e) || [];
2542
+ message.AllPublic = object.AllPublic ?? false;
2543
+ message.EventTypes = object.EventTypes?.map((e) => e) || [];
2544
+ return message;
2545
+ },
2546
+ };
2547
+
2548
+ function createBaseUnbindFederationPeerRequest(): UnbindFederationPeerRequest {
2549
+ return { Id: "" };
2550
+ }
2551
+
2552
+ export const UnbindFederationPeerRequest: MessageFns<UnbindFederationPeerRequest> = {
2553
+ encode(message: UnbindFederationPeerRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2554
+ if (message.Id !== "") {
2555
+ writer.uint32(10).string(message.Id);
2556
+ }
2557
+ return writer;
2558
+ },
2559
+
2560
+ decode(input: BinaryReader | Uint8Array, length?: number): UnbindFederationPeerRequest {
2561
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2562
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2563
+ if (previousRecursionDepth >= 100) {
2564
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2565
+ }
2566
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2567
+ try {
2568
+ const end = length === undefined ? reader.len : reader.pos + length;
2569
+ const message = createBaseUnbindFederationPeerRequest();
2570
+ while (reader.pos < end) {
2571
+ const tag = reader.uint32();
2572
+ switch (tag >>> 3) {
2573
+ case 1: {
2574
+ if (tag !== 10) {
2575
+ break;
2576
+ }
2577
+
2578
+ message.Id = reader.string();
2579
+ continue;
2580
+ }
2581
+ }
2582
+ if ((tag & 7) === 4 || tag === 0) {
2583
+ break;
2584
+ }
2585
+ reader.skip(tag & 7);
2586
+ }
2587
+ return message;
2588
+ } finally {
2589
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2590
+ }
2591
+ },
2592
+
2593
+ fromJSON(object: any): UnbindFederationPeerRequest {
2594
+ return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "" };
2595
+ },
2596
+
2597
+ toJSON(message: UnbindFederationPeerRequest): unknown {
2598
+ const obj: any = {};
2599
+ if (message.Id !== "") {
2600
+ obj.Id = message.Id;
2601
+ }
2602
+ return obj;
2603
+ },
2604
+
2605
+ create(base?: DeepPartial<UnbindFederationPeerRequest>): UnbindFederationPeerRequest {
2606
+ return UnbindFederationPeerRequest.fromPartial(base ?? {});
2607
+ },
2608
+ fromPartial(object: DeepPartial<UnbindFederationPeerRequest>): UnbindFederationPeerRequest {
2609
+ const message = createBaseUnbindFederationPeerRequest();
2610
+ message.Id = object.Id ?? "";
2611
+ return message;
2612
+ },
2613
+ };
2614
+
2615
+ function createBaseValidationResult(): ValidationResult {
2616
+ return { Severity: 0, Message: "", Members: [] };
2617
+ }
2618
+
2619
+ export const ValidationResult: MessageFns<ValidationResult> = {
2620
+ encode(message: ValidationResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2621
+ if (message.Severity !== 0) {
2622
+ writer.uint32(8).int32(message.Severity);
2623
+ }
2624
+ if (message.Message !== "") {
2625
+ writer.uint32(18).string(message.Message);
2626
+ }
2627
+ for (const v of message.Members) {
2628
+ writer.uint32(26).string(v!);
2629
+ }
2630
+ return writer;
2631
+ },
2632
+
2633
+ decode(input: BinaryReader | Uint8Array, length?: number): ValidationResult {
2634
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2635
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2636
+ if (previousRecursionDepth >= 100) {
2637
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2638
+ }
2639
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2640
+ try {
2641
+ const end = length === undefined ? reader.len : reader.pos + length;
2642
+ const message = createBaseValidationResult();
2643
+ while (reader.pos < end) {
2644
+ const tag = reader.uint32();
2645
+ switch (tag >>> 3) {
2646
+ case 1: {
2647
+ if (tag !== 8) {
2648
+ break;
2649
+ }
2650
+
2651
+ message.Severity = reader.int32() as any;
2652
+ continue;
2653
+ }
2654
+ case 2: {
2655
+ if (tag !== 18) {
2656
+ break;
2657
+ }
2658
+
2659
+ message.Message = reader.string();
2660
+ continue;
2661
+ }
2662
+ case 3: {
2663
+ if (tag !== 26) {
2664
+ break;
2665
+ }
2666
+
2667
+ message.Members.push(reader.string());
2668
+ continue;
2669
+ }
2670
+ }
2671
+ if ((tag & 7) === 4 || tag === 0) {
2672
+ break;
2673
+ }
2674
+ reader.skip(tag & 7);
2675
+ }
2676
+ return message;
2677
+ } finally {
2678
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
2679
+ }
2680
+ },
2681
+
2682
+ fromJSON(object: any): ValidationResult {
2683
+ return {
2684
+ Severity: isSet(object.Severity) ? validationResultSeverityFromJSON(object.Severity) : 0,
2685
+ Message: isSet(object.Message) ? globalThis.String(object.Message) : "",
2686
+ Members: globalThis.Array.isArray(object?.Members) ? object.Members.map((e: any) => globalThis.String(e)) : [],
2687
+ };
2688
+ },
2689
+
2690
+ toJSON(message: ValidationResult): unknown {
2691
+ const obj: any = {};
2692
+ if (message.Severity !== 0) {
2693
+ obj.Severity = validationResultSeverityToJSON(message.Severity);
2694
+ }
2695
+ if (message.Message !== "") {
2696
+ obj.Message = message.Message;
2697
+ }
2698
+ if (message.Members?.length) {
2699
+ obj.Members = message.Members;
2700
+ }
2701
+ return obj;
2702
+ },
2703
+
2704
+ create(base?: DeepPartial<ValidationResult>): ValidationResult {
2705
+ return ValidationResult.fromPartial(base ?? {});
2706
+ },
2707
+ fromPartial(object: DeepPartial<ValidationResult>): ValidationResult {
2708
+ const message = createBaseValidationResult();
2709
+ message.Severity = object.Severity ?? 0;
2710
+ message.Message = object.Message ?? "";
2711
+ message.Members = object.Members?.map((e) => e) || [];
2712
+ return message;
2713
+ },
2714
+ };
2715
+
2716
+ export type FederationDefinition = typeof FederationDefinition;
2717
+ export const FederationDefinition = {
2718
+ name: "Federation",
2719
+ fullName: "Cratis.Chronicle.Contracts.Federation.Federation",
2720
+ methods: {
2721
+ allBindings: {
2722
+ name: "AllBindings",
2723
+ requestType: Empty as typeof Empty,
2724
+ requestStream: false,
2725
+ responseType:
2726
+ QueryResultIEnumerableFederationBindingResponse as typeof QueryResultIEnumerableFederationBindingResponse,
2727
+ responseStream: false,
2728
+ options: {},
2729
+ },
2730
+ allGrants: {
2731
+ name: "AllGrants",
2732
+ requestType: Empty as typeof Empty,
2733
+ requestStream: false,
2734
+ responseType:
2735
+ QueryResultIEnumerableFederationGrantInformationResponse as typeof QueryResultIEnumerableFederationGrantInformationResponse,
2736
+ responseStream: false,
2737
+ options: {},
2738
+ },
2739
+ bindFederationPeer: {
2740
+ name: "BindFederationPeer",
2741
+ requestType: BindFederationPeerRequest as typeof BindFederationPeerRequest,
2742
+ requestStream: false,
2743
+ responseType: CommandResult as typeof CommandResult,
2744
+ responseStream: false,
2745
+ options: {},
2746
+ },
2747
+ revokeFederationLink: {
2748
+ name: "RevokeFederationLink",
2749
+ requestType: RevokeFederationLinkRequest as typeof RevokeFederationLinkRequest,
2750
+ requestStream: false,
2751
+ responseType: CommandResult as typeof CommandResult,
2752
+ responseStream: false,
2753
+ options: {},
2754
+ },
2755
+ setFederationGrant: {
2756
+ name: "SetFederationGrant",
2757
+ requestType: SetFederationGrantRequest as typeof SetFederationGrantRequest,
2758
+ requestStream: false,
2759
+ responseType: CommandResult as typeof CommandResult,
2760
+ responseStream: false,
2761
+ options: {},
2762
+ },
2763
+ unbindFederationPeer: {
2764
+ name: "UnbindFederationPeer",
2765
+ requestType: UnbindFederationPeerRequest as typeof UnbindFederationPeerRequest,
2766
+ requestStream: false,
2767
+ responseType: CommandResult as typeof CommandResult,
2768
+ responseStream: false,
2769
+ options: {},
2770
+ },
2771
+ },
2772
+ } as const;
2773
+
2774
+ export interface FederationServiceImplementation<CallContextExt = {}> {
2775
+ allBindings(
2776
+ request: Empty,
2777
+ context: CallContext & CallContextExt,
2778
+ ): Promise<DeepPartial<QueryResultIEnumerableFederationBindingResponse>>;
2779
+ allGrants(
2780
+ request: Empty,
2781
+ context: CallContext & CallContextExt,
2782
+ ): Promise<DeepPartial<QueryResultIEnumerableFederationGrantInformationResponse>>;
2783
+ bindFederationPeer(
2784
+ request: BindFederationPeerRequest,
2785
+ context: CallContext & CallContextExt,
2786
+ ): Promise<DeepPartial<CommandResult>>;
2787
+ revokeFederationLink(
2788
+ request: RevokeFederationLinkRequest,
2789
+ context: CallContext & CallContextExt,
2790
+ ): Promise<DeepPartial<CommandResult>>;
2791
+ setFederationGrant(
2792
+ request: SetFederationGrantRequest,
2793
+ context: CallContext & CallContextExt,
2794
+ ): Promise<DeepPartial<CommandResult>>;
2795
+ unbindFederationPeer(
2796
+ request: UnbindFederationPeerRequest,
2797
+ context: CallContext & CallContextExt,
2798
+ ): Promise<DeepPartial<CommandResult>>;
2799
+ }
2800
+
2801
+ export interface FederationClient<CallOptionsExt = {}> {
2802
+ allBindings(
2803
+ request: DeepPartial<Empty>,
2804
+ options?: CallOptions & CallOptionsExt,
2805
+ ): Promise<QueryResultIEnumerableFederationBindingResponse>;
2806
+ allGrants(
2807
+ request: DeepPartial<Empty>,
2808
+ options?: CallOptions & CallOptionsExt,
2809
+ ): Promise<QueryResultIEnumerableFederationGrantInformationResponse>;
2810
+ bindFederationPeer(
2811
+ request: DeepPartial<BindFederationPeerRequest>,
2812
+ options?: CallOptions & CallOptionsExt,
2813
+ ): Promise<CommandResult>;
2814
+ revokeFederationLink(
2815
+ request: DeepPartial<RevokeFederationLinkRequest>,
2816
+ options?: CallOptions & CallOptionsExt,
2817
+ ): Promise<CommandResult>;
2818
+ setFederationGrant(
2819
+ request: DeepPartial<SetFederationGrantRequest>,
2820
+ options?: CallOptions & CallOptionsExt,
2821
+ ): Promise<CommandResult>;
2822
+ unbindFederationPeer(
2823
+ request: DeepPartial<UnbindFederationPeerRequest>,
2824
+ options?: CallOptions & CallOptionsExt,
2825
+ ): Promise<CommandResult>;
2826
+ }
2827
+
2828
+ export type FederationPullDefinition = typeof FederationPullDefinition;
2829
+ export const FederationPullDefinition = {
2830
+ name: "FederationPull",
2831
+ fullName: "Cratis.Chronicle.Contracts.Federation.FederationPull",
2832
+ methods: {
2833
+ pull: {
2834
+ name: "Pull",
2835
+ requestType: PullRequest as typeof PullRequest,
2836
+ requestStream: false,
2837
+ responseType: QueryResultFederatedEventBatchResponse as typeof QueryResultFederatedEventBatchResponse,
2838
+ responseStream: false,
2839
+ options: {},
2840
+ },
2841
+ },
2842
+ } as const;
2843
+
2844
+ export interface FederationPullServiceImplementation<CallContextExt = {}> {
2845
+ pull(
2846
+ request: PullRequest,
2847
+ context: CallContext & CallContextExt,
2848
+ ): Promise<DeepPartial<QueryResultFederatedEventBatchResponse>>;
2849
+ }
2850
+
2851
+ export interface FederationPullClient<CallOptionsExt = {}> {
2852
+ pull(
2853
+ request: DeepPartial<PullRequest>,
2854
+ options?: CallOptions & CallOptionsExt,
2855
+ ): Promise<QueryResultFederatedEventBatchResponse>;
2856
+ }
2857
+
2858
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
2859
+
2860
+ export type DeepPartial<T> = T extends bigint ? string | number | bigint
2861
+ : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
2862
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
2863
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
2864
+ : Partial<T>;
2865
+
2866
+ function isSet(value: any): boolean {
2867
+ return value !== null && value !== undefined;
2868
+ }
2869
+
2870
+ export interface MessageFns<T> {
2871
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
2872
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
2873
+ fromJSON(object: any): T;
2874
+ toJSON(message: T): unknown;
2875
+ create(base?: DeepPartial<T>): T;
2876
+ fromPartial(object: DeepPartial<T>): T;
2877
+ }