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