@kronos-ts/kronosdb 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/connection.d.ts +86 -0
  2. package/dist/connection.d.ts.map +1 -0
  3. package/dist/connection.js +133 -0
  4. package/dist/connection.js.map +1 -0
  5. package/dist/errors.d.ts +72 -0
  6. package/dist/errors.d.ts.map +1 -0
  7. package/dist/errors.js +149 -0
  8. package/dist/errors.js.map +1 -0
  9. package/dist/event-processor-info.d.ts +32 -0
  10. package/dist/event-processor-info.d.ts.map +1 -0
  11. package/dist/event-processor-info.js +24 -0
  12. package/dist/event-processor-info.js.map +1 -0
  13. package/dist/flow-controlled-sender.d.ts +12 -0
  14. package/dist/flow-controlled-sender.d.ts.map +1 -0
  15. package/dist/flow-controlled-sender.js +53 -0
  16. package/dist/flow-controlled-sender.js.map +1 -0
  17. package/dist/generated/command.d.ts +169 -0
  18. package/dist/generated/command.d.ts.map +1 -0
  19. package/dist/generated/command.js +964 -0
  20. package/dist/generated/command.js.map +1 -0
  21. package/dist/generated/common.d.ts +76 -0
  22. package/dist/generated/common.d.ts.map +1 -0
  23. package/dist/generated/common.js +648 -0
  24. package/dist/generated/common.js.map +1 -0
  25. package/dist/generated/eventstore.d.ts +337 -0
  26. package/dist/generated/eventstore.d.ts.map +1 -0
  27. package/dist/generated/eventstore.js +1757 -0
  28. package/dist/generated/eventstore.js.map +1 -0
  29. package/dist/generated/platform.d.ts +242 -0
  30. package/dist/generated/platform.d.ts.map +1 -0
  31. package/dist/generated/platform.js +1525 -0
  32. package/dist/generated/platform.js.map +1 -0
  33. package/dist/generated/query.d.ts +265 -0
  34. package/dist/generated/query.d.ts.map +1 -0
  35. package/dist/generated/query.js +2114 -0
  36. package/dist/generated/query.js.map +1 -0
  37. package/dist/generated/snapshot.d.ts +180 -0
  38. package/dist/generated/snapshot.d.ts.map +1 -0
  39. package/dist/generated/snapshot.js +861 -0
  40. package/dist/generated/snapshot.js.map +1 -0
  41. package/dist/index.d.ts +13 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +13 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/kronosdb-event-store.d.ts +17 -0
  46. package/dist/kronosdb-event-store.d.ts.map +1 -0
  47. package/dist/kronosdb-event-store.js +328 -0
  48. package/dist/kronosdb-event-store.js.map +1 -0
  49. package/dist/kronosdb-snapshot-store.d.ts +10 -0
  50. package/dist/kronosdb-snapshot-store.d.ts.map +1 -0
  51. package/dist/kronosdb-snapshot-store.js +79 -0
  52. package/dist/kronosdb-snapshot-store.js.map +1 -0
  53. package/dist/kronosdb.d.ts +53 -0
  54. package/dist/kronosdb.d.ts.map +1 -0
  55. package/dist/kronosdb.js +852 -0
  56. package/dist/kronosdb.js.map +1 -0
  57. package/dist/metadata-conversion.d.ts +37 -0
  58. package/dist/metadata-conversion.d.ts.map +1 -0
  59. package/dist/metadata-conversion.js +75 -0
  60. package/dist/metadata-conversion.js.map +1 -0
  61. package/dist/outbound-stream.d.ts +15 -0
  62. package/dist/outbound-stream.d.ts.map +1 -0
  63. package/dist/outbound-stream.js +39 -0
  64. package/dist/outbound-stream.js.map +1 -0
  65. package/dist/platform-service.d.ts +87 -0
  66. package/dist/platform-service.d.ts.map +1 -0
  67. package/dist/platform-service.js +218 -0
  68. package/dist/platform-service.js.map +1 -0
  69. package/dist/service-definitions.d.ts +187 -0
  70. package/dist/service-definitions.d.ts.map +1 -0
  71. package/dist/service-definitions.js +18 -0
  72. package/dist/service-definitions.js.map +1 -0
  73. package/dist/shutdown-latch.d.ts +18 -0
  74. package/dist/shutdown-latch.d.ts.map +1 -0
  75. package/dist/shutdown-latch.js +51 -0
  76. package/dist/shutdown-latch.js.map +1 -0
  77. package/package.json +69 -0
  78. package/src/connection.ts +235 -0
  79. package/src/errors.ts +173 -0
  80. package/src/event-processor-info.ts +53 -0
  81. package/src/flow-controlled-sender.ts +73 -0
  82. package/src/generated/command.ts +1226 -0
  83. package/src/generated/common.ts +770 -0
  84. package/src/generated/eventstore.ts +2241 -0
  85. package/src/generated/platform.ts +1914 -0
  86. package/src/generated/query.ts +2571 -0
  87. package/src/generated/snapshot.ts +1110 -0
  88. package/src/index.ts +87 -0
  89. package/src/kronosdb-event-store.ts +401 -0
  90. package/src/kronosdb-snapshot-store.ts +104 -0
  91. package/src/kronosdb.ts +1000 -0
  92. package/src/metadata-conversion.ts +85 -0
  93. package/src/outbound-stream.ts +52 -0
  94. package/src/platform-service.ts +297 -0
  95. package/src/service-definitions.ts +25 -0
  96. package/src/shutdown-latch.ts +74 -0
