@cratis/chronicle.contracts 19.152.2 → 19.153.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 (35) hide show
  1. package/dist/cjs/generated/descriptorSet.js +1 -1
  2. package/dist/cjs/generated/descriptorSet.js.map +1 -1
  3. package/dist/cjs/generated/imports.d.ts +322 -0
  4. package/dist/cjs/generated/imports.d.ts.map +1 -0
  5. package/dist/cjs/generated/imports.js +3537 -0
  6. package/dist/cjs/generated/imports.js.map +1 -0
  7. package/dist/cjs/generated/index.d.ts +2 -0
  8. package/dist/cjs/generated/index.d.ts.map +1 -1
  9. package/dist/cjs/index.js +31 -0
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/esm/generated/descriptorSet.js +1 -1
  12. package/dist/esm/generated/descriptorSet.js.map +1 -1
  13. package/dist/esm/generated/imports.d.ts +322 -0
  14. package/dist/esm/generated/imports.d.ts.map +1 -0
  15. package/dist/esm/generated/imports.js +3505 -0
  16. package/dist/esm/generated/imports.js.map +1 -0
  17. package/dist/esm/generated/index.d.ts +2 -0
  18. package/dist/esm/generated/index.d.ts.map +1 -1
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/generated/descriptorSet.js +1 -1
  22. package/dist/generated/descriptorSet.js.map +1 -1
  23. package/dist/generated/imports.d.ts +322 -0
  24. package/dist/generated/imports.d.ts.map +1 -0
  25. package/dist/generated/imports.js +3504 -0
  26. package/dist/generated/imports.js.map +1 -0
  27. package/dist/generated/index.d.ts +2 -0
  28. package/dist/generated/index.d.ts.map +1 -1
  29. package/dist/generated/index.js +1 -0
  30. package/dist/generated/index.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/generated/descriptorSet.ts +1 -1
  33. package/generated/imports.ts +4065 -0
  34. package/generated/index.ts +3 -0
  35. package/package.json +1 -1
