@cratis/chronicle.contracts 19.6.1 → 19.7.1

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 (49) hide show
  1. package/README.md +12 -222
  2. package/dist/cjs/generated/descriptorSet.js +1 -1
  3. package/dist/cjs/generated/descriptorSet.js.map +1 -1
  4. package/dist/cjs/generated/index.d.ts +2 -0
  5. package/dist/cjs/generated/index.d.ts.map +1 -1
  6. package/dist/cjs/generated/projections.d.ts +3 -0
  7. package/dist/cjs/generated/projections.d.ts.map +1 -1
  8. package/dist/cjs/generated/projections.js +28 -1
  9. package/dist/cjs/generated/projections.js.map +1 -1
  10. package/dist/cjs/generated/statistics.d.ts +94 -0
  11. package/dist/cjs/generated/statistics.d.ts.map +1 -0
  12. package/dist/cjs/generated/statistics.js +665 -0
  13. package/dist/cjs/generated/statistics.js.map +1 -0
  14. package/dist/cjs/index.js +7 -0
  15. package/dist/cjs/index.js.map +1 -1
  16. package/dist/esm/generated/descriptorSet.js +1 -1
  17. package/dist/esm/generated/descriptorSet.js.map +1 -1
  18. package/dist/esm/generated/index.d.ts +2 -0
  19. package/dist/esm/generated/index.d.ts.map +1 -1
  20. package/dist/esm/generated/projections.d.ts +3 -0
  21. package/dist/esm/generated/projections.d.ts.map +1 -1
  22. package/dist/esm/generated/projections.js +28 -1
  23. package/dist/esm/generated/projections.js.map +1 -1
  24. package/dist/esm/generated/statistics.d.ts +94 -0
  25. package/dist/esm/generated/statistics.d.ts.map +1 -0
  26. package/dist/esm/generated/statistics.js +655 -0
  27. package/dist/esm/generated/statistics.js.map +1 -0
  28. package/dist/esm/index.js +1 -0
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/generated/descriptorSet.js +1 -1
  31. package/dist/generated/descriptorSet.js.map +1 -1
  32. package/dist/generated/index.d.ts +2 -0
  33. package/dist/generated/index.d.ts.map +1 -1
  34. package/dist/generated/index.js +1 -0
  35. package/dist/generated/index.js.map +1 -1
  36. package/dist/generated/projections.d.ts +3 -0
  37. package/dist/generated/projections.d.ts.map +1 -1
  38. package/dist/generated/projections.js +28 -1
  39. package/dist/generated/projections.js.map +1 -1
  40. package/dist/generated/statistics.d.ts +94 -0
  41. package/dist/generated/statistics.d.ts.map +1 -0
  42. package/dist/generated/statistics.js +653 -0
  43. package/dist/generated/statistics.js.map +1 -0
  44. package/dist/tsconfig.tsbuildinfo +1 -1
  45. package/generated/descriptorSet.ts +1 -1
  46. package/generated/index.ts +3 -0
  47. package/generated/projections.ts +30 -1
  48. package/generated/statistics.ts +791 -0
  49. package/package.json +1 -1
