@cratis/chronicle.contracts 19.31.10 → 19.32.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 (39) hide show
  1. package/dist/cjs/generated/alerts.d.ts +207 -0
  2. package/dist/cjs/generated/alerts.d.ts.map +1 -0
  3. package/dist/cjs/generated/alerts.js +2113 -0
  4. package/dist/cjs/generated/alerts.js.map +1 -0
  5. package/dist/cjs/generated/captures.js +0 -2
  6. package/dist/cjs/generated/captures.js.map +1 -1
  7. package/dist/cjs/generated/descriptorSet.js +1 -1
  8. package/dist/cjs/generated/descriptorSet.js.map +1 -1
  9. package/dist/cjs/generated/index.d.ts +5 -3
  10. package/dist/cjs/generated/index.d.ts.map +1 -1
  11. package/dist/cjs/index.js +43 -15
  12. package/dist/cjs/index.js.map +1 -1
  13. package/dist/esm/generated/alerts.d.ts +207 -0
  14. package/dist/esm/generated/alerts.d.ts.map +1 -0
  15. package/dist/esm/generated/alerts.js +2086 -0
  16. package/dist/esm/generated/alerts.js.map +1 -0
  17. package/dist/esm/generated/captures.js +1 -2
  18. package/dist/esm/generated/captures.js.map +1 -1
  19. package/dist/esm/generated/descriptorSet.js +1 -1
  20. package/dist/esm/generated/descriptorSet.js.map +1 -1
  21. package/dist/esm/generated/index.d.ts +5 -3
  22. package/dist/esm/generated/index.d.ts.map +1 -1
  23. package/dist/esm/index.js +3 -2
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/generated/alerts.d.ts +207 -0
  26. package/dist/generated/alerts.d.ts.map +1 -0
  27. package/dist/generated/alerts.js +2083 -0
  28. package/dist/generated/alerts.js.map +1 -0
  29. package/dist/generated/descriptorSet.js +1 -1
  30. package/dist/generated/descriptorSet.js.map +1 -1
  31. package/dist/generated/index.d.ts +5 -3
  32. package/dist/generated/index.d.ts.map +1 -1
  33. package/dist/generated/index.js +3 -2
  34. package/dist/generated/index.js.map +1 -1
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/generated/alerts.ts +2423 -0
  37. package/generated/descriptorSet.ts +1 -1
  38. package/generated/index.ts +6 -3
  39. package/package.json +1 -1