@@ -0,0 +1,1525 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.6
4
+ // protoc v3.19.1
5
+ // source: platform.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { ErrorMessage, InstructionAck } from "./common.js";
9
+ export const protobufPackage = "kronosdb.platform";
10
+ function createBaseClientIdentification() {
11
+ return { clientId: "", componentName: "", version: "", tags: {} };
12
+ }
13
+ export const ClientIdentification = {
14
+ encode(message, writer = new BinaryWriter()) {
15
+ if (message.clientId !== "") {
16
+ writer.uint32(10).string(message.clientId);
17
+ }
18
+ if (message.componentName !== "") {
19
+ writer.uint32(18).string(message.componentName);
20
+ }
21
+ if (message.version !== "") {
22
+ writer.uint32(26).string(message.version);
23
+ }
24
+ globalThis.Object.entries(message.tags).forEach(([key, value]) => {
25
+ ClientIdentification_TagsEntry.encode({ key: key, value }, writer.uint32(34).fork()).join();
26
+ });
27
+ return writer;
28
+ },
29
+ decode(input, length) {
30
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
31
+ const end = length === undefined ? reader.len : reader.pos + length;
32
+ const message = createBaseClientIdentification();
33
+ while (reader.pos < end) {
34
+ const tag = reader.uint32();
35
+ switch (tag >>> 3) {
36
+ case 1: {
37
+ if (tag !== 10) {
38
+ break;
39
+ }
40
+ message.clientId = reader.string();
41
+ continue;
42
+ }
43
+ case 2: {
44
+ if (tag !== 18) {
45
+ break;
46
+ }
47
+ message.componentName = reader.string();
48
+ continue;
49
+ }
50
+ case 3: {
51
+ if (tag !== 26) {
52
+ break;
53
+ }
54
+ message.version = reader.string();
55
+ continue;
56
+ }
57
+ case 4: {
58
+ if (tag !== 34) {
59
+ break;
60
+ }
61
+ const entry4 = ClientIdentification_TagsEntry.decode(reader, reader.uint32());
62
+ if (entry4.value !== undefined) {
63
+ message.tags[entry4.key] = entry4.value;
64
+ }
65
+ continue;
66
+ }
67
+ }
68
+ if ((tag & 7) === 4 || tag === 0) {
69
+ break;
70
+ }
71
+ reader.skip(tag & 7);
72
+ }
73
+ return message;
74
+ },
75
+ fromJSON(object) {
76
+ return {
77
+ clientId: isSet(object.clientId)
78
+ ? globalThis.String(object.clientId)
79
+ : isSet(object.client_id)
80
+ ? globalThis.String(object.client_id)
81
+ : "",
82
+ componentName: isSet(object.componentName)
83
+ ? globalThis.String(object.componentName)
84
+ : isSet(object.component_name)
85
+ ? globalThis.String(object.component_name)
86
+ : "",
87
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
88
+ tags: isObject(object.tags)
89
+ ? globalThis.Object.entries(object.tags).reduce((acc, [key, value]) => {
90
+ acc[key] = globalThis.String(value);
91
+ return acc;
92
+ }, {})
93
+ : {},
94
+ };
95
+ },
96
+ toJSON(message) {
97
+ const obj = {};
98
+ if (message.clientId !== "") {
99
+ obj.clientId = message.clientId;
100
+ }
101
+ if (message.componentName !== "") {
102
+ obj.componentName = message.componentName;
103
+ }
104
+ if (message.version !== "") {
105
+ obj.version = message.version;
106
+ }
107
+ if (message.tags) {
108
+ const entries = globalThis.Object.entries(message.tags);
109
+ if (entries.length > 0) {
110
+ obj.tags = {};
111
+ entries.forEach(([k, v]) => {
112
+ obj.tags[k] = v;
113
+ });
114
+ }
115
+ }
116
+ return obj;
117
+ },
118
+ create(base) {
119
+ return ClientIdentification.fromPartial(base ?? {});
120
+ },
121
+ fromPartial(object) {
122
+ const message = createBaseClientIdentification();
123
+ message.clientId = object.clientId ?? "";
124
+ message.componentName = object.componentName ?? "";
125
+ message.version = object.version ?? "";
126
+ message.tags = globalThis.Object.entries(object.tags ?? {}).reduce((acc, [key, value]) => {
127
+ if (value !== undefined) {
128
+ acc[key] = globalThis.String(value);
129
+ }
130
+ return acc;
131
+ }, {});
132
+ return message;
133
+ },
134
+ };
135
+ function createBaseClientIdentification_TagsEntry() {
136
+ return { key: "", value: "" };
137
+ }
138
+ export const ClientIdentification_TagsEntry = {
139
+ encode(message, writer = new BinaryWriter()) {
140
+ if (message.key !== "") {
141
+ writer.uint32(10).string(message.key);
142
+ }
143
+ if (message.value !== "") {
144
+ writer.uint32(18).string(message.value);
145
+ }
146
+ return writer;
147
+ },
148
+ decode(input, length) {
149
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
150
+ const end = length === undefined ? reader.len : reader.pos + length;
151
+ const message = createBaseClientIdentification_TagsEntry();
152
+ while (reader.pos < end) {
153
+ const tag = reader.uint32();
154
+ switch (tag >>> 3) {
155
+ case 1: {
156
+ if (tag !== 10) {
157
+ break;
158
+ }
159
+ message.key = reader.string();
160
+ continue;
161
+ }
162
+ case 2: {
163
+ if (tag !== 18) {
164
+ break;
165
+ }
166
+ message.value = reader.string();
167
+ continue;
168
+ }
169
+ }
170
+ if ((tag & 7) === 4 || tag === 0) {
171
+ break;
172
+ }
173
+ reader.skip(tag & 7);
174
+ }
175
+ return message;
176
+ },
177
+ fromJSON(object) {
178
+ return {
179
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
180
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
181
+ };
182
+ },
183
+ toJSON(message) {
184
+ const obj = {};
185
+ if (message.key !== "") {
186
+ obj.key = message.key;
187
+ }
188
+ if (message.value !== "") {
189
+ obj.value = message.value;
190
+ }
191
+ return obj;
192
+ },
193
+ create(base) {
194
+ return ClientIdentification_TagsEntry.fromPartial(base ?? {});
195
+ },
196
+ fromPartial(object) {
197
+ const message = createBaseClientIdentification_TagsEntry();
198
+ message.key = object.key ?? "";
199
+ message.value = object.value ?? "";
200
+ return message;
201
+ },
202
+ };
203
+ function createBasePlatformInfo() {
204
+ return { nodeName: "", version: "", contexts: [] };
205
+ }
206
+ export const PlatformInfo = {
207
+ encode(message, writer = new BinaryWriter()) {
208
+ if (message.nodeName !== "") {
209
+ writer.uint32(10).string(message.nodeName);
210
+ }
211
+ if (message.version !== "") {
212
+ writer.uint32(18).string(message.version);
213
+ }
214
+ for (const v of message.contexts) {
215
+ writer.uint32(26).string(v);
216
+ }
217
+ return writer;
218
+ },
219
+ decode(input, length) {
220
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
221
+ const end = length === undefined ? reader.len : reader.pos + length;
222
+ const message = createBasePlatformInfo();
223
+ while (reader.pos < end) {
224
+ const tag = reader.uint32();
225
+ switch (tag >>> 3) {
226
+ case 1: {
227
+ if (tag !== 10) {
228
+ break;
229
+ }
230
+ message.nodeName = reader.string();
231
+ continue;
232
+ }
233
+ case 2: {
234
+ if (tag !== 18) {
235
+ break;
236
+ }
237
+ message.version = reader.string();
238
+ continue;
239
+ }
240
+ case 3: {
241
+ if (tag !== 26) {
242
+ break;
243
+ }
244
+ message.contexts.push(reader.string());
245
+ continue;
246
+ }
247
+ }
248
+ if ((tag & 7) === 4 || tag === 0) {
249
+ break;
250
+ }
251
+ reader.skip(tag & 7);
252
+ }
253
+ return message;
254
+ },
255
+ fromJSON(object) {
256
+ return {
257
+ nodeName: isSet(object.nodeName)
258
+ ? globalThis.String(object.nodeName)
259
+ : isSet(object.node_name)
260
+ ? globalThis.String(object.node_name)
261
+ : "",
262
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
263
+ contexts: globalThis.Array.isArray(object?.contexts) ? object.contexts.map((e) => globalThis.String(e)) : [],
264
+ };
265
+ },
266
+ toJSON(message) {
267
+ const obj = {};
268
+ if (message.nodeName !== "") {
269
+ obj.nodeName = message.nodeName;
270
+ }
271
+ if (message.version !== "") {
272
+ obj.version = message.version;
273
+ }
274
+ if (message.contexts?.length) {
275
+ obj.contexts = message.contexts;
276
+ }
277
+ return obj;
278
+ },
279
+ create(base) {
280
+ return PlatformInfo.fromPartial(base ?? {});
281
+ },
282
+ fromPartial(object) {
283
+ const message = createBasePlatformInfo();
284
+ message.nodeName = object.nodeName ?? "";
285
+ message.version = object.version ?? "";
286
+ message.contexts = object.contexts?.map((e) => e) || [];
287
+ return message;
288
+ },
289
+ };
290
+ function createBasePlatformInbound() {
291
+ return {
292
+ register: undefined,
293
+ heartbeat: undefined,
294
+ ack: undefined,
295
+ eventProcessorInfo: undefined,
296
+ result: undefined,
297
+ };
298
+ }
299
+ export const PlatformInbound = {
300
+ encode(message, writer = new BinaryWriter()) {
301
+ if (message.register !== undefined) {
302
+ ClientIdentification.encode(message.register, writer.uint32(10).fork()).join();
303
+ }
304
+ if (message.heartbeat !== undefined) {
305
+ Heartbeat.encode(message.heartbeat, writer.uint32(18).fork()).join();
306
+ }
307
+ if (message.ack !== undefined) {
308
+ InstructionAck.encode(message.ack, writer.uint32(26).fork()).join();
309
+ }
310
+ if (message.eventProcessorInfo !== undefined) {
311
+ EventProcessorInfo.encode(message.eventProcessorInfo, writer.uint32(34).fork()).join();
312
+ }
313
+ if (message.result !== undefined) {
314
+ InstructionResult.encode(message.result, writer.uint32(42).fork()).join();
315
+ }
316
+ return writer;
317
+ },
318
+ decode(input, length) {
319
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
320
+ const end = length === undefined ? reader.len : reader.pos + length;
321
+ const message = createBasePlatformInbound();
322
+ while (reader.pos < end) {
323
+ const tag = reader.uint32();
324
+ switch (tag >>> 3) {
325
+ case 1: {
326
+ if (tag !== 10) {
327
+ break;
328
+ }
329
+ message.register = ClientIdentification.decode(reader, reader.uint32());
330
+ continue;
331
+ }
332
+ case 2: {
333
+ if (tag !== 18) {
334
+ break;
335
+ }
336
+ message.heartbeat = Heartbeat.decode(reader, reader.uint32());
337
+ continue;
338
+ }
339
+ case 3: {
340
+ if (tag !== 26) {
341
+ break;
342
+ }
343
+ message.ack = InstructionAck.decode(reader, reader.uint32());
344
+ continue;
345
+ }
346
+ case 4: {
347
+ if (tag !== 34) {
348
+ break;
349
+ }
350
+ message.eventProcessorInfo = EventProcessorInfo.decode(reader, reader.uint32());
351
+ continue;
352
+ }
353
+ case 5: {
354
+ if (tag !== 42) {
355
+ break;
356
+ }
357
+ message.result = InstructionResult.decode(reader, reader.uint32());
358
+ continue;
359
+ }
360
+ }
361
+ if ((tag & 7) === 4 || tag === 0) {
362
+ break;
363
+ }
364
+ reader.skip(tag & 7);
365
+ }
366
+ return message;
367
+ },
368
+ fromJSON(object) {
369
+ return {
370
+ register: isSet(object.register) ? ClientIdentification.fromJSON(object.register) : undefined,
371
+ heartbeat: isSet(object.heartbeat) ? Heartbeat.fromJSON(object.heartbeat) : undefined,
372
+ ack: isSet(object.ack) ? InstructionAck.fromJSON(object.ack) : undefined,
373
+ eventProcessorInfo: isSet(object.eventProcessorInfo)
374
+ ? EventProcessorInfo.fromJSON(object.eventProcessorInfo)
375
+ : isSet(object.event_processor_info)
376
+ ? EventProcessorInfo.fromJSON(object.event_processor_info)
377
+ : undefined,
378
+ result: isSet(object.result) ? InstructionResult.fromJSON(object.result) : undefined,
379
+ };
380
+ },
381
+ toJSON(message) {
382
+ const obj = {};
383
+ if (message.register !== undefined) {
384
+ obj.register = ClientIdentification.toJSON(message.register);
385
+ }
386
+ if (message.heartbeat !== undefined) {
387
+ obj.heartbeat = Heartbeat.toJSON(message.heartbeat);
388
+ }
389
+ if (message.ack !== undefined) {
390
+ obj.ack = InstructionAck.toJSON(message.ack);
391
+ }
392
+ if (message.eventProcessorInfo !== undefined) {
393
+ obj.eventProcessorInfo = EventProcessorInfo.toJSON(message.eventProcessorInfo);
394
+ }
395
+ if (message.result !== undefined) {
396
+ obj.result = InstructionResult.toJSON(message.result);
397
+ }
398
+ return obj;
399
+ },
400
+ create(base) {
401
+ return PlatformInbound.fromPartial(base ?? {});
402
+ },
403
+ fromPartial(object) {
404
+ const message = createBasePlatformInbound();
405
+ message.register = (object.register !== undefined && object.register !== null)
406
+ ? ClientIdentification.fromPartial(object.register)
407
+ : undefined;
408
+ message.heartbeat = (object.heartbeat !== undefined && object.heartbeat !== null)
409
+ ? Heartbeat.fromPartial(object.heartbeat)
410
+ : undefined;
411
+ message.ack = (object.ack !== undefined && object.ack !== null)
412
+ ? InstructionAck.fromPartial(object.ack)
413
+ : undefined;
414
+ message.eventProcessorInfo = (object.eventProcessorInfo !== undefined && object.eventProcessorInfo !== null)
415
+ ? EventProcessorInfo.fromPartial(object.eventProcessorInfo)
416
+ : undefined;
417
+ message.result = (object.result !== undefined && object.result !== null)
418
+ ? InstructionResult.fromPartial(object.result)
419
+ : undefined;
420
+ return message;
421
+ },
422
+ };
423
+ function createBasePlatformOutbound() {
424
+ return {
425
+ nodeNotification: undefined,
426
+ heartbeat: undefined,
427
+ requestReconnect: undefined,
428
+ pauseEventProcessor: undefined,
429
+ startEventProcessor: undefined,
430
+ releaseSegment: undefined,
431
+ requestEventProcessorInfo: undefined,
432
+ splitEventProcessorSegment: undefined,
433
+ mergeEventProcessorSegment: undefined,
434
+ topologyNotification: undefined,
435
+ instructionId: "",
436
+ };
437
+ }
438
+ export const PlatformOutbound = {
439
+ encode(message, writer = new BinaryWriter()) {
440
+ if (message.nodeNotification !== undefined) {
441
+ PlatformInfo.encode(message.nodeNotification, writer.uint32(10).fork()).join();
442
+ }
443
+ if (message.heartbeat !== undefined) {
444
+ Heartbeat.encode(message.heartbeat, writer.uint32(18).fork()).join();
445
+ }
446
+ if (message.requestReconnect !== undefined) {
447
+ RequestReconnect.encode(message.requestReconnect, writer.uint32(26).fork()).join();
448
+ }
449
+ if (message.pauseEventProcessor !== undefined) {
450
+ EventProcessorReference.encode(message.pauseEventProcessor, writer.uint32(34).fork()).join();
451
+ }
452
+ if (message.startEventProcessor !== undefined) {
453
+ EventProcessorReference.encode(message.startEventProcessor, writer.uint32(42).fork()).join();
454
+ }
455
+ if (message.releaseSegment !== undefined) {
456
+ EventProcessorSegmentReference.encode(message.releaseSegment, writer.uint32(50).fork()).join();
457
+ }
458
+ if (message.requestEventProcessorInfo !== undefined) {
459
+ EventProcessorReference.encode(message.requestEventProcessorInfo, writer.uint32(58).fork()).join();
460
+ }
461
+ if (message.splitEventProcessorSegment !== undefined) {
462
+ EventProcessorSegmentReference.encode(message.splitEventProcessorSegment, writer.uint32(66).fork()).join();
463
+ }
464
+ if (message.mergeEventProcessorSegment !== undefined) {
465
+ EventProcessorSegmentReference.encode(message.mergeEventProcessorSegment, writer.uint32(74).fork()).join();
466
+ }
467
+ if (message.topologyNotification !== undefined) {
468
+ TopologyNotification.encode(message.topologyNotification, writer.uint32(90).fork()).join();
469
+ }
470
+ if (message.instructionId !== "") {
471
+ writer.uint32(82).string(message.instructionId);
472
+ }
473
+ return writer;
474
+ },
475
+ decode(input, length) {
476
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
477
+ const end = length === undefined ? reader.len : reader.pos + length;
478
+ const message = createBasePlatformOutbound();
479
+ while (reader.pos < end) {
480
+ const tag = reader.uint32();
481
+ switch (tag >>> 3) {
482
+ case 1: {
483
+ if (tag !== 10) {
484
+ break;
485
+ }
486
+ message.nodeNotification = PlatformInfo.decode(reader, reader.uint32());
487
+ continue;
488
+ }
489
+ case 2: {
490
+ if (tag !== 18) {
491
+ break;
492
+ }
493
+ message.heartbeat = Heartbeat.decode(reader, reader.uint32());
494
+ continue;
495
+ }
496
+ case 3: {
497
+ if (tag !== 26) {
498
+ break;
499
+ }
500
+ message.requestReconnect = RequestReconnect.decode(reader, reader.uint32());
501
+ continue;
502
+ }
503
+ case 4: {
504
+ if (tag !== 34) {
505
+ break;
506
+ }
507
+ message.pauseEventProcessor = EventProcessorReference.decode(reader, reader.uint32());
508
+ continue;
509
+ }
510
+ case 5: {
511
+ if (tag !== 42) {
512
+ break;
513
+ }
514
+ message.startEventProcessor = EventProcessorReference.decode(reader, reader.uint32());
515
+ continue;
516
+ }
517
+ case 6: {
518
+ if (tag !== 50) {
519
+ break;
520
+ }
521
+ message.releaseSegment = EventProcessorSegmentReference.decode(reader, reader.uint32());
522
+ continue;
523
+ }
524
+ case 7: {
525
+ if (tag !== 58) {
526
+ break;
527
+ }
528
+ message.requestEventProcessorInfo = EventProcessorReference.decode(reader, reader.uint32());
529
+ continue;
530
+ }
531
+ case 8: {
532
+ if (tag !== 66) {
533
+ break;
534
+ }
535
+ message.splitEventProcessorSegment = EventProcessorSegmentReference.decode(reader, reader.uint32());
536
+ continue;
537
+ }
538
+ case 9: {
539
+ if (tag !== 74) {
540
+ break;
541
+ }
542
+ message.mergeEventProcessorSegment = EventProcessorSegmentReference.decode(reader, reader.uint32());
543
+ continue;
544
+ }
545
+ case 11: {
546
+ if (tag !== 90) {
547
+ break;
548
+ }
549
+ message.topologyNotification = TopologyNotification.decode(reader, reader.uint32());
550
+ continue;
551
+ }
552
+ case 10: {
553
+ if (tag !== 82) {
554
+ break;
555
+ }
556
+ message.instructionId = reader.string();
557
+ continue;
558
+ }
559
+ }
560
+ if ((tag & 7) === 4 || tag === 0) {
561
+ break;
562
+ }
563
+ reader.skip(tag & 7);
564
+ }
565
+ return message;
566
+ },
567
+ fromJSON(object) {
568
+ return {
569
+ nodeNotification: isSet(object.nodeNotification)
570
+ ? PlatformInfo.fromJSON(object.nodeNotification)
571
+ : isSet(object.node_notification)
572
+ ? PlatformInfo.fromJSON(object.node_notification)
573
+ : undefined,
574
+ heartbeat: isSet(object.heartbeat) ? Heartbeat.fromJSON(object.heartbeat) : undefined,
575
+ requestReconnect: isSet(object.requestReconnect)
576
+ ? RequestReconnect.fromJSON(object.requestReconnect)
577
+ : isSet(object.request_reconnect)
578
+ ? RequestReconnect.fromJSON(object.request_reconnect)
579
+ : undefined,
580
+ pauseEventProcessor: isSet(object.pauseEventProcessor)
581
+ ? EventProcessorReference.fromJSON(object.pauseEventProcessor)
582
+ : isSet(object.pause_event_processor)
583
+ ? EventProcessorReference.fromJSON(object.pause_event_processor)
584
+ : undefined,
585
+ startEventProcessor: isSet(object.startEventProcessor)
586
+ ? EventProcessorReference.fromJSON(object.startEventProcessor)
587
+ : isSet(object.start_event_processor)
588
+ ? EventProcessorReference.fromJSON(object.start_event_processor)
589
+ : undefined,
590
+ releaseSegment: isSet(object.releaseSegment)
591
+ ? EventProcessorSegmentReference.fromJSON(object.releaseSegment)
592
+ : isSet(object.release_segment)
593
+ ? EventProcessorSegmentReference.fromJSON(object.release_segment)
594
+ : undefined,
595
+ requestEventProcessorInfo: isSet(object.requestEventProcessorInfo)
596
+ ? EventProcessorReference.fromJSON(object.requestEventProcessorInfo)
597
+ : isSet(object.request_event_processor_info)
598
+ ? EventProcessorReference.fromJSON(object.request_event_processor_info)
599
+ : undefined,
600
+ splitEventProcessorSegment: isSet(object.splitEventProcessorSegment)
601
+ ? EventProcessorSegmentReference.fromJSON(object.splitEventProcessorSegment)
602
+ : isSet(object.split_event_processor_segment)
603
+ ? EventProcessorSegmentReference.fromJSON(object.split_event_processor_segment)
604
+ : undefined,
605
+ mergeEventProcessorSegment: isSet(object.mergeEventProcessorSegment)
606
+ ? EventProcessorSegmentReference.fromJSON(object.mergeEventProcessorSegment)
607
+ : isSet(object.merge_event_processor_segment)
608
+ ? EventProcessorSegmentReference.fromJSON(object.merge_event_processor_segment)
609
+ : undefined,
610
+ topologyNotification: isSet(object.topologyNotification)
611
+ ? TopologyNotification.fromJSON(object.topologyNotification)
612
+ : isSet(object.topology_notification)
613
+ ? TopologyNotification.fromJSON(object.topology_notification)
614
+ : undefined,
615
+ instructionId: isSet(object.instructionId)
616
+ ? globalThis.String(object.instructionId)
617
+ : isSet(object.instruction_id)
618
+ ? globalThis.String(object.instruction_id)
619
+ : "",
620
+ };
621
+ },
622
+ toJSON(message) {
623
+ const obj = {};
624
+ if (message.nodeNotification !== undefined) {
625
+ obj.nodeNotification = PlatformInfo.toJSON(message.nodeNotification);
626
+ }
627
+ if (message.heartbeat !== undefined) {
628
+ obj.heartbeat = Heartbeat.toJSON(message.heartbeat);
629
+ }
630
+ if (message.requestReconnect !== undefined) {
631
+ obj.requestReconnect = RequestReconnect.toJSON(message.requestReconnect);
632
+ }
633
+ if (message.pauseEventProcessor !== undefined) {
634
+ obj.pauseEventProcessor = EventProcessorReference.toJSON(message.pauseEventProcessor);
635
+ }
636
+ if (message.startEventProcessor !== undefined) {
637
+ obj.startEventProcessor = EventProcessorReference.toJSON(message.startEventProcessor);
638
+ }
639
+ if (message.releaseSegment !== undefined) {
640
+ obj.releaseSegment = EventProcessorSegmentReference.toJSON(message.releaseSegment);
641
+ }
642
+ if (message.requestEventProcessorInfo !== undefined) {
643
+ obj.requestEventProcessorInfo = EventProcessorReference.toJSON(message.requestEventProcessorInfo);
644
+ }
645
+ if (message.splitEventProcessorSegment !== undefined) {
646
+ obj.splitEventProcessorSegment = EventProcessorSegmentReference.toJSON(message.splitEventProcessorSegment);
647
+ }
648
+ if (message.mergeEventProcessorSegment !== undefined) {
649
+ obj.mergeEventProcessorSegment = EventProcessorSegmentReference.toJSON(message.mergeEventProcessorSegment);
650
+ }
651
+ if (message.topologyNotification !== undefined) {
652
+ obj.topologyNotification = TopologyNotification.toJSON(message.topologyNotification);
653
+ }
654
+ if (message.instructionId !== "") {
655
+ obj.instructionId = message.instructionId;
656
+ }
657
+ return obj;
658
+ },
659
+ create(base) {
660
+ return PlatformOutbound.fromPartial(base ?? {});
661
+ },
662
+ fromPartial(object) {
663
+ const message = createBasePlatformOutbound();
664
+ message.nodeNotification = (object.nodeNotification !== undefined && object.nodeNotification !== null)
665
+ ? PlatformInfo.fromPartial(object.nodeNotification)
666
+ : undefined;
667
+ message.heartbeat = (object.heartbeat !== undefined && object.heartbeat !== null)
668
+ ? Heartbeat.fromPartial(object.heartbeat)
669
+ : undefined;
670
+ message.requestReconnect = (object.requestReconnect !== undefined && object.requestReconnect !== null)
671
+ ? RequestReconnect.fromPartial(object.requestReconnect)
672
+ : undefined;
673
+ message.pauseEventProcessor = (object.pauseEventProcessor !== undefined && object.pauseEventProcessor !== null)
674
+ ? EventProcessorReference.fromPartial(object.pauseEventProcessor)
675
+ : undefined;
676
+ message.startEventProcessor = (object.startEventProcessor !== undefined && object.startEventProcessor !== null)
677
+ ? EventProcessorReference.fromPartial(object.startEventProcessor)
678
+ : undefined;
679
+ message.releaseSegment = (object.releaseSegment !== undefined && object.releaseSegment !== null)
680
+ ? EventProcessorSegmentReference.fromPartial(object.releaseSegment)
681
+ : undefined;
682
+ message.requestEventProcessorInfo =
683
+ (object.requestEventProcessorInfo !== undefined && object.requestEventProcessorInfo !== null)
684
+ ? EventProcessorReference.fromPartial(object.requestEventProcessorInfo)
685
+ : undefined;
686
+ message.splitEventProcessorSegment =
687
+ (object.splitEventProcessorSegment !== undefined && object.splitEventProcessorSegment !== null)
688
+ ? EventProcessorSegmentReference.fromPartial(object.splitEventProcessorSegment)
689
+ : undefined;
690
+ message.mergeEventProcessorSegment =
691
+ (object.mergeEventProcessorSegment !== undefined && object.mergeEventProcessorSegment !== null)
692
+ ? EventProcessorSegmentReference.fromPartial(object.mergeEventProcessorSegment)
693
+ : undefined;
694
+ message.topologyNotification = (object.topologyNotification !== undefined && object.topologyNotification !== null)
695
+ ? TopologyNotification.fromPartial(object.topologyNotification)
696
+ : undefined;
697
+ message.instructionId = object.instructionId ?? "";
698
+ return message;
699
+ },
700
+ };
701
+ function createBaseTopologyNotification() {
702
+ return { changeType: "", messageType: "", handlerKind: "", clientId: "", componentName: "" };
703
+ }
704
+ export const TopologyNotification = {
705
+ encode(message, writer = new BinaryWriter()) {
706
+ if (message.changeType !== "") {
707
+ writer.uint32(10).string(message.changeType);
708
+ }
709
+ if (message.messageType !== "") {
710
+ writer.uint32(18).string(message.messageType);
711
+ }
712
+ if (message.handlerKind !== "") {
713
+ writer.uint32(26).string(message.handlerKind);
714
+ }
715
+ if (message.clientId !== "") {
716
+ writer.uint32(34).string(message.clientId);
717
+ }
718
+ if (message.componentName !== "") {
719
+ writer.uint32(42).string(message.componentName);
720
+ }
721
+ return writer;
722
+ },
723
+ decode(input, length) {
724
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
725
+ const end = length === undefined ? reader.len : reader.pos + length;
726
+ const message = createBaseTopologyNotification();
727
+ while (reader.pos < end) {
728
+ const tag = reader.uint32();
729
+ switch (tag >>> 3) {
730
+ case 1: {
731
+ if (tag !== 10) {
732
+ break;
733
+ }
734
+ message.changeType = reader.string();
735
+ continue;
736
+ }
737
+ case 2: {
738
+ if (tag !== 18) {
739
+ break;
740
+ }
741
+ message.messageType = reader.string();
742
+ continue;
743
+ }
744
+ case 3: {
745
+ if (tag !== 26) {
746
+ break;
747
+ }
748
+ message.handlerKind = reader.string();
749
+ continue;
750
+ }
751
+ case 4: {
752
+ if (tag !== 34) {
753
+ break;
754
+ }
755
+ message.clientId = reader.string();
756
+ continue;
757
+ }
758
+ case 5: {
759
+ if (tag !== 42) {
760
+ break;
761
+ }
762
+ message.componentName = reader.string();
763
+ continue;
764
+ }
765
+ }
766
+ if ((tag & 7) === 4 || tag === 0) {
767
+ break;
768
+ }
769
+ reader.skip(tag & 7);
770
+ }
771
+ return message;
772
+ },
773
+ fromJSON(object) {
774
+ return {
775
+ changeType: isSet(object.changeType)
776
+ ? globalThis.String(object.changeType)
777
+ : isSet(object.change_type)
778
+ ? globalThis.String(object.change_type)
779
+ : "",
780
+ messageType: isSet(object.messageType)
781
+ ? globalThis.String(object.messageType)
782
+ : isSet(object.message_type)
783
+ ? globalThis.String(object.message_type)
784
+ : "",
785
+ handlerKind: isSet(object.handlerKind)
786
+ ? globalThis.String(object.handlerKind)
787
+ : isSet(object.handler_kind)
788
+ ? globalThis.String(object.handler_kind)
789
+ : "",
790
+ clientId: isSet(object.clientId)
791
+ ? globalThis.String(object.clientId)
792
+ : isSet(object.client_id)
793
+ ? globalThis.String(object.client_id)
794
+ : "",
795
+ componentName: isSet(object.componentName)
796
+ ? globalThis.String(object.componentName)
797
+ : isSet(object.component_name)
798
+ ? globalThis.String(object.component_name)
799
+ : "",
800
+ };
801
+ },
802
+ toJSON(message) {
803
+ const obj = {};
804
+ if (message.changeType !== "") {
805
+ obj.changeType = message.changeType;
806
+ }
807
+ if (message.messageType !== "") {
808
+ obj.messageType = message.messageType;
809
+ }
810
+ if (message.handlerKind !== "") {
811
+ obj.handlerKind = message.handlerKind;
812
+ }
813
+ if (message.clientId !== "") {
814
+ obj.clientId = message.clientId;
815
+ }
816
+ if (message.componentName !== "") {
817
+ obj.componentName = message.componentName;
818
+ }
819
+ return obj;
820
+ },
821
+ create(base) {
822
+ return TopologyNotification.fromPartial(base ?? {});
823
+ },
824
+ fromPartial(object) {
825
+ const message = createBaseTopologyNotification();
826
+ message.changeType = object.changeType ?? "";
827
+ message.messageType = object.messageType ?? "";
828
+ message.handlerKind = object.handlerKind ?? "";
829
+ message.clientId = object.clientId ?? "";
830
+ message.componentName = object.componentName ?? "";
831
+ return message;
832
+ },
833
+ };
834
+ function createBaseHeartbeat() {
835
+ return {};
836
+ }
837
+ export const Heartbeat = {
838
+ encode(_, writer = new BinaryWriter()) {
839
+ return writer;
840
+ },
841
+ decode(input, length) {
842
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
843
+ const end = length === undefined ? reader.len : reader.pos + length;
844
+ const message = createBaseHeartbeat();
845
+ while (reader.pos < end) {
846
+ const tag = reader.uint32();
847
+ switch (tag >>> 3) {
848
+ }
849
+ if ((tag & 7) === 4 || tag === 0) {
850
+ break;
851
+ }
852
+ reader.skip(tag & 7);
853
+ }
854
+ return message;
855
+ },
856
+ fromJSON(_) {
857
+ return {};
858
+ },
859
+ toJSON(_) {
860
+ const obj = {};
861
+ return obj;
862
+ },
863
+ create(base) {
864
+ return Heartbeat.fromPartial(base ?? {});
865
+ },
866
+ fromPartial(_) {
867
+ const message = createBaseHeartbeat();
868
+ return message;
869
+ },
870
+ };
871
+ function createBaseRequestReconnect() {
872
+ return {};
873
+ }
874
+ export const RequestReconnect = {
875
+ encode(_, writer = new BinaryWriter()) {
876
+ return writer;
877
+ },
878
+ decode(input, length) {
879
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
880
+ const end = length === undefined ? reader.len : reader.pos + length;
881
+ const message = createBaseRequestReconnect();
882
+ while (reader.pos < end) {
883
+ const tag = reader.uint32();
884
+ switch (tag >>> 3) {
885
+ }
886
+ if ((tag & 7) === 4 || tag === 0) {
887
+ break;
888
+ }
889
+ reader.skip(tag & 7);
890
+ }
891
+ return message;
892
+ },
893
+ fromJSON(_) {
894
+ return {};
895
+ },
896
+ toJSON(_) {
897
+ const obj = {};
898
+ return obj;
899
+ },
900
+ create(base) {
901
+ return RequestReconnect.fromPartial(base ?? {});
902
+ },
903
+ fromPartial(_) {
904
+ const message = createBaseRequestReconnect();
905
+ return message;
906
+ },
907
+ };
908
+ function createBaseEventProcessorInfo() {
909
+ return {
910
+ processorName: "",
911
+ mode: "",
912
+ activeThreads: 0,
913
+ running: false,
914
+ error: false,
915
+ segmentStatus: [],
916
+ availableThreads: 0,
917
+ tokenStoreIdentifier: "",
918
+ isStreamingProcessor: false,
919
+ };
920
+ }
921
+ export const EventProcessorInfo = {
922
+ encode(message, writer = new BinaryWriter()) {
923
+ if (message.processorName !== "") {
924
+ writer.uint32(10).string(message.processorName);
925
+ }
926
+ if (message.mode !== "") {
927
+ writer.uint32(18).string(message.mode);
928
+ }
929
+ if (message.activeThreads !== 0) {
930
+ writer.uint32(24).int32(message.activeThreads);
931
+ }
932
+ if (message.running !== false) {
933
+ writer.uint32(32).bool(message.running);
934
+ }
935
+ if (message.error !== false) {
936
+ writer.uint32(40).bool(message.error);
937
+ }
938
+ for (const v of message.segmentStatus) {
939
+ EventProcessorInfo_SegmentStatus.encode(v, writer.uint32(50).fork()).join();
940
+ }
941
+ if (message.availableThreads !== 0) {
942
+ writer.uint32(56).int32(message.availableThreads);
943
+ }
944
+ if (message.tokenStoreIdentifier !== "") {
945
+ writer.uint32(66).string(message.tokenStoreIdentifier);
946
+ }
947
+ if (message.isStreamingProcessor !== false) {
948
+ writer.uint32(72).bool(message.isStreamingProcessor);
949
+ }
950
+ return writer;
951
+ },
952
+ decode(input, length) {
953
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
954
+ const end = length === undefined ? reader.len : reader.pos + length;
955
+ const message = createBaseEventProcessorInfo();
956
+ while (reader.pos < end) {
957
+ const tag = reader.uint32();
958
+ switch (tag >>> 3) {
959
+ case 1: {
960
+ if (tag !== 10) {
961
+ break;
962
+ }
963
+ message.processorName = reader.string();
964
+ continue;
965
+ }
966
+ case 2: {
967
+ if (tag !== 18) {
968
+ break;
969
+ }
970
+ message.mode = reader.string();
971
+ continue;
972
+ }
973
+ case 3: {
974
+ if (tag !== 24) {
975
+ break;
976
+ }
977
+ message.activeThreads = reader.int32();
978
+ continue;
979
+ }
980
+ case 4: {
981
+ if (tag !== 32) {
982
+ break;
983
+ }
984
+ message.running = reader.bool();
985
+ continue;
986
+ }
987
+ case 5: {
988
+ if (tag !== 40) {
989
+ break;
990
+ }
991
+ message.error = reader.bool();
992
+ continue;
993
+ }
994
+ case 6: {
995
+ if (tag !== 50) {
996
+ break;
997
+ }
998
+ message.segmentStatus.push(EventProcessorInfo_SegmentStatus.decode(reader, reader.uint32()));
999
+ continue;
1000
+ }
1001
+ case 7: {
1002
+ if (tag !== 56) {
1003
+ break;
1004
+ }
1005
+ message.availableThreads = reader.int32();
1006
+ continue;
1007
+ }
1008
+ case 8: {
1009
+ if (tag !== 66) {
1010
+ break;
1011
+ }
1012
+ message.tokenStoreIdentifier = reader.string();
1013
+ continue;
1014
+ }
1015
+ case 9: {
1016
+ if (tag !== 72) {
1017
+ break;
1018
+ }
1019
+ message.isStreamingProcessor = reader.bool();
1020
+ continue;
1021
+ }
1022
+ }
1023
+ if ((tag & 7) === 4 || tag === 0) {
1024
+ break;
1025
+ }
1026
+ reader.skip(tag & 7);
1027
+ }
1028
+ return message;
1029
+ },
1030
+ fromJSON(object) {
1031
+ return {
1032
+ processorName: isSet(object.processorName)
1033
+ ? globalThis.String(object.processorName)
1034
+ : isSet(object.processor_name)
1035
+ ? globalThis.String(object.processor_name)
1036
+ : "",
1037
+ mode: isSet(object.mode) ? globalThis.String(object.mode) : "",
1038
+ activeThreads: isSet(object.activeThreads)
1039
+ ? globalThis.Number(object.activeThreads)
1040
+ : isSet(object.active_threads)
1041
+ ? globalThis.Number(object.active_threads)
1042
+ : 0,
1043
+ running: isSet(object.running) ? globalThis.Boolean(object.running) : false,
1044
+ error: isSet(object.error) ? globalThis.Boolean(object.error) : false,
1045
+ segmentStatus: globalThis.Array.isArray(object?.segmentStatus)
1046
+ ? object.segmentStatus.map((e) => EventProcessorInfo_SegmentStatus.fromJSON(e))
1047
+ : globalThis.Array.isArray(object?.segment_status)
1048
+ ? object.segment_status.map((e) => EventProcessorInfo_SegmentStatus.fromJSON(e))
1049
+ : [],
1050
+ availableThreads: isSet(object.availableThreads)
1051
+ ? globalThis.Number(object.availableThreads)
1052
+ : isSet(object.available_threads)
1053
+ ? globalThis.Number(object.available_threads)
1054
+ : 0,
1055
+ tokenStoreIdentifier: isSet(object.tokenStoreIdentifier)
1056
+ ? globalThis.String(object.tokenStoreIdentifier)
1057
+ : isSet(object.token_store_identifier)
1058
+ ? globalThis.String(object.token_store_identifier)
1059
+ : "",
1060
+ isStreamingProcessor: isSet(object.isStreamingProcessor)
1061
+ ? globalThis.Boolean(object.isStreamingProcessor)
1062
+ : isSet(object.is_streaming_processor)
1063
+ ? globalThis.Boolean(object.is_streaming_processor)
1064
+ : false,
1065
+ };
1066
+ },
1067
+ toJSON(message) {
1068
+ const obj = {};
1069
+ if (message.processorName !== "") {
1070
+ obj.processorName = message.processorName;
1071
+ }
1072
+ if (message.mode !== "") {
1073
+ obj.mode = message.mode;
1074
+ }
1075
+ if (message.activeThreads !== 0) {
1076
+ obj.activeThreads = Math.round(message.activeThreads);
1077
+ }
1078
+ if (message.running !== false) {
1079
+ obj.running = message.running;
1080
+ }
1081
+ if (message.error !== false) {
1082
+ obj.error = message.error;
1083
+ }
1084
+ if (message.segmentStatus?.length) {
1085
+ obj.segmentStatus = message.segmentStatus.map((e) => EventProcessorInfo_SegmentStatus.toJSON(e));
1086
+ }
1087
+ if (message.availableThreads !== 0) {
1088
+ obj.availableThreads = Math.round(message.availableThreads);
1089
+ }
1090
+ if (message.tokenStoreIdentifier !== "") {
1091
+ obj.tokenStoreIdentifier = message.tokenStoreIdentifier;
1092
+ }
1093
+ if (message.isStreamingProcessor !== false) {
1094
+ obj.isStreamingProcessor = message.isStreamingProcessor;
1095
+ }
1096
+ return obj;
1097
+ },
1098
+ create(base) {
1099
+ return EventProcessorInfo.fromPartial(base ?? {});
1100
+ },
1101
+ fromPartial(object) {
1102
+ const message = createBaseEventProcessorInfo();
1103
+ message.processorName = object.processorName ?? "";
1104
+ message.mode = object.mode ?? "";
1105
+ message.activeThreads = object.activeThreads ?? 0;
1106
+ message.running = object.running ?? false;
1107
+ message.error = object.error ?? false;
1108
+ message.segmentStatus = object.segmentStatus?.map((e) => EventProcessorInfo_SegmentStatus.fromPartial(e)) || [];
1109
+ message.availableThreads = object.availableThreads ?? 0;
1110
+ message.tokenStoreIdentifier = object.tokenStoreIdentifier ?? "";
1111
+ message.isStreamingProcessor = object.isStreamingProcessor ?? false;
1112
+ return message;
1113
+ },
1114
+ };
1115
+ function createBaseEventProcessorInfo_SegmentStatus() {
1116
+ return { segmentId: 0, caughtUp: false, replaying: false, onePartOf: 0, tokenPosition: 0n, errorState: "" };
1117
+ }
1118
+ export const EventProcessorInfo_SegmentStatus = {
1119
+ encode(message, writer = new BinaryWriter()) {
1120
+ if (message.segmentId !== 0) {
1121
+ writer.uint32(8).int32(message.segmentId);
1122
+ }
1123
+ if (message.caughtUp !== false) {
1124
+ writer.uint32(16).bool(message.caughtUp);
1125
+ }
1126
+ if (message.replaying !== false) {
1127
+ writer.uint32(24).bool(message.replaying);
1128
+ }
1129
+ if (message.onePartOf !== 0) {
1130
+ writer.uint32(32).int32(message.onePartOf);
1131
+ }
1132
+ if (message.tokenPosition !== 0n) {
1133
+ if (BigInt.asIntN(64, message.tokenPosition) !== message.tokenPosition) {
1134
+ throw new globalThis.Error("value provided for field message.tokenPosition of type int64 too large");
1135
+ }
1136
+ writer.uint32(40).int64(message.tokenPosition);
1137
+ }
1138
+ if (message.errorState !== "") {
1139
+ writer.uint32(50).string(message.errorState);
1140
+ }
1141
+ return writer;
1142
+ },
1143
+ decode(input, length) {
1144
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1145
+ const end = length === undefined ? reader.len : reader.pos + length;
1146
+ const message = createBaseEventProcessorInfo_SegmentStatus();
1147
+ while (reader.pos < end) {
1148
+ const tag = reader.uint32();
1149
+ switch (tag >>> 3) {
1150
+ case 1: {
1151
+ if (tag !== 8) {
1152
+ break;
1153
+ }
1154
+ message.segmentId = reader.int32();
1155
+ continue;
1156
+ }
1157
+ case 2: {
1158
+ if (tag !== 16) {
1159
+ break;
1160
+ }
1161
+ message.caughtUp = reader.bool();
1162
+ continue;
1163
+ }
1164
+ case 3: {
1165
+ if (tag !== 24) {
1166
+ break;
1167
+ }
1168
+ message.replaying = reader.bool();
1169
+ continue;
1170
+ }
1171
+ case 4: {
1172
+ if (tag !== 32) {
1173
+ break;
1174
+ }
1175
+ message.onePartOf = reader.int32();
1176
+ continue;
1177
+ }
1178
+ case 5: {
1179
+ if (tag !== 40) {
1180
+ break;
1181
+ }
1182
+ message.tokenPosition = reader.int64();
1183
+ continue;
1184
+ }
1185
+ case 6: {
1186
+ if (tag !== 50) {
1187
+ break;
1188
+ }
1189
+ message.errorState = reader.string();
1190
+ continue;
1191
+ }
1192
+ }
1193
+ if ((tag & 7) === 4 || tag === 0) {
1194
+ break;
1195
+ }
1196
+ reader.skip(tag & 7);
1197
+ }
1198
+ return message;
1199
+ },
1200
+ fromJSON(object) {
1201
+ return {
1202
+ segmentId: isSet(object.segmentId)
1203
+ ? globalThis.Number(object.segmentId)
1204
+ : isSet(object.segment_id)
1205
+ ? globalThis.Number(object.segment_id)
1206
+ : 0,
1207
+ caughtUp: isSet(object.caughtUp)
1208
+ ? globalThis.Boolean(object.caughtUp)
1209
+ : isSet(object.caught_up)
1210
+ ? globalThis.Boolean(object.caught_up)
1211
+ : false,
1212
+ replaying: isSet(object.replaying) ? globalThis.Boolean(object.replaying) : false,
1213
+ onePartOf: isSet(object.onePartOf)
1214
+ ? globalThis.Number(object.onePartOf)
1215
+ : isSet(object.one_part_of)
1216
+ ? globalThis.Number(object.one_part_of)
1217
+ : 0,
1218
+ tokenPosition: isSet(object.tokenPosition)
1219
+ ? BigInt(object.tokenPosition)
1220
+ : isSet(object.token_position)
1221
+ ? BigInt(object.token_position)
1222
+ : 0n,
1223
+ errorState: isSet(object.errorState)
1224
+ ? globalThis.String(object.errorState)
1225
+ : isSet(object.error_state)
1226
+ ? globalThis.String(object.error_state)
1227
+ : "",
1228
+ };
1229
+ },
1230
+ toJSON(message) {
1231
+ const obj = {};
1232
+ if (message.segmentId !== 0) {
1233
+ obj.segmentId = Math.round(message.segmentId);
1234
+ }
1235
+ if (message.caughtUp !== false) {
1236
+ obj.caughtUp = message.caughtUp;
1237
+ }
1238
+ if (message.replaying !== false) {
1239
+ obj.replaying = message.replaying;
1240
+ }
1241
+ if (message.onePartOf !== 0) {
1242
+ obj.onePartOf = Math.round(message.onePartOf);
1243
+ }
1244
+ if (message.tokenPosition !== 0n) {
1245
+ obj.tokenPosition = message.tokenPosition.toString();
1246
+ }
1247
+ if (message.errorState !== "") {
1248
+ obj.errorState = message.errorState;
1249
+ }
1250
+ return obj;
1251
+ },
1252
+ create(base) {
1253
+ return EventProcessorInfo_SegmentStatus.fromPartial(base ?? {});
1254
+ },
1255
+ fromPartial(object) {
1256
+ const message = createBaseEventProcessorInfo_SegmentStatus();
1257
+ message.segmentId = object.segmentId ?? 0;
1258
+ message.caughtUp = object.caughtUp ?? false;
1259
+ message.replaying = object.replaying ?? false;
1260
+ message.onePartOf = object.onePartOf ?? 0;
1261
+ message.tokenPosition = object.tokenPosition ?? 0n;
1262
+ message.errorState = object.errorState ?? "";
1263
+ return message;
1264
+ },
1265
+ };
1266
+ function createBaseEventProcessorReference() {
1267
+ return { processorName: "" };
1268
+ }
1269
+ export const EventProcessorReference = {
1270
+ encode(message, writer = new BinaryWriter()) {
1271
+ if (message.processorName !== "") {
1272
+ writer.uint32(10).string(message.processorName);
1273
+ }
1274
+ return writer;
1275
+ },
1276
+ decode(input, length) {
1277
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1278
+ const end = length === undefined ? reader.len : reader.pos + length;
1279
+ const message = createBaseEventProcessorReference();
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.processorName = reader.string();
1288
+ continue;
1289
+ }
1290
+ }
1291
+ if ((tag & 7) === 4 || tag === 0) {
1292
+ break;
1293
+ }
1294
+ reader.skip(tag & 7);
1295
+ }
1296
+ return message;
1297
+ },
1298
+ fromJSON(object) {
1299
+ return {
1300
+ processorName: isSet(object.processorName)
1301
+ ? globalThis.String(object.processorName)
1302
+ : isSet(object.processor_name)
1303
+ ? globalThis.String(object.processor_name)
1304
+ : "",
1305
+ };
1306
+ },
1307
+ toJSON(message) {
1308
+ const obj = {};
1309
+ if (message.processorName !== "") {
1310
+ obj.processorName = message.processorName;
1311
+ }
1312
+ return obj;
1313
+ },
1314
+ create(base) {
1315
+ return EventProcessorReference.fromPartial(base ?? {});
1316
+ },
1317
+ fromPartial(object) {
1318
+ const message = createBaseEventProcessorReference();
1319
+ message.processorName = object.processorName ?? "";
1320
+ return message;
1321
+ },
1322
+ };
1323
+ function createBaseEventProcessorSegmentReference() {
1324
+ return { processorName: "", segmentIdentifier: 0 };
1325
+ }
1326
+ export const EventProcessorSegmentReference = {
1327
+ encode(message, writer = new BinaryWriter()) {
1328
+ if (message.processorName !== "") {
1329
+ writer.uint32(10).string(message.processorName);
1330
+ }
1331
+ if (message.segmentIdentifier !== 0) {
1332
+ writer.uint32(16).int32(message.segmentIdentifier);
1333
+ }
1334
+ return writer;
1335
+ },
1336
+ decode(input, length) {
1337
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1338
+ const end = length === undefined ? reader.len : reader.pos + length;
1339
+ const message = createBaseEventProcessorSegmentReference();
1340
+ while (reader.pos < end) {
1341
+ const tag = reader.uint32();
1342
+ switch (tag >>> 3) {
1343
+ case 1: {
1344
+ if (tag !== 10) {
1345
+ break;
1346
+ }
1347
+ message.processorName = reader.string();
1348
+ continue;
1349
+ }
1350
+ case 2: {
1351
+ if (tag !== 16) {
1352
+ break;
1353
+ }
1354
+ message.segmentIdentifier = reader.int32();
1355
+ continue;
1356
+ }
1357
+ }
1358
+ if ((tag & 7) === 4 || tag === 0) {
1359
+ break;
1360
+ }
1361
+ reader.skip(tag & 7);
1362
+ }
1363
+ return message;
1364
+ },
1365
+ fromJSON(object) {
1366
+ return {
1367
+ processorName: isSet(object.processorName)
1368
+ ? globalThis.String(object.processorName)
1369
+ : isSet(object.processor_name)
1370
+ ? globalThis.String(object.processor_name)
1371
+ : "",
1372
+ segmentIdentifier: isSet(object.segmentIdentifier)
1373
+ ? globalThis.Number(object.segmentIdentifier)
1374
+ : isSet(object.segment_identifier)
1375
+ ? globalThis.Number(object.segment_identifier)
1376
+ : 0,
1377
+ };
1378
+ },
1379
+ toJSON(message) {
1380
+ const obj = {};
1381
+ if (message.processorName !== "") {
1382
+ obj.processorName = message.processorName;
1383
+ }
1384
+ if (message.segmentIdentifier !== 0) {
1385
+ obj.segmentIdentifier = Math.round(message.segmentIdentifier);
1386
+ }
1387
+ return obj;
1388
+ },
1389
+ create(base) {
1390
+ return EventProcessorSegmentReference.fromPartial(base ?? {});
1391
+ },
1392
+ fromPartial(object) {
1393
+ const message = createBaseEventProcessorSegmentReference();
1394
+ message.processorName = object.processorName ?? "";
1395
+ message.segmentIdentifier = object.segmentIdentifier ?? 0;
1396
+ return message;
1397
+ },
1398
+ };
1399
+ function createBaseInstructionResult() {
1400
+ return { instructionId: "", success: false, error: undefined };
1401
+ }
1402
+ export const InstructionResult = {
1403
+ encode(message, writer = new BinaryWriter()) {
1404
+ if (message.instructionId !== "") {
1405
+ writer.uint32(10).string(message.instructionId);
1406
+ }
1407
+ if (message.success !== false) {
1408
+ writer.uint32(16).bool(message.success);
1409
+ }
1410
+ if (message.error !== undefined) {
1411
+ ErrorMessage.encode(message.error, writer.uint32(26).fork()).join();
1412
+ }
1413
+ return writer;
1414
+ },
1415
+ decode(input, length) {
1416
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1417
+ const end = length === undefined ? reader.len : reader.pos + length;
1418
+ const message = createBaseInstructionResult();
1419
+ while (reader.pos < end) {
1420
+ const tag = reader.uint32();
1421
+ switch (tag >>> 3) {
1422
+ case 1: {
1423
+ if (tag !== 10) {
1424
+ break;
1425
+ }
1426
+ message.instructionId = reader.string();
1427
+ continue;
1428
+ }
1429
+ case 2: {
1430
+ if (tag !== 16) {
1431
+ break;
1432
+ }
1433
+ message.success = reader.bool();
1434
+ continue;
1435
+ }
1436
+ case 3: {
1437
+ if (tag !== 26) {
1438
+ break;
1439
+ }
1440
+ message.error = ErrorMessage.decode(reader, reader.uint32());
1441
+ continue;
1442
+ }
1443
+ }
1444
+ if ((tag & 7) === 4 || tag === 0) {
1445
+ break;
1446
+ }
1447
+ reader.skip(tag & 7);
1448
+ }
1449
+ return message;
1450
+ },
1451
+ fromJSON(object) {
1452
+ return {
1453
+ instructionId: isSet(object.instructionId)
1454
+ ? globalThis.String(object.instructionId)
1455
+ : isSet(object.instruction_id)
1456
+ ? globalThis.String(object.instruction_id)
1457
+ : "",
1458
+ success: isSet(object.success) ? globalThis.Boolean(object.success) : false,
1459
+ error: isSet(object.error) ? ErrorMessage.fromJSON(object.error) : undefined,
1460
+ };
1461
+ },
1462
+ toJSON(message) {
1463
+ const obj = {};
1464
+ if (message.instructionId !== "") {
1465
+ obj.instructionId = message.instructionId;
1466
+ }
1467
+ if (message.success !== false) {
1468
+ obj.success = message.success;
1469
+ }
1470
+ if (message.error !== undefined) {
1471
+ obj.error = ErrorMessage.toJSON(message.error);
1472
+ }
1473
+ return obj;
1474
+ },
1475
+ create(base) {
1476
+ return InstructionResult.fromPartial(base ?? {});
1477
+ },
1478
+ fromPartial(object) {
1479
+ const message = createBaseInstructionResult();
1480
+ message.instructionId = object.instructionId ?? "";
1481
+ message.success = object.success ?? false;
1482
+ message.error = (object.error !== undefined && object.error !== null)
1483
+ ? ErrorMessage.fromPartial(object.error)
1484
+ : undefined;
1485
+ return message;
1486
+ },
1487
+ };
1488
+ export const PlatformServiceDefinition = {
1489
+ name: "PlatformService",
1490
+ fullName: "kronosdb.platform.PlatformService",
1491
+ methods: {
1492
+ /**
1493
+ * Initial connection: client identifies itself and receives server info.
1494
+ * The server registers the client in the connection registry.
1495
+ */
1496
+ getPlatformServer: {
1497
+ name: "GetPlatformServer",
1498
+ requestType: ClientIdentification,
1499
+ requestStream: false,
1500
+ responseType: PlatformInfo,
1501
+ responseStream: false,
1502
+ options: {},
1503
+ },
1504
+ /**
1505
+ * Persistent bidirectional stream for lifecycle management.
1506
+ * Used for heartbeat exchange, event processor status reporting,
1507
+ * and server-initiated instructions.
1508
+ */
1509
+ openStream: {
1510
+ name: "OpenStream",
1511
+ requestType: PlatformInbound,
1512
+ requestStream: true,
1513
+ responseType: PlatformOutbound,
1514
+ responseStream: true,
1515
+ options: {},
1516
+ },
1517
+ },
1518
+ };
1519
+ function isObject(value) {
1520
+ return typeof value === "object" && value !== null;
1521
+ }
1522
+ function isSet(value) {
1523
+ return value !== null && value !== undefined;
1524
+ }
1525
+ //# sourceMappingURL=platform.js.map