@@ -0,0 +1,3537 @@
1
+ 'use strict';
2
+
3
+ var wire = require('@bufbuild/protobuf/wire');
4
+ var bcl = require('./protobuf-net/bcl.js');
5
+
6
+ exports.ImportState = void 0;
7
+ (function (ImportState) {
8
+ ImportState[ImportState["Open"] = 0] = "Open";
9
+ ImportState[ImportState["Staging"] = 1] = "Staging";
10
+ ImportState[ImportState["Validating"] = 2] = "Validating";
11
+ ImportState[ImportState["Committing"] = 3] = "Committing";
12
+ ImportState[ImportState["Completed"] = 4] = "Completed";
13
+ ImportState[ImportState["Failed"] = 5] = "Failed";
14
+ ImportState[ImportState["Abandoned"] = 6] = "Abandoned";
15
+ ImportState[ImportState["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
16
+ })(exports.ImportState || (exports.ImportState = {}));
17
+ function importStateFromJSON(object) {
18
+ switch (object) {
19
+ case 0:
20
+ case "Open":
21
+ return exports.ImportState.Open;
22
+ case 1:
23
+ case "Staging":
24
+ return exports.ImportState.Staging;
25
+ case 2:
26
+ case "Validating":
27
+ return exports.ImportState.Validating;
28
+ case 3:
29
+ case "Committing":
30
+ return exports.ImportState.Committing;
31
+ case 4:
32
+ case "Completed":
33
+ return exports.ImportState.Completed;
34
+ case 5:
35
+ case "Failed":
36
+ return exports.ImportState.Failed;
37
+ case 6:
38
+ case "Abandoned":
39
+ return exports.ImportState.Abandoned;
40
+ case -1:
41
+ case "UNRECOGNIZED":
42
+ default:
43
+ return exports.ImportState.UNRECOGNIZED;
44
+ }
45
+ }
46
+ function importStateToJSON(object) {
47
+ switch (object) {
48
+ case exports.ImportState.Open:
49
+ return "Open";
50
+ case exports.ImportState.Staging:
51
+ return "Staging";
52
+ case exports.ImportState.Validating:
53
+ return "Validating";
54
+ case exports.ImportState.Committing:
55
+ return "Committing";
56
+ case exports.ImportState.Completed:
57
+ return "Completed";
58
+ case exports.ImportState.Failed:
59
+ return "Failed";
60
+ case exports.ImportState.Abandoned:
61
+ return "Abandoned";
62
+ case exports.ImportState.UNRECOGNIZED:
63
+ default:
64
+ return "UNRECOGNIZED";
65
+ }
66
+ }
67
+ exports.OnInvalidEvent = void 0;
68
+ (function (OnInvalidEvent) {
69
+ OnInvalidEvent[OnInvalidEvent["Reject"] = 0] = "Reject";
70
+ OnInvalidEvent[OnInvalidEvent["Skip"] = 1] = "Skip";
71
+ OnInvalidEvent[OnInvalidEvent["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
72
+ })(exports.OnInvalidEvent || (exports.OnInvalidEvent = {}));
73
+ function onInvalidEventFromJSON(object) {
74
+ switch (object) {
75
+ case 0:
76
+ case "Reject":
77
+ return exports.OnInvalidEvent.Reject;
78
+ case 1:
79
+ case "Skip":
80
+ return exports.OnInvalidEvent.Skip;
81
+ case -1:
82
+ case "UNRECOGNIZED":
83
+ default:
84
+ return exports.OnInvalidEvent.UNRECOGNIZED;
85
+ }
86
+ }
87
+ function onInvalidEventToJSON(object) {
88
+ switch (object) {
89
+ case exports.OnInvalidEvent.Reject:
90
+ return "Reject";
91
+ case exports.OnInvalidEvent.Skip:
92
+ return "Skip";
93
+ case exports.OnInvalidEvent.UNRECOGNIZED:
94
+ default:
95
+ return "UNRECOGNIZED";
96
+ }
97
+ }
98
+ exports.ValidationResultSeverity = void 0;
99
+ (function (ValidationResultSeverity) {
100
+ ValidationResultSeverity[ValidationResultSeverity["Unknown"] = 0] = "Unknown";
101
+ ValidationResultSeverity[ValidationResultSeverity["Information"] = 1] = "Information";
102
+ ValidationResultSeverity[ValidationResultSeverity["Warning"] = 2] = "Warning";
103
+ ValidationResultSeverity[ValidationResultSeverity["Error"] = 3] = "Error";
104
+ ValidationResultSeverity[ValidationResultSeverity["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
105
+ })(exports.ValidationResultSeverity || (exports.ValidationResultSeverity = {}));
106
+ function validationResultSeverityFromJSON(object) {
107
+ switch (object) {
108
+ case 0:
109
+ case "Unknown":
110
+ return exports.ValidationResultSeverity.Unknown;
111
+ case 1:
112
+ case "Information":
113
+ return exports.ValidationResultSeverity.Information;
114
+ case 2:
115
+ case "Warning":
116
+ return exports.ValidationResultSeverity.Warning;
117
+ case 3:
118
+ case "Error":
119
+ return exports.ValidationResultSeverity.Error;
120
+ case -1:
121
+ case "UNRECOGNIZED":
122
+ default:
123
+ return exports.ValidationResultSeverity.UNRECOGNIZED;
124
+ }
125
+ }
126
+ function validationResultSeverityToJSON(object) {
127
+ switch (object) {
128
+ case exports.ValidationResultSeverity.Unknown:
129
+ return "Unknown";
130
+ case exports.ValidationResultSeverity.Information:
131
+ return "Information";
132
+ case exports.ValidationResultSeverity.Warning:
133
+ return "Warning";
134
+ case exports.ValidationResultSeverity.Error:
135
+ return "Error";
136
+ case exports.ValidationResultSeverity.UNRECOGNIZED:
137
+ default:
138
+ return "UNRECOGNIZED";
139
+ }
140
+ }
141
+ function createBaseAbandonImportRequest() {
142
+ return { EventStore: "", Namespace: "", ImportId: undefined };
143
+ }
144
+ const AbandonImportRequest = {
145
+ encode(message, writer = new wire.BinaryWriter()) {
146
+ if (message.EventStore !== "") {
147
+ writer.uint32(10).string(message.EventStore);
148
+ }
149
+ if (message.Namespace !== "") {
150
+ writer.uint32(18).string(message.Namespace);
151
+ }
152
+ if (message.ImportId !== undefined) {
153
+ bcl.Guid.encode(message.ImportId, writer.uint32(26).fork()).join();
154
+ }
155
+ return writer;
156
+ },
157
+ decode(input, length) {
158
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
159
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
160
+ if (previousRecursionDepth >= 100) {
161
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
162
+ }
163
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
164
+ try {
165
+ const end = length === undefined ? reader.len : reader.pos + length;
166
+ const message = createBaseAbandonImportRequest();
167
+ while (reader.pos < end) {
168
+ const tag = reader.uint32();
169
+ switch (tag >>> 3) {
170
+ case 1: {
171
+ if (tag !== 10) {
172
+ break;
173
+ }
174
+ message.EventStore = reader.string();
175
+ continue;
176
+ }
177
+ case 2: {
178
+ if (tag !== 18) {
179
+ break;
180
+ }
181
+ message.Namespace = reader.string();
182
+ continue;
183
+ }
184
+ case 3: {
185
+ if (tag !== 26) {
186
+ break;
187
+ }
188
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
189
+ continue;
190
+ }
191
+ }
192
+ if ((tag & 7) === 4 || tag === 0) {
193
+ break;
194
+ }
195
+ reader.skip(tag & 7);
196
+ }
197
+ return message;
198
+ }
199
+ finally {
200
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
201
+ }
202
+ },
203
+ fromJSON(object) {
204
+ return {
205
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
206
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
207
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
208
+ };
209
+ },
210
+ toJSON(message) {
211
+ const obj = {};
212
+ if (message.EventStore !== "") {
213
+ obj.EventStore = message.EventStore;
214
+ }
215
+ if (message.Namespace !== "") {
216
+ obj.Namespace = message.Namespace;
217
+ }
218
+ if (message.ImportId !== undefined) {
219
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
220
+ }
221
+ return obj;
222
+ },
223
+ create(base) {
224
+ return AbandonImportRequest.fromPartial(base ?? {});
225
+ },
226
+ fromPartial(object) {
227
+ const message = createBaseAbandonImportRequest();
228
+ message.EventStore = object.EventStore ?? "";
229
+ message.Namespace = object.Namespace ?? "";
230
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
231
+ ? bcl.Guid.fromPartial(object.ImportId)
232
+ : undefined;
233
+ return message;
234
+ },
235
+ };
236
+ function createBaseAbandonImportResponse() {
237
+ return { ImportId: undefined, State: 0, Error: "" };
238
+ }
239
+ const AbandonImportResponse = {
240
+ encode(message, writer = new wire.BinaryWriter()) {
241
+ if (message.ImportId !== undefined) {
242
+ bcl.Guid.encode(message.ImportId, writer.uint32(10).fork()).join();
243
+ }
244
+ if (message.State !== 0) {
245
+ writer.uint32(16).int32(message.State);
246
+ }
247
+ if (message.Error !== "") {
248
+ writer.uint32(26).string(message.Error);
249
+ }
250
+ return writer;
251
+ },
252
+ decode(input, length) {
253
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
254
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
255
+ if (previousRecursionDepth >= 100) {
256
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
257
+ }
258
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
259
+ try {
260
+ const end = length === undefined ? reader.len : reader.pos + length;
261
+ const message = createBaseAbandonImportResponse();
262
+ while (reader.pos < end) {
263
+ const tag = reader.uint32();
264
+ switch (tag >>> 3) {
265
+ case 1: {
266
+ if (tag !== 10) {
267
+ break;
268
+ }
269
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
270
+ continue;
271
+ }
272
+ case 2: {
273
+ if (tag !== 16) {
274
+ break;
275
+ }
276
+ message.State = reader.int32();
277
+ continue;
278
+ }
279
+ case 3: {
280
+ if (tag !== 26) {
281
+ break;
282
+ }
283
+ message.Error = reader.string();
284
+ continue;
285
+ }
286
+ }
287
+ if ((tag & 7) === 4 || tag === 0) {
288
+ break;
289
+ }
290
+ reader.skip(tag & 7);
291
+ }
292
+ return message;
293
+ }
294
+ finally {
295
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
296
+ }
297
+ },
298
+ fromJSON(object) {
299
+ return {
300
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
301
+ State: isSet(object.State) ? importStateFromJSON(object.State) : 0,
302
+ Error: isSet(object.Error) ? globalThis.String(object.Error) : "",
303
+ };
304
+ },
305
+ toJSON(message) {
306
+ const obj = {};
307
+ if (message.ImportId !== undefined) {
308
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
309
+ }
310
+ if (message.State !== 0) {
311
+ obj.State = importStateToJSON(message.State);
312
+ }
313
+ if (message.Error !== "") {
314
+ obj.Error = message.Error;
315
+ }
316
+ return obj;
317
+ },
318
+ create(base) {
319
+ return AbandonImportResponse.fromPartial(base ?? {});
320
+ },
321
+ fromPartial(object) {
322
+ const message = createBaseAbandonImportResponse();
323
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
324
+ ? bcl.Guid.fromPartial(object.ImportId)
325
+ : undefined;
326
+ message.State = object.State ?? 0;
327
+ message.Error = object.Error ?? "";
328
+ return message;
329
+ },
330
+ };
331
+ function createBaseAddImportChunkRequest() {
332
+ return { EventStore: "", Namespace: "", ImportId: undefined, ChunkIndex: 0, FirstEventIndex: 0n, Events: [] };
333
+ }
334
+ const AddImportChunkRequest = {
335
+ encode(message, writer = new wire.BinaryWriter()) {
336
+ if (message.EventStore !== "") {
337
+ writer.uint32(10).string(message.EventStore);
338
+ }
339
+ if (message.Namespace !== "") {
340
+ writer.uint32(18).string(message.Namespace);
341
+ }
342
+ if (message.ImportId !== undefined) {
343
+ bcl.Guid.encode(message.ImportId, writer.uint32(26).fork()).join();
344
+ }
345
+ if (message.ChunkIndex !== 0) {
346
+ writer.uint32(32).int32(message.ChunkIndex);
347
+ }
348
+ if (message.FirstEventIndex !== 0n) {
349
+ if (BigInt.asIntN(64, message.FirstEventIndex) !== message.FirstEventIndex) {
350
+ throw new globalThis.Error("value provided for field message.FirstEventIndex of type int64 too large");
351
+ }
352
+ writer.uint32(40).int64(message.FirstEventIndex);
353
+ }
354
+ for (const v of message.Events) {
355
+ ImportEvent.encode(v, writer.uint32(50).fork()).join();
356
+ }
357
+ return writer;
358
+ },
359
+ decode(input, length) {
360
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
361
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
362
+ if (previousRecursionDepth >= 100) {
363
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
364
+ }
365
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
366
+ try {
367
+ const end = length === undefined ? reader.len : reader.pos + length;
368
+ const message = createBaseAddImportChunkRequest();
369
+ while (reader.pos < end) {
370
+ const tag = reader.uint32();
371
+ switch (tag >>> 3) {
372
+ case 1: {
373
+ if (tag !== 10) {
374
+ break;
375
+ }
376
+ message.EventStore = reader.string();
377
+ continue;
378
+ }
379
+ case 2: {
380
+ if (tag !== 18) {
381
+ break;
382
+ }
383
+ message.Namespace = reader.string();
384
+ continue;
385
+ }
386
+ case 3: {
387
+ if (tag !== 26) {
388
+ break;
389
+ }
390
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
391
+ continue;
392
+ }
393
+ case 4: {
394
+ if (tag !== 32) {
395
+ break;
396
+ }
397
+ message.ChunkIndex = reader.int32();
398
+ continue;
399
+ }
400
+ case 5: {
401
+ if (tag !== 40) {
402
+ break;
403
+ }
404
+ message.FirstEventIndex = reader.int64();
405
+ continue;
406
+ }
407
+ case 6: {
408
+ if (tag !== 50) {
409
+ break;
410
+ }
411
+ message.Events.push(ImportEvent.decode(reader, reader.uint32()));
412
+ continue;
413
+ }
414
+ }
415
+ if ((tag & 7) === 4 || tag === 0) {
416
+ break;
417
+ }
418
+ reader.skip(tag & 7);
419
+ }
420
+ return message;
421
+ }
422
+ finally {
423
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
424
+ }
425
+ },
426
+ fromJSON(object) {
427
+ return {
428
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
429
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
430
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
431
+ ChunkIndex: isSet(object.ChunkIndex) ? globalThis.Number(object.ChunkIndex) : 0,
432
+ FirstEventIndex: isSet(object.FirstEventIndex) ? BigInt(object.FirstEventIndex) : 0n,
433
+ Events: globalThis.Array.isArray(object?.Events) ? object.Events.map((e) => ImportEvent.fromJSON(e)) : [],
434
+ };
435
+ },
436
+ toJSON(message) {
437
+ const obj = {};
438
+ if (message.EventStore !== "") {
439
+ obj.EventStore = message.EventStore;
440
+ }
441
+ if (message.Namespace !== "") {
442
+ obj.Namespace = message.Namespace;
443
+ }
444
+ if (message.ImportId !== undefined) {
445
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
446
+ }
447
+ if (message.ChunkIndex !== 0) {
448
+ obj.ChunkIndex = Math.round(message.ChunkIndex);
449
+ }
450
+ if (message.FirstEventIndex !== 0n) {
451
+ obj.FirstEventIndex = message.FirstEventIndex.toString();
452
+ }
453
+ if (message.Events?.length) {
454
+ obj.Events = message.Events.map((e) => ImportEvent.toJSON(e));
455
+ }
456
+ return obj;
457
+ },
458
+ create(base) {
459
+ return AddImportChunkRequest.fromPartial(base ?? {});
460
+ },
461
+ fromPartial(object) {
462
+ const message = createBaseAddImportChunkRequest();
463
+ message.EventStore = object.EventStore ?? "";
464
+ message.Namespace = object.Namespace ?? "";
465
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
466
+ ? bcl.Guid.fromPartial(object.ImportId)
467
+ : undefined;
468
+ message.ChunkIndex = object.ChunkIndex ?? 0;
469
+ message.FirstEventIndex = (object.FirstEventIndex !== undefined && object.FirstEventIndex !== null)
470
+ ? BigInt(object.FirstEventIndex)
471
+ : 0n;
472
+ message.Events = object.Events?.map((e) => ImportEvent.fromPartial(e)) || [];
473
+ return message;
474
+ },
475
+ };
476
+ function createBaseAddImportChunkResponse() {
477
+ return { ChunkIndex: 0, AlreadyStaged: false, EventsReceived: 0, EventsStaged: 0, Rejections: [], Error: "" };
478
+ }
479
+ const AddImportChunkResponse = {
480
+ encode(message, writer = new wire.BinaryWriter()) {
481
+ if (message.ChunkIndex !== 0) {
482
+ writer.uint32(8).int32(message.ChunkIndex);
483
+ }
484
+ if (message.AlreadyStaged !== false) {
485
+ writer.uint32(16).bool(message.AlreadyStaged);
486
+ }
487
+ if (message.EventsReceived !== 0) {
488
+ writer.uint32(24).int32(message.EventsReceived);
489
+ }
490
+ if (message.EventsStaged !== 0) {
491
+ writer.uint32(32).int32(message.EventsStaged);
492
+ }
493
+ for (const v of message.Rejections) {
494
+ ImportEventRejection.encode(v, writer.uint32(42).fork()).join();
495
+ }
496
+ if (message.Error !== "") {
497
+ writer.uint32(50).string(message.Error);
498
+ }
499
+ return writer;
500
+ },
501
+ decode(input, length) {
502
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
503
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
504
+ if (previousRecursionDepth >= 100) {
505
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
506
+ }
507
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
508
+ try {
509
+ const end = length === undefined ? reader.len : reader.pos + length;
510
+ const message = createBaseAddImportChunkResponse();
511
+ while (reader.pos < end) {
512
+ const tag = reader.uint32();
513
+ switch (tag >>> 3) {
514
+ case 1: {
515
+ if (tag !== 8) {
516
+ break;
517
+ }
518
+ message.ChunkIndex = reader.int32();
519
+ continue;
520
+ }
521
+ case 2: {
522
+ if (tag !== 16) {
523
+ break;
524
+ }
525
+ message.AlreadyStaged = reader.bool();
526
+ continue;
527
+ }
528
+ case 3: {
529
+ if (tag !== 24) {
530
+ break;
531
+ }
532
+ message.EventsReceived = reader.int32();
533
+ continue;
534
+ }
535
+ case 4: {
536
+ if (tag !== 32) {
537
+ break;
538
+ }
539
+ message.EventsStaged = reader.int32();
540
+ continue;
541
+ }
542
+ case 5: {
543
+ if (tag !== 42) {
544
+ break;
545
+ }
546
+ message.Rejections.push(ImportEventRejection.decode(reader, reader.uint32()));
547
+ continue;
548
+ }
549
+ case 6: {
550
+ if (tag !== 50) {
551
+ break;
552
+ }
553
+ message.Error = reader.string();
554
+ continue;
555
+ }
556
+ }
557
+ if ((tag & 7) === 4 || tag === 0) {
558
+ break;
559
+ }
560
+ reader.skip(tag & 7);
561
+ }
562
+ return message;
563
+ }
564
+ finally {
565
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
566
+ }
567
+ },
568
+ fromJSON(object) {
569
+ return {
570
+ ChunkIndex: isSet(object.ChunkIndex) ? globalThis.Number(object.ChunkIndex) : 0,
571
+ AlreadyStaged: isSet(object.AlreadyStaged) ? globalThis.Boolean(object.AlreadyStaged) : false,
572
+ EventsReceived: isSet(object.EventsReceived) ? globalThis.Number(object.EventsReceived) : 0,
573
+ EventsStaged: isSet(object.EventsStaged) ? globalThis.Number(object.EventsStaged) : 0,
574
+ Rejections: globalThis.Array.isArray(object?.Rejections)
575
+ ? object.Rejections.map((e) => ImportEventRejection.fromJSON(e))
576
+ : [],
577
+ Error: isSet(object.Error) ? globalThis.String(object.Error) : "",
578
+ };
579
+ },
580
+ toJSON(message) {
581
+ const obj = {};
582
+ if (message.ChunkIndex !== 0) {
583
+ obj.ChunkIndex = Math.round(message.ChunkIndex);
584
+ }
585
+ if (message.AlreadyStaged !== false) {
586
+ obj.AlreadyStaged = message.AlreadyStaged;
587
+ }
588
+ if (message.EventsReceived !== 0) {
589
+ obj.EventsReceived = Math.round(message.EventsReceived);
590
+ }
591
+ if (message.EventsStaged !== 0) {
592
+ obj.EventsStaged = Math.round(message.EventsStaged);
593
+ }
594
+ if (message.Rejections?.length) {
595
+ obj.Rejections = message.Rejections.map((e) => ImportEventRejection.toJSON(e));
596
+ }
597
+ if (message.Error !== "") {
598
+ obj.Error = message.Error;
599
+ }
600
+ return obj;
601
+ },
602
+ create(base) {
603
+ return AddImportChunkResponse.fromPartial(base ?? {});
604
+ },
605
+ fromPartial(object) {
606
+ const message = createBaseAddImportChunkResponse();
607
+ message.ChunkIndex = object.ChunkIndex ?? 0;
608
+ message.AlreadyStaged = object.AlreadyStaged ?? false;
609
+ message.EventsReceived = object.EventsReceived ?? 0;
610
+ message.EventsStaged = object.EventsStaged ?? 0;
611
+ message.Rejections = object.Rejections?.map((e) => ImportEventRejection.fromPartial(e)) || [];
612
+ message.Error = object.Error ?? "";
613
+ return message;
614
+ },
615
+ };
616
+ function createBaseBeginImportRequest() {
617
+ return { EventStore: "", Namespace: "", EventSequenceId: "", OnInvalid: 0, ImportId: undefined };
618
+ }
619
+ const BeginImportRequest = {
620
+ encode(message, writer = new wire.BinaryWriter()) {
621
+ if (message.EventStore !== "") {
622
+ writer.uint32(10).string(message.EventStore);
623
+ }
624
+ if (message.Namespace !== "") {
625
+ writer.uint32(18).string(message.Namespace);
626
+ }
627
+ if (message.EventSequenceId !== "") {
628
+ writer.uint32(26).string(message.EventSequenceId);
629
+ }
630
+ if (message.OnInvalid !== 0) {
631
+ writer.uint32(32).int32(message.OnInvalid);
632
+ }
633
+ if (message.ImportId !== undefined) {
634
+ bcl.Guid.encode(message.ImportId, writer.uint32(42).fork()).join();
635
+ }
636
+ return writer;
637
+ },
638
+ decode(input, length) {
639
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
640
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
641
+ if (previousRecursionDepth >= 100) {
642
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
643
+ }
644
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
645
+ try {
646
+ const end = length === undefined ? reader.len : reader.pos + length;
647
+ const message = createBaseBeginImportRequest();
648
+ while (reader.pos < end) {
649
+ const tag = reader.uint32();
650
+ switch (tag >>> 3) {
651
+ case 1: {
652
+ if (tag !== 10) {
653
+ break;
654
+ }
655
+ message.EventStore = reader.string();
656
+ continue;
657
+ }
658
+ case 2: {
659
+ if (tag !== 18) {
660
+ break;
661
+ }
662
+ message.Namespace = reader.string();
663
+ continue;
664
+ }
665
+ case 3: {
666
+ if (tag !== 26) {
667
+ break;
668
+ }
669
+ message.EventSequenceId = reader.string();
670
+ continue;
671
+ }
672
+ case 4: {
673
+ if (tag !== 32) {
674
+ break;
675
+ }
676
+ message.OnInvalid = reader.int32();
677
+ continue;
678
+ }
679
+ case 5: {
680
+ if (tag !== 42) {
681
+ break;
682
+ }
683
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
684
+ continue;
685
+ }
686
+ }
687
+ if ((tag & 7) === 4 || tag === 0) {
688
+ break;
689
+ }
690
+ reader.skip(tag & 7);
691
+ }
692
+ return message;
693
+ }
694
+ finally {
695
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
696
+ }
697
+ },
698
+ fromJSON(object) {
699
+ return {
700
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
701
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
702
+ EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "",
703
+ OnInvalid: isSet(object.OnInvalid) ? onInvalidEventFromJSON(object.OnInvalid) : 0,
704
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
705
+ };
706
+ },
707
+ toJSON(message) {
708
+ const obj = {};
709
+ if (message.EventStore !== "") {
710
+ obj.EventStore = message.EventStore;
711
+ }
712
+ if (message.Namespace !== "") {
713
+ obj.Namespace = message.Namespace;
714
+ }
715
+ if (message.EventSequenceId !== "") {
716
+ obj.EventSequenceId = message.EventSequenceId;
717
+ }
718
+ if (message.OnInvalid !== 0) {
719
+ obj.OnInvalid = onInvalidEventToJSON(message.OnInvalid);
720
+ }
721
+ if (message.ImportId !== undefined) {
722
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
723
+ }
724
+ return obj;
725
+ },
726
+ create(base) {
727
+ return BeginImportRequest.fromPartial(base ?? {});
728
+ },
729
+ fromPartial(object) {
730
+ const message = createBaseBeginImportRequest();
731
+ message.EventStore = object.EventStore ?? "";
732
+ message.Namespace = object.Namespace ?? "";
733
+ message.EventSequenceId = object.EventSequenceId ?? "";
734
+ message.OnInvalid = object.OnInvalid ?? 0;
735
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
736
+ ? bcl.Guid.fromPartial(object.ImportId)
737
+ : undefined;
738
+ return message;
739
+ },
740
+ };
741
+ function createBaseBeginImportResponse() {
742
+ return { ImportId: undefined, State: 0, MaxChunkEvents: 0, MaxChunkBytes: 0, Error: "" };
743
+ }
744
+ const BeginImportResponse = {
745
+ encode(message, writer = new wire.BinaryWriter()) {
746
+ if (message.ImportId !== undefined) {
747
+ bcl.Guid.encode(message.ImportId, writer.uint32(10).fork()).join();
748
+ }
749
+ if (message.State !== 0) {
750
+ writer.uint32(16).int32(message.State);
751
+ }
752
+ if (message.MaxChunkEvents !== 0) {
753
+ writer.uint32(24).int32(message.MaxChunkEvents);
754
+ }
755
+ if (message.MaxChunkBytes !== 0) {
756
+ writer.uint32(32).int32(message.MaxChunkBytes);
757
+ }
758
+ if (message.Error !== "") {
759
+ writer.uint32(42).string(message.Error);
760
+ }
761
+ return writer;
762
+ },
763
+ decode(input, length) {
764
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
765
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
766
+ if (previousRecursionDepth >= 100) {
767
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
768
+ }
769
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
770
+ try {
771
+ const end = length === undefined ? reader.len : reader.pos + length;
772
+ const message = createBaseBeginImportResponse();
773
+ while (reader.pos < end) {
774
+ const tag = reader.uint32();
775
+ switch (tag >>> 3) {
776
+ case 1: {
777
+ if (tag !== 10) {
778
+ break;
779
+ }
780
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
781
+ continue;
782
+ }
783
+ case 2: {
784
+ if (tag !== 16) {
785
+ break;
786
+ }
787
+ message.State = reader.int32();
788
+ continue;
789
+ }
790
+ case 3: {
791
+ if (tag !== 24) {
792
+ break;
793
+ }
794
+ message.MaxChunkEvents = reader.int32();
795
+ continue;
796
+ }
797
+ case 4: {
798
+ if (tag !== 32) {
799
+ break;
800
+ }
801
+ message.MaxChunkBytes = reader.int32();
802
+ continue;
803
+ }
804
+ case 5: {
805
+ if (tag !== 42) {
806
+ break;
807
+ }
808
+ message.Error = reader.string();
809
+ continue;
810
+ }
811
+ }
812
+ if ((tag & 7) === 4 || tag === 0) {
813
+ break;
814
+ }
815
+ reader.skip(tag & 7);
816
+ }
817
+ return message;
818
+ }
819
+ finally {
820
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
821
+ }
822
+ },
823
+ fromJSON(object) {
824
+ return {
825
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
826
+ State: isSet(object.State) ? importStateFromJSON(object.State) : 0,
827
+ MaxChunkEvents: isSet(object.MaxChunkEvents) ? globalThis.Number(object.MaxChunkEvents) : 0,
828
+ MaxChunkBytes: isSet(object.MaxChunkBytes) ? globalThis.Number(object.MaxChunkBytes) : 0,
829
+ Error: isSet(object.Error) ? globalThis.String(object.Error) : "",
830
+ };
831
+ },
832
+ toJSON(message) {
833
+ const obj = {};
834
+ if (message.ImportId !== undefined) {
835
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
836
+ }
837
+ if (message.State !== 0) {
838
+ obj.State = importStateToJSON(message.State);
839
+ }
840
+ if (message.MaxChunkEvents !== 0) {
841
+ obj.MaxChunkEvents = Math.round(message.MaxChunkEvents);
842
+ }
843
+ if (message.MaxChunkBytes !== 0) {
844
+ obj.MaxChunkBytes = Math.round(message.MaxChunkBytes);
845
+ }
846
+ if (message.Error !== "") {
847
+ obj.Error = message.Error;
848
+ }
849
+ return obj;
850
+ },
851
+ create(base) {
852
+ return BeginImportResponse.fromPartial(base ?? {});
853
+ },
854
+ fromPartial(object) {
855
+ const message = createBaseBeginImportResponse();
856
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
857
+ ? bcl.Guid.fromPartial(object.ImportId)
858
+ : undefined;
859
+ message.State = object.State ?? 0;
860
+ message.MaxChunkEvents = object.MaxChunkEvents ?? 0;
861
+ message.MaxChunkBytes = object.MaxChunkBytes ?? 0;
862
+ message.Error = object.Error ?? "";
863
+ return message;
864
+ },
865
+ };
866
+ function createBaseCausation() {
867
+ return { Occurred: undefined, Type: "", Properties: {} };
868
+ }
869
+ const Causation = {
870
+ encode(message, writer = new wire.BinaryWriter()) {
871
+ if (message.Occurred !== undefined) {
872
+ SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(10).fork()).join();
873
+ }
874
+ if (message.Type !== "") {
875
+ writer.uint32(18).string(message.Type);
876
+ }
877
+ globalThis.Object.entries(message.Properties).forEach(([key, value]) => {
878
+ Causation_PropertiesEntry.encode({ key: key, value }, writer.uint32(26).fork()).join();
879
+ });
880
+ return writer;
881
+ },
882
+ decode(input, length) {
883
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
884
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
885
+ if (previousRecursionDepth >= 100) {
886
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
887
+ }
888
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
889
+ try {
890
+ const end = length === undefined ? reader.len : reader.pos + length;
891
+ const message = createBaseCausation();
892
+ while (reader.pos < end) {
893
+ const tag = reader.uint32();
894
+ switch (tag >>> 3) {
895
+ case 1: {
896
+ if (tag !== 10) {
897
+ break;
898
+ }
899
+ message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32());
900
+ continue;
901
+ }
902
+ case 2: {
903
+ if (tag !== 18) {
904
+ break;
905
+ }
906
+ message.Type = reader.string();
907
+ continue;
908
+ }
909
+ case 3: {
910
+ if (tag !== 26) {
911
+ break;
912
+ }
913
+ const entry3 = Causation_PropertiesEntry.decode(reader, reader.uint32());
914
+ if (entry3.value !== undefined) {
915
+ message.Properties[entry3.key] = entry3.value;
916
+ }
917
+ continue;
918
+ }
919
+ }
920
+ if ((tag & 7) === 4 || tag === 0) {
921
+ break;
922
+ }
923
+ reader.skip(tag & 7);
924
+ }
925
+ return message;
926
+ }
927
+ finally {
928
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
929
+ }
930
+ },
931
+ fromJSON(object) {
932
+ return {
933
+ Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined,
934
+ Type: isSet(object.Type) ? globalThis.String(object.Type) : "",
935
+ Properties: isObject(object.Properties)
936
+ ? globalThis.Object.entries(object.Properties).reduce((acc, [key, value]) => {
937
+ globalThis.Object.defineProperty(acc, key, {
938
+ value: globalThis.String(value),
939
+ enumerable: true,
940
+ configurable: true,
941
+ writable: true,
942
+ });
943
+ return acc;
944
+ }, {})
945
+ : {},
946
+ };
947
+ },
948
+ toJSON(message) {
949
+ const obj = {};
950
+ if (message.Occurred !== undefined) {
951
+ obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred);
952
+ }
953
+ if (message.Type !== "") {
954
+ obj.Type = message.Type;
955
+ }
956
+ if (message.Properties) {
957
+ const entries = globalThis.Object.entries(message.Properties);
958
+ if (entries.length > 0) {
959
+ obj.Properties = {};
960
+ entries.forEach(([k, v]) => {
961
+ obj.Properties[k] = v;
962
+ });
963
+ }
964
+ }
965
+ return obj;
966
+ },
967
+ create(base) {
968
+ return Causation.fromPartial(base ?? {});
969
+ },
970
+ fromPartial(object) {
971
+ const message = createBaseCausation();
972
+ message.Occurred = (object.Occurred !== undefined && object.Occurred !== null)
973
+ ? SerializableDateTimeOffset.fromPartial(object.Occurred)
974
+ : undefined;
975
+ message.Type = object.Type ?? "";
976
+ message.Properties = globalThis.Object.entries(object.Properties ?? {}).reduce((acc, [key, value]) => {
977
+ if (value !== undefined) {
978
+ acc[key] = globalThis.String(value);
979
+ }
980
+ return acc;
981
+ }, {});
982
+ return message;
983
+ },
984
+ };
985
+ function createBaseCausation_PropertiesEntry() {
986
+ return { key: "", value: "" };
987
+ }
988
+ const Causation_PropertiesEntry = {
989
+ encode(message, writer = new wire.BinaryWriter()) {
990
+ if (message.key !== "") {
991
+ writer.uint32(10).string(message.key);
992
+ }
993
+ if (message.value !== "") {
994
+ writer.uint32(18).string(message.value);
995
+ }
996
+ return writer;
997
+ },
998
+ decode(input, length) {
999
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
1000
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1001
+ if (previousRecursionDepth >= 100) {
1002
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1003
+ }
1004
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1005
+ try {
1006
+ const end = length === undefined ? reader.len : reader.pos + length;
1007
+ const message = createBaseCausation_PropertiesEntry();
1008
+ while (reader.pos < end) {
1009
+ const tag = reader.uint32();
1010
+ switch (tag >>> 3) {
1011
+ case 1: {
1012
+ if (tag !== 10) {
1013
+ break;
1014
+ }
1015
+ message.key = reader.string();
1016
+ continue;
1017
+ }
1018
+ case 2: {
1019
+ if (tag !== 18) {
1020
+ break;
1021
+ }
1022
+ message.value = reader.string();
1023
+ continue;
1024
+ }
1025
+ }
1026
+ if ((tag & 7) === 4 || tag === 0) {
1027
+ break;
1028
+ }
1029
+ reader.skip(tag & 7);
1030
+ }
1031
+ return message;
1032
+ }
1033
+ finally {
1034
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1035
+ }
1036
+ },
1037
+ fromJSON(object) {
1038
+ return {
1039
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
1040
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
1041
+ };
1042
+ },
1043
+ toJSON(message) {
1044
+ const obj = {};
1045
+ if (message.key !== "") {
1046
+ obj.key = message.key;
1047
+ }
1048
+ if (message.value !== "") {
1049
+ obj.value = message.value;
1050
+ }
1051
+ return obj;
1052
+ },
1053
+ create(base) {
1054
+ return Causation_PropertiesEntry.fromPartial(base ?? {});
1055
+ },
1056
+ fromPartial(object) {
1057
+ const message = createBaseCausation_PropertiesEntry();
1058
+ message.key = object.key ?? "";
1059
+ message.value = object.value ?? "";
1060
+ return message;
1061
+ },
1062
+ };
1063
+ function createBaseCommandResultAbandonImportResponse() {
1064
+ return {
1065
+ CorrelationId: undefined,
1066
+ IsAuthorized: false,
1067
+ ValidationResults: [],
1068
+ ExceptionMessages: [],
1069
+ ExceptionStackTrace: "",
1070
+ AuthorizationFailureReason: "",
1071
+ Response: undefined,
1072
+ };
1073
+ }
1074
+ const CommandResultAbandonImportResponse = {
1075
+ encode(message, writer = new wire.BinaryWriter()) {
1076
+ if (message.CorrelationId !== undefined) {
1077
+ bcl.Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1078
+ }
1079
+ if (message.IsAuthorized !== false) {
1080
+ writer.uint32(16).bool(message.IsAuthorized);
1081
+ }
1082
+ for (const v of message.ValidationResults) {
1083
+ ValidationResult.encode(v, writer.uint32(26).fork()).join();
1084
+ }
1085
+ for (const v of message.ExceptionMessages) {
1086
+ writer.uint32(34).string(v);
1087
+ }
1088
+ if (message.ExceptionStackTrace !== "") {
1089
+ writer.uint32(42).string(message.ExceptionStackTrace);
1090
+ }
1091
+ if (message.AuthorizationFailureReason !== "") {
1092
+ writer.uint32(50).string(message.AuthorizationFailureReason);
1093
+ }
1094
+ if (message.Response !== undefined) {
1095
+ AbandonImportResponse.encode(message.Response, writer.uint32(58).fork()).join();
1096
+ }
1097
+ return writer;
1098
+ },
1099
+ decode(input, length) {
1100
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
1101
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1102
+ if (previousRecursionDepth >= 100) {
1103
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1104
+ }
1105
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1106
+ try {
1107
+ const end = length === undefined ? reader.len : reader.pos + length;
1108
+ const message = createBaseCommandResultAbandonImportResponse();
1109
+ while (reader.pos < end) {
1110
+ const tag = reader.uint32();
1111
+ switch (tag >>> 3) {
1112
+ case 1: {
1113
+ if (tag !== 10) {
1114
+ break;
1115
+ }
1116
+ message.CorrelationId = bcl.Guid.decode(reader, reader.uint32());
1117
+ continue;
1118
+ }
1119
+ case 2: {
1120
+ if (tag !== 16) {
1121
+ break;
1122
+ }
1123
+ message.IsAuthorized = reader.bool();
1124
+ continue;
1125
+ }
1126
+ case 3: {
1127
+ if (tag !== 26) {
1128
+ break;
1129
+ }
1130
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
1131
+ continue;
1132
+ }
1133
+ case 4: {
1134
+ if (tag !== 34) {
1135
+ break;
1136
+ }
1137
+ message.ExceptionMessages.push(reader.string());
1138
+ continue;
1139
+ }
1140
+ case 5: {
1141
+ if (tag !== 42) {
1142
+ break;
1143
+ }
1144
+ message.ExceptionStackTrace = reader.string();
1145
+ continue;
1146
+ }
1147
+ case 6: {
1148
+ if (tag !== 50) {
1149
+ break;
1150
+ }
1151
+ message.AuthorizationFailureReason = reader.string();
1152
+ continue;
1153
+ }
1154
+ case 7: {
1155
+ if (tag !== 58) {
1156
+ break;
1157
+ }
1158
+ message.Response = AbandonImportResponse.decode(reader, reader.uint32());
1159
+ continue;
1160
+ }
1161
+ }
1162
+ if ((tag & 7) === 4 || tag === 0) {
1163
+ break;
1164
+ }
1165
+ reader.skip(tag & 7);
1166
+ }
1167
+ return message;
1168
+ }
1169
+ finally {
1170
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1171
+ }
1172
+ },
1173
+ fromJSON(object) {
1174
+ return {
1175
+ CorrelationId: isSet(object.CorrelationId) ? bcl.Guid.fromJSON(object.CorrelationId) : undefined,
1176
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
1177
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
1178
+ ? object.ValidationResults.map((e) => ValidationResult.fromJSON(e))
1179
+ : [],
1180
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
1181
+ ? object.ExceptionMessages.map((e) => globalThis.String(e))
1182
+ : [],
1183
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
1184
+ AuthorizationFailureReason: isSet(object.AuthorizationFailureReason)
1185
+ ? globalThis.String(object.AuthorizationFailureReason)
1186
+ : "",
1187
+ Response: isSet(object.Response) ? AbandonImportResponse.fromJSON(object.Response) : undefined,
1188
+ };
1189
+ },
1190
+ toJSON(message) {
1191
+ const obj = {};
1192
+ if (message.CorrelationId !== undefined) {
1193
+ obj.CorrelationId = bcl.Guid.toJSON(message.CorrelationId);
1194
+ }
1195
+ if (message.IsAuthorized !== false) {
1196
+ obj.IsAuthorized = message.IsAuthorized;
1197
+ }
1198
+ if (message.ValidationResults?.length) {
1199
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
1200
+ }
1201
+ if (message.ExceptionMessages?.length) {
1202
+ obj.ExceptionMessages = message.ExceptionMessages;
1203
+ }
1204
+ if (message.ExceptionStackTrace !== "") {
1205
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
1206
+ }
1207
+ if (message.AuthorizationFailureReason !== "") {
1208
+ obj.AuthorizationFailureReason = message.AuthorizationFailureReason;
1209
+ }
1210
+ if (message.Response !== undefined) {
1211
+ obj.Response = AbandonImportResponse.toJSON(message.Response);
1212
+ }
1213
+ return obj;
1214
+ },
1215
+ create(base) {
1216
+ return CommandResultAbandonImportResponse.fromPartial(base ?? {});
1217
+ },
1218
+ fromPartial(object) {
1219
+ const message = createBaseCommandResultAbandonImportResponse();
1220
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1221
+ ? bcl.Guid.fromPartial(object.CorrelationId)
1222
+ : undefined;
1223
+ message.IsAuthorized = object.IsAuthorized ?? false;
1224
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
1225
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
1226
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
1227
+ message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? "";
1228
+ message.Response = (object.Response !== undefined && object.Response !== null)
1229
+ ? AbandonImportResponse.fromPartial(object.Response)
1230
+ : undefined;
1231
+ return message;
1232
+ },
1233
+ };
1234
+ function createBaseCommandResultAddImportChunkResponse() {
1235
+ return {
1236
+ CorrelationId: undefined,
1237
+ IsAuthorized: false,
1238
+ ValidationResults: [],
1239
+ ExceptionMessages: [],
1240
+ ExceptionStackTrace: "",
1241
+ AuthorizationFailureReason: "",
1242
+ Response: undefined,
1243
+ };
1244
+ }
1245
+ const CommandResultAddImportChunkResponse = {
1246
+ encode(message, writer = new wire.BinaryWriter()) {
1247
+ if (message.CorrelationId !== undefined) {
1248
+ bcl.Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1249
+ }
1250
+ if (message.IsAuthorized !== false) {
1251
+ writer.uint32(16).bool(message.IsAuthorized);
1252
+ }
1253
+ for (const v of message.ValidationResults) {
1254
+ ValidationResult.encode(v, writer.uint32(26).fork()).join();
1255
+ }
1256
+ for (const v of message.ExceptionMessages) {
1257
+ writer.uint32(34).string(v);
1258
+ }
1259
+ if (message.ExceptionStackTrace !== "") {
1260
+ writer.uint32(42).string(message.ExceptionStackTrace);
1261
+ }
1262
+ if (message.AuthorizationFailureReason !== "") {
1263
+ writer.uint32(50).string(message.AuthorizationFailureReason);
1264
+ }
1265
+ if (message.Response !== undefined) {
1266
+ AddImportChunkResponse.encode(message.Response, writer.uint32(58).fork()).join();
1267
+ }
1268
+ return writer;
1269
+ },
1270
+ decode(input, length) {
1271
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
1272
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1273
+ if (previousRecursionDepth >= 100) {
1274
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1275
+ }
1276
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1277
+ try {
1278
+ const end = length === undefined ? reader.len : reader.pos + length;
1279
+ const message = createBaseCommandResultAddImportChunkResponse();
1280
+ while (reader.pos < end) {
1281
+ const tag = reader.uint32();
1282
+ switch (tag >>> 3) {
1283
+ case 1: {
1284
+ if (tag !== 10) {
1285
+ break;
1286
+ }
1287
+ message.CorrelationId = bcl.Guid.decode(reader, reader.uint32());
1288
+ continue;
1289
+ }
1290
+ case 2: {
1291
+ if (tag !== 16) {
1292
+ break;
1293
+ }
1294
+ message.IsAuthorized = reader.bool();
1295
+ continue;
1296
+ }
1297
+ case 3: {
1298
+ if (tag !== 26) {
1299
+ break;
1300
+ }
1301
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
1302
+ continue;
1303
+ }
1304
+ case 4: {
1305
+ if (tag !== 34) {
1306
+ break;
1307
+ }
1308
+ message.ExceptionMessages.push(reader.string());
1309
+ continue;
1310
+ }
1311
+ case 5: {
1312
+ if (tag !== 42) {
1313
+ break;
1314
+ }
1315
+ message.ExceptionStackTrace = reader.string();
1316
+ continue;
1317
+ }
1318
+ case 6: {
1319
+ if (tag !== 50) {
1320
+ break;
1321
+ }
1322
+ message.AuthorizationFailureReason = reader.string();
1323
+ continue;
1324
+ }
1325
+ case 7: {
1326
+ if (tag !== 58) {
1327
+ break;
1328
+ }
1329
+ message.Response = AddImportChunkResponse.decode(reader, reader.uint32());
1330
+ continue;
1331
+ }
1332
+ }
1333
+ if ((tag & 7) === 4 || tag === 0) {
1334
+ break;
1335
+ }
1336
+ reader.skip(tag & 7);
1337
+ }
1338
+ return message;
1339
+ }
1340
+ finally {
1341
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1342
+ }
1343
+ },
1344
+ fromJSON(object) {
1345
+ return {
1346
+ CorrelationId: isSet(object.CorrelationId) ? bcl.Guid.fromJSON(object.CorrelationId) : undefined,
1347
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
1348
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
1349
+ ? object.ValidationResults.map((e) => ValidationResult.fromJSON(e))
1350
+ : [],
1351
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
1352
+ ? object.ExceptionMessages.map((e) => globalThis.String(e))
1353
+ : [],
1354
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
1355
+ AuthorizationFailureReason: isSet(object.AuthorizationFailureReason)
1356
+ ? globalThis.String(object.AuthorizationFailureReason)
1357
+ : "",
1358
+ Response: isSet(object.Response) ? AddImportChunkResponse.fromJSON(object.Response) : undefined,
1359
+ };
1360
+ },
1361
+ toJSON(message) {
1362
+ const obj = {};
1363
+ if (message.CorrelationId !== undefined) {
1364
+ obj.CorrelationId = bcl.Guid.toJSON(message.CorrelationId);
1365
+ }
1366
+ if (message.IsAuthorized !== false) {
1367
+ obj.IsAuthorized = message.IsAuthorized;
1368
+ }
1369
+ if (message.ValidationResults?.length) {
1370
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
1371
+ }
1372
+ if (message.ExceptionMessages?.length) {
1373
+ obj.ExceptionMessages = message.ExceptionMessages;
1374
+ }
1375
+ if (message.ExceptionStackTrace !== "") {
1376
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
1377
+ }
1378
+ if (message.AuthorizationFailureReason !== "") {
1379
+ obj.AuthorizationFailureReason = message.AuthorizationFailureReason;
1380
+ }
1381
+ if (message.Response !== undefined) {
1382
+ obj.Response = AddImportChunkResponse.toJSON(message.Response);
1383
+ }
1384
+ return obj;
1385
+ },
1386
+ create(base) {
1387
+ return CommandResultAddImportChunkResponse.fromPartial(base ?? {});
1388
+ },
1389
+ fromPartial(object) {
1390
+ const message = createBaseCommandResultAddImportChunkResponse();
1391
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1392
+ ? bcl.Guid.fromPartial(object.CorrelationId)
1393
+ : undefined;
1394
+ message.IsAuthorized = object.IsAuthorized ?? false;
1395
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
1396
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
1397
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
1398
+ message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? "";
1399
+ message.Response = (object.Response !== undefined && object.Response !== null)
1400
+ ? AddImportChunkResponse.fromPartial(object.Response)
1401
+ : undefined;
1402
+ return message;
1403
+ },
1404
+ };
1405
+ function createBaseCommandResultBeginImportResponse() {
1406
+ return {
1407
+ CorrelationId: undefined,
1408
+ IsAuthorized: false,
1409
+ ValidationResults: [],
1410
+ ExceptionMessages: [],
1411
+ ExceptionStackTrace: "",
1412
+ AuthorizationFailureReason: "",
1413
+ Response: undefined,
1414
+ };
1415
+ }
1416
+ const CommandResultBeginImportResponse = {
1417
+ encode(message, writer = new wire.BinaryWriter()) {
1418
+ if (message.CorrelationId !== undefined) {
1419
+ bcl.Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1420
+ }
1421
+ if (message.IsAuthorized !== false) {
1422
+ writer.uint32(16).bool(message.IsAuthorized);
1423
+ }
1424
+ for (const v of message.ValidationResults) {
1425
+ ValidationResult.encode(v, writer.uint32(26).fork()).join();
1426
+ }
1427
+ for (const v of message.ExceptionMessages) {
1428
+ writer.uint32(34).string(v);
1429
+ }
1430
+ if (message.ExceptionStackTrace !== "") {
1431
+ writer.uint32(42).string(message.ExceptionStackTrace);
1432
+ }
1433
+ if (message.AuthorizationFailureReason !== "") {
1434
+ writer.uint32(50).string(message.AuthorizationFailureReason);
1435
+ }
1436
+ if (message.Response !== undefined) {
1437
+ BeginImportResponse.encode(message.Response, writer.uint32(58).fork()).join();
1438
+ }
1439
+ return writer;
1440
+ },
1441
+ decode(input, length) {
1442
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
1443
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1444
+ if (previousRecursionDepth >= 100) {
1445
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1446
+ }
1447
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1448
+ try {
1449
+ const end = length === undefined ? reader.len : reader.pos + length;
1450
+ const message = createBaseCommandResultBeginImportResponse();
1451
+ while (reader.pos < end) {
1452
+ const tag = reader.uint32();
1453
+ switch (tag >>> 3) {
1454
+ case 1: {
1455
+ if (tag !== 10) {
1456
+ break;
1457
+ }
1458
+ message.CorrelationId = bcl.Guid.decode(reader, reader.uint32());
1459
+ continue;
1460
+ }
1461
+ case 2: {
1462
+ if (tag !== 16) {
1463
+ break;
1464
+ }
1465
+ message.IsAuthorized = reader.bool();
1466
+ continue;
1467
+ }
1468
+ case 3: {
1469
+ if (tag !== 26) {
1470
+ break;
1471
+ }
1472
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
1473
+ continue;
1474
+ }
1475
+ case 4: {
1476
+ if (tag !== 34) {
1477
+ break;
1478
+ }
1479
+ message.ExceptionMessages.push(reader.string());
1480
+ continue;
1481
+ }
1482
+ case 5: {
1483
+ if (tag !== 42) {
1484
+ break;
1485
+ }
1486
+ message.ExceptionStackTrace = reader.string();
1487
+ continue;
1488
+ }
1489
+ case 6: {
1490
+ if (tag !== 50) {
1491
+ break;
1492
+ }
1493
+ message.AuthorizationFailureReason = reader.string();
1494
+ continue;
1495
+ }
1496
+ case 7: {
1497
+ if (tag !== 58) {
1498
+ break;
1499
+ }
1500
+ message.Response = BeginImportResponse.decode(reader, reader.uint32());
1501
+ continue;
1502
+ }
1503
+ }
1504
+ if ((tag & 7) === 4 || tag === 0) {
1505
+ break;
1506
+ }
1507
+ reader.skip(tag & 7);
1508
+ }
1509
+ return message;
1510
+ }
1511
+ finally {
1512
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1513
+ }
1514
+ },
1515
+ fromJSON(object) {
1516
+ return {
1517
+ CorrelationId: isSet(object.CorrelationId) ? bcl.Guid.fromJSON(object.CorrelationId) : undefined,
1518
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
1519
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
1520
+ ? object.ValidationResults.map((e) => ValidationResult.fromJSON(e))
1521
+ : [],
1522
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
1523
+ ? object.ExceptionMessages.map((e) => globalThis.String(e))
1524
+ : [],
1525
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
1526
+ AuthorizationFailureReason: isSet(object.AuthorizationFailureReason)
1527
+ ? globalThis.String(object.AuthorizationFailureReason)
1528
+ : "",
1529
+ Response: isSet(object.Response) ? BeginImportResponse.fromJSON(object.Response) : undefined,
1530
+ };
1531
+ },
1532
+ toJSON(message) {
1533
+ const obj = {};
1534
+ if (message.CorrelationId !== undefined) {
1535
+ obj.CorrelationId = bcl.Guid.toJSON(message.CorrelationId);
1536
+ }
1537
+ if (message.IsAuthorized !== false) {
1538
+ obj.IsAuthorized = message.IsAuthorized;
1539
+ }
1540
+ if (message.ValidationResults?.length) {
1541
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
1542
+ }
1543
+ if (message.ExceptionMessages?.length) {
1544
+ obj.ExceptionMessages = message.ExceptionMessages;
1545
+ }
1546
+ if (message.ExceptionStackTrace !== "") {
1547
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
1548
+ }
1549
+ if (message.AuthorizationFailureReason !== "") {
1550
+ obj.AuthorizationFailureReason = message.AuthorizationFailureReason;
1551
+ }
1552
+ if (message.Response !== undefined) {
1553
+ obj.Response = BeginImportResponse.toJSON(message.Response);
1554
+ }
1555
+ return obj;
1556
+ },
1557
+ create(base) {
1558
+ return CommandResultBeginImportResponse.fromPartial(base ?? {});
1559
+ },
1560
+ fromPartial(object) {
1561
+ const message = createBaseCommandResultBeginImportResponse();
1562
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1563
+ ? bcl.Guid.fromPartial(object.CorrelationId)
1564
+ : undefined;
1565
+ message.IsAuthorized = object.IsAuthorized ?? false;
1566
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
1567
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
1568
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
1569
+ message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? "";
1570
+ message.Response = (object.Response !== undefined && object.Response !== null)
1571
+ ? BeginImportResponse.fromPartial(object.Response)
1572
+ : undefined;
1573
+ return message;
1574
+ },
1575
+ };
1576
+ function createBaseCompleteImportRequest() {
1577
+ return { EventStore: "", Namespace: "", ImportId: undefined, ExpectedChunks: 0, ExpectedEvents: 0n };
1578
+ }
1579
+ const CompleteImportRequest = {
1580
+ encode(message, writer = new wire.BinaryWriter()) {
1581
+ if (message.EventStore !== "") {
1582
+ writer.uint32(10).string(message.EventStore);
1583
+ }
1584
+ if (message.Namespace !== "") {
1585
+ writer.uint32(18).string(message.Namespace);
1586
+ }
1587
+ if (message.ImportId !== undefined) {
1588
+ bcl.Guid.encode(message.ImportId, writer.uint32(26).fork()).join();
1589
+ }
1590
+ if (message.ExpectedChunks !== 0) {
1591
+ writer.uint32(32).int32(message.ExpectedChunks);
1592
+ }
1593
+ if (message.ExpectedEvents !== 0n) {
1594
+ if (BigInt.asIntN(64, message.ExpectedEvents) !== message.ExpectedEvents) {
1595
+ throw new globalThis.Error("value provided for field message.ExpectedEvents of type int64 too large");
1596
+ }
1597
+ writer.uint32(40).int64(message.ExpectedEvents);
1598
+ }
1599
+ return writer;
1600
+ },
1601
+ decode(input, length) {
1602
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
1603
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1604
+ if (previousRecursionDepth >= 100) {
1605
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1606
+ }
1607
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1608
+ try {
1609
+ const end = length === undefined ? reader.len : reader.pos + length;
1610
+ const message = createBaseCompleteImportRequest();
1611
+ while (reader.pos < end) {
1612
+ const tag = reader.uint32();
1613
+ switch (tag >>> 3) {
1614
+ case 1: {
1615
+ if (tag !== 10) {
1616
+ break;
1617
+ }
1618
+ message.EventStore = reader.string();
1619
+ continue;
1620
+ }
1621
+ case 2: {
1622
+ if (tag !== 18) {
1623
+ break;
1624
+ }
1625
+ message.Namespace = reader.string();
1626
+ continue;
1627
+ }
1628
+ case 3: {
1629
+ if (tag !== 26) {
1630
+ break;
1631
+ }
1632
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
1633
+ continue;
1634
+ }
1635
+ case 4: {
1636
+ if (tag !== 32) {
1637
+ break;
1638
+ }
1639
+ message.ExpectedChunks = reader.int32();
1640
+ continue;
1641
+ }
1642
+ case 5: {
1643
+ if (tag !== 40) {
1644
+ break;
1645
+ }
1646
+ message.ExpectedEvents = reader.int64();
1647
+ continue;
1648
+ }
1649
+ }
1650
+ if ((tag & 7) === 4 || tag === 0) {
1651
+ break;
1652
+ }
1653
+ reader.skip(tag & 7);
1654
+ }
1655
+ return message;
1656
+ }
1657
+ finally {
1658
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1659
+ }
1660
+ },
1661
+ fromJSON(object) {
1662
+ return {
1663
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1664
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1665
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
1666
+ ExpectedChunks: isSet(object.ExpectedChunks) ? globalThis.Number(object.ExpectedChunks) : 0,
1667
+ ExpectedEvents: isSet(object.ExpectedEvents) ? BigInt(object.ExpectedEvents) : 0n,
1668
+ };
1669
+ },
1670
+ toJSON(message) {
1671
+ const obj = {};
1672
+ if (message.EventStore !== "") {
1673
+ obj.EventStore = message.EventStore;
1674
+ }
1675
+ if (message.Namespace !== "") {
1676
+ obj.Namespace = message.Namespace;
1677
+ }
1678
+ if (message.ImportId !== undefined) {
1679
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
1680
+ }
1681
+ if (message.ExpectedChunks !== 0) {
1682
+ obj.ExpectedChunks = Math.round(message.ExpectedChunks);
1683
+ }
1684
+ if (message.ExpectedEvents !== 0n) {
1685
+ obj.ExpectedEvents = message.ExpectedEvents.toString();
1686
+ }
1687
+ return obj;
1688
+ },
1689
+ create(base) {
1690
+ return CompleteImportRequest.fromPartial(base ?? {});
1691
+ },
1692
+ fromPartial(object) {
1693
+ const message = createBaseCompleteImportRequest();
1694
+ message.EventStore = object.EventStore ?? "";
1695
+ message.Namespace = object.Namespace ?? "";
1696
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
1697
+ ? bcl.Guid.fromPartial(object.ImportId)
1698
+ : undefined;
1699
+ message.ExpectedChunks = object.ExpectedChunks ?? 0;
1700
+ message.ExpectedEvents = (object.ExpectedEvents !== undefined && object.ExpectedEvents !== null)
1701
+ ? BigInt(object.ExpectedEvents)
1702
+ : 0n;
1703
+ return message;
1704
+ },
1705
+ };
1706
+ function createBaseEventType() {
1707
+ return { Id: "", Generation: 0, Tombstone: false };
1708
+ }
1709
+ const EventType = {
1710
+ encode(message, writer = new wire.BinaryWriter()) {
1711
+ if (message.Id !== "") {
1712
+ writer.uint32(10).string(message.Id);
1713
+ }
1714
+ if (message.Generation !== 0) {
1715
+ writer.uint32(16).uint32(message.Generation);
1716
+ }
1717
+ if (message.Tombstone !== false) {
1718
+ writer.uint32(24).bool(message.Tombstone);
1719
+ }
1720
+ return writer;
1721
+ },
1722
+ decode(input, length) {
1723
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
1724
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1725
+ if (previousRecursionDepth >= 100) {
1726
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1727
+ }
1728
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1729
+ try {
1730
+ const end = length === undefined ? reader.len : reader.pos + length;
1731
+ const message = createBaseEventType();
1732
+ while (reader.pos < end) {
1733
+ const tag = reader.uint32();
1734
+ switch (tag >>> 3) {
1735
+ case 1: {
1736
+ if (tag !== 10) {
1737
+ break;
1738
+ }
1739
+ message.Id = reader.string();
1740
+ continue;
1741
+ }
1742
+ case 2: {
1743
+ if (tag !== 16) {
1744
+ break;
1745
+ }
1746
+ message.Generation = reader.uint32();
1747
+ continue;
1748
+ }
1749
+ case 3: {
1750
+ if (tag !== 24) {
1751
+ break;
1752
+ }
1753
+ message.Tombstone = reader.bool();
1754
+ continue;
1755
+ }
1756
+ }
1757
+ if ((tag & 7) === 4 || tag === 0) {
1758
+ break;
1759
+ }
1760
+ reader.skip(tag & 7);
1761
+ }
1762
+ return message;
1763
+ }
1764
+ finally {
1765
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1766
+ }
1767
+ },
1768
+ fromJSON(object) {
1769
+ return {
1770
+ Id: isSet(object.Id) ? globalThis.String(object.Id) : "",
1771
+ Generation: isSet(object.Generation) ? globalThis.Number(object.Generation) : 0,
1772
+ Tombstone: isSet(object.Tombstone) ? globalThis.Boolean(object.Tombstone) : false,
1773
+ };
1774
+ },
1775
+ toJSON(message) {
1776
+ const obj = {};
1777
+ if (message.Id !== "") {
1778
+ obj.Id = message.Id;
1779
+ }
1780
+ if (message.Generation !== 0) {
1781
+ obj.Generation = Math.round(message.Generation);
1782
+ }
1783
+ if (message.Tombstone !== false) {
1784
+ obj.Tombstone = message.Tombstone;
1785
+ }
1786
+ return obj;
1787
+ },
1788
+ create(base) {
1789
+ return EventType.fromPartial(base ?? {});
1790
+ },
1791
+ fromPartial(object) {
1792
+ const message = createBaseEventType();
1793
+ message.Id = object.Id ?? "";
1794
+ message.Generation = object.Generation ?? 0;
1795
+ message.Tombstone = object.Tombstone ?? false;
1796
+ return message;
1797
+ },
1798
+ };
1799
+ function createBaseGetImportRequest() {
1800
+ return { EventStore: "", Namespace: "", ImportId: undefined };
1801
+ }
1802
+ const GetImportRequest = {
1803
+ encode(message, writer = new wire.BinaryWriter()) {
1804
+ if (message.EventStore !== "") {
1805
+ writer.uint32(10).string(message.EventStore);
1806
+ }
1807
+ if (message.Namespace !== "") {
1808
+ writer.uint32(18).string(message.Namespace);
1809
+ }
1810
+ if (message.ImportId !== undefined) {
1811
+ bcl.Guid.encode(message.ImportId, writer.uint32(26).fork()).join();
1812
+ }
1813
+ return writer;
1814
+ },
1815
+ decode(input, length) {
1816
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
1817
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1818
+ if (previousRecursionDepth >= 100) {
1819
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1820
+ }
1821
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1822
+ try {
1823
+ const end = length === undefined ? reader.len : reader.pos + length;
1824
+ const message = createBaseGetImportRequest();
1825
+ while (reader.pos < end) {
1826
+ const tag = reader.uint32();
1827
+ switch (tag >>> 3) {
1828
+ case 1: {
1829
+ if (tag !== 10) {
1830
+ break;
1831
+ }
1832
+ message.EventStore = reader.string();
1833
+ continue;
1834
+ }
1835
+ case 2: {
1836
+ if (tag !== 18) {
1837
+ break;
1838
+ }
1839
+ message.Namespace = reader.string();
1840
+ continue;
1841
+ }
1842
+ case 3: {
1843
+ if (tag !== 26) {
1844
+ break;
1845
+ }
1846
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
1847
+ continue;
1848
+ }
1849
+ }
1850
+ if ((tag & 7) === 4 || tag === 0) {
1851
+ break;
1852
+ }
1853
+ reader.skip(tag & 7);
1854
+ }
1855
+ return message;
1856
+ }
1857
+ finally {
1858
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1859
+ }
1860
+ },
1861
+ fromJSON(object) {
1862
+ return {
1863
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1864
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1865
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
1866
+ };
1867
+ },
1868
+ toJSON(message) {
1869
+ const obj = {};
1870
+ if (message.EventStore !== "") {
1871
+ obj.EventStore = message.EventStore;
1872
+ }
1873
+ if (message.Namespace !== "") {
1874
+ obj.Namespace = message.Namespace;
1875
+ }
1876
+ if (message.ImportId !== undefined) {
1877
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
1878
+ }
1879
+ return obj;
1880
+ },
1881
+ create(base) {
1882
+ return GetImportRequest.fromPartial(base ?? {});
1883
+ },
1884
+ fromPartial(object) {
1885
+ const message = createBaseGetImportRequest();
1886
+ message.EventStore = object.EventStore ?? "";
1887
+ message.Namespace = object.Namespace ?? "";
1888
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
1889
+ ? bcl.Guid.fromPartial(object.ImportId)
1890
+ : undefined;
1891
+ return message;
1892
+ },
1893
+ };
1894
+ function createBaseIdentity() {
1895
+ return { Subject: "", Name: "", UserName: "", OnBehalfOf: undefined };
1896
+ }
1897
+ const Identity = {
1898
+ encode(message, writer = new wire.BinaryWriter()) {
1899
+ if (message.Subject !== "") {
1900
+ writer.uint32(10).string(message.Subject);
1901
+ }
1902
+ if (message.Name !== "") {
1903
+ writer.uint32(18).string(message.Name);
1904
+ }
1905
+ if (message.UserName !== "") {
1906
+ writer.uint32(26).string(message.UserName);
1907
+ }
1908
+ if (message.OnBehalfOf !== undefined) {
1909
+ Identity.encode(message.OnBehalfOf, writer.uint32(34).fork()).join();
1910
+ }
1911
+ return writer;
1912
+ },
1913
+ decode(input, length) {
1914
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
1915
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
1916
+ if (previousRecursionDepth >= 100) {
1917
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1918
+ }
1919
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
1920
+ try {
1921
+ const end = length === undefined ? reader.len : reader.pos + length;
1922
+ const message = createBaseIdentity();
1923
+ while (reader.pos < end) {
1924
+ const tag = reader.uint32();
1925
+ switch (tag >>> 3) {
1926
+ case 1: {
1927
+ if (tag !== 10) {
1928
+ break;
1929
+ }
1930
+ message.Subject = reader.string();
1931
+ continue;
1932
+ }
1933
+ case 2: {
1934
+ if (tag !== 18) {
1935
+ break;
1936
+ }
1937
+ message.Name = reader.string();
1938
+ continue;
1939
+ }
1940
+ case 3: {
1941
+ if (tag !== 26) {
1942
+ break;
1943
+ }
1944
+ message.UserName = reader.string();
1945
+ continue;
1946
+ }
1947
+ case 4: {
1948
+ if (tag !== 34) {
1949
+ break;
1950
+ }
1951
+ message.OnBehalfOf = Identity.decode(reader, reader.uint32());
1952
+ continue;
1953
+ }
1954
+ }
1955
+ if ((tag & 7) === 4 || tag === 0) {
1956
+ break;
1957
+ }
1958
+ reader.skip(tag & 7);
1959
+ }
1960
+ return message;
1961
+ }
1962
+ finally {
1963
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
1964
+ }
1965
+ },
1966
+ fromJSON(object) {
1967
+ return {
1968
+ Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "",
1969
+ Name: isSet(object.Name) ? globalThis.String(object.Name) : "",
1970
+ UserName: isSet(object.UserName) ? globalThis.String(object.UserName) : "",
1971
+ OnBehalfOf: isSet(object.OnBehalfOf) ? Identity.fromJSON(object.OnBehalfOf) : undefined,
1972
+ };
1973
+ },
1974
+ toJSON(message) {
1975
+ const obj = {};
1976
+ if (message.Subject !== "") {
1977
+ obj.Subject = message.Subject;
1978
+ }
1979
+ if (message.Name !== "") {
1980
+ obj.Name = message.Name;
1981
+ }
1982
+ if (message.UserName !== "") {
1983
+ obj.UserName = message.UserName;
1984
+ }
1985
+ if (message.OnBehalfOf !== undefined) {
1986
+ obj.OnBehalfOf = Identity.toJSON(message.OnBehalfOf);
1987
+ }
1988
+ return obj;
1989
+ },
1990
+ create(base) {
1991
+ return Identity.fromPartial(base ?? {});
1992
+ },
1993
+ fromPartial(object) {
1994
+ const message = createBaseIdentity();
1995
+ message.Subject = object.Subject ?? "";
1996
+ message.Name = object.Name ?? "";
1997
+ message.UserName = object.UserName ?? "";
1998
+ message.OnBehalfOf = (object.OnBehalfOf !== undefined && object.OnBehalfOf !== null)
1999
+ ? Identity.fromPartial(object.OnBehalfOf)
2000
+ : undefined;
2001
+ return message;
2002
+ },
2003
+ };
2004
+ function createBaseImportEvent() {
2005
+ return {
2006
+ EventSourceId: "",
2007
+ EventSourceType: "",
2008
+ EventStreamType: "",
2009
+ EventStreamId: "",
2010
+ EventType: undefined,
2011
+ Content: "",
2012
+ Tags: [],
2013
+ NamedTags: [],
2014
+ Occurred: undefined,
2015
+ Subject: "",
2016
+ CorrelationId: undefined,
2017
+ Causation: [],
2018
+ CausedBy: undefined,
2019
+ IdempotencyKey: "",
2020
+ EventSource: "",
2021
+ SourceSequenceNumber: 0n,
2022
+ };
2023
+ }
2024
+ const ImportEvent = {
2025
+ encode(message, writer = new wire.BinaryWriter()) {
2026
+ if (message.EventSourceId !== "") {
2027
+ writer.uint32(10).string(message.EventSourceId);
2028
+ }
2029
+ if (message.EventSourceType !== "") {
2030
+ writer.uint32(18).string(message.EventSourceType);
2031
+ }
2032
+ if (message.EventStreamType !== "") {
2033
+ writer.uint32(26).string(message.EventStreamType);
2034
+ }
2035
+ if (message.EventStreamId !== "") {
2036
+ writer.uint32(34).string(message.EventStreamId);
2037
+ }
2038
+ if (message.EventType !== undefined) {
2039
+ EventType.encode(message.EventType, writer.uint32(42).fork()).join();
2040
+ }
2041
+ if (message.Content !== "") {
2042
+ writer.uint32(50).string(message.Content);
2043
+ }
2044
+ for (const v of message.Tags) {
2045
+ writer.uint32(58).string(v);
2046
+ }
2047
+ for (const v of message.NamedTags) {
2048
+ NamedTag.encode(v, writer.uint32(66).fork()).join();
2049
+ }
2050
+ if (message.Occurred !== undefined) {
2051
+ SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(74).fork()).join();
2052
+ }
2053
+ if (message.Subject !== "") {
2054
+ writer.uint32(82).string(message.Subject);
2055
+ }
2056
+ if (message.CorrelationId !== undefined) {
2057
+ bcl.Guid.encode(message.CorrelationId, writer.uint32(90).fork()).join();
2058
+ }
2059
+ for (const v of message.Causation) {
2060
+ Causation.encode(v, writer.uint32(98).fork()).join();
2061
+ }
2062
+ if (message.CausedBy !== undefined) {
2063
+ Identity.encode(message.CausedBy, writer.uint32(106).fork()).join();
2064
+ }
2065
+ if (message.IdempotencyKey !== "") {
2066
+ writer.uint32(114).string(message.IdempotencyKey);
2067
+ }
2068
+ if (message.EventSource !== "") {
2069
+ writer.uint32(122).string(message.EventSource);
2070
+ }
2071
+ if (message.SourceSequenceNumber !== 0n) {
2072
+ if (BigInt.asUintN(64, message.SourceSequenceNumber) !== message.SourceSequenceNumber) {
2073
+ throw new globalThis.Error("value provided for field message.SourceSequenceNumber of type uint64 too large");
2074
+ }
2075
+ writer.uint32(128).uint64(message.SourceSequenceNumber);
2076
+ }
2077
+ return writer;
2078
+ },
2079
+ decode(input, length) {
2080
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
2081
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2082
+ if (previousRecursionDepth >= 100) {
2083
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2084
+ }
2085
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2086
+ try {
2087
+ const end = length === undefined ? reader.len : reader.pos + length;
2088
+ const message = createBaseImportEvent();
2089
+ while (reader.pos < end) {
2090
+ const tag = reader.uint32();
2091
+ switch (tag >>> 3) {
2092
+ case 1: {
2093
+ if (tag !== 10) {
2094
+ break;
2095
+ }
2096
+ message.EventSourceId = reader.string();
2097
+ continue;
2098
+ }
2099
+ case 2: {
2100
+ if (tag !== 18) {
2101
+ break;
2102
+ }
2103
+ message.EventSourceType = reader.string();
2104
+ continue;
2105
+ }
2106
+ case 3: {
2107
+ if (tag !== 26) {
2108
+ break;
2109
+ }
2110
+ message.EventStreamType = reader.string();
2111
+ continue;
2112
+ }
2113
+ case 4: {
2114
+ if (tag !== 34) {
2115
+ break;
2116
+ }
2117
+ message.EventStreamId = reader.string();
2118
+ continue;
2119
+ }
2120
+ case 5: {
2121
+ if (tag !== 42) {
2122
+ break;
2123
+ }
2124
+ message.EventType = EventType.decode(reader, reader.uint32());
2125
+ continue;
2126
+ }
2127
+ case 6: {
2128
+ if (tag !== 50) {
2129
+ break;
2130
+ }
2131
+ message.Content = reader.string();
2132
+ continue;
2133
+ }
2134
+ case 7: {
2135
+ if (tag !== 58) {
2136
+ break;
2137
+ }
2138
+ message.Tags.push(reader.string());
2139
+ continue;
2140
+ }
2141
+ case 8: {
2142
+ if (tag !== 66) {
2143
+ break;
2144
+ }
2145
+ message.NamedTags.push(NamedTag.decode(reader, reader.uint32()));
2146
+ continue;
2147
+ }
2148
+ case 9: {
2149
+ if (tag !== 74) {
2150
+ break;
2151
+ }
2152
+ message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32());
2153
+ continue;
2154
+ }
2155
+ case 10: {
2156
+ if (tag !== 82) {
2157
+ break;
2158
+ }
2159
+ message.Subject = reader.string();
2160
+ continue;
2161
+ }
2162
+ case 11: {
2163
+ if (tag !== 90) {
2164
+ break;
2165
+ }
2166
+ message.CorrelationId = bcl.Guid.decode(reader, reader.uint32());
2167
+ continue;
2168
+ }
2169
+ case 12: {
2170
+ if (tag !== 98) {
2171
+ break;
2172
+ }
2173
+ message.Causation.push(Causation.decode(reader, reader.uint32()));
2174
+ continue;
2175
+ }
2176
+ case 13: {
2177
+ if (tag !== 106) {
2178
+ break;
2179
+ }
2180
+ message.CausedBy = Identity.decode(reader, reader.uint32());
2181
+ continue;
2182
+ }
2183
+ case 14: {
2184
+ if (tag !== 114) {
2185
+ break;
2186
+ }
2187
+ message.IdempotencyKey = reader.string();
2188
+ continue;
2189
+ }
2190
+ case 15: {
2191
+ if (tag !== 122) {
2192
+ break;
2193
+ }
2194
+ message.EventSource = reader.string();
2195
+ continue;
2196
+ }
2197
+ case 16: {
2198
+ if (tag !== 128) {
2199
+ break;
2200
+ }
2201
+ message.SourceSequenceNumber = reader.uint64();
2202
+ continue;
2203
+ }
2204
+ }
2205
+ if ((tag & 7) === 4 || tag === 0) {
2206
+ break;
2207
+ }
2208
+ reader.skip(tag & 7);
2209
+ }
2210
+ return message;
2211
+ }
2212
+ finally {
2213
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2214
+ }
2215
+ },
2216
+ fromJSON(object) {
2217
+ return {
2218
+ EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "",
2219
+ EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "",
2220
+ EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "",
2221
+ EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "",
2222
+ EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined,
2223
+ Content: isSet(object.Content) ? globalThis.String(object.Content) : "",
2224
+ Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e) => globalThis.String(e)) : [],
2225
+ NamedTags: globalThis.Array.isArray(object?.NamedTags)
2226
+ ? object.NamedTags.map((e) => NamedTag.fromJSON(e))
2227
+ : [],
2228
+ Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined,
2229
+ Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "",
2230
+ CorrelationId: isSet(object.CorrelationId) ? bcl.Guid.fromJSON(object.CorrelationId) : undefined,
2231
+ Causation: globalThis.Array.isArray(object?.Causation)
2232
+ ? object.Causation.map((e) => Causation.fromJSON(e))
2233
+ : [],
2234
+ CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined,
2235
+ IdempotencyKey: isSet(object.IdempotencyKey) ? globalThis.String(object.IdempotencyKey) : "",
2236
+ EventSource: isSet(object.EventSource) ? globalThis.String(object.EventSource) : "",
2237
+ SourceSequenceNumber: isSet(object.SourceSequenceNumber) ? BigInt(object.SourceSequenceNumber) : 0n,
2238
+ };
2239
+ },
2240
+ toJSON(message) {
2241
+ const obj = {};
2242
+ if (message.EventSourceId !== "") {
2243
+ obj.EventSourceId = message.EventSourceId;
2244
+ }
2245
+ if (message.EventSourceType !== "") {
2246
+ obj.EventSourceType = message.EventSourceType;
2247
+ }
2248
+ if (message.EventStreamType !== "") {
2249
+ obj.EventStreamType = message.EventStreamType;
2250
+ }
2251
+ if (message.EventStreamId !== "") {
2252
+ obj.EventStreamId = message.EventStreamId;
2253
+ }
2254
+ if (message.EventType !== undefined) {
2255
+ obj.EventType = EventType.toJSON(message.EventType);
2256
+ }
2257
+ if (message.Content !== "") {
2258
+ obj.Content = message.Content;
2259
+ }
2260
+ if (message.Tags?.length) {
2261
+ obj.Tags = message.Tags;
2262
+ }
2263
+ if (message.NamedTags?.length) {
2264
+ obj.NamedTags = message.NamedTags.map((e) => NamedTag.toJSON(e));
2265
+ }
2266
+ if (message.Occurred !== undefined) {
2267
+ obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred);
2268
+ }
2269
+ if (message.Subject !== "") {
2270
+ obj.Subject = message.Subject;
2271
+ }
2272
+ if (message.CorrelationId !== undefined) {
2273
+ obj.CorrelationId = bcl.Guid.toJSON(message.CorrelationId);
2274
+ }
2275
+ if (message.Causation?.length) {
2276
+ obj.Causation = message.Causation.map((e) => Causation.toJSON(e));
2277
+ }
2278
+ if (message.CausedBy !== undefined) {
2279
+ obj.CausedBy = Identity.toJSON(message.CausedBy);
2280
+ }
2281
+ if (message.IdempotencyKey !== "") {
2282
+ obj.IdempotencyKey = message.IdempotencyKey;
2283
+ }
2284
+ if (message.EventSource !== "") {
2285
+ obj.EventSource = message.EventSource;
2286
+ }
2287
+ if (message.SourceSequenceNumber !== 0n) {
2288
+ obj.SourceSequenceNumber = message.SourceSequenceNumber.toString();
2289
+ }
2290
+ return obj;
2291
+ },
2292
+ create(base) {
2293
+ return ImportEvent.fromPartial(base ?? {});
2294
+ },
2295
+ fromPartial(object) {
2296
+ const message = createBaseImportEvent();
2297
+ message.EventSourceId = object.EventSourceId ?? "";
2298
+ message.EventSourceType = object.EventSourceType ?? "";
2299
+ message.EventStreamType = object.EventStreamType ?? "";
2300
+ message.EventStreamId = object.EventStreamId ?? "";
2301
+ message.EventType = (object.EventType !== undefined && object.EventType !== null)
2302
+ ? EventType.fromPartial(object.EventType)
2303
+ : undefined;
2304
+ message.Content = object.Content ?? "";
2305
+ message.Tags = object.Tags?.map((e) => e) || [];
2306
+ message.NamedTags = object.NamedTags?.map((e) => NamedTag.fromPartial(e)) || [];
2307
+ message.Occurred = (object.Occurred !== undefined && object.Occurred !== null)
2308
+ ? SerializableDateTimeOffset.fromPartial(object.Occurred)
2309
+ : undefined;
2310
+ message.Subject = object.Subject ?? "";
2311
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
2312
+ ? bcl.Guid.fromPartial(object.CorrelationId)
2313
+ : undefined;
2314
+ message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || [];
2315
+ message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null)
2316
+ ? Identity.fromPartial(object.CausedBy)
2317
+ : undefined;
2318
+ message.IdempotencyKey = object.IdempotencyKey ?? "";
2319
+ message.EventSource = object.EventSource ?? "";
2320
+ message.SourceSequenceNumber = (object.SourceSequenceNumber !== undefined && object.SourceSequenceNumber !== null)
2321
+ ? BigInt(object.SourceSequenceNumber)
2322
+ : 0n;
2323
+ return message;
2324
+ },
2325
+ };
2326
+ function createBaseImportEventRejection() {
2327
+ return { Index: 0n, EventType: "", Reasons: [] };
2328
+ }
2329
+ const ImportEventRejection = {
2330
+ encode(message, writer = new wire.BinaryWriter()) {
2331
+ if (message.Index !== 0n) {
2332
+ if (BigInt.asIntN(64, message.Index) !== message.Index) {
2333
+ throw new globalThis.Error("value provided for field message.Index of type int64 too large");
2334
+ }
2335
+ writer.uint32(8).int64(message.Index);
2336
+ }
2337
+ if (message.EventType !== "") {
2338
+ writer.uint32(18).string(message.EventType);
2339
+ }
2340
+ for (const v of message.Reasons) {
2341
+ writer.uint32(26).string(v);
2342
+ }
2343
+ return writer;
2344
+ },
2345
+ decode(input, length) {
2346
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
2347
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2348
+ if (previousRecursionDepth >= 100) {
2349
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2350
+ }
2351
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2352
+ try {
2353
+ const end = length === undefined ? reader.len : reader.pos + length;
2354
+ const message = createBaseImportEventRejection();
2355
+ while (reader.pos < end) {
2356
+ const tag = reader.uint32();
2357
+ switch (tag >>> 3) {
2358
+ case 1: {
2359
+ if (tag !== 8) {
2360
+ break;
2361
+ }
2362
+ message.Index = reader.int64();
2363
+ continue;
2364
+ }
2365
+ case 2: {
2366
+ if (tag !== 18) {
2367
+ break;
2368
+ }
2369
+ message.EventType = reader.string();
2370
+ continue;
2371
+ }
2372
+ case 3: {
2373
+ if (tag !== 26) {
2374
+ break;
2375
+ }
2376
+ message.Reasons.push(reader.string());
2377
+ continue;
2378
+ }
2379
+ }
2380
+ if ((tag & 7) === 4 || tag === 0) {
2381
+ break;
2382
+ }
2383
+ reader.skip(tag & 7);
2384
+ }
2385
+ return message;
2386
+ }
2387
+ finally {
2388
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2389
+ }
2390
+ },
2391
+ fromJSON(object) {
2392
+ return {
2393
+ Index: isSet(object.Index) ? BigInt(object.Index) : 0n,
2394
+ EventType: isSet(object.EventType) ? globalThis.String(object.EventType) : "",
2395
+ Reasons: globalThis.Array.isArray(object?.Reasons) ? object.Reasons.map((e) => globalThis.String(e)) : [],
2396
+ };
2397
+ },
2398
+ toJSON(message) {
2399
+ const obj = {};
2400
+ if (message.Index !== 0n) {
2401
+ obj.Index = message.Index.toString();
2402
+ }
2403
+ if (message.EventType !== "") {
2404
+ obj.EventType = message.EventType;
2405
+ }
2406
+ if (message.Reasons?.length) {
2407
+ obj.Reasons = message.Reasons;
2408
+ }
2409
+ return obj;
2410
+ },
2411
+ create(base) {
2412
+ return ImportEventRejection.fromPartial(base ?? {});
2413
+ },
2414
+ fromPartial(object) {
2415
+ const message = createBaseImportEventRejection();
2416
+ message.Index = (object.Index !== undefined && object.Index !== null) ? BigInt(object.Index) : 0n;
2417
+ message.EventType = object.EventType ?? "";
2418
+ message.Reasons = object.Reasons?.map((e) => e) || [];
2419
+ return message;
2420
+ },
2421
+ };
2422
+ function createBaseImportProgressResponse() {
2423
+ return {
2424
+ ImportId: undefined,
2425
+ EventSequenceId: "",
2426
+ State: 0,
2427
+ OnInvalid: 0,
2428
+ Created: undefined,
2429
+ LastActivity: undefined,
2430
+ StagedChunks: [],
2431
+ EventsReceived: 0n,
2432
+ EventsStaged: 0n,
2433
+ EventsCommitted: 0n,
2434
+ AlreadyAppended: 0n,
2435
+ RejectedCount: 0n,
2436
+ Rejections: [],
2437
+ CommittedRanges: [],
2438
+ FirstSequenceNumber: 0n,
2439
+ LastSequenceNumber: 0n,
2440
+ FailureReason: "",
2441
+ MaxChunkEvents: 0,
2442
+ MaxChunkBytes: 0,
2443
+ AcknowledgedChunks: 0,
2444
+ AcknowledgedEvents: 0n,
2445
+ };
2446
+ }
2447
+ const ImportProgressResponse = {
2448
+ encode(message, writer = new wire.BinaryWriter()) {
2449
+ if (message.ImportId !== undefined) {
2450
+ bcl.Guid.encode(message.ImportId, writer.uint32(10).fork()).join();
2451
+ }
2452
+ if (message.EventSequenceId !== "") {
2453
+ writer.uint32(18).string(message.EventSequenceId);
2454
+ }
2455
+ if (message.State !== 0) {
2456
+ writer.uint32(24).int32(message.State);
2457
+ }
2458
+ if (message.OnInvalid !== 0) {
2459
+ writer.uint32(32).int32(message.OnInvalid);
2460
+ }
2461
+ if (message.Created !== undefined) {
2462
+ SerializableDateTimeOffset.encode(message.Created, writer.uint32(42).fork()).join();
2463
+ }
2464
+ if (message.LastActivity !== undefined) {
2465
+ SerializableDateTimeOffset.encode(message.LastActivity, writer.uint32(50).fork()).join();
2466
+ }
2467
+ for (const v of message.StagedChunks) {
2468
+ writer.uint32(56).int32(v);
2469
+ }
2470
+ if (message.EventsReceived !== 0n) {
2471
+ if (BigInt.asIntN(64, message.EventsReceived) !== message.EventsReceived) {
2472
+ throw new globalThis.Error("value provided for field message.EventsReceived of type int64 too large");
2473
+ }
2474
+ writer.uint32(64).int64(message.EventsReceived);
2475
+ }
2476
+ if (message.EventsStaged !== 0n) {
2477
+ if (BigInt.asIntN(64, message.EventsStaged) !== message.EventsStaged) {
2478
+ throw new globalThis.Error("value provided for field message.EventsStaged of type int64 too large");
2479
+ }
2480
+ writer.uint32(72).int64(message.EventsStaged);
2481
+ }
2482
+ if (message.EventsCommitted !== 0n) {
2483
+ if (BigInt.asIntN(64, message.EventsCommitted) !== message.EventsCommitted) {
2484
+ throw new globalThis.Error("value provided for field message.EventsCommitted of type int64 too large");
2485
+ }
2486
+ writer.uint32(80).int64(message.EventsCommitted);
2487
+ }
2488
+ if (message.AlreadyAppended !== 0n) {
2489
+ if (BigInt.asIntN(64, message.AlreadyAppended) !== message.AlreadyAppended) {
2490
+ throw new globalThis.Error("value provided for field message.AlreadyAppended of type int64 too large");
2491
+ }
2492
+ writer.uint32(88).int64(message.AlreadyAppended);
2493
+ }
2494
+ if (message.RejectedCount !== 0n) {
2495
+ if (BigInt.asIntN(64, message.RejectedCount) !== message.RejectedCount) {
2496
+ throw new globalThis.Error("value provided for field message.RejectedCount of type int64 too large");
2497
+ }
2498
+ writer.uint32(96).int64(message.RejectedCount);
2499
+ }
2500
+ for (const v of message.Rejections) {
2501
+ ImportEventRejection.encode(v, writer.uint32(106).fork()).join();
2502
+ }
2503
+ for (const v of message.CommittedRanges) {
2504
+ ImportSequenceRange.encode(v, writer.uint32(114).fork()).join();
2505
+ }
2506
+ if (message.FirstSequenceNumber !== 0n) {
2507
+ if (BigInt.asUintN(64, message.FirstSequenceNumber) !== message.FirstSequenceNumber) {
2508
+ throw new globalThis.Error("value provided for field message.FirstSequenceNumber of type uint64 too large");
2509
+ }
2510
+ writer.uint32(120).uint64(message.FirstSequenceNumber);
2511
+ }
2512
+ if (message.LastSequenceNumber !== 0n) {
2513
+ if (BigInt.asUintN(64, message.LastSequenceNumber) !== message.LastSequenceNumber) {
2514
+ throw new globalThis.Error("value provided for field message.LastSequenceNumber of type uint64 too large");
2515
+ }
2516
+ writer.uint32(128).uint64(message.LastSequenceNumber);
2517
+ }
2518
+ if (message.FailureReason !== "") {
2519
+ writer.uint32(138).string(message.FailureReason);
2520
+ }
2521
+ if (message.MaxChunkEvents !== 0) {
2522
+ writer.uint32(144).int32(message.MaxChunkEvents);
2523
+ }
2524
+ if (message.MaxChunkBytes !== 0) {
2525
+ writer.uint32(152).int32(message.MaxChunkBytes);
2526
+ }
2527
+ if (message.AcknowledgedChunks !== 0) {
2528
+ writer.uint32(160).int32(message.AcknowledgedChunks);
2529
+ }
2530
+ if (message.AcknowledgedEvents !== 0n) {
2531
+ if (BigInt.asIntN(64, message.AcknowledgedEvents) !== message.AcknowledgedEvents) {
2532
+ throw new globalThis.Error("value provided for field message.AcknowledgedEvents of type int64 too large");
2533
+ }
2534
+ writer.uint32(168).int64(message.AcknowledgedEvents);
2535
+ }
2536
+ return writer;
2537
+ },
2538
+ decode(input, length) {
2539
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
2540
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2541
+ if (previousRecursionDepth >= 100) {
2542
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2543
+ }
2544
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2545
+ try {
2546
+ const end = length === undefined ? reader.len : reader.pos + length;
2547
+ const message = createBaseImportProgressResponse();
2548
+ while (reader.pos < end) {
2549
+ const tag = reader.uint32();
2550
+ switch (tag >>> 3) {
2551
+ case 1: {
2552
+ if (tag !== 10) {
2553
+ break;
2554
+ }
2555
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
2556
+ continue;
2557
+ }
2558
+ case 2: {
2559
+ if (tag !== 18) {
2560
+ break;
2561
+ }
2562
+ message.EventSequenceId = reader.string();
2563
+ continue;
2564
+ }
2565
+ case 3: {
2566
+ if (tag !== 24) {
2567
+ break;
2568
+ }
2569
+ message.State = reader.int32();
2570
+ continue;
2571
+ }
2572
+ case 4: {
2573
+ if (tag !== 32) {
2574
+ break;
2575
+ }
2576
+ message.OnInvalid = reader.int32();
2577
+ continue;
2578
+ }
2579
+ case 5: {
2580
+ if (tag !== 42) {
2581
+ break;
2582
+ }
2583
+ message.Created = SerializableDateTimeOffset.decode(reader, reader.uint32());
2584
+ continue;
2585
+ }
2586
+ case 6: {
2587
+ if (tag !== 50) {
2588
+ break;
2589
+ }
2590
+ message.LastActivity = SerializableDateTimeOffset.decode(reader, reader.uint32());
2591
+ continue;
2592
+ }
2593
+ case 7: {
2594
+ if (tag === 56) {
2595
+ message.StagedChunks.push(reader.int32());
2596
+ continue;
2597
+ }
2598
+ if (tag === 58) {
2599
+ const end2 = reader.uint32() + reader.pos;
2600
+ while (reader.pos < end2) {
2601
+ message.StagedChunks.push(reader.int32());
2602
+ }
2603
+ continue;
2604
+ }
2605
+ break;
2606
+ }
2607
+ case 8: {
2608
+ if (tag !== 64) {
2609
+ break;
2610
+ }
2611
+ message.EventsReceived = reader.int64();
2612
+ continue;
2613
+ }
2614
+ case 9: {
2615
+ if (tag !== 72) {
2616
+ break;
2617
+ }
2618
+ message.EventsStaged = reader.int64();
2619
+ continue;
2620
+ }
2621
+ case 10: {
2622
+ if (tag !== 80) {
2623
+ break;
2624
+ }
2625
+ message.EventsCommitted = reader.int64();
2626
+ continue;
2627
+ }
2628
+ case 11: {
2629
+ if (tag !== 88) {
2630
+ break;
2631
+ }
2632
+ message.AlreadyAppended = reader.int64();
2633
+ continue;
2634
+ }
2635
+ case 12: {
2636
+ if (tag !== 96) {
2637
+ break;
2638
+ }
2639
+ message.RejectedCount = reader.int64();
2640
+ continue;
2641
+ }
2642
+ case 13: {
2643
+ if (tag !== 106) {
2644
+ break;
2645
+ }
2646
+ message.Rejections.push(ImportEventRejection.decode(reader, reader.uint32()));
2647
+ continue;
2648
+ }
2649
+ case 14: {
2650
+ if (tag !== 114) {
2651
+ break;
2652
+ }
2653
+ message.CommittedRanges.push(ImportSequenceRange.decode(reader, reader.uint32()));
2654
+ continue;
2655
+ }
2656
+ case 15: {
2657
+ if (tag !== 120) {
2658
+ break;
2659
+ }
2660
+ message.FirstSequenceNumber = reader.uint64();
2661
+ continue;
2662
+ }
2663
+ case 16: {
2664
+ if (tag !== 128) {
2665
+ break;
2666
+ }
2667
+ message.LastSequenceNumber = reader.uint64();
2668
+ continue;
2669
+ }
2670
+ case 17: {
2671
+ if (tag !== 138) {
2672
+ break;
2673
+ }
2674
+ message.FailureReason = reader.string();
2675
+ continue;
2676
+ }
2677
+ case 18: {
2678
+ if (tag !== 144) {
2679
+ break;
2680
+ }
2681
+ message.MaxChunkEvents = reader.int32();
2682
+ continue;
2683
+ }
2684
+ case 19: {
2685
+ if (tag !== 152) {
2686
+ break;
2687
+ }
2688
+ message.MaxChunkBytes = reader.int32();
2689
+ continue;
2690
+ }
2691
+ case 20: {
2692
+ if (tag !== 160) {
2693
+ break;
2694
+ }
2695
+ message.AcknowledgedChunks = reader.int32();
2696
+ continue;
2697
+ }
2698
+ case 21: {
2699
+ if (tag !== 168) {
2700
+ break;
2701
+ }
2702
+ message.AcknowledgedEvents = reader.int64();
2703
+ continue;
2704
+ }
2705
+ }
2706
+ if ((tag & 7) === 4 || tag === 0) {
2707
+ break;
2708
+ }
2709
+ reader.skip(tag & 7);
2710
+ }
2711
+ return message;
2712
+ }
2713
+ finally {
2714
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2715
+ }
2716
+ },
2717
+ fromJSON(object) {
2718
+ return {
2719
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
2720
+ EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "",
2721
+ State: isSet(object.State) ? importStateFromJSON(object.State) : 0,
2722
+ OnInvalid: isSet(object.OnInvalid) ? onInvalidEventFromJSON(object.OnInvalid) : 0,
2723
+ Created: isSet(object.Created) ? SerializableDateTimeOffset.fromJSON(object.Created) : undefined,
2724
+ LastActivity: isSet(object.LastActivity) ? SerializableDateTimeOffset.fromJSON(object.LastActivity) : undefined,
2725
+ StagedChunks: globalThis.Array.isArray(object?.StagedChunks)
2726
+ ? object.StagedChunks.map((e) => globalThis.Number(e))
2727
+ : [],
2728
+ EventsReceived: isSet(object.EventsReceived) ? BigInt(object.EventsReceived) : 0n,
2729
+ EventsStaged: isSet(object.EventsStaged) ? BigInt(object.EventsStaged) : 0n,
2730
+ EventsCommitted: isSet(object.EventsCommitted) ? BigInt(object.EventsCommitted) : 0n,
2731
+ AlreadyAppended: isSet(object.AlreadyAppended) ? BigInt(object.AlreadyAppended) : 0n,
2732
+ RejectedCount: isSet(object.RejectedCount) ? BigInt(object.RejectedCount) : 0n,
2733
+ Rejections: globalThis.Array.isArray(object?.Rejections)
2734
+ ? object.Rejections.map((e) => ImportEventRejection.fromJSON(e))
2735
+ : [],
2736
+ CommittedRanges: globalThis.Array.isArray(object?.CommittedRanges)
2737
+ ? object.CommittedRanges.map((e) => ImportSequenceRange.fromJSON(e))
2738
+ : [],
2739
+ FirstSequenceNumber: isSet(object.FirstSequenceNumber) ? BigInt(object.FirstSequenceNumber) : 0n,
2740
+ LastSequenceNumber: isSet(object.LastSequenceNumber) ? BigInt(object.LastSequenceNumber) : 0n,
2741
+ FailureReason: isSet(object.FailureReason) ? globalThis.String(object.FailureReason) : "",
2742
+ MaxChunkEvents: isSet(object.MaxChunkEvents) ? globalThis.Number(object.MaxChunkEvents) : 0,
2743
+ MaxChunkBytes: isSet(object.MaxChunkBytes) ? globalThis.Number(object.MaxChunkBytes) : 0,
2744
+ AcknowledgedChunks: isSet(object.AcknowledgedChunks) ? globalThis.Number(object.AcknowledgedChunks) : 0,
2745
+ AcknowledgedEvents: isSet(object.AcknowledgedEvents) ? BigInt(object.AcknowledgedEvents) : 0n,
2746
+ };
2747
+ },
2748
+ toJSON(message) {
2749
+ const obj = {};
2750
+ if (message.ImportId !== undefined) {
2751
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
2752
+ }
2753
+ if (message.EventSequenceId !== "") {
2754
+ obj.EventSequenceId = message.EventSequenceId;
2755
+ }
2756
+ if (message.State !== 0) {
2757
+ obj.State = importStateToJSON(message.State);
2758
+ }
2759
+ if (message.OnInvalid !== 0) {
2760
+ obj.OnInvalid = onInvalidEventToJSON(message.OnInvalid);
2761
+ }
2762
+ if (message.Created !== undefined) {
2763
+ obj.Created = SerializableDateTimeOffset.toJSON(message.Created);
2764
+ }
2765
+ if (message.LastActivity !== undefined) {
2766
+ obj.LastActivity = SerializableDateTimeOffset.toJSON(message.LastActivity);
2767
+ }
2768
+ if (message.StagedChunks?.length) {
2769
+ obj.StagedChunks = message.StagedChunks.map((e) => Math.round(e));
2770
+ }
2771
+ if (message.EventsReceived !== 0n) {
2772
+ obj.EventsReceived = message.EventsReceived.toString();
2773
+ }
2774
+ if (message.EventsStaged !== 0n) {
2775
+ obj.EventsStaged = message.EventsStaged.toString();
2776
+ }
2777
+ if (message.EventsCommitted !== 0n) {
2778
+ obj.EventsCommitted = message.EventsCommitted.toString();
2779
+ }
2780
+ if (message.AlreadyAppended !== 0n) {
2781
+ obj.AlreadyAppended = message.AlreadyAppended.toString();
2782
+ }
2783
+ if (message.RejectedCount !== 0n) {
2784
+ obj.RejectedCount = message.RejectedCount.toString();
2785
+ }
2786
+ if (message.Rejections?.length) {
2787
+ obj.Rejections = message.Rejections.map((e) => ImportEventRejection.toJSON(e));
2788
+ }
2789
+ if (message.CommittedRanges?.length) {
2790
+ obj.CommittedRanges = message.CommittedRanges.map((e) => ImportSequenceRange.toJSON(e));
2791
+ }
2792
+ if (message.FirstSequenceNumber !== 0n) {
2793
+ obj.FirstSequenceNumber = message.FirstSequenceNumber.toString();
2794
+ }
2795
+ if (message.LastSequenceNumber !== 0n) {
2796
+ obj.LastSequenceNumber = message.LastSequenceNumber.toString();
2797
+ }
2798
+ if (message.FailureReason !== "") {
2799
+ obj.FailureReason = message.FailureReason;
2800
+ }
2801
+ if (message.MaxChunkEvents !== 0) {
2802
+ obj.MaxChunkEvents = Math.round(message.MaxChunkEvents);
2803
+ }
2804
+ if (message.MaxChunkBytes !== 0) {
2805
+ obj.MaxChunkBytes = Math.round(message.MaxChunkBytes);
2806
+ }
2807
+ if (message.AcknowledgedChunks !== 0) {
2808
+ obj.AcknowledgedChunks = Math.round(message.AcknowledgedChunks);
2809
+ }
2810
+ if (message.AcknowledgedEvents !== 0n) {
2811
+ obj.AcknowledgedEvents = message.AcknowledgedEvents.toString();
2812
+ }
2813
+ return obj;
2814
+ },
2815
+ create(base) {
2816
+ return ImportProgressResponse.fromPartial(base ?? {});
2817
+ },
2818
+ fromPartial(object) {
2819
+ const message = createBaseImportProgressResponse();
2820
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
2821
+ ? bcl.Guid.fromPartial(object.ImportId)
2822
+ : undefined;
2823
+ message.EventSequenceId = object.EventSequenceId ?? "";
2824
+ message.State = object.State ?? 0;
2825
+ message.OnInvalid = object.OnInvalid ?? 0;
2826
+ message.Created = (object.Created !== undefined && object.Created !== null)
2827
+ ? SerializableDateTimeOffset.fromPartial(object.Created)
2828
+ : undefined;
2829
+ message.LastActivity = (object.LastActivity !== undefined && object.LastActivity !== null)
2830
+ ? SerializableDateTimeOffset.fromPartial(object.LastActivity)
2831
+ : undefined;
2832
+ message.StagedChunks = object.StagedChunks?.map((e) => e) || [];
2833
+ message.EventsReceived = (object.EventsReceived !== undefined && object.EventsReceived !== null)
2834
+ ? BigInt(object.EventsReceived)
2835
+ : 0n;
2836
+ message.EventsStaged = (object.EventsStaged !== undefined && object.EventsStaged !== null)
2837
+ ? BigInt(object.EventsStaged)
2838
+ : 0n;
2839
+ message.EventsCommitted = (object.EventsCommitted !== undefined && object.EventsCommitted !== null)
2840
+ ? BigInt(object.EventsCommitted)
2841
+ : 0n;
2842
+ message.AlreadyAppended = (object.AlreadyAppended !== undefined && object.AlreadyAppended !== null)
2843
+ ? BigInt(object.AlreadyAppended)
2844
+ : 0n;
2845
+ message.RejectedCount = (object.RejectedCount !== undefined && object.RejectedCount !== null)
2846
+ ? BigInt(object.RejectedCount)
2847
+ : 0n;
2848
+ message.Rejections = object.Rejections?.map((e) => ImportEventRejection.fromPartial(e)) || [];
2849
+ message.CommittedRanges = object.CommittedRanges?.map((e) => ImportSequenceRange.fromPartial(e)) || [];
2850
+ message.FirstSequenceNumber = (object.FirstSequenceNumber !== undefined && object.FirstSequenceNumber !== null)
2851
+ ? BigInt(object.FirstSequenceNumber)
2852
+ : 0n;
2853
+ message.LastSequenceNumber = (object.LastSequenceNumber !== undefined && object.LastSequenceNumber !== null)
2854
+ ? BigInt(object.LastSequenceNumber)
2855
+ : 0n;
2856
+ message.FailureReason = object.FailureReason ?? "";
2857
+ message.MaxChunkEvents = object.MaxChunkEvents ?? 0;
2858
+ message.MaxChunkBytes = object.MaxChunkBytes ?? 0;
2859
+ message.AcknowledgedChunks = object.AcknowledgedChunks ?? 0;
2860
+ message.AcknowledgedEvents = (object.AcknowledgedEvents !== undefined && object.AcknowledgedEvents !== null)
2861
+ ? BigInt(object.AcknowledgedEvents)
2862
+ : 0n;
2863
+ return message;
2864
+ },
2865
+ };
2866
+ function createBaseImportSequenceRange() {
2867
+ return { ChunkIndex: 0, First: 0n, Last: 0n };
2868
+ }
2869
+ const ImportSequenceRange = {
2870
+ encode(message, writer = new wire.BinaryWriter()) {
2871
+ if (message.ChunkIndex !== 0) {
2872
+ writer.uint32(8).int32(message.ChunkIndex);
2873
+ }
2874
+ if (message.First !== 0n) {
2875
+ if (BigInt.asUintN(64, message.First) !== message.First) {
2876
+ throw new globalThis.Error("value provided for field message.First of type uint64 too large");
2877
+ }
2878
+ writer.uint32(16).uint64(message.First);
2879
+ }
2880
+ if (message.Last !== 0n) {
2881
+ if (BigInt.asUintN(64, message.Last) !== message.Last) {
2882
+ throw new globalThis.Error("value provided for field message.Last of type uint64 too large");
2883
+ }
2884
+ writer.uint32(24).uint64(message.Last);
2885
+ }
2886
+ return writer;
2887
+ },
2888
+ decode(input, length) {
2889
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
2890
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2891
+ if (previousRecursionDepth >= 100) {
2892
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2893
+ }
2894
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2895
+ try {
2896
+ const end = length === undefined ? reader.len : reader.pos + length;
2897
+ const message = createBaseImportSequenceRange();
2898
+ while (reader.pos < end) {
2899
+ const tag = reader.uint32();
2900
+ switch (tag >>> 3) {
2901
+ case 1: {
2902
+ if (tag !== 8) {
2903
+ break;
2904
+ }
2905
+ message.ChunkIndex = reader.int32();
2906
+ continue;
2907
+ }
2908
+ case 2: {
2909
+ if (tag !== 16) {
2910
+ break;
2911
+ }
2912
+ message.First = reader.uint64();
2913
+ continue;
2914
+ }
2915
+ case 3: {
2916
+ if (tag !== 24) {
2917
+ break;
2918
+ }
2919
+ message.Last = reader.uint64();
2920
+ continue;
2921
+ }
2922
+ }
2923
+ if ((tag & 7) === 4 || tag === 0) {
2924
+ break;
2925
+ }
2926
+ reader.skip(tag & 7);
2927
+ }
2928
+ return message;
2929
+ }
2930
+ finally {
2931
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
2932
+ }
2933
+ },
2934
+ fromJSON(object) {
2935
+ return {
2936
+ ChunkIndex: isSet(object.ChunkIndex) ? globalThis.Number(object.ChunkIndex) : 0,
2937
+ First: isSet(object.First) ? BigInt(object.First) : 0n,
2938
+ Last: isSet(object.Last) ? BigInt(object.Last) : 0n,
2939
+ };
2940
+ },
2941
+ toJSON(message) {
2942
+ const obj = {};
2943
+ if (message.ChunkIndex !== 0) {
2944
+ obj.ChunkIndex = Math.round(message.ChunkIndex);
2945
+ }
2946
+ if (message.First !== 0n) {
2947
+ obj.First = message.First.toString();
2948
+ }
2949
+ if (message.Last !== 0n) {
2950
+ obj.Last = message.Last.toString();
2951
+ }
2952
+ return obj;
2953
+ },
2954
+ create(base) {
2955
+ return ImportSequenceRange.fromPartial(base ?? {});
2956
+ },
2957
+ fromPartial(object) {
2958
+ const message = createBaseImportSequenceRange();
2959
+ message.ChunkIndex = object.ChunkIndex ?? 0;
2960
+ message.First = (object.First !== undefined && object.First !== null) ? BigInt(object.First) : 0n;
2961
+ message.Last = (object.Last !== undefined && object.Last !== null) ? BigInt(object.Last) : 0n;
2962
+ return message;
2963
+ },
2964
+ };
2965
+ function createBaseNamedTag() {
2966
+ return { Name: "", Value: "" };
2967
+ }
2968
+ const NamedTag = {
2969
+ encode(message, writer = new wire.BinaryWriter()) {
2970
+ if (message.Name !== "") {
2971
+ writer.uint32(10).string(message.Name);
2972
+ }
2973
+ if (message.Value !== "") {
2974
+ writer.uint32(18).string(message.Value);
2975
+ }
2976
+ return writer;
2977
+ },
2978
+ decode(input, length) {
2979
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
2980
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
2981
+ if (previousRecursionDepth >= 100) {
2982
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
2983
+ }
2984
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
2985
+ try {
2986
+ const end = length === undefined ? reader.len : reader.pos + length;
2987
+ const message = createBaseNamedTag();
2988
+ while (reader.pos < end) {
2989
+ const tag = reader.uint32();
2990
+ switch (tag >>> 3) {
2991
+ case 1: {
2992
+ if (tag !== 10) {
2993
+ break;
2994
+ }
2995
+ message.Name = reader.string();
2996
+ continue;
2997
+ }
2998
+ case 2: {
2999
+ if (tag !== 18) {
3000
+ break;
3001
+ }
3002
+ message.Value = reader.string();
3003
+ continue;
3004
+ }
3005
+ }
3006
+ if ((tag & 7) === 4 || tag === 0) {
3007
+ break;
3008
+ }
3009
+ reader.skip(tag & 7);
3010
+ }
3011
+ return message;
3012
+ }
3013
+ finally {
3014
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3015
+ }
3016
+ },
3017
+ fromJSON(object) {
3018
+ return {
3019
+ Name: isSet(object.Name) ? globalThis.String(object.Name) : "",
3020
+ Value: isSet(object.Value) ? globalThis.String(object.Value) : "",
3021
+ };
3022
+ },
3023
+ toJSON(message) {
3024
+ const obj = {};
3025
+ if (message.Name !== "") {
3026
+ obj.Name = message.Name;
3027
+ }
3028
+ if (message.Value !== "") {
3029
+ obj.Value = message.Value;
3030
+ }
3031
+ return obj;
3032
+ },
3033
+ create(base) {
3034
+ return NamedTag.fromPartial(base ?? {});
3035
+ },
3036
+ fromPartial(object) {
3037
+ const message = createBaseNamedTag();
3038
+ message.Name = object.Name ?? "";
3039
+ message.Value = object.Value ?? "";
3040
+ return message;
3041
+ },
3042
+ };
3043
+ function createBaseObserveImportRequest() {
3044
+ return { EventStore: "", Namespace: "", ImportId: undefined };
3045
+ }
3046
+ const ObserveImportRequest = {
3047
+ encode(message, writer = new wire.BinaryWriter()) {
3048
+ if (message.EventStore !== "") {
3049
+ writer.uint32(10).string(message.EventStore);
3050
+ }
3051
+ if (message.Namespace !== "") {
3052
+ writer.uint32(18).string(message.Namespace);
3053
+ }
3054
+ if (message.ImportId !== undefined) {
3055
+ bcl.Guid.encode(message.ImportId, writer.uint32(26).fork()).join();
3056
+ }
3057
+ return writer;
3058
+ },
3059
+ decode(input, length) {
3060
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
3061
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3062
+ if (previousRecursionDepth >= 100) {
3063
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3064
+ }
3065
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3066
+ try {
3067
+ const end = length === undefined ? reader.len : reader.pos + length;
3068
+ const message = createBaseObserveImportRequest();
3069
+ while (reader.pos < end) {
3070
+ const tag = reader.uint32();
3071
+ switch (tag >>> 3) {
3072
+ case 1: {
3073
+ if (tag !== 10) {
3074
+ break;
3075
+ }
3076
+ message.EventStore = reader.string();
3077
+ continue;
3078
+ }
3079
+ case 2: {
3080
+ if (tag !== 18) {
3081
+ break;
3082
+ }
3083
+ message.Namespace = reader.string();
3084
+ continue;
3085
+ }
3086
+ case 3: {
3087
+ if (tag !== 26) {
3088
+ break;
3089
+ }
3090
+ message.ImportId = bcl.Guid.decode(reader, reader.uint32());
3091
+ continue;
3092
+ }
3093
+ }
3094
+ if ((tag & 7) === 4 || tag === 0) {
3095
+ break;
3096
+ }
3097
+ reader.skip(tag & 7);
3098
+ }
3099
+ return message;
3100
+ }
3101
+ finally {
3102
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3103
+ }
3104
+ },
3105
+ fromJSON(object) {
3106
+ return {
3107
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
3108
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
3109
+ ImportId: isSet(object.ImportId) ? bcl.Guid.fromJSON(object.ImportId) : undefined,
3110
+ };
3111
+ },
3112
+ toJSON(message) {
3113
+ const obj = {};
3114
+ if (message.EventStore !== "") {
3115
+ obj.EventStore = message.EventStore;
3116
+ }
3117
+ if (message.Namespace !== "") {
3118
+ obj.Namespace = message.Namespace;
3119
+ }
3120
+ if (message.ImportId !== undefined) {
3121
+ obj.ImportId = bcl.Guid.toJSON(message.ImportId);
3122
+ }
3123
+ return obj;
3124
+ },
3125
+ create(base) {
3126
+ return ObserveImportRequest.fromPartial(base ?? {});
3127
+ },
3128
+ fromPartial(object) {
3129
+ const message = createBaseObserveImportRequest();
3130
+ message.EventStore = object.EventStore ?? "";
3131
+ message.Namespace = object.Namespace ?? "";
3132
+ message.ImportId = (object.ImportId !== undefined && object.ImportId !== null)
3133
+ ? bcl.Guid.fromPartial(object.ImportId)
3134
+ : undefined;
3135
+ return message;
3136
+ },
3137
+ };
3138
+ function createBaseQueryResultImportProgressResponse() {
3139
+ return {
3140
+ CorrelationId: undefined,
3141
+ IsAuthorized: false,
3142
+ ValidationResults: [],
3143
+ ExceptionMessages: [],
3144
+ ExceptionStackTrace: "",
3145
+ Data: undefined,
3146
+ };
3147
+ }
3148
+ const QueryResultImportProgressResponse = {
3149
+ encode(message, writer = new wire.BinaryWriter()) {
3150
+ if (message.CorrelationId !== undefined) {
3151
+ bcl.Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
3152
+ }
3153
+ if (message.IsAuthorized !== false) {
3154
+ writer.uint32(16).bool(message.IsAuthorized);
3155
+ }
3156
+ for (const v of message.ValidationResults) {
3157
+ ValidationResult.encode(v, writer.uint32(26).fork()).join();
3158
+ }
3159
+ for (const v of message.ExceptionMessages) {
3160
+ writer.uint32(34).string(v);
3161
+ }
3162
+ if (message.ExceptionStackTrace !== "") {
3163
+ writer.uint32(42).string(message.ExceptionStackTrace);
3164
+ }
3165
+ if (message.Data !== undefined) {
3166
+ ImportProgressResponse.encode(message.Data, writer.uint32(50).fork()).join();
3167
+ }
3168
+ return writer;
3169
+ },
3170
+ decode(input, length) {
3171
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
3172
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3173
+ if (previousRecursionDepth >= 100) {
3174
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3175
+ }
3176
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3177
+ try {
3178
+ const end = length === undefined ? reader.len : reader.pos + length;
3179
+ const message = createBaseQueryResultImportProgressResponse();
3180
+ while (reader.pos < end) {
3181
+ const tag = reader.uint32();
3182
+ switch (tag >>> 3) {
3183
+ case 1: {
3184
+ if (tag !== 10) {
3185
+ break;
3186
+ }
3187
+ message.CorrelationId = bcl.Guid.decode(reader, reader.uint32());
3188
+ continue;
3189
+ }
3190
+ case 2: {
3191
+ if (tag !== 16) {
3192
+ break;
3193
+ }
3194
+ message.IsAuthorized = reader.bool();
3195
+ continue;
3196
+ }
3197
+ case 3: {
3198
+ if (tag !== 26) {
3199
+ break;
3200
+ }
3201
+ message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32()));
3202
+ continue;
3203
+ }
3204
+ case 4: {
3205
+ if (tag !== 34) {
3206
+ break;
3207
+ }
3208
+ message.ExceptionMessages.push(reader.string());
3209
+ continue;
3210
+ }
3211
+ case 5: {
3212
+ if (tag !== 42) {
3213
+ break;
3214
+ }
3215
+ message.ExceptionStackTrace = reader.string();
3216
+ continue;
3217
+ }
3218
+ case 6: {
3219
+ if (tag !== 50) {
3220
+ break;
3221
+ }
3222
+ message.Data = ImportProgressResponse.decode(reader, reader.uint32());
3223
+ continue;
3224
+ }
3225
+ }
3226
+ if ((tag & 7) === 4 || tag === 0) {
3227
+ break;
3228
+ }
3229
+ reader.skip(tag & 7);
3230
+ }
3231
+ return message;
3232
+ }
3233
+ finally {
3234
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3235
+ }
3236
+ },
3237
+ fromJSON(object) {
3238
+ return {
3239
+ CorrelationId: isSet(object.CorrelationId) ? bcl.Guid.fromJSON(object.CorrelationId) : undefined,
3240
+ IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false,
3241
+ ValidationResults: globalThis.Array.isArray(object?.ValidationResults)
3242
+ ? object.ValidationResults.map((e) => ValidationResult.fromJSON(e))
3243
+ : [],
3244
+ ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages)
3245
+ ? object.ExceptionMessages.map((e) => globalThis.String(e))
3246
+ : [],
3247
+ ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "",
3248
+ Data: isSet(object.Data) ? ImportProgressResponse.fromJSON(object.Data) : undefined,
3249
+ };
3250
+ },
3251
+ toJSON(message) {
3252
+ const obj = {};
3253
+ if (message.CorrelationId !== undefined) {
3254
+ obj.CorrelationId = bcl.Guid.toJSON(message.CorrelationId);
3255
+ }
3256
+ if (message.IsAuthorized !== false) {
3257
+ obj.IsAuthorized = message.IsAuthorized;
3258
+ }
3259
+ if (message.ValidationResults?.length) {
3260
+ obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e));
3261
+ }
3262
+ if (message.ExceptionMessages?.length) {
3263
+ obj.ExceptionMessages = message.ExceptionMessages;
3264
+ }
3265
+ if (message.ExceptionStackTrace !== "") {
3266
+ obj.ExceptionStackTrace = message.ExceptionStackTrace;
3267
+ }
3268
+ if (message.Data !== undefined) {
3269
+ obj.Data = ImportProgressResponse.toJSON(message.Data);
3270
+ }
3271
+ return obj;
3272
+ },
3273
+ create(base) {
3274
+ return QueryResultImportProgressResponse.fromPartial(base ?? {});
3275
+ },
3276
+ fromPartial(object) {
3277
+ const message = createBaseQueryResultImportProgressResponse();
3278
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
3279
+ ? bcl.Guid.fromPartial(object.CorrelationId)
3280
+ : undefined;
3281
+ message.IsAuthorized = object.IsAuthorized ?? false;
3282
+ message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || [];
3283
+ message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || [];
3284
+ message.ExceptionStackTrace = object.ExceptionStackTrace ?? "";
3285
+ message.Data = (object.Data !== undefined && object.Data !== null)
3286
+ ? ImportProgressResponse.fromPartial(object.Data)
3287
+ : undefined;
3288
+ return message;
3289
+ },
3290
+ };
3291
+ function createBaseSerializableDateTimeOffset() {
3292
+ return { Value: "" };
3293
+ }
3294
+ const SerializableDateTimeOffset = {
3295
+ encode(message, writer = new wire.BinaryWriter()) {
3296
+ if (message.Value !== "") {
3297
+ writer.uint32(10).string(message.Value);
3298
+ }
3299
+ return writer;
3300
+ },
3301
+ decode(input, length) {
3302
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
3303
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3304
+ if (previousRecursionDepth >= 100) {
3305
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3306
+ }
3307
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3308
+ try {
3309
+ const end = length === undefined ? reader.len : reader.pos + length;
3310
+ const message = createBaseSerializableDateTimeOffset();
3311
+ while (reader.pos < end) {
3312
+ const tag = reader.uint32();
3313
+ switch (tag >>> 3) {
3314
+ case 1: {
3315
+ if (tag !== 10) {
3316
+ break;
3317
+ }
3318
+ message.Value = reader.string();
3319
+ continue;
3320
+ }
3321
+ }
3322
+ if ((tag & 7) === 4 || tag === 0) {
3323
+ break;
3324
+ }
3325
+ reader.skip(tag & 7);
3326
+ }
3327
+ return message;
3328
+ }
3329
+ finally {
3330
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3331
+ }
3332
+ },
3333
+ fromJSON(object) {
3334
+ return { Value: isSet(object.Value) ? globalThis.String(object.Value) : "" };
3335
+ },
3336
+ toJSON(message) {
3337
+ const obj = {};
3338
+ if (message.Value !== "") {
3339
+ obj.Value = message.Value;
3340
+ }
3341
+ return obj;
3342
+ },
3343
+ create(base) {
3344
+ return SerializableDateTimeOffset.fromPartial(base ?? {});
3345
+ },
3346
+ fromPartial(object) {
3347
+ const message = createBaseSerializableDateTimeOffset();
3348
+ message.Value = object.Value ?? "";
3349
+ return message;
3350
+ },
3351
+ };
3352
+ function createBaseValidationResult() {
3353
+ return { Severity: 0, Message: "", Members: [] };
3354
+ }
3355
+ const ValidationResult = {
3356
+ encode(message, writer = new wire.BinaryWriter()) {
3357
+ if (message.Severity !== 0) {
3358
+ writer.uint32(8).int32(message.Severity);
3359
+ }
3360
+ if (message.Message !== "") {
3361
+ writer.uint32(18).string(message.Message);
3362
+ }
3363
+ for (const v of message.Members) {
3364
+ writer.uint32(26).string(v);
3365
+ }
3366
+ return writer;
3367
+ },
3368
+ decode(input, length) {
3369
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
3370
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
3371
+ if (previousRecursionDepth >= 100) {
3372
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
3373
+ }
3374
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
3375
+ try {
3376
+ const end = length === undefined ? reader.len : reader.pos + length;
3377
+ const message = createBaseValidationResult();
3378
+ while (reader.pos < end) {
3379
+ const tag = reader.uint32();
3380
+ switch (tag >>> 3) {
3381
+ case 1: {
3382
+ if (tag !== 8) {
3383
+ break;
3384
+ }
3385
+ message.Severity = reader.int32();
3386
+ continue;
3387
+ }
3388
+ case 2: {
3389
+ if (tag !== 18) {
3390
+ break;
3391
+ }
3392
+ message.Message = reader.string();
3393
+ continue;
3394
+ }
3395
+ case 3: {
3396
+ if (tag !== 26) {
3397
+ break;
3398
+ }
3399
+ message.Members.push(reader.string());
3400
+ continue;
3401
+ }
3402
+ }
3403
+ if ((tag & 7) === 4 || tag === 0) {
3404
+ break;
3405
+ }
3406
+ reader.skip(tag & 7);
3407
+ }
3408
+ return message;
3409
+ }
3410
+ finally {
3411
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
3412
+ }
3413
+ },
3414
+ fromJSON(object) {
3415
+ return {
3416
+ Severity: isSet(object.Severity) ? validationResultSeverityFromJSON(object.Severity) : 0,
3417
+ Message: isSet(object.Message) ? globalThis.String(object.Message) : "",
3418
+ Members: globalThis.Array.isArray(object?.Members) ? object.Members.map((e) => globalThis.String(e)) : [],
3419
+ };
3420
+ },
3421
+ toJSON(message) {
3422
+ const obj = {};
3423
+ if (message.Severity !== 0) {
3424
+ obj.Severity = validationResultSeverityToJSON(message.Severity);
3425
+ }
3426
+ if (message.Message !== "") {
3427
+ obj.Message = message.Message;
3428
+ }
3429
+ if (message.Members?.length) {
3430
+ obj.Members = message.Members;
3431
+ }
3432
+ return obj;
3433
+ },
3434
+ create(base) {
3435
+ return ValidationResult.fromPartial(base ?? {});
3436
+ },
3437
+ fromPartial(object) {
3438
+ const message = createBaseValidationResult();
3439
+ message.Severity = object.Severity ?? 0;
3440
+ message.Message = object.Message ?? "";
3441
+ message.Members = object.Members?.map((e) => e) || [];
3442
+ return message;
3443
+ },
3444
+ };
3445
+ const ImportsDefinition = {
3446
+ name: "Imports",
3447
+ fullName: "Cratis.Chronicle.Contracts.Imports.Imports",
3448
+ methods: {
3449
+ abandonImport: {
3450
+ name: "AbandonImport",
3451
+ requestType: AbandonImportRequest,
3452
+ requestStream: false,
3453
+ responseType: CommandResultAbandonImportResponse,
3454
+ responseStream: false,
3455
+ options: {},
3456
+ },
3457
+ addImportChunk: {
3458
+ name: "AddImportChunk",
3459
+ requestType: AddImportChunkRequest,
3460
+ requestStream: false,
3461
+ responseType: CommandResultAddImportChunkResponse,
3462
+ responseStream: false,
3463
+ options: {},
3464
+ },
3465
+ beginImport: {
3466
+ name: "BeginImport",
3467
+ requestType: BeginImportRequest,
3468
+ requestStream: false,
3469
+ responseType: CommandResultBeginImportResponse,
3470
+ responseStream: false,
3471
+ options: {},
3472
+ },
3473
+ completeImport: {
3474
+ name: "CompleteImport",
3475
+ requestType: CompleteImportRequest,
3476
+ requestStream: false,
3477
+ responseType: CommandResultAbandonImportResponse,
3478
+ responseStream: false,
3479
+ options: {},
3480
+ },
3481
+ getImport: {
3482
+ name: "GetImport",
3483
+ requestType: GetImportRequest,
3484
+ requestStream: false,
3485
+ responseType: QueryResultImportProgressResponse,
3486
+ responseStream: false,
3487
+ options: {},
3488
+ },
3489
+ observeImport: {
3490
+ name: "ObserveImport",
3491
+ requestType: ObserveImportRequest,
3492
+ requestStream: false,
3493
+ responseType: QueryResultImportProgressResponse,
3494
+ responseStream: true,
3495
+ options: {},
3496
+ },
3497
+ },
3498
+ };
3499
+ function isObject(value) {
3500
+ return typeof value === "object" && value !== null;
3501
+ }
3502
+ function isSet(value) {
3503
+ return value !== null && value !== undefined;
3504
+ }
3505
+
3506
+ exports.AbandonImportRequest = AbandonImportRequest;
3507
+ exports.AbandonImportResponse = AbandonImportResponse;
3508
+ exports.AddImportChunkRequest = AddImportChunkRequest;
3509
+ exports.AddImportChunkResponse = AddImportChunkResponse;
3510
+ exports.BeginImportRequest = BeginImportRequest;
3511
+ exports.BeginImportResponse = BeginImportResponse;
3512
+ exports.Causation = Causation;
3513
+ exports.Causation_PropertiesEntry = Causation_PropertiesEntry;
3514
+ exports.CommandResultAbandonImportResponse = CommandResultAbandonImportResponse;
3515
+ exports.CommandResultAddImportChunkResponse = CommandResultAddImportChunkResponse;
3516
+ exports.CommandResultBeginImportResponse = CommandResultBeginImportResponse;
3517
+ exports.CompleteImportRequest = CompleteImportRequest;
3518
+ exports.EventType = EventType;
3519
+ exports.GetImportRequest = GetImportRequest;
3520
+ exports.Identity = Identity;
3521
+ exports.ImportEvent = ImportEvent;
3522
+ exports.ImportEventRejection = ImportEventRejection;
3523
+ exports.ImportProgressResponse = ImportProgressResponse;
3524
+ exports.ImportSequenceRange = ImportSequenceRange;
3525
+ exports.ImportsDefinition = ImportsDefinition;
3526
+ exports.NamedTag = NamedTag;
3527
+ exports.ObserveImportRequest = ObserveImportRequest;
3528
+ exports.QueryResultImportProgressResponse = QueryResultImportProgressResponse;
3529
+ exports.SerializableDateTimeOffset = SerializableDateTimeOffset;
3530
+ exports.ValidationResult = ValidationResult;
3531
+ exports.importStateFromJSON = importStateFromJSON;
3532
+ exports.importStateToJSON = importStateToJSON;
3533
+ exports.onInvalidEventFromJSON = onInvalidEventFromJSON;
3534
+ exports.onInvalidEventToJSON = onInvalidEventToJSON;
3535
+ exports.validationResultSeverityFromJSON = validationResultSeverityFromJSON;
3536
+ exports.validationResultSeverityToJSON = validationResultSeverityToJSON;
3537
+ //# sourceMappingURL=imports.js.map