@@ -0,0 +1,2083 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { Guid } from "./protobuf-net/bcl";
3
+ export const protobufPackage = "Cratis.Chronicle.Contracts.Alerts";
4
+ export var AlertIncidentsReadinessState;
5
+ (function (AlertIncidentsReadinessState) {
6
+ AlertIncidentsReadinessState[AlertIncidentsReadinessState["CatchingUp"] = 0] = "CatchingUp";
7
+ AlertIncidentsReadinessState[AlertIncidentsReadinessState["Ready"] = 1] = "Ready";
8
+ AlertIncidentsReadinessState[AlertIncidentsReadinessState["Degraded"] = 2] = "Degraded";
9
+ AlertIncidentsReadinessState[AlertIncidentsReadinessState["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
10
+ })(AlertIncidentsReadinessState || (AlertIncidentsReadinessState = {}));
11
+ export function alertIncidentsReadinessStateFromJSON(object) {
12
+ switch (object) {
13
+ case 0:
14
+ case "CatchingUp":
15
+ return AlertIncidentsReadinessState.CatchingUp;
16
+ case 1:
17
+ case "Ready":
18
+ return AlertIncidentsReadinessState.Ready;
19
+ case 2:
20
+ case "Degraded":
21
+ return AlertIncidentsReadinessState.Degraded;
22
+ case -1:
23
+ case "UNRECOGNIZED":
24
+ default:
25
+ return AlertIncidentsReadinessState.UNRECOGNIZED;
26
+ }
27
+ }
28
+ export function alertIncidentsReadinessStateToJSON(object) {
29
+ switch (object) {
30
+ case AlertIncidentsReadinessState.CatchingUp:
31
+ return "CatchingUp";
32
+ case AlertIncidentsReadinessState.Ready:
33
+ return "Ready";
34
+ case AlertIncidentsReadinessState.Degraded:
35
+ return "Degraded";
36
+ case AlertIncidentsReadinessState.UNRECOGNIZED:
37
+ default:
38
+ return "UNRECOGNIZED";
39
+ }
40
+ }
41
+ export var AlertSeverity;
42
+ (function (AlertSeverity) {
43
+ AlertSeverity[AlertSeverity["ALERT_SEVERITY_Warning"] = 0] = "ALERT_SEVERITY_Warning";
44
+ AlertSeverity[AlertSeverity["Critical"] = 1] = "Critical";
45
+ AlertSeverity[AlertSeverity["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
46
+ })(AlertSeverity || (AlertSeverity = {}));
47
+ export function alertSeverityFromJSON(object) {
48
+ switch (object) {
49
+ case 0:
50
+ case "ALERT_SEVERITY_Warning":
51
+ return AlertSeverity.ALERT_SEVERITY_Warning;
52
+ case 1:
53
+ case "Critical":
54
+ return AlertSeverity.Critical;
55
+ case -1:
56
+ case "UNRECOGNIZED":
57
+ default:
58
+ return AlertSeverity.UNRECOGNIZED;
59
+ }
60
+ }
61
+ export function alertSeverityToJSON(object) {
62
+ switch (object) {
63
+ case AlertSeverity.ALERT_SEVERITY_Warning:
64
+ return "ALERT_SEVERITY_Warning";
65
+ case AlertSeverity.Critical:
66
+ return "Critical";
67
+ case AlertSeverity.UNRECOGNIZED:
68
+ default:
69
+ return "UNRECOGNIZED";
70
+ }
71
+ }
72
+ export var FailureKind;
73
+ (function (FailureKind) {
74
+ FailureKind[FailureKind["FAILURE_KIND_Unknown"] = 0] = "FAILURE_KIND_Unknown";
75
+ FailureKind[FailureKind["Handling"] = 1] = "Handling";
76
+ FailureKind[FailureKind["Timeout"] = 2] = "Timeout";
77
+ FailureKind[FailureKind["Disconnected"] = 3] = "Disconnected";
78
+ FailureKind[FailureKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
79
+ })(FailureKind || (FailureKind = {}));
80
+ export function failureKindFromJSON(object) {
81
+ switch (object) {
82
+ case 0:
83
+ case "FAILURE_KIND_Unknown":
84
+ return FailureKind.FAILURE_KIND_Unknown;
85
+ case 1:
86
+ case "Handling":
87
+ return FailureKind.Handling;
88
+ case 2:
89
+ case "Timeout":
90
+ return FailureKind.Timeout;
91
+ case 3:
92
+ case "Disconnected":
93
+ return FailureKind.Disconnected;
94
+ case -1:
95
+ case "UNRECOGNIZED":
96
+ default:
97
+ return FailureKind.UNRECOGNIZED;
98
+ }
99
+ }
100
+ export function failureKindToJSON(object) {
101
+ switch (object) {
102
+ case FailureKind.FAILURE_KIND_Unknown:
103
+ return "FAILURE_KIND_Unknown";
104
+ case FailureKind.Handling:
105
+ return "Handling";
106
+ case FailureKind.Timeout:
107
+ return "Timeout";
108
+ case FailureKind.Disconnected:
109
+ return "Disconnected";
110
+ case FailureKind.UNRECOGNIZED:
111
+ default:
112
+ return "UNRECOGNIZED";
113
+ }
114
+ }
115
+ export var ValidationResultSeverity;
116
+ (function (ValidationResultSeverity) {
117
+ ValidationResultSeverity[ValidationResultSeverity["VALIDATION_RESULT_SEVERITY_Unknown"] = 0] = "VALIDATION_RESULT_SEVERITY_Unknown";
118
+ ValidationResultSeverity[ValidationResultSeverity["Information"] = 1] = "Information";
119
+ ValidationResultSeverity[ValidationResultSeverity["VALIDATION_RESULT_SEVERITY_Warning"] = 2] = "VALIDATION_RESULT_SEVERITY_Warning";
120
+ ValidationResultSeverity[ValidationResultSeverity["Error"] = 3] = "Error";
121
+ ValidationResultSeverity[ValidationResultSeverity["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
122
+ })(ValidationResultSeverity || (ValidationResultSeverity = {}));
123
+ export function validationResultSeverityFromJSON(object) {
124
+ switch (object) {
125
+ case 0:
126
+ case "VALIDATION_RESULT_SEVERITY_Unknown":
127
+ return ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Unknown;
128
+ case 1:
129
+ case "Information":
130
+ return ValidationResultSeverity.Information;
131
+ case 2:
132
+ case "VALIDATION_RESULT_SEVERITY_Warning":
133
+ return ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Warning;
134
+ case 3:
135
+ case "Error":
136
+ return ValidationResultSeverity.Error;
137
+ case -1:
138
+ case "UNRECOGNIZED":
139
+ default:
140
+ return ValidationResultSeverity.UNRECOGNIZED;
141
+ }
142
+ }
143
+ export function validationResultSeverityToJSON(object) {
144
+ switch (object) {
145
+ case ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Unknown:
146
+ return "VALIDATION_RESULT_SEVERITY_Unknown";
147
+ case ValidationResultSeverity.Information:
148
+ return "Information";
149
+ case ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Warning:
150
+ return "VALIDATION_RESULT_SEVERITY_Warning";
151
+ case ValidationResultSeverity.Error:
152
+ return "Error";
153
+ case ValidationResultSeverity.UNRECOGNIZED:
154
+ default:
155
+ return "UNRECOGNIZED";
156
+ }
157
+ }
158
+ function createBaseAlertEvidence() {
159
+ return { AttemptCount: 0, FirstFailure: undefined, LastFailure: undefined, FailureKind: 0, Message: "" };
160
+ }
161
+ export const AlertEvidence = {
162
+ encode(message, writer = new BinaryWriter()) {
163
+ if (message.AttemptCount !== 0) {
164
+ writer.uint32(8).int32(message.AttemptCount);
165
+ }
166
+ if (message.FirstFailure !== undefined) {
167
+ SerializableDateTimeOffset.encode(message.FirstFailure, writer.uint32(18).fork()).join();
168
+ }
169
+ if (message.LastFailure !== undefined) {
170
+ SerializableDateTimeOffset.encode(message.LastFailure, writer.uint32(26).fork()).join();
171
+ }
172
+ if (message.FailureKind !== 0) {
173
+ writer.uint32(32).int32(message.FailureKind);
174
+ }
175
+ if (message.Message !== "") {
176
+ writer.uint32(42).string(message.Message);
177
+ }
178
+ return writer;
179
+ },
180
+ decode(input, length) {
181
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
182
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
183
+ if (previousRecursionDepth >= 100) {
184
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
185
+ }
186
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
187
+ try {
188
+ const end = length === undefined ? reader.len : reader.pos + length;
189
+ const message = createBaseAlertEvidence();
190
+ while (reader.pos < end) {
191
+ const tag = reader.uint32();
192
+ switch (tag >>> 3) {
193
+ case 1: {
194
+ if (tag !== 8) {
195
+ break;
196
+ }
197
+ message.AttemptCount = reader.int32();
198
+ continue;
199
+ }
200
+ case 2: {
201
+ if (tag !== 18) {
202
+ break;
203
+ }
204
+ message.FirstFailure = SerializableDateTimeOffset.decode(reader, reader.uint32());
205
+ continue;
206
+ }
207
+ case 3: {
208
+ if (tag !== 26) {
209
+ break;
210
+ }
211
+ message.LastFailure = SerializableDateTimeOffset.decode(reader, reader.uint32());
212
+ continue;
213
+ }
214
+ case 4: {
215
+ if (tag !== 32) {
216
+ break;
217
+ }
218
+ message.FailureKind = reader.int32();
219
+ continue;
220
+ }
221
+ case 5: {
222
+ if (tag !== 42) {
223
+ break;
224
+ }
225
+ message.Message = reader.string();
226
+ continue;
227
+ }
228
+ }
229
+ if ((tag & 7) === 4 || tag === 0) {
230
+ break;
231
+ }
232
+ reader.skip(tag & 7);
233
+ }
234
+ return message;
235
+ }
236
+ finally {
237
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
238
+ }
239
+ },
240
+ fromJSON(object) {
241
+ return {
242
+ AttemptCount: isSet(object.AttemptCount) ? globalThis.Number(object.AttemptCount) : 0,
243
+ FirstFailure: isSet(object.FirstFailure) ? SerializableDateTimeOffset.fromJSON(object.FirstFailure) : undefined,
244
+ LastFailure: isSet(object.LastFailure) ? SerializableDateTimeOffset.fromJSON(object.LastFailure) : undefined,
245
+ FailureKind: isSet(object.FailureKind) ? failureKindFromJSON(object.FailureKind) : 0,
246
+ Message: isSet(object.Message) ? globalThis.String(object.Message) : "",
247
+ };
248
+ },
249
+ toJSON(message) {
250
+ const obj = {};
251
+ if (message.AttemptCount !== 0) {
252
+ obj.AttemptCount = Math.round(message.AttemptCount);
253
+ }
254
+ if (message.FirstFailure !== undefined) {
255
+ obj.FirstFailure = SerializableDateTimeOffset.toJSON(message.FirstFailure);
256
+ }
257
+ if (message.LastFailure !== undefined) {
258
+ obj.LastFailure = SerializableDateTimeOffset.toJSON(message.LastFailure);
259
+ }
260
+ if (message.FailureKind !== 0) {
261
+ obj.FailureKind = failureKindToJSON(message.FailureKind);
262
+ }
263
+ if (message.Message !== "") {
264
+ obj.Message = message.Message;
265
+ }
266
+ return obj;
267
+ },
268
+ create(base) {
269
+ return AlertEvidence.fromPartial(base ?? {});
270
+ },
271
+ fromPartial(object) {
272
+ const message = createBaseAlertEvidence();
273
+ message.AttemptCount = object.AttemptCount ?? 0;
274
+ message.FirstFailure = (object.FirstFailure !== undefined && object.FirstFailure !== null)
275
+ ? SerializableDateTimeOffset.fromPartial(object.FirstFailure)
276
+ : undefined;
277
+ message.LastFailure = (object.LastFailure !== undefined && object.LastFailure !== null)
278
+ ? SerializableDateTimeOffset.fromPartial(object.LastFailure)
279
+ : undefined;
280
+ message.FailureKind = object.FailureKind ?? 0;
281
+ message.Message = object.Message ?? "";
282
+ return message;
283
+ },
284
+ };
285
+ function createBaseAlertIncidentContinuation() {
286
+ return { RaisedSequenceNumber: 0n, IncidentId: undefined };
287
+ }
288
+ export const AlertIncidentContinuation = {
289
+ encode(message, writer = new BinaryWriter()) {
290
+ if (message.RaisedSequenceNumber !== 0n) {
291
+ if (BigInt.asUintN(64, message.RaisedSequenceNumber) !== message.RaisedSequenceNumber) {
292
+ throw new globalThis.Error("value provided for field message.RaisedSequenceNumber of type uint64 too large");
293
+ }
294
+ writer.uint32(8).uint64(message.RaisedSequenceNumber);
295
+ }
296
+ if (message.IncidentId !== undefined) {
297
+ Guid.encode(message.IncidentId, writer.uint32(18).fork()).join();
298
+ }
299
+ return writer;
300
+ },
301
+ decode(input, length) {
302
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
303
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
304
+ if (previousRecursionDepth >= 100) {
305
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
306
+ }
307
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
308
+ try {
309
+ const end = length === undefined ? reader.len : reader.pos + length;
310
+ const message = createBaseAlertIncidentContinuation();
311
+ while (reader.pos < end) {
312
+ const tag = reader.uint32();
313
+ switch (tag >>> 3) {
314
+ case 1: {
315
+ if (tag !== 8) {
316
+ break;
317
+ }
318
+ message.RaisedSequenceNumber = reader.uint64();
319
+ continue;
320
+ }
321
+ case 2: {
322
+ if (tag !== 18) {
323
+ break;
324
+ }
325
+ message.IncidentId = Guid.decode(reader, reader.uint32());
326
+ continue;
327
+ }
328
+ }
329
+ if ((tag & 7) === 4 || tag === 0) {
330
+ break;
331
+ }
332
+ reader.skip(tag & 7);
333
+ }
334
+ return message;
335
+ }
336
+ finally {
337
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
338
+ }
339
+ },
340
+ fromJSON(object) {
341
+ return {
342
+ RaisedSequenceNumber: isSet(object.RaisedSequenceNumber) ? BigInt(object.RaisedSequenceNumber) : 0n,
343
+ IncidentId: isSet(object.IncidentId) ? Guid.fromJSON(object.IncidentId) : undefined,
344
+ };
345
+ },
346
+ toJSON(message) {
347
+ const obj = {};
348
+ if (message.RaisedSequenceNumber !== 0n) {
349
+ obj.RaisedSequenceNumber = message.RaisedSequenceNumber.toString();
350
+ }
351
+ if (message.IncidentId !== undefined) {
352
+ obj.IncidentId = Guid.toJSON(message.IncidentId);
353
+ }
354
+ return obj;
355
+ },
356
+ create(base) {
357
+ return AlertIncidentContinuation.fromPartial(base ?? {});
358
+ },
359
+ fromPartial(object) {
360
+ const message = createBaseAlertIncidentContinuation();
361
+ message.RaisedSequenceNumber = (object.RaisedSequenceNumber !== undefined && object.RaisedSequenceNumber !== null)
362
+ ? BigInt(object.RaisedSequenceNumber)
363
+ : 0n;
364
+ message.IncidentId = (object.IncidentId !== undefined && object.IncidentId !== null)
365
+ ? Guid.fromPartial(object.IncidentId)
366
+ : undefined;
367
+ return message;
368
+ },
369
+ };
370
+ function createBaseAlertIncidentCountDetails() {
371
+ return { Namespace: "", Condition: "", Severity: 0, Count: 0n };
372
+ }
373
+ export const AlertIncidentCountDetails = {
374
+ encode(message, writer = new BinaryWriter()) {
375
+ if (message.Namespace !== "") {
376
+ writer.uint32(10).string(message.Namespace);
377
+ }
378
+ if (message.Condition !== "") {
379
+ writer.uint32(18).string(message.Condition);
380
+ }
381
+ if (message.Severity !== 0) {
382
+ writer.uint32(24).int32(message.Severity);
383
+ }
384
+ if (message.Count !== 0n) {
385
+ if (BigInt.asIntN(64, message.Count) !== message.Count) {
386
+ throw new globalThis.Error("value provided for field message.Count of type int64 too large");
387
+ }
388
+ writer.uint32(32).int64(message.Count);
389
+ }
390
+ return writer;
391
+ },
392
+ decode(input, length) {
393
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
394
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
395
+ if (previousRecursionDepth >= 100) {
396
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
397
+ }
398
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
399
+ try {
400
+ const end = length === undefined ? reader.len : reader.pos + length;
401
+ const message = createBaseAlertIncidentCountDetails();
402
+ while (reader.pos < end) {
403
+ const tag = reader.uint32();
404
+ switch (tag >>> 3) {
405
+ case 1: {
406
+ if (tag !== 10) {
407
+ break;
408
+ }
409
+ message.Namespace = reader.string();
410
+ continue;
411
+ }
412
+ case 2: {
413
+ if (tag !== 18) {
414
+ break;
415
+ }
416
+ message.Condition = reader.string();
417
+ continue;
418
+ }
419
+ case 3: {
420
+ if (tag !== 24) {
421
+ break;
422
+ }
423
+ message.Severity = reader.int32();
424
+ continue;
425
+ }
426
+ case 4: {
427
+ if (tag !== 32) {
428
+ break;
429
+ }
430
+ message.Count = reader.int64();
431
+ continue;
432
+ }
433
+ }
434
+ if ((tag & 7) === 4 || tag === 0) {
435
+ break;
436
+ }
437
+ reader.skip(tag & 7);
438
+ }
439
+ return message;
440
+ }
441
+ finally {
442
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
443
+ }
444
+ },
445
+ fromJSON(object) {
446
+ return {
447
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
448
+ Condition: isSet(object.Condition) ? globalThis.String(object.Condition) : "",
449
+ Severity: isSet(object.Severity) ? alertSeverityFromJSON(object.Severity) : 0,
450
+ Count: isSet(object.Count) ? BigInt(object.Count) : 0n,
451
+ };
452
+ },
453
+ toJSON(message) {
454
+ const obj = {};
455
+ if (message.Namespace !== "") {
456
+ obj.Namespace = message.Namespace;
457
+ }
458
+ if (message.Condition !== "") {
459
+ obj.Condition = message.Condition;
460
+ }
461
+ if (message.Severity !== 0) {
462
+ obj.Severity = alertSeverityToJSON(message.Severity);
463
+ }
464
+ if (message.Count !== 0n) {
465
+ obj.Count = message.Count.toString();
466
+ }
467
+ return obj;
468
+ },
469
+ create(base) {
470
+ return AlertIncidentCountDetails.fromPartial(base ?? {});
471
+ },
472
+ fromPartial(object) {
473
+ const message = createBaseAlertIncidentCountDetails();
474
+ message.Namespace = object.Namespace ?? "";
475
+ message.Condition = object.Condition ?? "";
476
+ message.Severity = object.Severity ?? 0;
477
+ message.Count = (object.Count !== undefined && object.Count !== null) ? BigInt(object.Count) : 0n;
478
+ return message;
479
+ },
480
+ };
481
+ function createBaseAlertIncidentDetails() {
482
+ return {
483
+ Id: undefined,
484
+ Target: undefined,
485
+ Condition: "",
486
+ Severity: 0,
487
+ Evidence: undefined,
488
+ RaisedAt: undefined,
489
+ LastChangedAt: undefined,
490
+ RaisedSequenceNumber: 0n,
491
+ LastTransitionSequenceNumber: 0n,
492
+ };
493
+ }
494
+ export const AlertIncidentDetails = {
495
+ encode(message, writer = new BinaryWriter()) {
496
+ if (message.Id !== undefined) {
497
+ Guid.encode(message.Id, writer.uint32(10).fork()).join();
498
+ }
499
+ if (message.Target !== undefined) {
500
+ AlertTarget.encode(message.Target, writer.uint32(18).fork()).join();
501
+ }
502
+ if (message.Condition !== "") {
503
+ writer.uint32(26).string(message.Condition);
504
+ }
505
+ if (message.Severity !== 0) {
506
+ writer.uint32(32).int32(message.Severity);
507
+ }
508
+ if (message.Evidence !== undefined) {
509
+ AlertEvidence.encode(message.Evidence, writer.uint32(42).fork()).join();
510
+ }
511
+ if (message.RaisedAt !== undefined) {
512
+ SerializableDateTimeOffset.encode(message.RaisedAt, writer.uint32(50).fork()).join();
513
+ }
514
+ if (message.LastChangedAt !== undefined) {
515
+ SerializableDateTimeOffset.encode(message.LastChangedAt, writer.uint32(58).fork()).join();
516
+ }
517
+ if (message.RaisedSequenceNumber !== 0n) {
518
+ if (BigInt.asUintN(64, message.RaisedSequenceNumber) !== message.RaisedSequenceNumber) {
519
+ throw new globalThis.Error("value provided for field message.RaisedSequenceNumber of type uint64 too large");
520
+ }
521
+ writer.uint32(64).uint64(message.RaisedSequenceNumber);
522
+ }
523
+ if (message.LastTransitionSequenceNumber !== 0n) {
524
+ if (BigInt.asUintN(64, message.LastTransitionSequenceNumber) !== message.LastTransitionSequenceNumber) {
525
+ throw new globalThis.Error("value provided for field message.LastTransitionSequenceNumber of type uint64 too large");
526
+ }
527
+ writer.uint32(72).uint64(message.LastTransitionSequenceNumber);
528
+ }
529
+ return writer;
530
+ },
531
+ decode(input, length) {
532
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
533
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
534
+ if (previousRecursionDepth >= 100) {
535
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
536
+ }
537
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
538
+ try {
539
+ const end = length === undefined ? reader.len : reader.pos + length;
540
+ const message = createBaseAlertIncidentDetails();
541
+ while (reader.pos < end) {
542
+ const tag = reader.uint32();
543
+ switch (tag >>> 3) {
544
+ case 1: {
545
+ if (tag !== 10) {
546
+ break;
547
+ }
548
+ message.Id = Guid.decode(reader, reader.uint32());
549
+ continue;
550
+ }
551
+ case 2: {
552
+ if (tag !== 18) {
553
+ break;
554
+ }
555
+ message.Target = AlertTarget.decode(reader, reader.uint32());
556
+ continue;
557
+ }
558
+ case 3: {
559
+ if (tag !== 26) {
560
+ break;
561
+ }
562
+ message.Condition = reader.string();
563
+ continue;
564
+ }
565
+ case 4: {
566
+ if (tag !== 32) {
567
+ break;
568
+ }
569
+ message.Severity = reader.int32();
570
+ continue;
571
+ }
572
+ case 5: {
573
+ if (tag !== 42) {
574
+ break;
575
+ }
576
+ message.Evidence = AlertEvidence.decode(reader, reader.uint32());
577
+ continue;
578
+ }
579
+ case 6: {
580
+ if (tag !== 50) {
581
+ break;
582
+ }
583
+ message.RaisedAt = SerializableDateTimeOffset.decode(reader, reader.uint32());
584
+ continue;
585
+ }
586
+ case 7: {
587
+ if (tag !== 58) {
588
+ break;
589
+ }
590
+ message.LastChangedAt = SerializableDateTimeOffset.decode(reader, reader.uint32());
591
+ continue;
592
+ }
593
+ case 8: {
594
+ if (tag !== 64) {
595
+ break;
596
+ }
597
+ message.RaisedSequenceNumber = reader.uint64();
598
+ continue;
599
+ }
600
+ case 9: {
601
+ if (tag !== 72) {
602
+ break;
603
+ }
604
+ message.LastTransitionSequenceNumber = reader.uint64();
605
+ continue;
606
+ }
607
+ }
608
+ if ((tag & 7) === 4 || tag === 0) {
609
+ break;
610
+ }
611
+ reader.skip(tag & 7);
612
+ }
613
+ return message;
614
+ }
615
+ finally {
616
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
617
+ }
618
+ },
619
+ fromJSON(object) {
620
+ return {
621
+ Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined,
622
+ Target: isSet(object.Target) ? AlertTarget.fromJSON(object.Target) : undefined,
623
+ Condition: isSet(object.Condition) ? globalThis.String(object.Condition) : "",
624
+ Severity: isSet(object.Severity) ? alertSeverityFromJSON(object.Severity) : 0,
625
+ Evidence: isSet(object.Evidence) ? AlertEvidence.fromJSON(object.Evidence) : undefined,
626
+ RaisedAt: isSet(object.RaisedAt) ? SerializableDateTimeOffset.fromJSON(object.RaisedAt) : undefined,
627
+ LastChangedAt: isSet(object.LastChangedAt)
628
+ ? SerializableDateTimeOffset.fromJSON(object.LastChangedAt)
629
+ : undefined,
630
+ RaisedSequenceNumber: isSet(object.RaisedSequenceNumber) ? BigInt(object.RaisedSequenceNumber) : 0n,
631
+ LastTransitionSequenceNumber: isSet(object.LastTransitionSequenceNumber)
632
+ ? BigInt(object.LastTransitionSequenceNumber)
633
+ : 0n,
634
+ };
635
+ },
636
+ toJSON(message) {
637
+ const obj = {};
638
+ if (message.Id !== undefined) {
639
+ obj.Id = Guid.toJSON(message.Id);
640
+ }
641
+ if (message.Target !== undefined) {
642
+ obj.Target = AlertTarget.toJSON(message.Target);
643
+ }
644
+ if (message.Condition !== "") {
645
+ obj.Condition = message.Condition;
646
+ }
647
+ if (message.Severity !== 0) {
648
+ obj.Severity = alertSeverityToJSON(message.Severity);
649
+ }
650
+ if (message.Evidence !== undefined) {
651
+ obj.Evidence = AlertEvidence.toJSON(message.Evidence);
652
+ }
653
+ if (message.RaisedAt !== undefined) {
654
+ obj.RaisedAt = SerializableDateTimeOffset.toJSON(message.RaisedAt);
655
+ }
656
+ if (message.LastChangedAt !== undefined) {
657
+ obj.LastChangedAt = SerializableDateTimeOffset.toJSON(message.LastChangedAt);
658
+ }
659
+ if (message.RaisedSequenceNumber !== 0n) {
660
+ obj.RaisedSequenceNumber = message.RaisedSequenceNumber.toString();
661
+ }
662
+ if (message.LastTransitionSequenceNumber !== 0n) {
663
+ obj.LastTransitionSequenceNumber = message.LastTransitionSequenceNumber.toString();
664
+ }
665
+ return obj;
666
+ },
667
+ create(base) {
668
+ return AlertIncidentDetails.fromPartial(base ?? {});
669
+ },
670
+ fromPartial(object) {
671
+ const message = createBaseAlertIncidentDetails();
672
+ message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined;
673
+ message.Target = (object.Target !== undefined && object.Target !== null)
674
+ ? AlertTarget.fromPartial(object.Target)
675
+ : undefined;
676
+ message.Condition = object.Condition ?? "";
677
+ message.Severity = object.Severity ?? 0;
678
+ message.Evidence = (object.Evidence !== undefined && object.Evidence !== null)
679
+ ? AlertEvidence.fromPartial(object.Evidence)
680
+ : undefined;
681
+ message.RaisedAt = (object.RaisedAt !== undefined && object.RaisedAt !== null)
682
+ ? SerializableDateTimeOffset.fromPartial(object.RaisedAt)
683
+ : undefined;
684
+ message.LastChangedAt = (object.LastChangedAt !== undefined && object.LastChangedAt !== null)
685
+ ? SerializableDateTimeOffset.fromPartial(object.LastChangedAt)
686
+ : undefined;
687
+ message.RaisedSequenceNumber = (object.RaisedSequenceNumber !== undefined && object.RaisedSequenceNumber !== null)
688
+ ? BigInt(object.RaisedSequenceNumber)
689
+ : 0n;
690
+ message.LastTransitionSequenceNumber =
691
+ (object.LastTransitionSequenceNumber !== undefined && object.LastTransitionSequenceNumber !== null)
692
+ ? BigInt(object.LastTransitionSequenceNumber)
693
+ : 0n;
694
+ return message;
695
+ },
696
+ };
697
+ function createBaseAlertIncidentLookupResponse() {
698
+ return { Status: 0, Incident: undefined };
699
+ }
700
+ export const AlertIncidentLookupResponse = {
701
+ encode(message, writer = new BinaryWriter()) {
702
+ if (message.Status !== 0) {
703
+ writer.uint32(8).int32(message.Status);
704
+ }
705
+ if (message.Incident !== undefined) {
706
+ AlertIncidentDetails.encode(message.Incident, writer.uint32(18).fork()).join();
707
+ }
708
+ return writer;
709
+ },
710
+ decode(input, length) {
711
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
712
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
713
+ if (previousRecursionDepth >= 100) {
714
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
715
+ }
716
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
717
+ try {
718
+ const end = length === undefined ? reader.len : reader.pos + length;
719
+ const message = createBaseAlertIncidentLookupResponse();
720
+ while (reader.pos < end) {
721
+ const tag = reader.uint32();
722
+ switch (tag >>> 3) {
723
+ case 1: {
724
+ if (tag !== 8) {
725
+ break;
726
+ }
727
+ message.Status = reader.int32();
728
+ continue;
729
+ }
730
+ case 2: {
731
+ if (tag !== 18) {
732
+ break;
733
+ }
734
+ message.Incident = AlertIncidentDetails.decode(reader, reader.uint32());
735
+ continue;
736
+ }
737
+ }
738
+ if ((tag & 7) === 4 || tag === 0) {
739
+ break;
740
+ }
741
+ reader.skip(tag & 7);
742
+ }
743
+ return message;
744
+ }
745
+ finally {
746
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
747
+ }
748
+ },
749
+ fromJSON(object) {
750
+ return {
751
+ Status: isSet(object.Status) ? alertIncidentsReadinessStateFromJSON(object.Status) : 0,
752
+ Incident: isSet(object.Incident) ? AlertIncidentDetails.fromJSON(object.Incident) : undefined,
753
+ };
754
+ },
755
+ toJSON(message) {
756
+ const obj = {};
757
+ if (message.Status !== 0) {
758
+ obj.Status = alertIncidentsReadinessStateToJSON(message.Status);
759
+ }
760
+ if (message.Incident !== undefined) {
761
+ obj.Incident = AlertIncidentDetails.toJSON(message.Incident);
762
+ }
763
+ return obj;
764
+ },
765
+ create(base) {
766
+ return AlertIncidentLookupResponse.fromPartial(base ?? {});
767
+ },
768
+ fromPartial(object) {
769
+ const message = createBaseAlertIncidentLookupResponse();
770
+ message.Status = object.Status ?? 0;
771
+ message.Incident = (object.Incident !== undefined && object.Incident !== null)
772
+ ? AlertIncidentDetails.fromPartial(object.Incident)
773
+ : undefined;
774
+ return message;
775
+ },
776
+ };
777
+ function createBaseAlertIncidentPageResponse() {
778
+ return { Status: 0, Items: [], Next: undefined };
779
+ }
780
+ export const AlertIncidentPageResponse = {
781
+ encode(message, writer = new BinaryWriter()) {
782
+ if (message.Status !== 0) {
783
+ writer.uint32(8).int32(message.Status);
784
+ }
785
+ for (const v of message.Items) {
786
+ AlertIncidentDetails.encode(v, writer.uint32(18).fork()).join();
787
+ }
788
+ if (message.Next !== undefined) {
789
+ AlertIncidentContinuation.encode(message.Next, writer.uint32(26).fork()).join();
790
+ }
791
+ return writer;
792
+ },
793
+ decode(input, length) {
794
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
795
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
796
+ if (previousRecursionDepth >= 100) {
797
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
798
+ }
799
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
800
+ try {
801
+ const end = length === undefined ? reader.len : reader.pos + length;
802
+ const message = createBaseAlertIncidentPageResponse();
803
+ while (reader.pos < end) {
804
+ const tag = reader.uint32();
805
+ switch (tag >>> 3) {
806
+ case 1: {
807
+ if (tag !== 8) {
808
+ break;
809
+ }
810
+ message.Status = reader.int32();
811
+ continue;
812
+ }
813
+ case 2: {
814
+ if (tag !== 18) {
815
+ break;
816
+ }
817
+ message.Items.push(AlertIncidentDetails.decode(reader, reader.uint32()));
818
+ continue;
819
+ }
820
+ case 3: {
821
+ if (tag !== 26) {
822
+ break;
823
+ }
824
+ message.Next = AlertIncidentContinuation.decode(reader, reader.uint32());
825
+ continue;
826
+ }
827
+ }
828
+ if ((tag & 7) === 4 || tag === 0) {
829
+ break;
830
+ }
831
+ reader.skip(tag & 7);
832
+ }
833
+ return message;
834
+ }
835
+ finally {
836
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
837
+ }
838
+ },
839
+ fromJSON(object) {
840
+ return {
841
+ Status: isSet(object.Status) ? alertIncidentsReadinessStateFromJSON(object.Status) : 0,
842
+ Items: globalThis.Array.isArray(object?.Items)
843
+ ? object.Items.map((e) => AlertIncidentDetails.fromJSON(e))
844
+ : [],
845
+ Next: isSet(object.Next) ? AlertIncidentContinuation.fromJSON(object.Next) : undefined,
846
+ };
847
+ },
848
+ toJSON(message) {
849
+ const obj = {};
850
+ if (message.Status !== 0) {
851
+ obj.Status = alertIncidentsReadinessStateToJSON(message.Status);
852
+ }
853
+ if (message.Items?.length) {
854
+ obj.Items = message.Items.map((e) => AlertIncidentDetails.toJSON(e));
855
+ }
856
+ if (message.Next !== undefined) {
857
+ obj.Next = AlertIncidentContinuation.toJSON(message.Next);
858
+ }
859
+ return obj;
860
+ },
861
+ create(base) {
862
+ return AlertIncidentPageResponse.fromPartial(base ?? {});
863
+ },
864
+ fromPartial(object) {
865
+ const message = createBaseAlertIncidentPageResponse();
866
+ message.Status = object.Status ?? 0;
867
+ message.Items = object.Items?.map((e) => AlertIncidentDetails.fromPartial(e)) || [];
868
+ message.Next = (object.Next !== undefined && object.Next !== null)
869
+ ? AlertIncidentContinuation.fromPartial(object.Next)
870
+ : undefined;
871
+ return message;
872
+ },
873
+ };
874
+ function createBaseAlertIncidentSummaryResponse() {
875
+ return { Status: 0, Counts: [] };
876
+ }
877
+ export const AlertIncidentSummaryResponse = {
878
+ encode(message, writer = new BinaryWriter()) {
879
+ if (message.Status !== 0) {
880
+ writer.uint32(8).int32(message.Status);
881
+ }
882
+ for (const v of message.Counts) {
883
+ AlertIncidentCountDetails.encode(v, writer.uint32(18).fork()).join();
884
+ }
885
+ return writer;
886
+ },
887
+ decode(input, length) {
888
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
889
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
890
+ if (previousRecursionDepth >= 100) {
891
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
892
+ }
893
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
894
+ try {
895
+ const end = length === undefined ? reader.len : reader.pos + length;
896
+ const message = createBaseAlertIncidentSummaryResponse();
897
+ while (reader.pos < end) {
898
+ const tag = reader.uint32();
899
+ switch (tag >>> 3) {
900
+ case 1: {
901
+ if (tag !== 8) {
902
+ break;
903
+ }
904
+ message.Status = reader.int32();
905
+ continue;
906
+ }
907
+ case 2: {
908
+ if (tag !== 18) {
909
+ break;
910
+ }
911
+ message.Counts.push(AlertIncidentCountDetails.decode(reader, reader.uint32()));
912
+ continue;
913
+ }
914
+ }
915
+ if ((tag & 7) === 4 || tag === 0) {
916
+ break;
917
+ }
918
+ reader.skip(tag & 7);
919
+ }
920
+ return message;
921
+ }
922
+ finally {
923
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
924
+ }
925
+ },
926
+ fromJSON(object) {
927
+ return {
928
+ Status: isSet(object.Status) ? alertIncidentsReadinessStateFromJSON(object.Status) : 0,
929
+ Counts: globalThis.Array.isArray(object?.Counts)
930
+ ? object.Counts.map((e) => AlertIncidentCountDetails.fromJSON(e))
931
+ : [],
932
+ };
933
+ },
934
+ toJSON(message) {
935
+ const obj = {};
936
+ if (message.Status !== 0) {
937
+ obj.Status = alertIncidentsReadinessStateToJSON(message.Status);
938
+ }
939
+ if (message.Counts?.length) {
940
+ obj.Counts = message.Counts.map((e) => AlertIncidentCountDetails.toJSON(e));
941
+ }
942
+ return obj;
943
+ },
944
+ create(base) {
945
+ return AlertIncidentSummaryResponse.fromPartial(base ?? {});
946
+ },
947
+ fromPartial(object) {
948
+ const message = createBaseAlertIncidentSummaryResponse();
949
+ message.Status = object.Status ?? 0;
950
+ message.Counts = object.Counts?.map((e) => AlertIncidentCountDetails.fromPartial(e)) || [];
951
+ return message;
952
+ },
953
+ };
954
+ function createBaseAlertTarget() {
955
+ return { EventStore: "", Namespace: "", ObserverId: "", EventSequenceId: "", Partition: "" };
956
+ }
957
+ export const AlertTarget = {
958
+ encode(message, writer = new BinaryWriter()) {
959
+ if (message.EventStore !== "") {
960
+ writer.uint32(10).string(message.EventStore);
961
+ }
962
+ if (message.Namespace !== "") {
963
+ writer.uint32(18).string(message.Namespace);
964
+ }
965
+ if (message.ObserverId !== "") {
966
+ writer.uint32(26).string(message.ObserverId);
967
+ }
968
+ if (message.EventSequenceId !== "") {
969
+ writer.uint32(34).string(message.EventSequenceId);
970
+ }
971
+ if (message.Partition !== "") {
972
+ writer.uint32(42).string(message.Partition);
973
+ }
974
+ return writer;
975
+ },
976
+ decode(input, length) {
977
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
978
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
979
+ if (previousRecursionDepth >= 100) {
980
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
981
+ }
982
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
983
+ try {
984
+ const end = length === undefined ? reader.len : reader.pos + length;
985
+ const message = createBaseAlertTarget();
986
+ while (reader.pos < end) {
987
+ const tag = reader.uint32();
988
+ switch (tag >>> 3) {
989
+ case 1: {
990
+ if (tag !== 10) {
991
+ break;
992
+ }
993
+ message.EventStore = reader.string();
994
+ continue;
995
+ }
996
+ case 2: {
997
+ if (tag !== 18) {
998
+ break;
999
+ }
1000
+ message.Namespace = reader.string();
1001
+ continue;
1002
+ }
1003
+ case 3: {
1004
+ if (tag !== 26) {
1005
+ break;
1006
+ }
1007
+ message.ObserverId = reader.string();
1008
+ continue;
1009
+ }
1010
+ case 4: {
1011
+ if (tag !== 34) {
1012
+ break;
1013
+ }
1014
+ message.EventSequenceId = reader.string();
1015
+ continue;
1016
+ }
1017
+ case 5: {
1018
+ if (tag !== 42) {
1019
+ break;
1020
+ }
1021
+ message.Partition = reader.string();
1022
+ continue;
1023
+ }
1024
+ }
1025
+ if ((tag & 7) === 4 || tag === 0) {
1026
+ break;
1027
+ }
1028
+ reader.skip(tag & 7);
1029
+ }
1030
+ return message;
1031
+ }
1032
+ finally {
1033
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1034
+ }
1035
+ },
1036
+ fromJSON(object) {
1037
+ return {
1038
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1039
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1040
+ ObserverId: isSet(object.ObserverId) ? globalThis.String(object.ObserverId) : "",
1041
+ EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "",
1042
+ Partition: isSet(object.Partition) ? globalThis.String(object.Partition) : "",
1043
+ };
1044
+ },
1045
+ toJSON(message) {
1046
+ const obj = {};
1047
+ if (message.EventStore !== "") {
1048
+ obj.EventStore = message.EventStore;
1049
+ }
1050
+ if (message.Namespace !== "") {
1051
+ obj.Namespace = message.Namespace;
1052
+ }
1053
+ if (message.ObserverId !== "") {
1054
+ obj.ObserverId = message.ObserverId;
1055
+ }
1056
+ if (message.EventSequenceId !== "") {
1057
+ obj.EventSequenceId = message.EventSequenceId;
1058
+ }
1059
+ if (message.Partition !== "") {
1060
+ obj.Partition = message.Partition;
1061
+ }
1062
+ return obj;
1063
+ },
1064
+ create(base) {
1065
+ return AlertTarget.fromPartial(base ?? {});
1066
+ },
1067
+ fromPartial(object) {
1068
+ const message = createBaseAlertTarget();
1069
+ message.EventStore = object.EventStore ?? "";
1070
+ message.Namespace = object.Namespace ?? "";
1071
+ message.ObserverId = object.ObserverId ?? "";
1072
+ message.EventSequenceId = object.EventSequenceId ?? "";
1073
+ message.Partition = object.Partition ?? "";
1074
+ return message;
1075
+ },
1076
+ };
1077
+ function createBaseGetOpenIncidentCountsRequest() {
1078
+ return { EventStore: "", Namespace: "" };
1079
+ }
1080
+ export const GetOpenIncidentCountsRequest = {
1081
+ encode(message, writer = new BinaryWriter()) {
1082
+ if (message.EventStore !== "") {
1083
+ writer.uint32(10).string(message.EventStore);
1084
+ }
1085
+ if (message.Namespace !== "") {
1086
+ writer.uint32(18).string(message.Namespace);
1087
+ }
1088
+ return writer;
1089
+ },
1090
+ decode(input, length) {
1091
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1092
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1093
+ if (previousRecursionDepth >= 100) {
1094
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1095
+ }
1096
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1097
+ try {
1098
+ const end = length === undefined ? reader.len : reader.pos + length;
1099
+ const message = createBaseGetOpenIncidentCountsRequest();
1100
+ while (reader.pos < end) {
1101
+ const tag = reader.uint32();
1102
+ switch (tag >>> 3) {
1103
+ case 1: {
1104
+ if (tag !== 10) {
1105
+ break;
1106
+ }
1107
+ message.EventStore = reader.string();
1108
+ continue;
1109
+ }
1110
+ case 2: {
1111
+ if (tag !== 18) {
1112
+ break;
1113
+ }
1114
+ message.Namespace = reader.string();
1115
+ continue;
1116
+ }
1117
+ }
1118
+ if ((tag & 7) === 4 || tag === 0) {
1119
+ break;
1120
+ }
1121
+ reader.skip(tag & 7);
1122
+ }
1123
+ return message;
1124
+ }
1125
+ finally {
1126
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1127
+ }
1128
+ },
1129
+ fromJSON(object) {
1130
+ return {
1131
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1132
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1133
+ };
1134
+ },
1135
+ toJSON(message) {
1136
+ const obj = {};
1137
+ if (message.EventStore !== "") {
1138
+ obj.EventStore = message.EventStore;
1139
+ }
1140
+ if (message.Namespace !== "") {
1141
+ obj.Namespace = message.Namespace;
1142
+ }
1143
+ return obj;
1144
+ },
1145
+ create(base) {
1146
+ return GetOpenIncidentCountsRequest.fromPartial(base ?? {});
1147
+ },
1148
+ fromPartial(object) {
1149
+ const message = createBaseGetOpenIncidentCountsRequest();
1150
+ message.EventStore = object.EventStore ?? "";
1151
+ message.Namespace = object.Namespace ?? "";
1152
+ return message;
1153
+ },
1154
+ };
1155
+ function createBaseGetOpenIncidentRequest() {
1156
+ return { EventStore: "", IncidentId: undefined, Namespace: "" };
1157
+ }
1158
+ export const GetOpenIncidentRequest = {
1159
+ encode(message, writer = new BinaryWriter()) {
1160
+ if (message.EventStore !== "") {
1161
+ writer.uint32(10).string(message.EventStore);
1162
+ }
1163
+ if (message.IncidentId !== undefined) {
1164
+ Guid.encode(message.IncidentId, writer.uint32(18).fork()).join();
1165
+ }
1166
+ if (message.Namespace !== "") {
1167
+ writer.uint32(26).string(message.Namespace);
1168
+ }
1169
+ return writer;
1170
+ },
1171
+ decode(input, length) {
1172
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1173
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1174
+ if (previousRecursionDepth >= 100) {
1175
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1176
+ }
1177
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1178
+ try {
1179
+ const end = length === undefined ? reader.len : reader.pos + length;
1180
+ const message = createBaseGetOpenIncidentRequest();
1181
+ while (reader.pos < end) {
1182
+ const tag = reader.uint32();
1183
+ switch (tag >>> 3) {
1184
+ case 1: {
1185
+ if (tag !== 10) {
1186
+ break;
1187
+ }
1188
+ message.EventStore = reader.string();
1189
+ continue;
1190
+ }
1191
+ case 2: {
1192
+ if (tag !== 18) {
1193
+ break;
1194
+ }
1195
+ message.IncidentId = Guid.decode(reader, reader.uint32());
1196
+ continue;
1197
+ }
1198
+ case 3: {
1199
+ if (tag !== 26) {
1200
+ break;
1201
+ }
1202
+ message.Namespace = reader.string();
1203
+ continue;
1204
+ }
1205
+ }
1206
+ if ((tag & 7) === 4 || tag === 0) {
1207
+ break;
1208
+ }
1209
+ reader.skip(tag & 7);
1210
+ }
1211
+ return message;
1212
+ }
1213
+ finally {
1214
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1215
+ }
1216
+ },
1217
+ fromJSON(object) {
1218
+ return {
1219
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1220
+ IncidentId: isSet(object.IncidentId) ? Guid.fromJSON(object.IncidentId) : undefined,
1221
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1222
+ };
1223
+ },
1224
+ toJSON(message) {
1225
+ const obj = {};
1226
+ if (message.EventStore !== "") {
1227
+ obj.EventStore = message.EventStore;
1228
+ }
1229
+ if (message.IncidentId !== undefined) {
1230
+ obj.IncidentId = Guid.toJSON(message.IncidentId);
1231
+ }
1232
+ if (message.Namespace !== "") {
1233
+ obj.Namespace = message.Namespace;
1234
+ }
1235
+ return obj;
1236
+ },
1237
+ create(base) {
1238
+ return GetOpenIncidentRequest.fromPartial(base ?? {});
1239
+ },
1240
+ fromPartial(object) {
1241
+ const message = createBaseGetOpenIncidentRequest();
1242
+ message.EventStore = object.EventStore ?? "";
1243
+ message.IncidentId = (object.IncidentId !== undefined && object.IncidentId !== null)
1244
+ ? Guid.fromPartial(object.IncidentId)
1245
+ : undefined;
1246
+ message.Namespace = object.Namespace ?? "";
1247
+ return message;
1248
+ },
1249
+ };
1250
+ function createBaseGetOpenIncidentsRequest() {
1251
+ return {
1252
+ EventStore: "",
1253
+ Namespace: "",
1254
+ ObserverId: "",
1255
+ Condition: "",
1256
+ MinimumSeverity: 0,
1257
+ Limit: 0,
1258
+ AfterRaisedSequenceNumber: 0n,
1259
+ AfterIncidentId: undefined,
1260
+ };
1261
+ }
1262
+ export const GetOpenIncidentsRequest = {
1263
+ encode(message, writer = new BinaryWriter()) {
1264
+ if (message.EventStore !== "") {
1265
+ writer.uint32(10).string(message.EventStore);
1266
+ }
1267
+ if (message.Namespace !== "") {
1268
+ writer.uint32(18).string(message.Namespace);
1269
+ }
1270
+ if (message.ObserverId !== "") {
1271
+ writer.uint32(26).string(message.ObserverId);
1272
+ }
1273
+ if (message.Condition !== "") {
1274
+ writer.uint32(34).string(message.Condition);
1275
+ }
1276
+ if (message.MinimumSeverity !== 0) {
1277
+ writer.uint32(40).int32(message.MinimumSeverity);
1278
+ }
1279
+ if (message.Limit !== 0) {
1280
+ writer.uint32(48).int32(message.Limit);
1281
+ }
1282
+ if (message.AfterRaisedSequenceNumber !== 0n) {
1283
+ if (BigInt.asUintN(64, message.AfterRaisedSequenceNumber) !== message.AfterRaisedSequenceNumber) {
1284
+ throw new globalThis.Error("value provided for field message.AfterRaisedSequenceNumber of type uint64 too large");
1285
+ }
1286
+ writer.uint32(56).uint64(message.AfterRaisedSequenceNumber);
1287
+ }
1288
+ if (message.AfterIncidentId !== undefined) {
1289
+ Guid.encode(message.AfterIncidentId, writer.uint32(66).fork()).join();
1290
+ }
1291
+ return writer;
1292
+ },
1293
+ decode(input, length) {
1294
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1295
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1296
+ if (previousRecursionDepth >= 100) {
1297
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1298
+ }
1299
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1300
+ try {
1301
+ const end = length === undefined ? reader.len : reader.pos + length;
1302
+ const message = createBaseGetOpenIncidentsRequest();
1303
+ while (reader.pos < end) {
1304
+ const tag = reader.uint32();
1305
+ switch (tag >>> 3) {
1306
+ case 1: {
1307
+ if (tag !== 10) {
1308
+ break;
1309
+ }
1310
+ message.EventStore = reader.string();
1311
+ continue;
1312
+ }
1313
+ case 2: {
1314
+ if (tag !== 18) {
1315
+ break;
1316
+ }
1317
+ message.Namespace = reader.string();
1318
+ continue;
1319
+ }
1320
+ case 3: {
1321
+ if (tag !== 26) {
1322
+ break;
1323
+ }
1324
+ message.ObserverId = reader.string();
1325
+ continue;
1326
+ }
1327
+ case 4: {
1328
+ if (tag !== 34) {
1329
+ break;
1330
+ }
1331
+ message.Condition = reader.string();
1332
+ continue;
1333
+ }
1334
+ case 5: {
1335
+ if (tag !== 40) {
1336
+ break;
1337
+ }
1338
+ message.MinimumSeverity = reader.int32();
1339
+ continue;
1340
+ }
1341
+ case 6: {
1342
+ if (tag !== 48) {
1343
+ break;
1344
+ }
1345
+ message.Limit = reader.int32();
1346
+ continue;
1347
+ }
1348
+ case 7: {
1349
+ if (tag !== 56) {
1350
+ break;
1351
+ }
1352
+ message.AfterRaisedSequenceNumber = reader.uint64();
1353
+ continue;
1354
+ }
1355
+ case 8: {
1356
+ if (tag !== 66) {
1357
+ break;
1358
+ }
1359
+ message.AfterIncidentId = Guid.decode(reader, reader.uint32());
1360
+ continue;
1361
+ }
1362
+ }
1363
+ if ((tag & 7) === 4 || tag === 0) {
1364
+ break;
1365
+ }
1366
+ reader.skip(tag & 7);
1367
+ }
1368
+ return message;
1369
+ }
1370
+ finally {
1371
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1372
+ }
1373
+ },
1374
+ fromJSON(object) {
1375
+ return {
1376
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1377
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1378
+ ObserverId: isSet(object.ObserverId) ? globalThis.String(object.ObserverId) : "",
1379
+ Condition: isSet(object.Condition) ? globalThis.String(object.Condition) : "",
1380
+ MinimumSeverity: isSet(object.MinimumSeverity) ? alertSeverityFromJSON(object.MinimumSeverity) : 0,
1381
+ Limit: isSet(object.Limit) ? globalThis.Number(object.Limit) : 0,
1382
+ AfterRaisedSequenceNumber: isSet(object.AfterRaisedSequenceNumber)
1383
+ ? BigInt(object.AfterRaisedSequenceNumber)
1384
+ : 0n,
1385
+ AfterIncidentId: isSet(object.AfterIncidentId) ? Guid.fromJSON(object.AfterIncidentId) : undefined,
1386
+ };
1387
+ },
1388
+ toJSON(message) {
1389
+ const obj = {};
1390
+ if (message.EventStore !== "") {
1391
+ obj.EventStore = message.EventStore;
1392
+ }
1393
+ if (message.Namespace !== "") {
1394
+ obj.Namespace = message.Namespace;
1395
+ }
1396
+ if (message.ObserverId !== "") {
1397
+ obj.ObserverId = message.ObserverId;
1398
+ }
1399
+ if (message.Condition !== "") {
1400
+ obj.Condition = message.Condition;
1401
+ }
1402
+ if (message.MinimumSeverity !== 0) {
1403
+ obj.MinimumSeverity = alertSeverityToJSON(message.MinimumSeverity);
1404
+ }
1405
+ if (message.Limit !== 0) {
1406
+ obj.Limit = Math.round(message.Limit);
1407
+ }
1408
+ if (message.AfterRaisedSequenceNumber !== 0n) {
1409
+ obj.AfterRaisedSequenceNumber = message.AfterRaisedSequenceNumber.toString();
1410
+ }
1411
+ if (message.AfterIncidentId !== undefined) {
1412
+ obj.AfterIncidentId = Guid.toJSON(message.AfterIncidentId);
1413
+ }
1414
+ return obj;
1415
+ },
1416
+ create(base) {
1417
+ return GetOpenIncidentsRequest.fromPartial(base ?? {});
1418
+ },
1419
+ fromPartial(object) {
1420
+ const message = createBaseGetOpenIncidentsRequest();
1421
+ message.EventStore = object.EventStore ?? "";
1422
+ message.Namespace = object.Namespace ?? "";
1423
+ message.ObserverId = object.ObserverId ?? "";
1424
+ message.Condition = object.Condition ?? "";
1425
+ message.MinimumSeverity = object.MinimumSeverity ?? 0;
1426
+ message.Limit = object.Limit ?? 0;
1427
+ message.AfterRaisedSequenceNumber =
1428
+ (object.AfterRaisedSequenceNumber !== undefined && object.AfterRaisedSequenceNumber !== null)
1429
+ ? BigInt(object.AfterRaisedSequenceNumber)
1430
+ : 0n;
1431
+ message.AfterIncidentId = (object.AfterIncidentId !== undefined && object.AfterIncidentId !== null)
1432
+ ? Guid.fromPartial(object.AfterIncidentId)
1433
+ : undefined;
1434
+ return message;
1435
+ },
1436
+ };
1437
+ function createBaseQueryResultAlertIncidentLookupResponse() {
1438
+ return {
1439
+ CorrelationId: undefined,
1440
+ IsAuthorized: false,
1441
+ ValidationResults: [],
1442
+ ExceptionMessages: [],
1443
+ ExceptionStackTrace: "",
1444
+ Data: undefined,
1445
+ };
1446
+ }
1447
+ export const QueryResultAlertIncidentLookupResponse = {
1448
+ encode(message, writer = new BinaryWriter()) {
1449
+ if (message.CorrelationId !== undefined) {
1450
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1451
+ }
1452
+ if (message.IsAuthorized !== false) {
1453
+ writer.uint32(16).bool(message.IsAuthorized);
1454
+ }
1455
+ for (const v of message.ValidationResults) {
1456
+ ValidationResult.encode(v, writer.uint32(26).fork()).join();
1457
+ }
1458
+ for (const v of message.ExceptionMessages) {
1459
+ writer.uint32(34).string(v);
1460
+ }
1461
+ if (message.ExceptionStackTrace !== "") {
1462
+ writer.uint32(42).string(message.ExceptionStackTrace);
1463
+ }
1464
+ if (message.Data !== undefined) {
1465
+ AlertIncidentLookupResponse.encode(message.Data, writer.uint32(50).fork()).join();
1466
+ }
1467
+ return writer;
1468
+ },
1469
+ decode(input, length) {
1470
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1471
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1472
+ if (previousRecursionDepth >= 100) {
1473
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1474
+ }
1475
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1476
+ try {
1477
+ const end = length === undefined ? reader.len : reader.pos + length;
1478
+ const message = createBaseQueryResultAlertIncidentLookupResponse();
1479
+ while (reader.pos < end) {
1480
+ const tag = reader.uint32();
1481
+ switch (tag >>> 3) {
1482
+ case 1: {
1483
+ if (tag !== 10) {
1484
+ break;
1485
+ }
1486
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
1487
+ continue;
1488
+ }
1489
+ case 2: {
1490
+ if (tag !== 16) {
1491
+ break;
1492
+ }
1493
+ message.IsAuthorized = reader.bool();
1494
+ continue;
1495
+ }
1496
+ case 3: {
1497
+ if (tag !== 26) {
1498
+ break;
1499
+ }
1500
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
1501
+ continue;
1502
+ }
1503
+ case 4: {
1504
+ if (tag !== 34) {
1505
+ break;
1506
+ }
1507
+ message.ExceptionMessages.push(reader.string());
1508
+ continue;
1509
+ }
1510
+ case 5: {
1511
+ if (tag !== 42) {
1512
+ break;
1513
+ }
1514
+ message.ExceptionStackTrace = reader.string();
1515
+ continue;
1516
+ }
1517
+ case 6: {
1518
+ if (tag !== 50) {
1519
+ break;
1520
+ }
1521
+ message.Data = AlertIncidentLookupResponse.decode(reader, reader.uint32());
1522
+ continue;
1523
+ }
1524
+ }
1525
+ if ((tag & 7) === 4 || tag === 0) {
1526
+ break;
1527
+ }
1528
+ reader.skip(tag & 7);
1529
+ }
1530
+ return message;
1531
+ }
1532
+ finally {
1533
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1534
+ }
1535
+ },
1536
+ fromJSON(object) {
1537
+ return {
1538
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
1539
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
1540
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
1541
+ ? object.ValidationResults.map((e) => ValidationResult.fromJSON(e))
1542
+ : [],
1543
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
1544
+ ? object.ExceptionMessages.map((e) => globalThis.String(e))
1545
+ : [],
1546
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
1547
+ Data: isSet(object.Data) ? AlertIncidentLookupResponse.fromJSON(object.Data) : undefined,
1548
+ };
1549
+ },
1550
+ toJSON(message) {
1551
+ const obj = {};
1552
+ if (message.CorrelationId !== undefined) {
1553
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
1554
+ }
1555
+ if (message.IsAuthorized !== false) {
1556
+ obj.IsAuthorized = message.IsAuthorized;
1557
+ }
1558
+ if (message.ValidationResults?.length) {
1559
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
1560
+ }
1561
+ if (message.ExceptionMessages?.length) {
1562
+ obj.ExceptionMessages = message.ExceptionMessages;
1563
+ }
1564
+ if (message.ExceptionStackTrace !== "") {
1565
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
1566
+ }
1567
+ if (message.Data !== undefined) {
1568
+ obj.Data = AlertIncidentLookupResponse.toJSON(message.Data);
1569
+ }
1570
+ return obj;
1571
+ },
1572
+ create(base) {
1573
+ return QueryResultAlertIncidentLookupResponse.fromPartial(base ?? {});
1574
+ },
1575
+ fromPartial(object) {
1576
+ const message = createBaseQueryResultAlertIncidentLookupResponse();
1577
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1578
+ ? Guid.fromPartial(object.CorrelationId)
1579
+ : undefined;
1580
+ message.IsAuthorized = object.IsAuthorized ?? false;
1581
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
1582
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
1583
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
1584
+ message.Data = (object.Data !== undefined && object.Data !== null)
1585
+ ? AlertIncidentLookupResponse.fromPartial(object.Data)
1586
+ : undefined;
1587
+ return message;
1588
+ },
1589
+ };
1590
+ function createBaseQueryResultAlertIncidentPageResponse() {
1591
+ return {
1592
+ CorrelationId: undefined,
1593
+ IsAuthorized: false,
1594
+ ValidationResults: [],
1595
+ ExceptionMessages: [],
1596
+ ExceptionStackTrace: "",
1597
+ Data: undefined,
1598
+ };
1599
+ }
1600
+ export const QueryResultAlertIncidentPageResponse = {
1601
+ encode(message, writer = new BinaryWriter()) {
1602
+ if (message.CorrelationId !== undefined) {
1603
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1604
+ }
1605
+ if (message.IsAuthorized !== false) {
1606
+ writer.uint32(16).bool(message.IsAuthorized);
1607
+ }
1608
+ for (const v of message.ValidationResults) {
1609
+ ValidationResult.encode(v, writer.uint32(26).fork()).join();
1610
+ }
1611
+ for (const v of message.ExceptionMessages) {
1612
+ writer.uint32(34).string(v);
1613
+ }
1614
+ if (message.ExceptionStackTrace !== "") {
1615
+ writer.uint32(42).string(message.ExceptionStackTrace);
1616
+ }
1617
+ if (message.Data !== undefined) {
1618
+ AlertIncidentPageResponse.encode(message.Data, writer.uint32(50).fork()).join();
1619
+ }
1620
+ return writer;
1621
+ },
1622
+ decode(input, length) {
1623
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1624
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1625
+ if (previousRecursionDepth >= 100) {
1626
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1627
+ }
1628
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1629
+ try {
1630
+ const end = length === undefined ? reader.len : reader.pos + length;
1631
+ const message = createBaseQueryResultAlertIncidentPageResponse();
1632
+ while (reader.pos < end) {
1633
+ const tag = reader.uint32();
1634
+ switch (tag >>> 3) {
1635
+ case 1: {
1636
+ if (tag !== 10) {
1637
+ break;
1638
+ }
1639
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
1640
+ continue;
1641
+ }
1642
+ case 2: {
1643
+ if (tag !== 16) {
1644
+ break;
1645
+ }
1646
+ message.IsAuthorized = reader.bool();
1647
+ continue;
1648
+ }
1649
+ case 3: {
1650
+ if (tag !== 26) {
1651
+ break;
1652
+ }
1653
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
1654
+ continue;
1655
+ }
1656
+ case 4: {
1657
+ if (tag !== 34) {
1658
+ break;
1659
+ }
1660
+ message.ExceptionMessages.push(reader.string());
1661
+ continue;
1662
+ }
1663
+ case 5: {
1664
+ if (tag !== 42) {
1665
+ break;
1666
+ }
1667
+ message.ExceptionStackTrace = reader.string();
1668
+ continue;
1669
+ }
1670
+ case 6: {
1671
+ if (tag !== 50) {
1672
+ break;
1673
+ }
1674
+ message.Data = AlertIncidentPageResponse.decode(reader, reader.uint32());
1675
+ continue;
1676
+ }
1677
+ }
1678
+ if ((tag & 7) === 4 || tag === 0) {
1679
+ break;
1680
+ }
1681
+ reader.skip(tag & 7);
1682
+ }
1683
+ return message;
1684
+ }
1685
+ finally {
1686
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1687
+ }
1688
+ },
1689
+ fromJSON(object) {
1690
+ return {
1691
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
1692
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
1693
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
1694
+ ? object.ValidationResults.map((e) => ValidationResult.fromJSON(e))
1695
+ : [],
1696
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
1697
+ ? object.ExceptionMessages.map((e) => globalThis.String(e))
1698
+ : [],
1699
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
1700
+ Data: isSet(object.Data) ? AlertIncidentPageResponse.fromJSON(object.Data) : undefined,
1701
+ };
1702
+ },
1703
+ toJSON(message) {
1704
+ const obj = {};
1705
+ if (message.CorrelationId !== undefined) {
1706
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
1707
+ }
1708
+ if (message.IsAuthorized !== false) {
1709
+ obj.IsAuthorized = message.IsAuthorized;
1710
+ }
1711
+ if (message.ValidationResults?.length) {
1712
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
1713
+ }
1714
+ if (message.ExceptionMessages?.length) {
1715
+ obj.ExceptionMessages = message.ExceptionMessages;
1716
+ }
1717
+ if (message.ExceptionStackTrace !== "") {
1718
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
1719
+ }
1720
+ if (message.Data !== undefined) {
1721
+ obj.Data = AlertIncidentPageResponse.toJSON(message.Data);
1722
+ }
1723
+ return obj;
1724
+ },
1725
+ create(base) {
1726
+ return QueryResultAlertIncidentPageResponse.fromPartial(base ?? {});
1727
+ },
1728
+ fromPartial(object) {
1729
+ const message = createBaseQueryResultAlertIncidentPageResponse();
1730
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1731
+ ? Guid.fromPartial(object.CorrelationId)
1732
+ : undefined;
1733
+ message.IsAuthorized = object.IsAuthorized ?? false;
1734
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
1735
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
1736
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
1737
+ message.Data = (object.Data !== undefined && object.Data !== null)
1738
+ ? AlertIncidentPageResponse.fromPartial(object.Data)
1739
+ : undefined;
1740
+ return message;
1741
+ },
1742
+ };
1743
+ function createBaseQueryResultAlertIncidentSummaryResponse() {
1744
+ return {
1745
+ CorrelationId: undefined,
1746
+ IsAuthorized: false,
1747
+ ValidationResults: [],
1748
+ ExceptionMessages: [],
1749
+ ExceptionStackTrace: "",
1750
+ Data: undefined,
1751
+ };
1752
+ }
1753
+ export const QueryResultAlertIncidentSummaryResponse = {
1754
+ encode(message, writer = new BinaryWriter()) {
1755
+ if (message.CorrelationId !== undefined) {
1756
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1757
+ }
1758
+ if (message.IsAuthorized !== false) {
1759
+ writer.uint32(16).bool(message.IsAuthorized);
1760
+ }
1761
+ for (const v of message.ValidationResults) {
1762
+ ValidationResult.encode(v, writer.uint32(26).fork()).join();
1763
+ }
1764
+ for (const v of message.ExceptionMessages) {
1765
+ writer.uint32(34).string(v);
1766
+ }
1767
+ if (message.ExceptionStackTrace !== "") {
1768
+ writer.uint32(42).string(message.ExceptionStackTrace);
1769
+ }
1770
+ if (message.Data !== undefined) {
1771
+ AlertIncidentSummaryResponse.encode(message.Data, writer.uint32(50).fork()).join();
1772
+ }
1773
+ return writer;
1774
+ },
1775
+ decode(input, length) {
1776
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1777
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1778
+ if (previousRecursionDepth >= 100) {
1779
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1780
+ }
1781
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1782
+ try {
1783
+ const end = length === undefined ? reader.len : reader.pos + length;
1784
+ const message = createBaseQueryResultAlertIncidentSummaryResponse();
1785
+ while (reader.pos < end) {
1786
+ const tag = reader.uint32();
1787
+ switch (tag >>> 3) {
1788
+ case 1: {
1789
+ if (tag !== 10) {
1790
+ break;
1791
+ }
1792
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
1793
+ continue;
1794
+ }
1795
+ case 2: {
1796
+ if (tag !== 16) {
1797
+ break;
1798
+ }
1799
+ message.IsAuthorized = reader.bool();
1800
+ continue;
1801
+ }
1802
+ case 3: {
1803
+ if (tag !== 26) {
1804
+ break;
1805
+ }
1806
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
1807
+ continue;
1808
+ }
1809
+ case 4: {
1810
+ if (tag !== 34) {
1811
+ break;
1812
+ }
1813
+ message.ExceptionMessages.push(reader.string());
1814
+ continue;
1815
+ }
1816
+ case 5: {
1817
+ if (tag !== 42) {
1818
+ break;
1819
+ }
1820
+ message.ExceptionStackTrace = reader.string();
1821
+ continue;
1822
+ }
1823
+ case 6: {
1824
+ if (tag !== 50) {
1825
+ break;
1826
+ }
1827
+ message.Data = AlertIncidentSummaryResponse.decode(reader, reader.uint32());
1828
+ continue;
1829
+ }
1830
+ }
1831
+ if ((tag & 7) === 4 || tag === 0) {
1832
+ break;
1833
+ }
1834
+ reader.skip(tag & 7);
1835
+ }
1836
+ return message;
1837
+ }
1838
+ finally {
1839
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1840
+ }
1841
+ },
1842
+ fromJSON(object) {
1843
+ return {
1844
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
1845
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
1846
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
1847
+ ? object.ValidationResults.map((e) => ValidationResult.fromJSON(e))
1848
+ : [],
1849
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
1850
+ ? object.ExceptionMessages.map((e) => globalThis.String(e))
1851
+ : [],
1852
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
1853
+ Data: isSet(object.Data) ? AlertIncidentSummaryResponse.fromJSON(object.Data) : undefined,
1854
+ };
1855
+ },
1856
+ toJSON(message) {
1857
+ const obj = {};
1858
+ if (message.CorrelationId !== undefined) {
1859
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
1860
+ }
1861
+ if (message.IsAuthorized !== false) {
1862
+ obj.IsAuthorized = message.IsAuthorized;
1863
+ }
1864
+ if (message.ValidationResults?.length) {
1865
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
1866
+ }
1867
+ if (message.ExceptionMessages?.length) {
1868
+ obj.ExceptionMessages = message.ExceptionMessages;
1869
+ }
1870
+ if (message.ExceptionStackTrace !== "") {
1871
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
1872
+ }
1873
+ if (message.Data !== undefined) {
1874
+ obj.Data = AlertIncidentSummaryResponse.toJSON(message.Data);
1875
+ }
1876
+ return obj;
1877
+ },
1878
+ create(base) {
1879
+ return QueryResultAlertIncidentSummaryResponse.fromPartial(base ?? {});
1880
+ },
1881
+ fromPartial(object) {
1882
+ const message = createBaseQueryResultAlertIncidentSummaryResponse();
1883
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1884
+ ? Guid.fromPartial(object.CorrelationId)
1885
+ : undefined;
1886
+ message.IsAuthorized = object.IsAuthorized ?? false;
1887
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
1888
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
1889
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
1890
+ message.Data = (object.Data !== undefined && object.Data !== null)
1891
+ ? AlertIncidentSummaryResponse.fromPartial(object.Data)
1892
+ : undefined;
1893
+ return message;
1894
+ },
1895
+ };
1896
+ function createBaseSerializableDateTimeOffset() {
1897
+ return { Value: "" };
1898
+ }
1899
+ export const SerializableDateTimeOffset = {
1900
+ encode(message, writer = new BinaryWriter()) {
1901
+ if (message.Value !== "") {
1902
+ writer.uint32(10).string(message.Value);
1903
+ }
1904
+ return writer;
1905
+ },
1906
+ decode(input, length) {
1907
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1908
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1909
+ if (previousRecursionDepth >= 100) {
1910
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1911
+ }
1912
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1913
+ try {
1914
+ const end = length === undefined ? reader.len : reader.pos + length;
1915
+ const message = createBaseSerializableDateTimeOffset();
1916
+ while (reader.pos < end) {
1917
+ const tag = reader.uint32();
1918
+ switch (tag >>> 3) {
1919
+ case 1: {
1920
+ if (tag !== 10) {
1921
+ break;
1922
+ }
1923
+ message.Value = reader.string();
1924
+ continue;
1925
+ }
1926
+ }
1927
+ if ((tag & 7) === 4 || tag === 0) {
1928
+ break;
1929
+ }
1930
+ reader.skip(tag & 7);
1931
+ }
1932
+ return message;
1933
+ }
1934
+ finally {
1935
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1936
+ }
1937
+ },
1938
+ fromJSON(object) {
1939
+ return { Value: isSet(object.Value) ? globalThis.String(object.Value) : "" };
1940
+ },
1941
+ toJSON(message) {
1942
+ const obj = {};
1943
+ if (message.Value !== "") {
1944
+ obj.Value = message.Value;
1945
+ }
1946
+ return obj;
1947
+ },
1948
+ create(base) {
1949
+ return SerializableDateTimeOffset.fromPartial(base ?? {});
1950
+ },
1951
+ fromPartial(object) {
1952
+ const message = createBaseSerializableDateTimeOffset();
1953
+ message.Value = object.Value ?? "";
1954
+ return message;
1955
+ },
1956
+ };
1957
+ function createBaseValidationResult() {
1958
+ return { Severity: 0, Message: "", Members: [] };
1959
+ }
1960
+ export const ValidationResult = {
1961
+ encode(message, writer = new BinaryWriter()) {
1962
+ if (message.Severity !== 0) {
1963
+ writer.uint32(8).int32(message.Severity);
1964
+ }
1965
+ if (message.Message !== "") {
1966
+ writer.uint32(18).string(message.Message);
1967
+ }
1968
+ for (const v of message.Members) {
1969
+ writer.uint32(26).string(v);
1970
+ }
1971
+ return writer;
1972
+ },
1973
+ decode(input, length) {
1974
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1975
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1976
+ if (previousRecursionDepth >= 100) {
1977
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1978
+ }
1979
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1980
+ try {
1981
+ const end = length === undefined ? reader.len : reader.pos + length;
1982
+ const message = createBaseValidationResult();
1983
+ while (reader.pos < end) {
1984
+ const tag = reader.uint32();
1985
+ switch (tag >>> 3) {
1986
+ case 1: {
1987
+ if (tag !== 8) {
1988
+ break;
1989
+ }
1990
+ message.Severity = reader.int32();
1991
+ continue;
1992
+ }
1993
+ case 2: {
1994
+ if (tag !== 18) {
1995
+ break;
1996
+ }
1997
+ message.Message = reader.string();
1998
+ continue;
1999
+ }
2000
+ case 3: {
2001
+ if (tag !== 26) {
2002
+ break;
2003
+ }
2004
+ message.Members.push(reader.string());
2005
+ continue;
2006
+ }
2007
+ }
2008
+ if ((tag & 7) === 4 || tag === 0) {
2009
+ break;
2010
+ }
2011
+ reader.skip(tag & 7);
2012
+ }
2013
+ return message;
2014
+ }
2015
+ finally {
2016
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2017
+ }
2018
+ },
2019
+ fromJSON(object) {
2020
+ return {
2021
+ Severity: isSet(object.Severity) ? validationResultSeverityFromJSON(object.Severity) : 0,
2022
+ Message: isSet(object.Message) ? globalThis.String(object.Message) : "",
2023
+ Members: globalThis.Array.isArray(object?.Members) ? object.Members.map((e) => globalThis.String(e)) : [],
2024
+ };
2025
+ },
2026
+ toJSON(message) {
2027
+ const obj = {};
2028
+ if (message.Severity !== 0) {
2029
+ obj.Severity = validationResultSeverityToJSON(message.Severity);
2030
+ }
2031
+ if (message.Message !== "") {
2032
+ obj.Message = message.Message;
2033
+ }
2034
+ if (message.Members?.length) {
2035
+ obj.Members = message.Members;
2036
+ }
2037
+ return obj;
2038
+ },
2039
+ create(base) {
2040
+ return ValidationResult.fromPartial(base ?? {});
2041
+ },
2042
+ fromPartial(object) {
2043
+ const message = createBaseValidationResult();
2044
+ message.Severity = object.Severity ?? 0;
2045
+ message.Message = object.Message ?? "";
2046
+ message.Members = object.Members?.map((e) => e) || [];
2047
+ return message;
2048
+ },
2049
+ };
2050
+ export const AlertsDefinition = {
2051
+ name: "Alerts",
2052
+ fullName: "Cratis.Chronicle.Contracts.Alerts.Alerts",
2053
+ methods: {
2054
+ getOpenIncident: {
2055
+ name: "GetOpenIncident",
2056
+ requestType: GetOpenIncidentRequest,
2057
+ requestStream: false,
2058
+ responseType: QueryResultAlertIncidentLookupResponse,
2059
+ responseStream: false,
2060
+ options: {},
2061
+ },
2062
+ getOpenIncidentCounts: {
2063
+ name: "GetOpenIncidentCounts",
2064
+ requestType: GetOpenIncidentCountsRequest,
2065
+ requestStream: false,
2066
+ responseType: QueryResultAlertIncidentSummaryResponse,
2067
+ responseStream: false,
2068
+ options: {},
2069
+ },
2070
+ getOpenIncidents: {
2071
+ name: "GetOpenIncidents",
2072
+ requestType: GetOpenIncidentsRequest,
2073
+ requestStream: false,
2074
+ responseType: QueryResultAlertIncidentPageResponse,
2075
+ responseStream: false,
2076
+ options: {},
2077
+ },
2078
+ },
2079
+ };
2080
+ function isSet(value) {
2081
+ return value !== null && value !== undefined;
2082
+ }
2083
+ //# sourceMappingURL=alerts.js.map