@@ -0,0 +1,791 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.4
4
+ // protoc v5.28.3
5
+ // source: statistics.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import type { CallContext, CallOptions } from "nice-grpc-common";
10
+ import { Guid } from "./protobuf-net/bcl";
11
+
12
+ export const protobufPackage = "Cratis.Chronicle.Contracts.Statistics";
13
+
14
+ export enum ValidationResultSeverity {
15
+ Unknown = 0,
16
+ Information = 1,
17
+ Warning = 2,
18
+ Error = 3,
19
+ UNRECOGNIZED = -1,
20
+ }
21
+
22
+ export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity {
23
+ switch (object) {
24
+ case 0:
25
+ case "Unknown":
26
+ return ValidationResultSeverity.Unknown;
27
+ case 1:
28
+ case "Information":
29
+ return ValidationResultSeverity.Information;
30
+ case 2:
31
+ case "Warning":
32
+ return ValidationResultSeverity.Warning;
33
+ case 3:
34
+ case "Error":
35
+ return ValidationResultSeverity.Error;
36
+ case -1:
37
+ case "UNRECOGNIZED":
38
+ default:
39
+ return ValidationResultSeverity.UNRECOGNIZED;
40
+ }
41
+ }
42
+
43
+ export function validationResultSeverityToJSON(object: ValidationResultSeverity): string {
44
+ switch (object) {
45
+ case ValidationResultSeverity.Unknown:
46
+ return "Unknown";
47
+ case ValidationResultSeverity.Information:
48
+ return "Information";
49
+ case ValidationResultSeverity.Warning:
50
+ return "Warning";
51
+ case ValidationResultSeverity.Error:
52
+ return "Error";
53
+ case ValidationResultSeverity.UNRECOGNIZED:
54
+ default:
55
+ return "UNRECOGNIZED";
56
+ }
57
+ }
58
+
59
+ export interface EventStatisticsResponse {
60
+ TotalEvents: bigint;
61
+ EventTypes: number;
62
+ Namespaces: number;
63
+ PerEventType: EventTypeCount[];
64
+ }
65
+
66
+ export interface EventTypeCount {
67
+ EventType: string;
68
+ Count: bigint;
69
+ }
70
+
71
+ export interface QueryResultEventStatisticsResponse {
72
+ /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */
73
+ CorrelationId: Guid | undefined;
74
+ IsAuthorized: boolean;
75
+ ValidationResults: ValidationResult[];
76
+ ExceptionMessages: string[];
77
+ ExceptionStackTrace: string;
78
+ Data: EventStatisticsResponse | undefined;
79
+ }
80
+
81
+ export interface StatisticsForEventStoreRequest {
82
+ EventStore: string;
83
+ }
84
+
85
+ export interface StatisticsForNamespaceRequest {
86
+ EventStore: string;
87
+ Namespace: string;
88
+ }
89
+
90
+ export interface ValidationResult {
91
+ /** default value could not be applied: Error */
92
+ Severity: ValidationResultSeverity;
93
+ Message: string;
94
+ Members: string[];
95
+ }
96
+
97
+ function createBaseEventStatisticsResponse(): EventStatisticsResponse {
98
+ return { TotalEvents: 0n, EventTypes: 0, Namespaces: 0, PerEventType: [] };
99
+ }
100
+
101
+ export const EventStatisticsResponse: MessageFns<EventStatisticsResponse> = {
102
+ encode(message: EventStatisticsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
103
+ if (message.TotalEvents !== 0n) {
104
+ if (BigInt.asIntN(64, message.TotalEvents) !== message.TotalEvents) {
105
+ throw new globalThis.Error("value provided for field message.TotalEvents of type int64 too large");
106
+ }
107
+ writer.uint32(8).int64(message.TotalEvents);
108
+ }
109
+ if (message.EventTypes !== 0) {
110
+ writer.uint32(16).int32(message.EventTypes);
111
+ }
112
+ if (message.Namespaces !== 0) {
113
+ writer.uint32(24).int32(message.Namespaces);
114
+ }
115
+ for (const v of message.PerEventType) {
116
+ EventTypeCount.encode(v!, writer.uint32(34).fork()).join();
117
+ }
118
+ return writer;
119
+ },
120
+
121
+ decode(input: BinaryReader | Uint8Array, length?: number): EventStatisticsResponse {
122
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
123
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
124
+ if (previousRecursionDepth >= 100) {
125
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
126
+ }
127
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
128
+ try {
129
+ const end = length === undefined ? reader.len : reader.pos + length;
130
+ const message = createBaseEventStatisticsResponse();
131
+ while (reader.pos < end) {
132
+ const tag = reader.uint32();
133
+ switch (tag >>> 3) {
134
+ case 1: {
135
+ if (tag !== 8) {
136
+ break;
137
+ }
138
+
139
+ message.TotalEvents = reader.int64() as bigint;
140
+ continue;
141
+ }
142
+ case 2: {
143
+ if (tag !== 16) {
144
+ break;
145
+ }
146
+
147
+ message.EventTypes = reader.int32();
148
+ continue;
149
+ }
150
+ case 3: {
151
+ if (tag !== 24) {
152
+ break;
153
+ }
154
+
155
+ message.Namespaces = reader.int32();
156
+ continue;
157
+ }
158
+ case 4: {
159
+ if (tag !== 34) {
160
+ break;
161
+ }
162
+
163
+ message.PerEventType.push(EventTypeCount.decode(reader, reader.uint32()));
164
+ continue;
165
+ }
166
+ }
167
+ if ((tag & 7) === 4 || tag === 0) {
168
+ break;
169
+ }
170
+ reader.skip(tag & 7);
171
+ }
172
+ return message;
173
+ } finally {
174
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
175
+ }
176
+ },
177
+
178
+ fromJSON(object: any): EventStatisticsResponse {
179
+ return {
180
+ TotalEvents: isSet(object.TotalEvents) ? BigInt(object.TotalEvents) : 0n,
181
+ EventTypes: isSet(object.EventTypes) ? globalThis.Number(object.EventTypes) : 0,
182
+ Namespaces: isSet(object.Namespaces) ? globalThis.Number(object.Namespaces) : 0,
183
+ PerEventType: globalThis.Array.isArray(object?.PerEventType)
184
+ ? object.PerEventType.map((e: any) => EventTypeCount.fromJSON(e))
185
+ : [],
186
+ };
187
+ },
188
+
189
+ toJSON(message: EventStatisticsResponse): unknown {
190
+ const obj: any = {};
191
+ if (message.TotalEvents !== 0n) {
192
+ obj.TotalEvents = message.TotalEvents.toString();
193
+ }
194
+ if (message.EventTypes !== 0) {
195
+ obj.EventTypes = Math.round(message.EventTypes);
196
+ }
197
+ if (message.Namespaces !== 0) {
198
+ obj.Namespaces = Math.round(message.Namespaces);
199
+ }
200
+ if (message.PerEventType?.length) {
201
+ obj.PerEventType = message.PerEventType.map((e) => EventTypeCount.toJSON(e));
202
+ }
203
+ return obj;
204
+ },
205
+
206
+ create(base?: DeepPartial<EventStatisticsResponse>): EventStatisticsResponse {
207
+ return EventStatisticsResponse.fromPartial(base ?? {});
208
+ },
209
+ fromPartial(object: DeepPartial<EventStatisticsResponse>): EventStatisticsResponse {
210
+ const message = createBaseEventStatisticsResponse();
211
+ message.TotalEvents = (object.TotalEvents !== undefined && object.TotalEvents !== null)
212
+ ? BigInt(object.TotalEvents)
213
+ : 0n;
214
+ message.EventTypes = object.EventTypes ?? 0;
215
+ message.Namespaces = object.Namespaces ?? 0;
216
+ message.PerEventType = object.PerEventType?.map((e) => EventTypeCount.fromPartial(e)) || [];
217
+ return message;
218
+ },
219
+ };
220
+
221
+ function createBaseEventTypeCount(): EventTypeCount {
222
+ return { EventType: "", Count: 0n };
223
+ }
224
+
225
+ export const EventTypeCount: MessageFns<EventTypeCount> = {
226
+ encode(message: EventTypeCount, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
227
+ if (message.EventType !== "") {
228
+ writer.uint32(10).string(message.EventType);
229
+ }
230
+ if (message.Count !== 0n) {
231
+ if (BigInt.asIntN(64, message.Count) !== message.Count) {
232
+ throw new globalThis.Error("value provided for field message.Count of type int64 too large");
233
+ }
234
+ writer.uint32(16).int64(message.Count);
235
+ }
236
+ return writer;
237
+ },
238
+
239
+ decode(input: BinaryReader | Uint8Array, length?: number): EventTypeCount {
240
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
241
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
242
+ if (previousRecursionDepth >= 100) {
243
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
244
+ }
245
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
246
+ try {
247
+ const end = length === undefined ? reader.len : reader.pos + length;
248
+ const message = createBaseEventTypeCount();
249
+ while (reader.pos < end) {
250
+ const tag = reader.uint32();
251
+ switch (tag >>> 3) {
252
+ case 1: {
253
+ if (tag !== 10) {
254
+ break;
255
+ }
256
+
257
+ message.EventType = reader.string();
258
+ continue;
259
+ }
260
+ case 2: {
261
+ if (tag !== 16) {
262
+ break;
263
+ }
264
+
265
+ message.Count = reader.int64() as bigint;
266
+ continue;
267
+ }
268
+ }
269
+ if ((tag & 7) === 4 || tag === 0) {
270
+ break;
271
+ }
272
+ reader.skip(tag & 7);
273
+ }
274
+ return message;
275
+ } finally {
276
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
277
+ }
278
+ },
279
+
280
+ fromJSON(object: any): EventTypeCount {
281
+ return {
282
+ EventType: isSet(object.EventType) ? globalThis.String(object.EventType) : "",
283
+ Count: isSet(object.Count) ? BigInt(object.Count) : 0n,
284
+ };
285
+ },
286
+
287
+ toJSON(message: EventTypeCount): unknown {
288
+ const obj: any = {};
289
+ if (message.EventType !== "") {
290
+ obj.EventType = message.EventType;
291
+ }
292
+ if (message.Count !== 0n) {
293
+ obj.Count = message.Count.toString();
294
+ }
295
+ return obj;
296
+ },
297
+
298
+ create(base?: DeepPartial<EventTypeCount>): EventTypeCount {
299
+ return EventTypeCount.fromPartial(base ?? {});
300
+ },
301
+ fromPartial(object: DeepPartial<EventTypeCount>): EventTypeCount {
302
+ const message = createBaseEventTypeCount();
303
+ message.EventType = object.EventType ?? "";
304
+ message.Count = (object.Count !== undefined && object.Count !== null) ? BigInt(object.Count) : 0n;
305
+ return message;
306
+ },
307
+ };
308
+
309
+ function createBaseQueryResultEventStatisticsResponse(): QueryResultEventStatisticsResponse {
310
+ return {
311
+ CorrelationId: undefined,
312
+ IsAuthorized: false,
313
+ ValidationResults: [],
314
+ ExceptionMessages: [],
315
+ ExceptionStackTrace: "",
316
+ Data: undefined,
317
+ };
318
+ }
319
+
320
+ export const QueryResultEventStatisticsResponse: MessageFns<QueryResultEventStatisticsResponse> = {
321
+ encode(message: QueryResultEventStatisticsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
322
+ if (message.CorrelationId !== undefined) {
323
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
324
+ }
325
+ if (message.IsAuthorized !== false) {
326
+ writer.uint32(16).bool(message.IsAuthorized);
327
+ }
328
+ for (const v of message.ValidationResults) {
329
+ ValidationResult.encode(v!, writer.uint32(26).fork()).join();
330
+ }
331
+ for (const v of message.ExceptionMessages) {
332
+ writer.uint32(34).string(v!);
333
+ }
334
+ if (message.ExceptionStackTrace !== "") {
335
+ writer.uint32(42).string(message.ExceptionStackTrace);
336
+ }
337
+ if (message.Data !== undefined) {
338
+ EventStatisticsResponse.encode(message.Data, writer.uint32(50).fork()).join();
339
+ }
340
+ return writer;
341
+ },
342
+
343
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryResultEventStatisticsResponse {
344
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
345
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
346
+ if (previousRecursionDepth >= 100) {
347
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
348
+ }
349
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
350
+ try {
351
+ const end = length === undefined ? reader.len : reader.pos + length;
352
+ const message = createBaseQueryResultEventStatisticsResponse();
353
+ while (reader.pos < end) {
354
+ const tag = reader.uint32();
355
+ switch (tag >>> 3) {
356
+ case 1: {
357
+ if (tag !== 10) {
358
+ break;
359
+ }
360
+
361
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
362
+ continue;
363
+ }
364
+ case 2: {
365
+ if (tag !== 16) {
366
+ break;
367
+ }
368
+
369
+ message.IsAuthorized = reader.bool();
370
+ continue;
371
+ }
372
+ case 3: {
373
+ if (tag !== 26) {
374
+ break;
375
+ }
376
+
377
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
378
+ continue;
379
+ }
380
+ case 4: {
381
+ if (tag !== 34) {
382
+ break;
383
+ }
384
+
385
+ message.ExceptionMessages.push(reader.string());
386
+ continue;
387
+ }
388
+ case 5: {
389
+ if (tag !== 42) {
390
+ break;
391
+ }
392
+
393
+ message.ExceptionStackTrace = reader.string();
394
+ continue;
395
+ }
396
+ case 6: {
397
+ if (tag !== 50) {
398
+ break;
399
+ }
400
+
401
+ message.Data = EventStatisticsResponse.decode(reader, reader.uint32());
402
+ continue;
403
+ }
404
+ }
405
+ if ((tag & 7) === 4 || tag === 0) {
406
+ break;
407
+ }
408
+ reader.skip(tag & 7);
409
+ }
410
+ return message;
411
+ } finally {
412
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
413
+ }
414
+ },
415
+
416
+ fromJSON(object: any): QueryResultEventStatisticsResponse {
417
+ return {
418
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
419
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
420
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
421
+ ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e))
422
+ : [],
423
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
424
+ ? object.ExceptionMessages.map((e: any) => globalThis.String(e))
425
+ : [],
426
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
427
+ Data: isSet(object.Data) ? EventStatisticsResponse.fromJSON(object.Data) : undefined,
428
+ };
429
+ },
430
+
431
+ toJSON(message: QueryResultEventStatisticsResponse): unknown {
432
+ const obj: any = {};
433
+ if (message.CorrelationId !== undefined) {
434
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
435
+ }
436
+ if (message.IsAuthorized !== false) {
437
+ obj.IsAuthorized = message.IsAuthorized;
438
+ }
439
+ if (message.ValidationResults?.length) {
440
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
441
+ }
442
+ if (message.ExceptionMessages?.length) {
443
+ obj.ExceptionMessages = message.ExceptionMessages;
444
+ }
445
+ if (message.ExceptionStackTrace !== "") {
446
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
447
+ }
448
+ if (message.Data !== undefined) {
449
+ obj.Data = EventStatisticsResponse.toJSON(message.Data);
450
+ }
451
+ return obj;
452
+ },
453
+
454
+ create(base?: DeepPartial<QueryResultEventStatisticsResponse>): QueryResultEventStatisticsResponse {
455
+ return QueryResultEventStatisticsResponse.fromPartial(base ?? {});
456
+ },
457
+ fromPartial(object: DeepPartial<QueryResultEventStatisticsResponse>): QueryResultEventStatisticsResponse {
458
+ const message = createBaseQueryResultEventStatisticsResponse();
459
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
460
+ ? Guid.fromPartial(object.CorrelationId)
461
+ : undefined;
462
+ message.IsAuthorized = object.IsAuthorized ?? false;
463
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
464
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
465
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
466
+ message.Data = (object.Data !== undefined && object.Data !== null)
467
+ ? EventStatisticsResponse.fromPartial(object.Data)
468
+ : undefined;
469
+ return message;
470
+ },
471
+ };
472
+
473
+ function createBaseStatisticsForEventStoreRequest(): StatisticsForEventStoreRequest {
474
+ return { EventStore: "" };
475
+ }
476
+
477
+ export const StatisticsForEventStoreRequest: MessageFns<StatisticsForEventStoreRequest> = {
478
+ encode(message: StatisticsForEventStoreRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
479
+ if (message.EventStore !== "") {
480
+ writer.uint32(10).string(message.EventStore);
481
+ }
482
+ return writer;
483
+ },
484
+
485
+ decode(input: BinaryReader | Uint8Array, length?: number): StatisticsForEventStoreRequest {
486
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
487
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
488
+ if (previousRecursionDepth >= 100) {
489
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
490
+ }
491
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
492
+ try {
493
+ const end = length === undefined ? reader.len : reader.pos + length;
494
+ const message = createBaseStatisticsForEventStoreRequest();
495
+ while (reader.pos < end) {
496
+ const tag = reader.uint32();
497
+ switch (tag >>> 3) {
498
+ case 1: {
499
+ if (tag !== 10) {
500
+ break;
501
+ }
502
+
503
+ message.EventStore = reader.string();
504
+ continue;
505
+ }
506
+ }
507
+ if ((tag & 7) === 4 || tag === 0) {
508
+ break;
509
+ }
510
+ reader.skip(tag & 7);
511
+ }
512
+ return message;
513
+ } finally {
514
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
515
+ }
516
+ },
517
+
518
+ fromJSON(object: any): StatisticsForEventStoreRequest {
519
+ return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "" };
520
+ },
521
+
522
+ toJSON(message: StatisticsForEventStoreRequest): unknown {
523
+ const obj: any = {};
524
+ if (message.EventStore !== "") {
525
+ obj.EventStore = message.EventStore;
526
+ }
527
+ return obj;
528
+ },
529
+
530
+ create(base?: DeepPartial<StatisticsForEventStoreRequest>): StatisticsForEventStoreRequest {
531
+ return StatisticsForEventStoreRequest.fromPartial(base ?? {});
532
+ },
533
+ fromPartial(object: DeepPartial<StatisticsForEventStoreRequest>): StatisticsForEventStoreRequest {
534
+ const message = createBaseStatisticsForEventStoreRequest();
535
+ message.EventStore = object.EventStore ?? "";
536
+ return message;
537
+ },
538
+ };
539
+
540
+ function createBaseStatisticsForNamespaceRequest(): StatisticsForNamespaceRequest {
541
+ return { EventStore: "", Namespace: "" };
542
+ }
543
+
544
+ export const StatisticsForNamespaceRequest: MessageFns<StatisticsForNamespaceRequest> = {
545
+ encode(message: StatisticsForNamespaceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
546
+ if (message.EventStore !== "") {
547
+ writer.uint32(10).string(message.EventStore);
548
+ }
549
+ if (message.Namespace !== "") {
550
+ writer.uint32(18).string(message.Namespace);
551
+ }
552
+ return writer;
553
+ },
554
+
555
+ decode(input: BinaryReader | Uint8Array, length?: number): StatisticsForNamespaceRequest {
556
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
557
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
558
+ if (previousRecursionDepth >= 100) {
559
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
560
+ }
561
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
562
+ try {
563
+ const end = length === undefined ? reader.len : reader.pos + length;
564
+ const message = createBaseStatisticsForNamespaceRequest();
565
+ while (reader.pos < end) {
566
+ const tag = reader.uint32();
567
+ switch (tag >>> 3) {
568
+ case 1: {
569
+ if (tag !== 10) {
570
+ break;
571
+ }
572
+
573
+ message.EventStore = reader.string();
574
+ continue;
575
+ }
576
+ case 2: {
577
+ if (tag !== 18) {
578
+ break;
579
+ }
580
+
581
+ message.Namespace = reader.string();
582
+ continue;
583
+ }
584
+ }
585
+ if ((tag & 7) === 4 || tag === 0) {
586
+ break;
587
+ }
588
+ reader.skip(tag & 7);
589
+ }
590
+ return message;
591
+ } finally {
592
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
593
+ }
594
+ },
595
+
596
+ fromJSON(object: any): StatisticsForNamespaceRequest {
597
+ return {
598
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
599
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
600
+ };
601
+ },
602
+
603
+ toJSON(message: StatisticsForNamespaceRequest): unknown {
604
+ const obj: any = {};
605
+ if (message.EventStore !== "") {
606
+ obj.EventStore = message.EventStore;
607
+ }
608
+ if (message.Namespace !== "") {
609
+ obj.Namespace = message.Namespace;
610
+ }
611
+ return obj;
612
+ },
613
+
614
+ create(base?: DeepPartial<StatisticsForNamespaceRequest>): StatisticsForNamespaceRequest {
615
+ return StatisticsForNamespaceRequest.fromPartial(base ?? {});
616
+ },
617
+ fromPartial(object: DeepPartial<StatisticsForNamespaceRequest>): StatisticsForNamespaceRequest {
618
+ const message = createBaseStatisticsForNamespaceRequest();
619
+ message.EventStore = object.EventStore ?? "";
620
+ message.Namespace = object.Namespace ?? "";
621
+ return message;
622
+ },
623
+ };
624
+
625
+ function createBaseValidationResult(): ValidationResult {
626
+ return { Severity: 0, Message: "", Members: [] };
627
+ }
628
+
629
+ export const ValidationResult: MessageFns<ValidationResult> = {
630
+ encode(message: ValidationResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
631
+ if (message.Severity !== 0) {
632
+ writer.uint32(8).int32(message.Severity);
633
+ }
634
+ if (message.Message !== "") {
635
+ writer.uint32(18).string(message.Message);
636
+ }
637
+ for (const v of message.Members) {
638
+ writer.uint32(26).string(v!);
639
+ }
640
+ return writer;
641
+ },
642
+
643
+ decode(input: BinaryReader | Uint8Array, length?: number): ValidationResult {
644
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
645
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
646
+ if (previousRecursionDepth >= 100) {
647
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
648
+ }
649
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
650
+ try {
651
+ const end = length === undefined ? reader.len : reader.pos + length;
652
+ const message = createBaseValidationResult();
653
+ while (reader.pos < end) {
654
+ const tag = reader.uint32();
655
+ switch (tag >>> 3) {
656
+ case 1: {
657
+ if (tag !== 8) {
658
+ break;
659
+ }
660
+
661
+ message.Severity = reader.int32() as any;
662
+ continue;
663
+ }
664
+ case 2: {
665
+ if (tag !== 18) {
666
+ break;
667
+ }
668
+
669
+ message.Message = reader.string();
670
+ continue;
671
+ }
672
+ case 3: {
673
+ if (tag !== 26) {
674
+ break;
675
+ }
676
+
677
+ message.Members.push(reader.string());
678
+ continue;
679
+ }
680
+ }
681
+ if ((tag & 7) === 4 || tag === 0) {
682
+ break;
683
+ }
684
+ reader.skip(tag & 7);
685
+ }
686
+ return message;
687
+ } finally {
688
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
689
+ }
690
+ },
691
+
692
+ fromJSON(object: any): ValidationResult {
693
+ return {
694
+ Severity: isSet(object.Severity) ? validationResultSeverityFromJSON(object.Severity) : 0,
695
+ Message: isSet(object.Message) ? globalThis.String(object.Message) : "",
696
+ Members: globalThis.Array.isArray(object?.Members) ? object.Members.map((e: any) => globalThis.String(e)) : [],
697
+ };
698
+ },
699
+
700
+ toJSON(message: ValidationResult): unknown {
701
+ const obj: any = {};
702
+ if (message.Severity !== 0) {
703
+ obj.Severity = validationResultSeverityToJSON(message.Severity);
704
+ }
705
+ if (message.Message !== "") {
706
+ obj.Message = message.Message;
707
+ }
708
+ if (message.Members?.length) {
709
+ obj.Members = message.Members;
710
+ }
711
+ return obj;
712
+ },
713
+
714
+ create(base?: DeepPartial<ValidationResult>): ValidationResult {
715
+ return ValidationResult.fromPartial(base ?? {});
716
+ },
717
+ fromPartial(object: DeepPartial<ValidationResult>): ValidationResult {
718
+ const message = createBaseValidationResult();
719
+ message.Severity = object.Severity ?? 0;
720
+ message.Message = object.Message ?? "";
721
+ message.Members = object.Members?.map((e) => e) || [];
722
+ return message;
723
+ },
724
+ };
725
+
726
+ export type StatisticsDefinition = typeof StatisticsDefinition;
727
+ export const StatisticsDefinition = {
728
+ name: "Statistics",
729
+ fullName: "Cratis.Chronicle.Contracts.Statistics.Statistics",
730
+ methods: {
731
+ statisticsForEventStore: {
732
+ name: "StatisticsForEventStore",
733
+ requestType: StatisticsForEventStoreRequest as typeof StatisticsForEventStoreRequest,
734
+ requestStream: false,
735
+ responseType: QueryResultEventStatisticsResponse as typeof QueryResultEventStatisticsResponse,
736
+ responseStream: false,
737
+ options: {},
738
+ },
739
+ statisticsForNamespace: {
740
+ name: "StatisticsForNamespace",
741
+ requestType: StatisticsForNamespaceRequest as typeof StatisticsForNamespaceRequest,
742
+ requestStream: false,
743
+ responseType: QueryResultEventStatisticsResponse as typeof QueryResultEventStatisticsResponse,
744
+ responseStream: false,
745
+ options: {},
746
+ },
747
+ },
748
+ } as const;
749
+
750
+ export interface StatisticsServiceImplementation<CallContextExt = {}> {
751
+ statisticsForEventStore(
752
+ request: StatisticsForEventStoreRequest,
753
+ context: CallContext & CallContextExt,
754
+ ): Promise<DeepPartial<QueryResultEventStatisticsResponse>>;
755
+ statisticsForNamespace(
756
+ request: StatisticsForNamespaceRequest,
757
+ context: CallContext & CallContextExt,
758
+ ): Promise<DeepPartial<QueryResultEventStatisticsResponse>>;
759
+ }
760
+
761
+ export interface StatisticsClient<CallOptionsExt = {}> {
762
+ statisticsForEventStore(
763
+ request: DeepPartial<StatisticsForEventStoreRequest>,
764
+ options?: CallOptions & CallOptionsExt,
765
+ ): Promise<QueryResultEventStatisticsResponse>;
766
+ statisticsForNamespace(
767
+ request: DeepPartial<StatisticsForNamespaceRequest>,
768
+ options?: CallOptions & CallOptionsExt,
769
+ ): Promise<QueryResultEventStatisticsResponse>;
770
+ }
771
+
772
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
773
+
774
+ export type DeepPartial<T> = T extends bigint ? string | number | bigint
775
+ : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
776
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
777
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
778
+ : Partial<T>;
779
+
780
+ function isSet(value: any): boolean {
781
+ return value !== null && value !== undefined;
782
+ }
783
+
784
+ export interface MessageFns<T> {
785
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
786
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
787
+ fromJSON(object: any): T;
788
+ toJSON(message: T): unknown;
789
+ create(base?: DeepPartial<T>): T;
790
+ fromPartial(object: DeepPartial<T>): T;
791
+ }